X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fclient%2Fmain.qc;h=7de2946819ceeabef3852073e8ed6ea7a3e66efb;hb=7bd50098b6a52dce50052454b12e8a55a7298ec9;hp=680e65ac05e50e33bd5b19832bb664cad6480b25;hpb=4f133bdb70d13143f2ce4b9de097744371c1f92a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 680e65ac0..7de294681 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -1,17 +1,17 @@ #include "main.qh" #include -#include "hud/all.qh" +#include "hud/_mod.qh" #include "mapvoting.qh" #include "mutators/events.qh" +#include "hud/panel/scoreboard.qh" #include "hud/panel/quickmenu.qh" -#include "scoreboard.qh" #include "shownames.qh" #include #include "wall.qh" #include "weapons/projectile.qh" #include -#include +#include #include #include #include @@ -108,7 +108,6 @@ void CSQC_Init() binddb = db_create(); tempdb = db_create(); ClientProgsDB = db_load("client.db"); - compressShortVector_init(); draw_endBoldFont(); @@ -131,13 +130,7 @@ void CSQC_Init() registercvar("cl_spawn_near_teammate", "1"); - gametype = 0; - - // hud_fields uses strunzone on the titles! - for(int i = 0; i < MAX_HUD_FIELDS; ++i) - hud_title[i] = strzone("(null)"); - - Cmd_HUD_SetFields(0); + gametype = NULL; postinit = false; @@ -235,7 +228,7 @@ float SetTeam(entity o, int Team) default: if(GetTeam(Team, false) == NULL) { - LOG_TRACEF("trying to switch to unsupported team %d\n", Team); + LOG_TRACEF("trying to switch to unsupported team %d", Team); Team = NUM_SPECTATOR; } break; @@ -251,7 +244,7 @@ float SetTeam(entity o, int Team) default: if(GetTeam(Team, false) == NULL) { - LOG_TRACEF("trying to switch to unsupported team %d\n", Team); + LOG_TRACEF("trying to switch to unsupported team %d", Team); Team = NUM_SPECTATOR; } break; @@ -323,9 +316,9 @@ void Playerchecker_Think(entity this) e.ping_movementloss = 0; //e.gotscores = 0; // we might already have the scores... int t = entcs_GetScoreTeam(i); - if (t) SetTeam(e, t); // will not hurt; later updates come with HUD_UpdatePlayerTeams + if (t) SetTeam(e, t); // will not hurt; later updates come with Scoreboard_UpdatePlayerTeams RegisterPlayer(e); - HUD_UpdatePlayerPos(e); + Scoreboard_UpdatePlayerPos(e); } } } @@ -443,7 +436,7 @@ NET_HANDLE(ENT_CLIENT_SCORES, bool isnew) return = true; if(o.sort_prev) - HUD_UpdatePlayerPos(o); // if not registered, we cannot do this yet! + Scoreboard_UpdatePlayerPos(o); // if not registered, we cannot do this yet! this.entremove = Ent_RemovePlayerScore; } @@ -477,7 +470,7 @@ NET_HANDLE(ENT_CLIENT_TEAMSCORES, bool isnew) return = true; - HUD_UpdateTeamPos(o); + Scoreboard_UpdateTeamPos(o); } NET_HANDLE(ENT_CLIENT_CLIENTDATA, bool isnew) @@ -715,7 +708,7 @@ NET_HANDLE(ENT_CLIENT_SPAWNPOINT, bool is_new) }*/ if(autocvar_cl_spawn_point_particles) { - if((serverflags & SERVERFLAG_TEAMPLAY)) + if(teamplay) { switch(teamnum) { @@ -845,7 +838,7 @@ void CSQC_Ent_Update(entity this, bool isnew) time = savetime; if (!done) { - LOG_FATALF("CSQC_Ent_Update(%d) at %f with this=%i {.entnum=%d, .enttype=%d} t=%s (%d)\n", isnew, savetime, this, this.entnum, this.enttype, this.classname, t); + LOG_FATALF("CSQC_Ent_Update(%d) at %f with this=%i {.entnum=%d, .enttype=%d} t=%s (%d)", isnew, savetime, this, this.entnum, this.enttype, this.classname, t); } } @@ -880,7 +873,7 @@ void CSQC_Ent_Remove(entity this) if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Ent_Remove() with this=%i {.entnum=%d, .enttype=%d}\n", this, this.entnum, this.enttype); if (wasfreed(this)) { - LOG_WARNING("CSQC_Ent_Remove called for already removed entity. Packet loss?\n"); + LOG_WARN("CSQC_Ent_Remove called for already removed entity. Packet loss?"); return; } if (this.enttype) Ent_Remove(this); @@ -950,7 +943,7 @@ void Gamemode_Init(); NET_HANDLE(ENT_CLIENT_SCORES_INFO, bool isnew) { make_pure(this); - gametype = ReadInt24_t(); + gametype = ReadRegistered(Gametypes); HUD_ModIcons_SetFunc(); FOREACH(Scores, true, { if (scores_label(it)) strunzone(scores_label(it)); @@ -964,7 +957,7 @@ NET_HANDLE(ENT_CLIENT_SCORES_INFO, bool isnew) teamscores_flags(i) = ReadByte(); } return = true; - HUD_InitScores(); + Scoreboard_InitScores(); Gamemode_Init(); }