X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fmain.qc;h=04cafebbd3a341786d40a29acc313c9b321620c0;hp=955cfa7ff3ebc4b5d304ee3d6ff5a56d5ad623d8;hb=991de5e6922cd3c283de56c3249624f0f1bfe767;hpb=7e537e254c2920bb6bc56e655a5c05c67f95240e diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 955cfa7ff..04cafebbd 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -140,6 +140,9 @@ void CSQC_Init() registercvar("cl_spawn_near_teammate", "1"); + registercvar("cl_weapon_switch_reload", "1"); + registercvar("cl_weapon_switch_fallback_to_impulse", "1"); + if(autocvar_cl_lockview) cvar_set("cl_lockview", "0"); @@ -223,6 +226,8 @@ void Shutdown() localcmd("\ncl_hook_shutdown\n"); + localcmd("\n-button12\n"); + deactivate_minigame(); HUD_MinigameMenu_Close(NULL, NULL, NULL); } @@ -303,7 +308,7 @@ bool SetTeam(entity o, int Team) void Playerchecker_Think(entity this) { - int i; + int i; entity e; for(i = 0; i < maxclients; ++i) { @@ -363,20 +368,21 @@ void PostInit() // In the case of mouse input after a setcursormode(1) call, nPrimary is xpos, nSecondary is ypos. float CSQC_InputEvent(int bInputType, float nPrimary, float nSecondary) { - TC(int, bInputType); - if (HUD_Panel_InputEvent(bInputType, nPrimary, nSecondary)) + TC(int, bInputType); + bool override = false; + override |= HUD_Panel_InputEvent(bInputType, nPrimary, nSecondary); + if (override) return true; - if (QuickMenu_InputEvent(bInputType, nPrimary, nSecondary)) - return true; + override |= QuickMenu_InputEvent(bInputType, nPrimary, nSecondary); - if (HUD_Radar_InputEvent(bInputType, nPrimary, nSecondary)) - return true; + override |= HUD_Radar_InputEvent(bInputType, nPrimary, nSecondary); - if (MapVote_InputEvent(bInputType, nPrimary, nSecondary)) - return true; + override |= MapVote_InputEvent(bInputType, nPrimary, nSecondary); - if (HUD_Minigame_InputEvent(bInputType, nPrimary, nSecondary)) + override |= HUD_Minigame_InputEvent(bInputType, nPrimary, nSecondary); + + if(override) return true; return false; @@ -795,7 +801,7 @@ NET_HANDLE(ENT_CLIENT_SPAWNEVENT, bool is_new) // The only parameter reflects if the entity is "new" to the client, meaning it just came into the client's PVS. void CSQC_Ent_Update(entity this, bool isnew) { - this.sourceLoc = __FILE__ ":" STR(__LINE__); + this.sourceLoc = __FILE__":"STR(__LINE__); int t = ReadByte(); // set up the "time" global for received entities to be correct for interpolation purposes @@ -1115,17 +1121,15 @@ NET_HANDLE(TE_CSQC_RACE, bool isNew) break; case RACE_NET_PENALTY_RACE: - race_penaltyeventtime = time; - race_penaltytime = ReadShort(); - //race_penaltyaccumulator += race_penaltytime; - strcpy(race_penaltyreason, ReadString()); - break; - case RACE_NET_PENALTY_QUALIFYING: race_penaltyeventtime = time; race_penaltytime = ReadShort(); - race_penaltyaccumulator += race_penaltytime; - strcpy(race_penaltyreason, ReadString()); + string reason = ReadString(); + if (reason == "missing a checkpoint") + reason = _("missing a checkpoint"); + strcpy(race_penaltyreason, reason); + if (b == RACE_NET_PENALTY_QUALIFYING) + race_penaltyaccumulator += race_penaltytime; break; case RACE_NET_SERVER_RECORD: @@ -1146,12 +1150,12 @@ NET_HANDLE(TE_CSQC_RACE, bool isNew) break; case RACE_NET_SERVER_RANKINGS: float prevpos, del; - int pos = ReadShort(); + int pos = ReadShort(); prevpos = ReadShort(); del = ReadShort(); // move other rankings out of the way - int i; + int i; if (prevpos) { int m = min(prevpos, RANKINGS_DISPLAY_CNT); for (i=m-1; i>pos-1; --i) { @@ -1255,6 +1259,8 @@ string _getcommandkey(string cmd_name, string command, bool forcename) if(!joy_active && substring(key, 0, 3) == "JOY") continue; + key = translate_key(key); + if (keys == "") keys = key; else