From: FruitieX Date: Sat, 3 Jul 2010 21:00:43 +0000 (+0300) Subject: new panel for "info messages" such as the spec info X-Git-Tag: xonotic-v0.1.0preview~457^2~19 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=536896a7e230617829396e9e22377f47c1519b18;hp=9246ae97f8eb6fa597a88efd8de29e69b4baf95a;p=xonotic%2Fxonotic-data.pk3dir.git new panel for "info messages" such as the spec info --- diff --git a/hud_wickedhud_default.cfg b/hud_wickedhud_default.cfg index 60d8965ec..c44fee689 100644 --- a/hud_wickedhud_default.cfg +++ b/hud_wickedhud_default.cfg @@ -20,7 +20,7 @@ seta hud_progressbar_armor_color "0 0.6 0" "R G B vector of the progress bar bac seta hud_progressbar_fuel_color "0.6 0.6 0" "R G B vector of the progress bar background color" seta hud_progressbar_nexball_color "0.7 0.1 0" "R G B vector of the progress bar background color" -seta _hud_panelorder "6 0 1 2 3 4 5 7 8 9 10 11 12 13" "contains order in which panels are to be drawn" +seta _hud_panelorder "6 0 1 2 3 4 5 7 8 9 10 11 12 13 14" "contains order in which panels are to be drawn" seta hud_weaponicons 1 "enable/disable this panel" seta hud_weaponicons_pos "0.930000 0.090000" "position of this panel" @@ -89,7 +89,6 @@ seta hud_notify_flip 0 "order the list top to bottom instead of bottom to top" seta hud_notify_print 0 "also con_notify print the messages that are shown on the notify panel" seta hud_notify_time 10 "time that a new entry stays until it fades out" seta hud_notify_fadetime 3 "fade out time" -seta hud_notify_info_top 1 "show info messages at top of panel" seta hud_timer 1 "enable/disable this panel" seta hud_timer_pos "0.880000 0.015000" "position of this base of the panel" @@ -192,3 +191,14 @@ seta hud_engineinfo_framecounter_decimals 0 "amount of decimals to show" seta hud_engineinfo_framecounter_exponentialmovingaverage 1 "use an averaging method for calculating fps instead of counting frametime like engine does" seta hud_engineinfo_framecounter_exponentialmovingaverage_new_weight 0.1 "weight of latest data point" seta hud_engineinfo_framecounter_exponentialmovingaverage_instantupdate_change_threshold 0.5 "threshold for fps change when to update instantly, to make big fps changes update faster" + +seta hud_infomessages 1 "enable/disable this panel +seta hud_infomessages_pos "0.020000 0.680000" "position of this base of the panel" +seta hud_infomessages_size "0.320000 0.090000" "size of this panel" +seta hud_infomessages_bg "border_modicons" "if set to something else than \"\" = override default background" +seta hud_infomessages_bg_color "" "if set to something else than \"\" = override default panel background color" +seta hud_infomessages_bg_color_team "" "override panel color with team color in team based games" +seta hud_infomessages_bg_alpha 0 "if set to something else than \"\" = override default panel background alpha" +seta hud_infomessages_bg_border "" "if set to something else than \"\" = override default size of border around the background" +seta hud_infomessages_bg_padding "" "if set to something else than \"\" = override default padding of contents from border" +seta hud_infomessages_flip 0 "1 = align the items to the right" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 8b15c599d..2b63a77cc 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -107,7 +107,6 @@ var float autocvar_hud_notify_print; var float autocvar_hud_notify_time; var float autocvar_hud_notify_fadetime; var float autocvar_hud_notify_flip; -var float autocvar_hud_notify_info_top; var float autocvar_hud_timer; var vector autocvar_hud_timer_pos; @@ -200,3 +199,14 @@ var string autocvar_hud_engineinfo_bg_color_team; var string autocvar_hud_engineinfo_bg_alpha; var string autocvar_hud_engineinfo_bg_border; var string autocvar_hud_engineinfo_bg_padding; + +var float autocvar_hud_infomessages; +var vector autocvar_hud_infomessages_pos; +var vector autocvar_hud_infomessages_size; +var string autocvar_hud_infomessages_bg; +var string autocvar_hud_infomessages_bg_color; +var string autocvar_hud_infomessages_bg_color_team; +var string autocvar_hud_infomessages_bg_alpha; +var string autocvar_hud_infomessages_bg_border; +var string autocvar_hud_infomessages_bg_padding; +var float autocvar_hud_infomessages_flip; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index ad5a61f29..abb2c2d99 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -1186,7 +1186,7 @@ float HUD_Panel_HighlightCheck() void HUD_Panel_FirstInDrawQ(float id) { float i; - float place; + var float place = -1; // find out where in the array our current id is, save into place for(i = 0; i < HUD_PANEL_NUM; ++i) { @@ -1196,6 +1196,9 @@ void HUD_Panel_FirstInDrawQ(float id) break; } } + // place last if we didn't find a place for it yet (probably new panel, or screwed up cvar) + if(place == -1) + place = HUD_PANEL_NUM - 1; // move all ids up by one step in the array until "place" for(i = place; i > 0; --i) @@ -2765,7 +2768,6 @@ void HUD_Notify (void) float entries, height; entries = bound(1, floor(14 * mySize_y/mySize_x), 12); height = mySize_y/entries; - entries -= 2; // top/bottom two lines reserved for info messaged, such as spec instructions vector fontsize; fontsize = '0.5 0.5 0' * height; @@ -2790,8 +2792,6 @@ void HUD_Notify (void) i = j; else // rather nasty hack for ordering items from the bottom up i = entries - j - 1; - if(autocvar_hud_notify_info_top) - i += 2; // top/bottom two lines reserved for info messaged, such as spec instructions if(fadetime) { @@ -2991,155 +2991,6 @@ void HUD_Notify (void) drawcolorcodedstring(pos_victim, victim, fontsize, panel_fg_alpha * a, DRAWFLAG_NORMAL); } } - - } - - // TODO: separate panel for these? - // Info messages - // - entity tm; - vector o; - o = pos; - if(autocvar_hud_notify_info_top) - o = pos + eY; - else - o = pos + eY * mySize_y - eY * 2 * height; - - if(spectatee_status && !intermission) - { - //drawfont = hud_bigfont; - if(spectatee_status == -1) - s = "^1Observing"; - else - s = GetPlayerName(spectatee_status - 1); - - //s = textShortenToWidth(s, mySize_y, 0.5 * height, stringwidth_colors); - //drawcolorcodedstring(pos + eY * 0.25 * height, s, 0.5 * height, panel_fg_alpha, DRAWFLAG_NORMAL); - //drawfont = hud_font; - - // spectator text in the upper right corner - if(spectatee_status == -1) - s = strcat("^1Press ^3", getcommandkey("primary fire", "+attack"), "^1 to spectate"); - else - s = strcat("^1Press ^3", getcommandkey("primary fire", "+attack"), "^1 for another player"); - drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); - o += eY * fontsize_y; - - if(spectatee_status == -1) - s = strcat("^1Use ^3", getcommandkey("next weapon", "weapnext"), "^1 or ^3", getcommandkey("previous weapon", "weapprev"), "^1 to change the speed"); - else - s = strcat("^1Press ^3", getcommandkey("secondary fire", "+attack2"), "^1 to observe"); - drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); - o += eY * fontsize_y; - - s = strcat("^1Press ^3", getcommandkey("server info", "+show_info"), "^1 for gamemode info"); - drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); - o += eY * fontsize_y; - - if(gametype == GAME_ARENA) - s = "^1Wait for your turn to join"; - else if(gametype == GAME_LMS) - { - entity sk; - sk = playerslots[player_localentnum - 1]; - 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 = strcat("^1Press ^3", getcommandkey("jump", "+jump"), "^1 to join"); - } - else - s = strcat("^1Press ^3", getcommandkey("jump", "+jump"), "^1 to join"); - drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); - o += eY * fontsize_y; - - //show restart countdown: - if (time < getstatf(STAT_GAMESTARTTIME)) { - float countdown; - //we need to ceil, otherwise the countdown would be off by .5 when using round() - countdown = ceil(getstatf(STAT_GAMESTARTTIME) - time); - s = strcat("^1Game starts in ^3", ftos(countdown), "^1 seconds"); - drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); - o += eY * fontsize_y; - } - } - if(warmup_stage && !intermission) - { - s = "^2Currently in ^1warmup^2 stage!"; - drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); - o += eY * fontsize_y; - } - - string blinkcolor; - if(mod(time, 1) >= 0.5) - blinkcolor = "^1"; - else - blinkcolor = "^3"; - - if(ready_waiting && !intermission && !spectatee_status) - { - if(ready_waiting_for_me) - { - if(warmup_stage) - s = strcat(blinkcolor, "Press ^3", getcommandkey("ready", "ready"), blinkcolor, " to end warmup"); - else - s = strcat(blinkcolor, "Press ^3", getcommandkey("ready", "ready"), blinkcolor, " once you are ready"); - } - else - { - if(warmup_stage) - s = strcat("^2Waiting for others to ready up to end warmup..."); - else - s = strcat("^2Waiting for others to ready up..."); - } - drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); - o += eY * fontsize_y; - } - else if(warmup_stage && !intermission && !spectatee_status) - { - s = strcat("^2Press ^3", getcommandkey("ready", "ready"), "^2 to end warmup"); - drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); - o += eY * fontsize_y; - } - - if(teamplay && !intermission && !spectatee_status && gametype != GAME_CA && teamnagger) - { - float ts_min, ts_max; - tm = teams.sort_next; - if (tm) - { - for(; tm.sort_next; tm = tm.sort_next) - { - if(!tm.team_size || tm.team == COLOR_SPECTATOR) - continue; - if(!ts_min) ts_min = tm.team_size; - else ts_min = min(ts_min, tm.team_size); - if(!ts_max) ts_max = tm.team_size; - else ts_max = max(ts_max, tm.team_size); - } - if ((ts_max - ts_min) > 1) - { - s = strcat(blinkcolor, "Teamnumbers are unbalanced!"); - tm = GetTeam(myteam, false); - if (tm) - if (tm.team != COLOR_SPECTATOR) - if (tm.team_size == ts_max) - s = strcat(s, " Press ^3", getcommandkey("team menu", "menu_showteamselect"), blinkcolor, " to adjust"); - - drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); - o += eY * fontsize_y; - } - } - } - if(autocvar__hud_configure) - { - s = "^7Press ^3ESC ^7to show HUD options."; - drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); - o += eY * fontsize_y; - s = "^3Doubleclick a panel for panel-specific options."; - drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); - o += eY * fontsize_y; } } @@ -4446,6 +4297,211 @@ void HUD_EngineInfo(void) drawstring_aspect(pos, strcat("FPS: ", ftos_decimals(prevfps, cvar("hud_engineinfo_framecounter_decimals"))), mySize, mySize_y, color, panel_fg_alpha, DRAWFLAG_NORMAL); drawfont = hud_font; } + +// Info messages panel (#14) +// +void HUD_InfoMessages(void) +{ + if(!autocvar_hud_infomessages && !autocvar__hud_configure) + return; + + float id = HUD_PANEL_INFOMESSAGES; + HUD_Panel_UpdateCvarsForId(id); + vector pos, mySize; + pos = panel_pos; + mySize = panel_size; + + HUD_Panel_DrawBg(1); + if(panel_bg_padding) + { + pos += '1 1 0' * panel_bg_padding; + mySize -= '2 2 0' * panel_bg_padding; + } + + // always force 6:1 aspect + vector newSize; + if(mySize_x/mySize_y > 6) + { + newSize_x = 6 * mySize_y; + newSize_y = mySize_y; + + pos_x = pos_x + (mySize_x - newSize_x) / 2; + } + else + { + newSize_y = 1/6 * mySize_x; + newSize_x = mySize_x; + + pos_y = pos_y + (mySize_y - newSize_y) / 2; + } + + mySize = newSize; + entity tm; + vector o; + o = pos; + + vector fontsize; + fontsize = '0.25 0.25 0' * mySize_y; + + string s; + if(spectatee_status && !intermission) + { + //drawfont = hud_bigfont; + if(spectatee_status == -1) + s = "^1Observing"; + else + s = GetPlayerName(spectatee_status - 1); + + //s = textShortenToWidth(s, mySize_y, 0.5 * height, stringwidth_colors); + //drawcolorcodedstring(pos + eY * 0.25 * height, s, 0.5 * height, panel_fg_alpha, DRAWFLAG_NORMAL); + //drawfont = hud_font; + + // spectator text in the upper right corner + if(spectatee_status == -1) + s = strcat("^1Press ^3", getcommandkey("primary fire", "+attack"), "^1 to spectate"); + else + s = strcat("^1Press ^3", getcommandkey("primary fire", "+attack"), "^1 for another player"); + if(autocvar_hud_infomessages_flip) + o_x = pos_x + mySize_x - stringwidth(s, TRUE, fontsize); + drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + o += eY * fontsize_y; + + if(spectatee_status == -1) + s = strcat("^1Use ^3", getcommandkey("next weapon", "weapnext"), "^1 or ^3", getcommandkey("previous weapon", "weapprev"), "^1 to change the speed"); + else + s = strcat("^1Press ^3", getcommandkey("secondary fire", "+attack2"), "^1 to observe"); + if(autocvar_hud_infomessages_flip) + o_x = pos_x + mySize_x - stringwidth(s, TRUE, fontsize); + drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + o += eY * fontsize_y; + + s = strcat("^1Press ^3", getcommandkey("server info", "+show_info"), "^1 for gamemode info"); + if(autocvar_hud_infomessages_flip) + o_x = pos_x + mySize_x - stringwidth(s, TRUE, fontsize); + drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + o += eY * fontsize_y; + + if(gametype == GAME_ARENA) + s = "^1Wait for your turn to join"; + else if(gametype == GAME_LMS) + { + entity sk; + sk = playerslots[player_localentnum - 1]; + 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 = strcat("^1Press ^3", getcommandkey("jump", "+jump"), "^1 to join"); + } + else + s = strcat("^1Press ^3", getcommandkey("jump", "+jump"), "^1 to join"); + if(autocvar_hud_infomessages_flip) + o_x = pos_x + mySize_x - stringwidth(s, TRUE, fontsize); + drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + o += eY * fontsize_y; + + //show restart countdown: + if (time < getstatf(STAT_GAMESTARTTIME)) { + float countdown; + //we need to ceil, otherwise the countdown would be off by .5 when using round() + countdown = ceil(getstatf(STAT_GAMESTARTTIME) - time); + s = strcat("^1Game starts in ^3", ftos(countdown), "^1 seconds"); + drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + o += eY * fontsize_y; + } + } + if(warmup_stage && !intermission) + { + s = "^2Currently in ^1warmup^2 stage!"; + if(autocvar_hud_infomessages_flip) + o_x = pos_x + mySize_x - stringwidth(s, TRUE, fontsize); + drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + o += eY * fontsize_y; + } + + string blinkcolor; + if(mod(time, 1) >= 0.5) + blinkcolor = "^1"; + else + blinkcolor = "^3"; + + if(ready_waiting && !intermission && !spectatee_status) + { + if(ready_waiting_for_me) + { + if(warmup_stage) + s = strcat(blinkcolor, "Press ^3", getcommandkey("ready", "ready"), blinkcolor, " to end warmup"); + else + s = strcat(blinkcolor, "Press ^3", getcommandkey("ready", "ready"), blinkcolor, " once you are ready"); + } + else + { + if(warmup_stage) + s = strcat("^2Waiting for others to ready up to end warmup..."); + else + s = strcat("^2Waiting for others to ready up..."); + } + if(autocvar_hud_infomessages_flip) + o_x = pos_x + mySize_x - stringwidth(s, TRUE, fontsize); + drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + o += eY * fontsize_y; + } + else if(warmup_stage && !intermission && !spectatee_status) + { + s = strcat("^2Press ^3", getcommandkey("ready", "ready"), "^2 to end warmup"); + if(autocvar_hud_infomessages_flip) + o_x = pos_x + mySize_x - stringwidth(s, TRUE, fontsize); + drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + o += eY * fontsize_y; + } + + if(teamplay && !intermission && !spectatee_status && gametype != GAME_CA && teamnagger) + { + float ts_min, ts_max; + tm = teams.sort_next; + if (tm) + { + for(; tm.sort_next; tm = tm.sort_next) + { + if(!tm.team_size || tm.team == COLOR_SPECTATOR) + continue; + if(!ts_min) ts_min = tm.team_size; + else ts_min = min(ts_min, tm.team_size); + if(!ts_max) ts_max = tm.team_size; + else ts_max = max(ts_max, tm.team_size); + } + if ((ts_max - ts_min) > 1) + { + s = strcat(blinkcolor, "Teamnumbers are unbalanced!"); + tm = GetTeam(myteam, false); + if (tm) + if (tm.team != COLOR_SPECTATOR) + if (tm.team_size == ts_max) + s = strcat(s, " Press ^3", getcommandkey("team menu", "menu_showteamselect"), blinkcolor, " to adjust"); + + if(autocvar_hud_infomessages_flip) + o_x = pos_x + mySize_x - stringwidth(s, TRUE, fontsize); + drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + o += eY * fontsize_y; + } + } + } + if(autocvar__hud_configure) + { + s = "^7Press ^3ESC ^7to show HUD options."; + if(autocvar_hud_infomessages_flip) + o_x = pos_x + mySize_x - stringwidth(s, TRUE, fontsize); + drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + o += eY * fontsize_y; + s = "^3Doubleclick a panel for panel-specific options."; + if(autocvar_hud_infomessages_flip) + o_x = pos_x + mySize_x - stringwidth(s, TRUE, fontsize); + drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + o += eY * fontsize_y; + } +} + /* ================== Main HUD system @@ -4587,6 +4643,8 @@ switch (id) {\ HUD_Chat(); break;\ case (HUD_PANEL_ENGINEINFO):\ HUD_EngineInfo(); break;\ + case (HUD_PANEL_INFOMESSAGES):\ + HUD_InfoMessages(); break;\ } void HUD_Main (void) diff --git a/qcsrc/client/hud.qh b/qcsrc/client/hud.qh index 5537b44ea..08e752735 100644 --- a/qcsrc/client/hud.qh +++ b/qcsrc/client/hud.qh @@ -227,6 +227,7 @@ switch(id) { \ case HUD_PANEL_PRESSEDKEYS: HUD_Panel_UpdateCvars(pressedkeys) break; \ case HUD_PANEL_CHAT: HUD_Panel_UpdateCvars(chat) break; \ case HUD_PANEL_ENGINEINFO: HUD_Panel_UpdateCvars(engineinfo) break; \ + case HUD_PANEL_INFOMESSAGES: HUD_Panel_UpdateCvars(infomessages) break; \ } #define HUD_Panel_UpdatePosSize(name) \ @@ -239,18 +240,19 @@ HUD_Panel_GetBorder() // Update pos and size of given panel id #define HUD_Panel_UpdatePosSizeForId(id) \ switch(id) { \ - case HUD_PANEL_WEAPONICONS: HUD_Panel_UpdatePosSize(weaponicons) break; \ - case HUD_PANEL_INVENTORY: HUD_Panel_UpdatePosSize(inventory) break; \ - case HUD_PANEL_POWERUPS: HUD_Panel_UpdatePosSize(powerups) break; \ - case HUD_PANEL_HEALTHARMOR: HUD_Panel_UpdatePosSize(healtharmor) break; \ - case HUD_PANEL_NOTIFY: HUD_Panel_UpdatePosSize(notify) break; \ - case HUD_PANEL_TIMER: HUD_Panel_UpdatePosSize(timer) break; \ - case HUD_PANEL_RADAR: HUD_Panel_UpdatePosSize(radar) break; \ - case HUD_PANEL_SCORE: HUD_Panel_UpdatePosSize(score) break; \ - case HUD_PANEL_RACETIMER: HUD_Panel_UpdatePosSize(racetimer) break; \ - case HUD_PANEL_VOTE: HUD_Panel_UpdatePosSize(vote) break; \ - case HUD_PANEL_MODICONS: HUD_Panel_UpdatePosSize(modicons) break; \ - case HUD_PANEL_PRESSEDKEYS: HUD_Panel_UpdatePosSize(pressedkeys) break; \ - case HUD_PANEL_CHAT: HUD_Panel_UpdatePosSize(chat) break; \ - case HUD_PANEL_ENGINEINFO: HUD_Panel_UpdatePosSize(engineinfo) break; \ + case HUD_PANEL_WEAPONICONS: HUD_Panel_UpdatePosSize(weaponicons) break;\ + case HUD_PANEL_INVENTORY: HUD_Panel_UpdatePosSize(inventory) break;\ + case HUD_PANEL_POWERUPS: HUD_Panel_UpdatePosSize(powerups) break;\ + case HUD_PANEL_HEALTHARMOR: HUD_Panel_UpdatePosSize(healtharmor) break;\ + case HUD_PANEL_NOTIFY: HUD_Panel_UpdatePosSize(notify) break;\ + case HUD_PANEL_TIMER: HUD_Panel_UpdatePosSize(timer) break;\ + case HUD_PANEL_RADAR: HUD_Panel_UpdatePosSize(radar) break;\ + case HUD_PANEL_SCORE: HUD_Panel_UpdatePosSize(score) break;\ + case HUD_PANEL_RACETIMER: HUD_Panel_UpdatePosSize(racetimer) break;\ + case HUD_PANEL_VOTE: HUD_Panel_UpdatePosSize(vote) break;\ + case HUD_PANEL_MODICONS: HUD_Panel_UpdatePosSize(modicons) break;\ + case HUD_PANEL_PRESSEDKEYS: HUD_Panel_UpdatePosSize(pressedkeys) break;\ + case HUD_PANEL_CHAT: HUD_Panel_UpdatePosSize(chat) break;\ + case HUD_PANEL_ENGINEINFO: HUD_Panel_UpdatePosSize(engineinfo) break;\ + case HUD_PANEL_INFOMESSAGES: HUD_Panel_UpdatePosSize(infomessages)\ } diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index adb12bc72..9eebbfb6c 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -604,21 +604,23 @@ float HUD_PANEL_MODICONS = 10; float HUD_PANEL_PRESSEDKEYS = 11; float HUD_PANEL_CHAT = 12; float HUD_PANEL_ENGINEINFO = 13; -float HUD_PANEL_NUM = 14; // always last panel id + 1, please increment when adding a new panel - -string HUD_PANELNAME_WEAPONICONS = "weaponicons"; -string HUD_PANELNAME_INVENTORY = "inventory"; -string HUD_PANELNAME_POWERUPS = "powerups"; -string HUD_PANELNAME_HEALTHARMOR = "healtharmor"; -string HUD_PANELNAME_NOTIFY = "notify"; -string HUD_PANELNAME_TIMER = "timer"; -string HUD_PANELNAME_RADAR = "radar"; -string HUD_PANELNAME_SCORE = "score"; -string HUD_PANELNAME_RACETIMER = "racetimer"; -string HUD_PANELNAME_VOTE = "vote"; -string HUD_PANELNAME_MODICONS = "modicons"; -string HUD_PANELNAME_PRESSEDKEYS = "pressedkeys"; -string HUD_PANELNAME_CHAT = "chat"; -string HUD_PANELNAME_ENGINEINFO = "engineinfo"; +float HUD_PANEL_INFOMESSAGES = 14; +float HUD_PANEL_NUM = 15; // always last panel id + 1, please increment when adding a new panel + +string HUD_PANELNAME_WEAPONICONS = "weaponicons"; +string HUD_PANELNAME_INVENTORY = "inventory"; +string HUD_PANELNAME_POWERUPS = "powerups"; +string HUD_PANELNAME_HEALTHARMOR = "healtharmor"; +string HUD_PANELNAME_NOTIFY = "notify"; +string HUD_PANELNAME_TIMER = "timer"; +string HUD_PANELNAME_RADAR = "radar"; +string HUD_PANELNAME_SCORE = "score"; +string HUD_PANELNAME_RACETIMER = "racetimer"; +string HUD_PANELNAME_VOTE = "vote"; +string HUD_PANELNAME_MODICONS = "modicons"; +string HUD_PANELNAME_PRESSEDKEYS = "pressedkeys"; +string HUD_PANELNAME_CHAT = "chat"; +string HUD_PANELNAME_ENGINEINFO = "engineinfo"; +string HUD_PANELNAME_INFOMESSAGES = "infomessages"; float HUD_MENU_ENABLE = 0; diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index 56659d038..41e792ed8 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -211,6 +211,12 @@ float get_model_parameters_age; string get_model_parameters_desc; float get_model_parameters(string mod, float skn); // call with string_null to clear; skin -1 means mod is the filename of the txt file and is to be split +// stupid stupid stupid FTEQCC has a max limit on macro sizes, let's work around by splitting the macro into two macros! :( +#define HUD_Panel_GetName_Part2(id) \ +switch(id) {\ + case HUD_PANEL_ENGINEINFO: panel_name = HUD_PANELNAME_ENGINEINFO; break; \ + case HUD_PANEL_INFOMESSAGES: panel_name = HUD_PANELNAME_INFOMESSAGES; break; \ +} // Get name of specified panel id #define HUD_Panel_GetName(id) \ @@ -228,5 +234,5 @@ switch(id) { \ case HUD_PANEL_MODICONS: panel_name = HUD_PANELNAME_MODICONS; break; \ case HUD_PANEL_PRESSEDKEYS: panel_name = HUD_PANELNAME_PRESSEDKEYS; break; \ case HUD_PANEL_CHAT: panel_name = HUD_PANELNAME_CHAT; break; \ - case HUD_PANEL_ENGINEINFO: panel_name = HUD_PANELNAME_ENGINEINFO; break; \ -} +}\ +HUD_Panel_GetName_Part2(id)