1 #include "infomessages.qh"
3 #include <common/ent_cs.qh>
4 #include <common/mapinfo.qh>
6 // Info messages panel (#14)
8 #define drawInfoMessage(s) MACRO_BEGIN { \
9 if(autocvar_hud_panel_infomessages_flip) \
10 o.x = pos.x + mySize.x - stringwidth(s, true, fontsize); \
11 drawcolorcodedstring(o, s, fontsize, a, DRAWFLAG_NORMAL); \
14 void HUD_InfoMessages()
16 if(!autocvar__hud_configure)
18 if(!autocvar_hud_panel_infomessages) return;
21 HUD_Panel_UpdateCvars();
29 pos += '1 1 0' * panel_bg_padding;
30 mySize -= '2 2 0' * panel_bg_padding;
33 // always force 5:1 aspect
34 vector newSize = '0 0 0';
35 if(mySize.x/mySize.y > 5)
37 newSize.x = 5 * mySize.y;
40 pos.x = pos.x + (mySize.x - newSize.x) / 2;
44 newSize.y = 1/5 * mySize.x;
47 pos.y = pos.y + (mySize.y - newSize.y) / 2;
56 fontsize = '0.20 0.20 0' * mySize.y;
62 if(!autocvar__hud_configure)
67 if(spectatee_status == -1)
70 s = sprintf(_("^1Spectating: ^7%s"), entcs_GetName(current_player));
73 if(spectatee_status == -1)
74 s = sprintf(_("^1Press ^3%s^1 to spectate"), getcommandkey("primary fire", "+fire"));
76 s = sprintf(_("^1Press ^3%s^1 or ^3%s^1 for next or previous player"), getcommandkey("next weapon", "weapnext"), getcommandkey("previous weapon", "weapprev"));
79 if(spectatee_status == -1)
80 s = sprintf(_("^1Use ^3%s^1 or ^3%s^1 to change the speed"), getcommandkey("next weapon", "weapnext"), getcommandkey("previous weapon", "weapprev"));
82 s = sprintf(_("^1Press ^3%s^1 to observe"), getcommandkey("secondary fire", "+fire2"));
85 s = sprintf(_("^1Press ^3%s^1 for gamemode info"), getcommandkey("server info", "+show_info"));
88 if(gametype == MAPINFO_TYPE_LMS)
91 sk = playerslots[player_localnum];
92 if(sk.(scores[ps_primary]) >= 666)
93 s = _("^1Match has already begun");
94 else if(sk.(scores[ps_primary]) > 0)
95 s = _("^1You have no more lives left");
97 s = sprintf(_("^1Press ^3%s^1 to join"), getcommandkey("jump", "+jump"));
100 s = sprintf(_("^1Press ^3%s^1 to join"), getcommandkey("jump", "+jump"));
104 if (time < STAT(GAMESTARTTIME))
106 //we need to ceil, otherwise the countdown would be off by .5 when using round()
107 float countdown = ceil(STAT(GAMESTARTTIME) - time);
108 s = sprintf(_("^1Game starts in ^3%d^1 seconds"), countdown);
114 s = _("^2Currently in ^1warmup^2 stage!");
124 if(ready_waiting && !spectatee_status)
126 if(ready_waiting_for_me)
129 s = sprintf(_("%sPress ^3%s%s to end warmup"), blinkcolor, getcommandkey("ready", "ready"), blinkcolor);
131 s = sprintf(_("%sPress ^3%s%s once you are ready"), blinkcolor, getcommandkey("ready", "ready"), blinkcolor);
136 s = _("^2Waiting for others to ready up to end warmup...");
138 s = _("^2Waiting for others to ready up...");
142 else if(warmup_stage && !spectatee_status)
144 s = sprintf(_("^2Press ^3%s^2 to end warmup"), getcommandkey("ready", "ready"));
148 if(teamplay && !spectatee_status && gametype != MAPINFO_TYPE_CA && teamnagger)
150 float ts_min = 0, ts_max = 0;
151 tm = teams.sort_next;
154 for (; tm.sort_next; tm = tm.sort_next)
156 if(!tm.team_size || tm.team == NUM_SPECTATOR)
158 if(!ts_min) ts_min = tm.team_size;
159 else ts_min = min(ts_min, tm.team_size);
160 if(!ts_max) ts_max = tm.team_size;
161 else ts_max = max(ts_max, tm.team_size);
163 if ((ts_max - ts_min) > 1)
165 s = strcat(blinkcolor, _("Teamnumbers are unbalanced!"));
166 tm = GetTeam(myteam, false);
168 if (tm.team != NUM_SPECTATOR)
169 if (tm.team_size == ts_max)
170 s = strcat(s, sprintf(_(" Press ^3%s%s to adjust"), getcommandkey("team menu", "menu_showteamselect"), blinkcolor));
178 s = _("^7Press ^3ESC ^7to show HUD options.");
180 s = _("^3Doubleclick ^7a panel for panel-specific options.");
182 s = _("^3CTRL ^7to disable collision testing, ^3SHIFT ^7and");
184 s = _("^3ALT ^7+ ^3ARROW KEYS ^7for fine adjustments.");