X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fpanel%2Finfomessages.qc;h=131d62efe921129071db68a515723bf45cf0c69f;hb=014563bb18d2fca287bd53fbde65b057e4ec6eef;hp=640bc404abbee5459a1df91e2929f1b2ac7c2abe;hpb=4f133bdb70d13143f2ce4b9de097744371c1f92a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud/panel/infomessages.qc b/qcsrc/client/hud/panel/infomessages.qc index 640bc404a..131d62efe 100644 --- a/qcsrc/client/hud/panel/infomessages.qc +++ b/qcsrc/client/hud/panel/infomessages.qc @@ -1,10 +1,14 @@ #include "infomessages.qh" +#include +#include + #include #include -// Info messages panel (#14) +// Info messages (#14) +float autocvar_hud_panel_infomessages_group0 = 1; float autocvar_hud_panel_infomessages_group_fadetime = 0.4; float autocvar_hud_panel_infomessages_group_time = 6; const int IMG_COUNT = 1; // number of InfoMessage Groups @@ -29,7 +33,6 @@ int img_select(int group_id) return img_cur_msg[group_id]; } -float stringwidth_colors(string s, vector theSize); vector InfoMessages_drawstring(string s, vector pos, vector sz, float a, vector fontsize) { getWrappedLine_remaining = s; @@ -47,10 +50,10 @@ vector InfoMessages_drawstring(string s, vector pos, vector sz, float a, vector return pos; } -#define InfoMessage(s) MACRO_BEGIN { \ +#define InfoMessage(s) MACRO_BEGIN \ pos = InfoMessages_drawstring(s, pos, mySize, ((img_curr_group >= 0) ? panel_fg_alpha * img_fade[img_curr_group] : panel_fg_alpha), fontsize); \ img_curr_group = -1; \ -} MACRO_END +MACRO_END void HUD_InfoMessages() { @@ -59,7 +62,7 @@ void HUD_InfoMessages() if(!autocvar_hud_panel_infomessages) return; } - HUD_Panel_UpdateCvars(); + HUD_Panel_LoadCvars(); vector pos, mySize; pos = panel_pos; mySize = panel_size; @@ -68,7 +71,7 @@ void HUD_InfoMessages() HUD_Scale_Enable(); else HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if(panel_bg_padding) { pos += '1 1 0' * panel_bg_padding; @@ -88,29 +91,34 @@ void HUD_InfoMessages() s = sprintf(_("^1Spectating: ^7%s"), entcs_GetName(current_player)); InfoMessage(s); - img_curr_group = 0; - switch(img_select(img_curr_group) % 3) + if(autocvar_hud_panel_infomessages_group0) { - default: - case 0: - if(spectatee_status == -1) - s = sprintf(_("^1Press ^3%s^1 to spectate"), getcommandkey(_("primary fire"), "+fire")); - else - s = sprintf(_("^1Press ^3%s^1 or ^3%s^1 for next or previous player"), getcommandkey(_("next weapon"), "weapnext"), getcommandkey(_("previous weapon"), "weapprev")); - break; - case 1: - if(spectatee_status == -1) - s = sprintf(_("^1Use ^3%s^1 or ^3%s^1 to change the speed"), getcommandkey(_("next weapon"), "weapnext"), getcommandkey(_("previous weapon"), "weapprev")); - else - s = sprintf(_("^1Press ^3%s^1 to observe, ^3%s^1 to change camera mode"), getcommandkey(_("secondary fire"), "+fire2"), getcommandkey(_("drop weapon"), "dropweapon")); - break; - case 2: - s = sprintf(_("^1Press ^3%s^1 for gamemode info"), getcommandkey(_("server info"), "+show_info")); - break; + img_curr_group = 0; + switch(img_select(img_curr_group) % 3) + { + default: + case 0: + if(spectatee_status == -1) + s = sprintf(_("^1Press ^3%s^1 to spectate"), getcommandkey(_("primary fire"), "+fire")); + else + s = sprintf(_("^1Press ^3%s^1 or ^3%s^1 for next or previous player"), getcommandkey(_("next weapon"), "weapnext"), getcommandkey(_("previous weapon"), "weapprev")); + break; + case 1: + if(spectatee_status == -1) + s = sprintf(_("^1Use ^3%s^1 or ^3%s^1 to change the speed"), getcommandkey(_("next weapon"), "weapnext"), getcommandkey(_("previous weapon"), "weapprev")); + else + s = sprintf(_("^1Press ^3%s^1 to observe, ^3%s^1 to change camera mode"), getcommandkey(_("secondary fire"), "+fire2"), getcommandkey(_("drop weapon"), "dropweapon")); + break; + case 2: + s = sprintf(_("^1Press ^3%s^1 for gamemode info"), getcommandkey(_("server info"), "+show_info")); + break; + } + InfoMessage(s); } - InfoMessage(s); - if(gametype == MAPINFO_TYPE_LMS) + MUTATOR_CALLHOOK(DrawInfoMessages, pos, mySize); + + if(!warmup_stage && ISGAMETYPE(LMS)) { entity sk; sk = playerslots[player_localnum]; @@ -170,7 +178,7 @@ void HUD_InfoMessages() InfoMessage(s); } - if(teamplay && !spectatee_status && gametype != MAPINFO_TYPE_CA && teamnagger) + if(teamplay && !spectatee_status && teamnagger) { float ts_min = 0, ts_max = 0; entity tm = teams.sort_next; @@ -201,7 +209,7 @@ void HUD_InfoMessages() //if(spectatee_status != -1) { s = ((spectatee_status) ? _("^1Spectating this player:") : _("^1Spectating you:")); - //drawInfoMessage(s) + // InfoMessage(s) int limit = min(num_spectators, MAX_SPECTATORS); for(int i = 0; i < limit; ++i) { @@ -210,7 +218,7 @@ void HUD_InfoMessages() s = strcat(s, " ^7", entcs_GetName(slot)); else s = strcat("^7", entcs_GetName(slot)); - drawInfoMessage(s); + InfoMessage(s); } } }