X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fpanel%2Finfomessages.qc;h=5169ea5f384d34ae16ea80f3b46da767fae0ed5d;hb=126111bb9ef1d8979a6b76bcf464f6e19ea1168d;hp=cd49f09adc769bc0a5cd66450e8178b04a943e4c;hpb=29fae4d9d59e5ec8afbdd6ef0ebcc5dcdc1bfa3f;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud/panel/infomessages.qc b/qcsrc/client/hud/panel/infomessages.qc index cd49f09ad..5169ea5f3 100644 --- a/qcsrc/client/hud/panel/infomessages.qc +++ b/qcsrc/client/hud/panel/infomessages.qc @@ -1,10 +1,16 @@ #include "infomessages.qh" +#include #include -#include // Info messages (#14) +void HUD_InfoMessages_Export(int fh) +{ + // allow saving cvars that aesthetically change the panel into hud skin files + HUD_Write_Cvar("hud_panel_infomessages_flip"); +} + float autocvar_hud_panel_infomessages_group0 = 1; float autocvar_hud_panel_infomessages_group_fadetime = 0.4; float autocvar_hud_panel_infomessages_group_time = 6; @@ -30,7 +36,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; @@ -48,10 +53,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() { @@ -114,20 +119,15 @@ void HUD_InfoMessages() InfoMessage(s); } - if(gametype == MAPINFO_TYPE_LMS) + bool mutator_returnvalue = MUTATOR_CALLHOOK(DrawInfoMessages, pos, mySize, img_curr_group); + pos = M_ARGV(0, vector); + img_curr_group = M_ARGV(2, int); + + if(!mutator_returnvalue) { - entity sk; - sk = playerslots[player_localnum]; - if(sk.(scores(ps_primary)) >= 666) - s = _("^1Match has already begun"); - else if(sk.(scores(ps_primary)) > 0) - s = _("^1You have no more lives left"); - else - s = sprintf(_("^1Press ^3%s^1 to join"), getcommandkey(_("jump"), "+jump")); - } - else s = sprintf(_("^1Press ^3%s^1 to join"), getcommandkey(_("jump"), "+jump")); - InfoMessage(s); + InfoMessage(s); + } } if (time < STAT(GAMESTARTTIME)) @@ -174,7 +174,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;