- Rename active_panel to hud_configure_active_panel as it's used only in hud configure
- Use more autocvars
- Reduce checks of hud_configure when possible
float autocvar_cl_zoomspeed;
float autocvar_con_chat;
float autocvar_con_chatpos;
float autocvar_cl_zoomspeed;
float autocvar_con_chat;
float autocvar_con_chatpos;
+float autocvar_con_chatrect;
float autocvar_con_chatsize;
float autocvar_con_chattime;
float autocvar_con_notify;
float autocvar_con_chatsize;
float autocvar_con_chattime;
float autocvar_con_notify;
#define HUD_Panel_DrawBg(alpha)\
if(panel_bg != "0")\
draw_BorderPicture(panel_pos - '1 1 0' * panel_bg_border, panel_bg, panel_size + '1 1 0' * 2 * panel_bg_border, panel_bg_color, panel_bg_alpha * alpha, '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER));\
#define HUD_Panel_DrawBg(alpha)\
if(panel_bg != "0")\
draw_BorderPicture(panel_pos - '1 1 0' * panel_bg_border, panel_bg, panel_size + '1 1 0' * 2 * panel_bg_border, panel_bg_color, panel_bg_alpha * alpha, '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER));\
-if(highlightedPanel_prev == active_panel && autocvar__hud_configure)\
+if(highlightedPanel_prev == hud_configure_active_panel && autocvar__hud_configure)\
{\
HUD_Panel_HlBorder(panel_bg_border + 1.5 * hlBorderSize, '0 0.5 1', 0.25 * (1 - autocvar__menu_alpha) * alpha);\
} ENDS_WITH_CURLY_BRACE
{\
HUD_Panel_HlBorder(panel_bg_border + 1.5 * hlBorderSize, '0 0.5 1', 0.25 * (1 - autocvar__menu_alpha) * alpha);\
} ENDS_WITH_CURLY_BRACE
vector HUD_Panel_CheckMove(vector myPos, vector mySize)
{
float i;
vector HUD_Panel_CheckMove(vector myPos, vector mySize)
{
float i;
+ float myCenter_x, myCenter_y, targCenter_x, targCenter_y;
vector myTarget;
myTarget = myPos;
vector myTarget;
myTarget = myPos;
- vector myCenter;
- vector targCenter;
- myCenter = '0 0 0'; // shut up fteqcc, there IS a reference
- targCenter = '0 0 0'; // shut up fteqcc, there IS a reference
-
for (i = 0; i < HUD_PANEL_NUM; ++i) {
if(i == highlightedPanel || !panel_enabled)
continue;
for (i = 0; i < HUD_PANEL_NUM; ++i) {
if(i == highlightedPanel || !panel_enabled)
continue;
//if(cvar("hud_configure_checkcollisions_debug"))
//drawfill(pos, mySize, '1 1 1', .2, DRAWFLAG_NORMAL);
//if(cvar("hud_configure_checkcollisions_debug"))
//drawfill(pos, mySize, '1 1 1', .2, DRAWFLAG_NORMAL);
- if(cvar("hud_configure_grid"))
+ if(autocvar_hud_configure_grid)
{
pos_x = floor((pos_x/vid_conwidth)/hud_configure_gridSize_x + 0.5) * hud_configure_realGridSize_x;
pos_y = floor((pos_y/vid_conheight)/hud_configure_gridSize_y + 0.5) * hud_configure_realGridSize_y;
{
pos_x = floor((pos_x/vid_conwidth)/hud_configure_gridSize_x + 0.5) * hud_configure_realGridSize_x;
pos_y = floor((pos_y/vid_conheight)/hud_configure_gridSize_y + 0.5) * hud_configure_realGridSize_y;
// (which side the resize direction finds for first) and reduce the size up to there
//
// dist is the distance between resizeorigin and the "analogous" point of the panel
// (which side the resize direction finds for first) and reduce the size up to there
//
// dist is the distance between resizeorigin and the "analogous" point of the panel
- // in this case resizeorigin (bottom-right point) and the bottom-right point of the panel
+ // in this case between resizeorigin (bottom-right point) and the bottom-right point of the panel
dist_x = resizeorigin_x - targEndPos_x;
dist_y = resizeorigin_y - targEndPos_y;
if (dist_y <= 0 || dist_x / dist_y > ratio)
dist_x = resizeorigin_x - targEndPos_x;
dist_y = resizeorigin_y - targEndPos_y;
if (dist_y <= 0 || dist_x / dist_y > ratio)
//drawfill(myPos, mySize, '1 1 1', .2, DRAWFLAG_NORMAL);
// before checkresize, otherwise panel can be snapped partially inside another panel or panel aspect ratio can be broken
//drawfill(myPos, mySize, '1 1 1', .2, DRAWFLAG_NORMAL);
// before checkresize, otherwise panel can be snapped partially inside another panel or panel aspect ratio can be broken
- if(cvar("hud_configure_grid"))
+ if(autocvar_hud_configure_grid)
{
mySize_x = floor((mySize_x/vid_conwidth)/hud_configure_gridSize_x + 0.5) * hud_configure_realGridSize_x;
mySize_y = floor((mySize_y/vid_conheight)/hud_configure_gridSize_y + 0.5) * hud_configure_realGridSize_y;
{
mySize_x = floor((mySize_x/vid_conwidth)/hud_configure_gridSize_x + 0.5) * hud_configure_realGridSize_x;
mySize_y = floor((mySize_y/vid_conheight)/hud_configure_gridSize_y + 0.5) * hud_configure_realGridSize_y;
hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && autocvar_hud_configure_checkcollisions);
float step;
hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && autocvar_hud_configure_checkcollisions);
float step;
- if(cvar("hud_configure_grid"))
+ if(autocvar_hud_configure_grid)
{
if (nPrimary == K_UPARROW || nPrimary == K_DOWNARROW)
{
{
if (nPrimary == K_UPARROW || nPrimary == K_DOWNARROW)
{
if(!autocvar_hud_panel_weapons) return;
if(spectatee_status == -1) return;
}
if(!autocvar_hud_panel_weapons) return;
if(spectatee_status == -1) return;
}
+ else
+ hud_configure_active_panel = HUD_PANEL_WEAPONS;
float timeout = autocvar_hud_panel_weapons_timeout;
float timeout_effect_length, timein_effect_length;
float timeout = autocvar_hud_panel_weapons_timeout;
float timeout_effect_length, timein_effect_length;
- active_panel = HUD_PANEL_WEAPONS;
HUD_Panel_UpdateCvars(weapons);
if (timeout && time >= weapontime + timeout && !autocvar__hud_configure)
HUD_Panel_UpdateCvars(weapons);
if (timeout && time >= weapontime + timeout && !autocvar__hud_configure)
if(!autocvar_hud_panel_ammo) return;
if(spectatee_status == -1) return;
}
if(!autocvar_hud_panel_ammo) return;
if(spectatee_status == -1) return;
}
+ else
+ hud_configure_active_panel = HUD_PANEL_AMMO;
- active_panel = HUD_PANEL_AMMO;
HUD_Panel_UpdateCvars(ammo);
vector pos, mySize;
pos = panel_pos;
HUD_Panel_UpdateCvars(ammo);
vector pos, mySize;
pos = panel_pos;
-void HUD_Powerups(void) {
+void HUD_Powerups(void)
+{
+ float strength_time, shield_time;
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_powerups) return;
if(spectatee_status == -1) return;
if not(getstati(STAT_ITEMS) & (IT_STRENGTH | IT_INVINCIBLE)) return;
if (getstati(STAT_HEALTH) <= 0) return;
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_powerups) return;
if(spectatee_status == -1) return;
if not(getstati(STAT_ITEMS) & (IT_STRENGTH | IT_INVINCIBLE)) return;
if (getstati(STAT_HEALTH) <= 0) return;
+
+ strength_time = bound(0, getstatf(STAT_STRENGTH_FINISHED) - time, 99);
+ shield_time = bound(0, getstatf(STAT_INVINCIBLE_FINISHED) - time, 99);
+ }
+ else
+ {
+ hud_configure_active_panel = HUD_PANEL_POWERUPS;
+
+ strength_time = 15;
+ shield_time = 27;
- active_panel = HUD_PANEL_POWERUPS;
HUD_Panel_UpdateCvars(powerups);
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
HUD_Panel_UpdateCvars(powerups);
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
- float strength_time, shield_time;
- if(autocvar__hud_configure)
- {
- strength_time = 15;
- shield_time = 27;
- }
- else
- {
- strength_time = bound(0, getstatf(STAT_STRENGTH_FINISHED) - time, 99);
- shield_time = bound(0, getstatf(STAT_INVINCIBLE_FINISHED) - time, 99);
- }
-
HUD_Panel_DrawBg(bound(0, max(strength_time, shield_time), 1));
if(panel_bg_padding)
{
HUD_Panel_DrawBg(bound(0, max(strength_time, shield_time), 1));
if(panel_bg_padding)
{
//
void HUD_HealthArmor(void)
{
//
void HUD_HealthArmor(void)
{
+ float armor, health, fuel;
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_healtharmor) return;
if(spectatee_status == -1) return;
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_healtharmor) return;
if(spectatee_status == -1) return;
+
+ health = getstati(STAT_HEALTH);
+ if(health <= 0)
+ return;
+ armor = getstati(STAT_ARMOR);
+ fuel = getstati(STAT_FUEL);
+ }
+ else
+ {
+ hud_configure_active_panel = HUD_PANEL_HEALTHARMOR;
+
+ health = 150;
+ armor = 75;
+ fuel = 20;
- active_panel = HUD_PANEL_HEALTHARMOR;
HUD_Panel_UpdateCvars(healtharmor);
vector pos, mySize;
pos = panel_pos;
HUD_Panel_UpdateCvars(healtharmor);
vector pos, mySize;
pos = panel_pos;
mySize -= '2 2 0' * panel_bg_padding;
}
mySize -= '2 2 0' * panel_bg_padding;
}
- float armor, health, fuel;
- armor = getstati(STAT_ARMOR);
- health = getstati(STAT_HEALTH);
- fuel = getstati(STAT_FUEL);
-
- if(autocvar__hud_configure)
- {
- armor = 75;
- health = 150;
- fuel = 20;
- }
-
- if(health <= 0)
- return;
-
vector barsize;
vector picpos, numpos;
vector barsize;
vector picpos, numpos;
- if(!autocvar_hud_panel_notify && !autocvar__hud_configure)
- return;
+ if(!autocvar__hud_configure)
+ {
+ if(!autocvar_hud_panel_notify) return;
+ }
+ else
+ hud_configure_active_panel = HUD_PANEL_NOTIFY;
- active_panel = HUD_PANEL_NOTIFY;
HUD_Panel_UpdateCvars(notify);
vector pos, mySize;
pos = panel_pos;
HUD_Panel_UpdateCvars(notify);
vector pos, mySize;
pos = panel_pos;
- if(!autocvar_hud_panel_timer && !autocvar__hud_configure)
- return;
+ if(!autocvar__hud_configure)
+ {
+ if(!autocvar_hud_panel_timer) return;
+ }
+ else
+ hud_configure_active_panel = HUD_PANEL_TIMER;
- active_panel = HUD_PANEL_TIMER;
HUD_Panel_UpdateCvars(timer);
vector pos, mySize;
pos = panel_pos;
HUD_Panel_UpdateCvars(timer);
vector pos, mySize;
pos = panel_pos;
//
void HUD_Radar(void)
{
//
void HUD_Radar(void)
{
- if ((autocvar_hud_panel_radar == 0 || (autocvar_hud_panel_radar != 2 && !teamplay)) && !autocvar__hud_configure)
- return;
+ if (!autocvar__hud_configure)
+ {
+ if (autocvar_hud_panel_radar == 0) return;
+ if (autocvar_hud_panel_radar != 2 && !teamplay) return;
+ }
+ else
+ hud_configure_active_panel = HUD_PANEL_RADAR;
- active_panel = HUD_PANEL_RADAR;
HUD_Panel_UpdateCvars(radar);
vector pos, mySize;
pos = panel_pos;
HUD_Panel_UpdateCvars(radar);
vector pos, mySize;
pos = panel_pos;
void HUD_UpdatePlayerTeams();
void HUD_Score(void)
{
void HUD_UpdatePlayerTeams();
void HUD_Score(void)
{
- if(!autocvar__hud_configure && !autocvar_hud_panel_score)
- return;
+ if(!autocvar__hud_configure)
+ {
+ if(!autocvar_hud_panel_score) return;
+ }
+ else
+ hud_configure_active_panel = HUD_PANEL_SCORE;
- active_panel = HUD_PANEL_SCORE;
HUD_Panel_UpdateCvars(score);
vector pos, mySize;
pos = panel_pos;
HUD_Panel_UpdateCvars(score);
vector pos, mySize;
pos = panel_pos;
-void HUD_RaceTimer (void) {
+void HUD_RaceTimer (void)
+{
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_racetimer) return;
if(!(gametype == GAME_RACE || gametype == GAME_CTS)) return;
if(spectatee_status == -1) return;
}
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_racetimer) return;
if(!(gametype == GAME_RACE || gametype == GAME_CTS)) return;
if(spectatee_status == -1) return;
}
+ else
+ hud_configure_active_panel = HUD_PANEL_RACETIMER;
- active_panel = HUD_PANEL_RACETIMER;
HUD_Panel_UpdateCvars(racetimer);
vector pos, mySize;
pos = panel_pos;
HUD_Panel_UpdateCvars(racetimer);
vector pos, mySize;
pos = panel_pos;
- if(!autocvar_hud_panel_vote && !autocvar__hud_configure)
- return;
-
if(!autocvar__hud_configure)
{
if(!autocvar__hud_configure)
{
+ if(!autocvar_hud_panel_vote) return;
+
panel_fg_alpha = autocvar_hud_panel_fg_alpha;
panel_bg_alpha_str = autocvar_hud_panel_vote_bg_alpha;
panel_fg_alpha = autocvar_hud_panel_fg_alpha;
panel_bg_alpha_str = autocvar_hud_panel_vote_bg_alpha;
}
panel_bg_alpha = stof(panel_bg_alpha_str);
}
}
panel_bg_alpha = stof(panel_bg_alpha_str);
}
+ else
+ {
+ hud_configure_active_panel = HUD_PANEL_VOTE;
+
+ vote_yescount = 3;
+ vote_nocount = 2;
+ vote_needed = 4;
+ }
else
vote_alpha = bound(0, 1 - (time - vote_change) * 2, 1);
else
vote_alpha = bound(0, 1 - (time - vote_change) * 2, 1);
- if(autocvar__hud_configure)
- {
- vote_yescount = 3;
- vote_nocount = 2;
- vote_needed = 4;
- }
-
- active_panel = HUD_PANEL_VOTE;
HUD_Panel_UpdateCvars(vote);
if(uid2name_dialog)
HUD_Panel_UpdateCvars(vote);
if(uid2name_dialog)
void HUD_ModIcons(void)
{
void HUD_ModIcons(void)
{
- if(!autocvar_hud_panel_modicons && !autocvar__hud_configure)
- return;
-
- if (gametype != GAME_KEYHUNT && gametype != GAME_CTF && gametype != GAME_NEXBALL && gametype != GAME_CTS && gametype != GAME_RACE && gametype != GAME_CA && gametype != GAME_FREEZETAG && gametype != GAME_KEEPAWAY && !autocvar__hud_configure)
- return;
+ if(!autocvar__hud_configure)
+ {
+ if(!autocvar_hud_panel_modicons) return;
+ if (gametype != GAME_CTF && gametype != GAME_KEYHUNT && gametype != GAME_NEXBALL && gametype != GAME_CTS && gametype != GAME_RACE && gametype != GAME_CA && gametype != GAME_FREEZETAG && gametype != GAME_KEEPAWAY) return;
+ }
+ else
+ hud_configure_active_panel = HUD_PANEL_MODICONS;
- active_panel = HUD_PANEL_MODICONS;
HUD_Panel_UpdateCvars(modicons);
vector pos, mySize;
pos = panel_pos;
HUD_Panel_UpdateCvars(modicons);
vector pos, mySize;
pos = panel_pos;
//
void HUD_DrawPressedKeys(void)
{
//
void HUD_DrawPressedKeys(void)
{
- if(!autocvar_hud_panel_pressedkeys && !autocvar__hud_configure)
- return;
+ if(!autocvar__hud_configure)
+ {
+ if(!autocvar_hud_panel_pressedkeys) return;
+ if(spectatee_status <= 0 && autocvar_hud_panel_pressedkeys < 2) return;
+ }
+ else
+ hud_configure_active_panel = HUD_PANEL_PRESSEDKEYS;
- if(!(spectatee_status > 0 || autocvar_hud_panel_pressedkeys >= 2 || autocvar__hud_configure))
- return;
- active_panel = HUD_PANEL_PRESSEDKEYS;
HUD_Panel_UpdateCvars(pressedkeys);
vector pos, mySize;
pos = panel_pos;
HUD_Panel_UpdateCvars(pressedkeys);
vector pos, mySize;
pos = panel_pos;
- if(!autocvar_hud_panel_chat && !autocvar__hud_configure)
+ if(!autocvar__hud_configure)
- cvar_set("con_chatrect", "0");
- return;
+ if (!autocvar_hud_panel_chat)
+ {
+ if (!autocvar_con_chatrect)
+ cvar_set("con_chatrect", "0");
+ return;
+ }
+ else
+ hud_configure_active_panel = HUD_PANEL_CHAT;
- active_panel = HUD_PANEL_CHAT;
HUD_Panel_UpdateCvars(chat);
if(autocvar__con_chat_maximized && !autocvar__hud_configure) // draw at full screen height if maximized
HUD_Panel_UpdateCvars(chat);
if(autocvar__con_chat_maximized && !autocvar__hud_configure) // draw at full screen height if maximized
mySize -= '2 2 0' * panel_bg_padding;
}
mySize -= '2 2 0' * panel_bg_padding;
}
- cvar_set("con_chatrect", "1");
+ if (!autocvar_con_chatrect)
+ cvar_set("con_chatrect", "1");
cvar_set("con_chatrect_x", ftos(pos_x/vid_conwidth));
cvar_set("con_chatrect_y", ftos(pos_y/vid_conheight));
cvar_set("con_chatrect_x", ftos(pos_x/vid_conwidth));
cvar_set("con_chatrect_y", ftos(pos_y/vid_conheight));
if(autocvar__hud_configure)
{
if(autocvar__hud_configure)
{
- float chatsize;
- chatsize = autocvar_con_chatsize;
+ vector chatsize;
+ chatsize = '1 1 0' * autocvar_con_chatsize;
cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over alpha and such
float i, a;
for(i = 0; i < autocvar_con_chat; ++i)
cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over alpha and such
float i, a;
for(i = 0; i < autocvar_con_chat; ++i)
a = panel_fg_alpha;
else
a = panel_fg_alpha * floor(((i + 1) * 7 + autocvar_con_chattime)/45);
a = panel_fg_alpha;
else
a = panel_fg_alpha * floor(((i + 1) * 7 + autocvar_con_chattime)/45);
- drawcolorcodedstring(pos + eY * i * chatsize, textShortenToWidth("^3Player^7: This is the chat area.", mySize_x, '1 1 0' * chatsize, stringwidth_colors), '1 1 0' * chatsize, a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos, textShortenToWidth("^3Player^7: This is the chat area.", mySize_x, chatsize, stringwidth_colors), chatsize, a, DRAWFLAG_NORMAL);
+ pos_y += chatsize_y;
float frametimeavg2; // 2 frames ago
void HUD_EngineInfo(void)
{
float frametimeavg2; // 2 frames ago
void HUD_EngineInfo(void)
{
- if(!autocvar_hud_panel_engineinfo && !autocvar__hud_configure)
- return;
+ if(!autocvar__hud_configure)
+ {
+ if(!autocvar_hud_panel_engineinfo) return;
+ }
+ else
+ hud_configure_active_panel = HUD_PANEL_ENGINEINFO;
- active_panel = HUD_PANEL_ENGINEINFO;
HUD_Panel_UpdateCvars(engineinfo);
vector pos, mySize;
pos = panel_pos;
HUD_Panel_UpdateCvars(engineinfo);
vector pos, mySize;
pos = panel_pos;
o_y += fontsize_y;
void HUD_InfoMessages(void)
{
o_y += fontsize_y;
void HUD_InfoMessages(void)
{
- if(!autocvar_hud_panel_infomessages && !autocvar__hud_configure)
- return;
+ if(!autocvar__hud_configure)
+ {
+ if(!autocvar_hud_panel_infomessages) return;
+ }
+ else
+ hud_configure_active_panel = HUD_PANEL_INFOMESSAGES;
- active_panel = HUD_PANEL_INFOMESSAGES;
HUD_Panel_UpdateCvars(infomessages);
vector pos, mySize;
pos = panel_pos;
HUD_Panel_UpdateCvars(infomessages);
vector pos, mySize;
pos = panel_pos;
- if(!autocvar_hud_panel_physics && !autocvar__hud_configure)
- return;
+ if(!autocvar_hud_panel_physics)
+ {
+ if(!autocvar__hud_configure) return;
+ }
+ else
+ hud_configure_active_panel = HUD_PANEL_PHYSICS;
- active_panel = HUD_PANEL_PHYSICS;
HUD_Panel_UpdateCvars(physics);
HUD_Panel_DrawBg(1);
HUD_Panel_UpdateCvars(physics);
HUD_Panel_DrawBg(1);
}
// HUD configure visible grid
}
// HUD configure visible grid
- float hud_configure_grid_alpha;
- if(autocvar__hud_configure && cvar("hud_configure_grid") && (hud_configure_grid_alpha = cvar("hud_configure_grid_alpha")))
+ if(autocvar__hud_configure && autocvar_hud_configure_grid && autocvar_hud_configure_grid_alpha)
{
hud_configure_gridSize_x = bound(0.005, cvar("hud_configure_grid_xsize"), 0.2);
hud_configure_gridSize_y = bound(0.005, cvar("hud_configure_grid_ysize"), 0.2);
{
hud_configure_gridSize_x = bound(0.005, cvar("hud_configure_grid_xsize"), 0.2);
hud_configure_gridSize_y = bound(0.005, cvar("hud_configure_grid_ysize"), 0.2);
hud_configure_realGridSize_y = hud_configure_gridSize_y * vid_conheight;
// x-axis
for(i = 0; i < 1/hud_configure_gridSize_x; ++i)
hud_configure_realGridSize_y = hud_configure_gridSize_y * vid_conheight;
// x-axis
for(i = 0; i < 1/hud_configure_gridSize_x; ++i)
- drawfill(eX * i * hud_configure_realGridSize_x, eX + eY * vid_conheight, '0.5 0.5 0.5', hud_configure_grid_alpha, DRAWFLAG_NORMAL);
+ drawfill(eX * i * hud_configure_realGridSize_x, eX + eY * vid_conheight, '0.5 0.5 0.5', autocvar_hud_configure_grid_alpha, DRAWFLAG_NORMAL);
// y-axis
for(i = 0; i < 1/hud_configure_gridSize_y; ++i)
// y-axis
for(i = 0; i < 1/hud_configure_gridSize_y; ++i)
- drawfill(eY * i * hud_configure_realGridSize_y, eY + eX * vid_conwidth, '0.5 0.5 0.5', hud_configure_grid_alpha, DRAWFLAG_NORMAL);
+ drawfill(eY * i * hud_configure_realGridSize_y, eY + eX * vid_conwidth, '0.5 0.5 0.5', autocvar_hud_configure_grid_alpha, DRAWFLAG_NORMAL);
panel_order[i] = stof(argv(i));
}
}
panel_order[i] = stof(argv(i));
}
}
// draw panels in order specified by panel_order array
for(i = HUD_PANEL_NUM - 1; i >= 0; --i) {
if(i != HUD_PANEL_CHAT || !autocvar__con_chat_maximized) // don't draw maximized chat panel twice!
// draw panels in order specified by panel_order array
for(i = HUD_PANEL_NUM - 1; i >= 0; --i) {
if(i != HUD_PANEL_CHAT || !autocvar__con_chat_maximized) // don't draw maximized chat panel twice!
var float highlightedPanel_copied = -1; //this is good only to know if there is something copied
var vector panel_size_copied;
var float highlightedPanel_copied = -1; //this is good only to know if there is something copied
var vector panel_size_copied;
-var float active_panel; // this panel has recently referred the UpdateCvars macro
+var float hud_configure_active_panel; // this panel has recently referred the UpdateCvars macro
var string panel_name;
var float panel_enabled;
var vector panel_pos;
var string panel_name;
var float panel_enabled;
var vector panel_pos;
if(autocvar__hud_configure) {\
if(!panel_enabled)\
panel_bg_alpha = 0.25;\
if(autocvar__hud_configure) {\
if(!panel_enabled)\
panel_bg_alpha = 0.25;\
- else if(menu_enabled == 2 && highlightedPanel == active_panel)\
+ else if(menu_enabled == 2 && highlightedPanel == hud_configure_active_panel)\
panel_bg_alpha = (1 - autocvar__menu_alpha) * max(cvar("hud_configure_bg_minalpha"), panel_bg_alpha) + autocvar__menu_alpha * panel_bg_alpha;\
else\
panel_bg_alpha = max(cvar("hud_configure_bg_minalpha"), panel_bg_alpha);\
panel_bg_alpha = (1 - autocvar__menu_alpha) * max(cvar("hud_configure_bg_minalpha"), panel_bg_alpha) + autocvar__menu_alpha * panel_bg_alpha;\
else\
panel_bg_alpha = max(cvar("hud_configure_bg_minalpha"), panel_bg_alpha);\
-} if(!(menu_enabled == 2 && highlightedPanel == active_panel)) {\
+} if(!(menu_enabled == 2 && highlightedPanel == hud_configure_active_panel)) {\
panel_bg_alpha *= hud_fade_alpha;\
}
panel_bg_alpha *= hud_fade_alpha;\
}
panel_fg_alpha = autocvar_hud_panel_fg_alpha;\
if(autocvar__hud_configure && !panel_enabled)\
panel_fg_alpha = 0.25;\
panel_fg_alpha = autocvar_hud_panel_fg_alpha;\
if(autocvar__hud_configure && !panel_enabled)\
panel_fg_alpha = 0.25;\
-if(!(menu_enabled == 2 && highlightedPanel == active_panel))\
+if(!(menu_enabled == 2 && highlightedPanel == hud_configure_active_panel))\
panel_fg_alpha *= hud_fade_alpha;
// Get border. See comments above, it's similar.
panel_fg_alpha *= hud_fade_alpha;
// Get border. See comments above, it's similar.
panel_pos = (1 - autocvar__menu_alpha) * panel_pos + (autocvar__menu_alpha) * menu_enable_panelpos;
// return smoothly faded size of given panel when a dialog is active
panel_pos = (1 - autocvar__menu_alpha) * panel_pos + (autocvar__menu_alpha) * menu_enable_panelpos;
// return smoothly faded size of given panel when a dialog is active
-var vector menu_enable_maxsize; FTEQCC_YOU_SUCK_THIS_IS_NOT_UNREFERENCED(menu_enable_maxsize);
+//var vector menu_enable_maxsize; FTEQCC_YOU_SUCK_THIS_IS_NOT_UNREFERENCED(menu_enable_maxsize);
+var float menu_enable_maxsize_x;
+var float menu_enable_maxsize_y;
var vector menu_enable_size;
#define HUD_Panel_GetMenuSize()\
menu_enable_maxsize_x = 0.3 * vid_conwidth;\
var vector menu_enable_size;
#define HUD_Panel_GetMenuSize()\
menu_enable_maxsize_x = 0.3 * vid_conwidth;\
panel_bg_border_str = cvar_string("hud_panel_" #name "_bg_border"); \
panel_bg_padding_str = cvar_string("hud_panel_" #name "_bg_padding"); \
HUD_Panel_GetStringVars()\
panel_bg_border_str = cvar_string("hud_panel_" #name "_bg_border"); \
panel_bg_padding_str = cvar_string("hud_panel_" #name "_bg_padding"); \
HUD_Panel_GetStringVars()\
-if(menu_enabled == 2 && active_panel == highlightedPanel) {\
+if(menu_enabled == 2 && hud_configure_active_panel == highlightedPanel) {\
HUD_Panel_GetMenuSize()\
HUD_Panel_GetMenuPos()\
} ENDS_WITH_CURLY_BRACE
HUD_Panel_GetMenuSize()\
HUD_Panel_GetMenuPos()\
} ENDS_WITH_CURLY_BRACE
panel_pos = stov(cvar_string("hud_panel_" #name "_pos")); \
panel_size = stov(cvar_string("hud_panel_" #name "_size")); \
HUD_Panel_GetScaledVectors()\
panel_pos = stov(cvar_string("hud_panel_" #name "_pos")); \
panel_size = stov(cvar_string("hud_panel_" #name "_size")); \
HUD_Panel_GetScaledVectors()\
-if(menu_enabled == 2 && active_panel == highlightedPanel) {\
+if(menu_enabled == 2 && hud_configure_active_panel == highlightedPanel) {\
HUD_Panel_GetMenuSize()\
HUD_Panel_GetMenuPos()\
}\
HUD_Panel_GetMenuSize()\
HUD_Panel_GetMenuPos()\
}\