X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fpanel%2Fmodicons.qc;h=87e4a7fb251af875266a9ea72c82cdd6449e1f91;hb=5a95a7be13adcf53cc5aedb89ac41c5416fb4304;hp=e87d64c87bb002641fedb5c5884b000593aacb62;hpb=264c9f48d418d1ebd4b5ef5868b85f92644917dc;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud/panel/modicons.qc b/qcsrc/client/hud/panel/modicons.qc index e87d64c87..87e4a7fb2 100644 --- a/qcsrc/client/hud/panel/modicons.qc +++ b/qcsrc/client/hud/panel/modicons.qc @@ -1,8 +1,11 @@ #include "modicons.qh" +#include +#include #include #include -#include // TODO: remove +#include +#include // Mod icons (#10) @@ -10,7 +13,7 @@ bool mod_active; // is there any active mod icon? void DrawCAItem(vector myPos, vector mySize, float aspect_ratio, int layout, int i) { - TC(int, layout); TC(int, i); + TC(int, layout); TC(int, i); int stat = -1; string pic = ""; vector color = '0 0 0'; @@ -512,14 +515,16 @@ void race_showTime(string text, vector pos, vector timeText_ofs, float theTime, void HUD_Mod_Race(vector pos, vector mySize) { - mod_active = 1; // race should never hide the mod icons panel - entity me; - me = playerslots[player_localnum]; - float score; - score = me.(scores(ps_primary)); + entity me = playerslots[player_localnum]; + float score = me.(scores(ps_primary)); if(!(scores_flags(ps_primary) & SFL_TIME) || teamplay) // race/cts record display on HUD + { + mod_active = 0; // hide it in this case! return; // no records in the actual race + } + + mod_active = 1; // clientside personal record string rr; @@ -578,30 +583,19 @@ void HUD_Mod_Race(vector pos, vector mySize) if (race_status != race_status_prev || race_status_name != race_status_name_prev) { race_status_time = time + 5; race_status_prev = race_status; - if (race_status_name_prev) - strunzone(race_status_name_prev); - race_status_name_prev = strzone(race_status_name); + strcpy(race_status_name_prev, race_status_name); } // race "awards" - float a; - a = bound(0, race_status_time - time, 1); + float a = bound(0, race_status_time - time, 1); + string s = textShortenToWidth(ColorTranslateRGB(race_status_name), squareSize, '1 1 0' * 0.1 * squareSize, stringwidth_colors); - string s; - s = textShortenToWidth(ColorTranslateRGB(race_status_name), squareSize, '1 1 0' * 0.1 * squareSize, stringwidth_colors); - - float rank; + float rank = 0; if(race_status > 0) rank = race_CheckName(race_status_name); - else - rank = 0; - string rankname; - rankname = count_ordinal(rank); - - vector namepos; - namepos = medalPos + '0 0.8 0' * squareSize; - vector rankpos; - rankpos = medalPos + '0 0.15 0' * squareSize; + string rankname = count_ordinal(rank); + vector namepos = medalPos + '0 0.8 0' * squareSize; + vector rankpos = medalPos + '0 0.15 0' * squareSize; if(race_status == 0) drawpic_aspect_skin(medalPos, "race_newfail", '1 1 0' * squareSize, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL); @@ -625,18 +619,14 @@ void HUD_Mod_Race(vector pos, vector mySize) if (race_status_time - time <= 0) { race_status_prev = -1; race_status = -1; - if(race_status_name) - strunzone(race_status_name); - race_status_name = string_null; - if(race_status_name_prev) - strunzone(race_status_name_prev); - race_status_name_prev = string_null; + strfree(race_status_name); + strfree(race_status_name_prev); } } void DrawDomItem(vector myPos, vector mySize, float aspect_ratio, int layout, int i) { - TC(int, layout); TC(int, i); + TC(int, layout); TC(int, i); float stat = -1; string pic = ""; vector color = '0 0 0';