X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2FMain.qc;h=8891586c1e781873fa063b784d44efc85c1d4d47;hp=90563dec0bdec3f6fa6561bc2c7f985ffc1ea72b;hb=118ccbe88b886126fe05a8e2366b4a9ea42dc859;hpb=3bd2dde0e4b6cc23f26567ad36f12e3f324dccb3 diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 90563dec0b..8891586c1e 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -105,14 +105,14 @@ void CSQC_Init(void) #ifndef CAMERATEST } #endif - registercvar("sbar_usecsqc", "1"); - registercvar("sbar_columns", "default", CVAR_SAVE); + registercvar("hud_usecsqc", "1"); + registercvar("hud_columns", "default", CVAR_SAVE); gametype = 0; - // sbar_fields uses strunzone on the titles! - for(i = 0; i < MAX_SBAR_FIELDS; ++i) - sbar_title[i] = strzone("(null)"); + // hud_fields uses strunzone on the titles! + for(i = 0; i < MAX_HUD_FIELDS; ++i) + hud_title[i] = strzone("(null)"); postinit = false; @@ -321,9 +321,9 @@ void Playerchecker_Think() e.ping_packetloss = 0; e.ping_movementloss = 0; //e.gotscores = 0; // we might already have the scores... - SetTeam(e, GetPlayerColor(i)); // will not hurt; later updates come with Sbar_UpdatePlayerTeams + SetTeam(e, GetPlayerColor(i)); // will not hurt; later updates come with HUD_UpdatePlayerTeams RegisterPlayer(e); - Sbar_UpdatePlayerPos(e); + HUD_UpdatePlayerPos(e); } } } @@ -335,7 +335,7 @@ void TrueAim_Init(); void PostInit(void) { print(strcat("PostInit\n maxclients = ", ftos(maxclients), "\n")); - localcmd(strcat("\nsbar_columns_set ", cvar_string("sbar_columns"), ";\n")); + localcmd(strcat("\nhud_columns_set ", cvar_string("hud_columns"), ";\n")); entity playerchecker; playerchecker = spawn(); @@ -351,8 +351,8 @@ void PostInit(void) // CSQC_ConsoleCommand : Used to parse commands in the console that have been registered with the "registercmd" function // Return value should be 1 if CSQC handled the command, otherwise return 0 to have the engine handle it. float button_zoom; -void Cmd_Sbar_SetFields(float); -void Cmd_Sbar_Help(float); +void Cmd_HUD_SetFields(float); +void Cmd_HUD_Help(float); float CSQC_ConsoleCommand(string strMessage) { float argc; @@ -506,8 +506,8 @@ void GameCommand(string msg) print("Usage: cl_cmd COMMAND..., where possible commands are:\n"); print(" settemp cvar value\n"); print(" radar\n"); - print(" sbar_columns_set ...\n"); - print(" sbar_columns_help\n"); + print(" hud_columns_set ...\n"); + print(" hud_columns_help\n"); GameCommand_Generic("help"); return; } @@ -526,11 +526,11 @@ void GameCommand(string msg) else if(cmd == "radar") { ons_showmap = !ons_showmap; } - else if(cmd == "sbar_columns_set") { - Cmd_Sbar_SetFields(argc); + else if(cmd == "hud_columns_set") { + Cmd_HUD_SetFields(argc); } - else if(cmd == "sbar_columns_help") { - Cmd_Sbar_Help(argc); + else if(cmd == "hud_columns_help") { + Cmd_HUD_Help(argc); } #ifdef BLURTEST else if(cmd == "blurtest") { @@ -584,12 +584,16 @@ void GameCommand(string msg) localcmd("sv_cmd debug_shotorg\n"); } else if(cmd == "sendcvar") { - s = cvar_string(argv(1)); - if(argv(1) == "cl_weaponpriority") + // W_FixWeaponOrder will trash argv, so save what we need. + string cvar; + cvar = strzone(argv(1)); + s = cvar_string(cvar); + if(cvar == "cl_weaponpriority") s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 1); - else if(substring(argv(1), 0, 17) == "cl_weaponpriority" && strlen(argv(1)) == 18) + else if(substring(cvar, 0, 17) == "cl_weaponpriority" && strlen(cvar) == 18) s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 0); - localcmd("cmd sentcvar ", argv(1), " \"", s, "\"\n"); + localcmd("cmd sentcvar ", cvar, " \"", s, "\"\n"); + strunzone(cvar); } else if(cmd == "spawn") { s = argv(1); @@ -675,7 +679,7 @@ void Ent_ReadPlayerScore() float isNew; entity o; - // damnit -.- don't want to go change every single .sv_entnum in sbar.qc AGAIN + // damnit -.- don't want to go change every single .sv_entnum in hud.qc AGAIN // (no I've never heard of M-x replace-string, sed, or anything like that) isNew = !self.owner; // workaround for DP bug n = ReadByte()-1; @@ -721,7 +725,7 @@ void Ent_ReadPlayerScore() } if(o.sort_prev) - Sbar_UpdatePlayerPos(o); // if not registered, we cannot do this yet! + HUD_UpdatePlayerPos(o); // if not registered, we cannot do this yet! self.entremove = Ent_RemovePlayerScore; } @@ -752,7 +756,7 @@ void Ent_ReadTeamScore() o.(teamscores[i]) = ReadChar(); } - Sbar_UpdateTeamPos(o); + HUD_UpdateTeamPos(o); } void Net_Reset() @@ -907,6 +911,7 @@ void(float bIsNewEntity) CSQC_Ent_Update = case ENT_CLIENT_TUBANOTE: Ent_TubaNote(bIsNewEntity); break; case ENT_CLIENT_WARPZONE: WarpZone_Read(bIsNewEntity); break; case ENT_CLIENT_WARPZONE_CAMERA: WarpZone_Camera_Read(bIsNewEntity); break; + case ENT_CLIENT_TRIGGER_MUSIC: Ent_ReadTriggerMusic(); break; default: error(strcat("unknown entity type in CSQC_Ent_Update: ", ftos(self.enttype), "\n")); break; @@ -999,7 +1004,7 @@ void Ent_ScoresInfo() teamscores_label[i] = strzone(ReadString()); teamscores_flags[i] = ReadByte(); } - Sbar_InitScores(); + HUD_InitScores(); Gamemode_Init(); } @@ -1021,6 +1026,9 @@ void Ent_Init() g_weaponswitchdelay = ReadByte() / 255.0; + g_balance_grenadelauncher_secondary_bouncefactor = ReadCoord(); + g_balance_grenadelauncher_secondary_bouncestop = ReadCoord(); + if(!postinit) PostInit(); } @@ -1236,6 +1244,10 @@ float CSQC_Parse_TempEntity() // NOTE: Could just do return instead of break... switch(nTEID) { + case TE_CSQC_TARGET_MUSIC: + Net_TargetMusic(); + bHandled = true; + break; case TE_CSQC_PICTURE: Net_MapVote_Picture(); bHandled = true; @@ -1298,7 +1310,7 @@ string getcommandkey(string text, string command) string keys; float n, j, k, l; - if (!sbar_showbinds) + if (!hud_showbinds) return text; keys = db_get(binddb, command); @@ -1316,7 +1328,7 @@ string getcommandkey(string text, string command) keys = strcat(keys, ", ", keynumtostring(k)); ++l; - if (sbar_showbinds_limit > 0 && sbar_showbinds_limit >= l) break; + if (hud_showbinds_limit > 0 && hud_showbinds_limit >= l) break; } } @@ -1324,12 +1336,12 @@ string getcommandkey(string text, string command) } if ("" == keys) { - if (sbar_showbinds > 1) + if (hud_showbinds > 1) return strcat(text, " (not bound)"); else return text; } - else if (sbar_showbinds > 1) + else if (hud_showbinds > 1) return strcat(text, " (", keys, ")"); else return keys;