// common cvars for all panels
for (int i = 0; i < hud_panels_COUNT; ++i)
{
- panel = hud_panels[i];
+ panel = hud_panels_from(i);
HUD_Write_PanelCvar_n("");
HUD_Write_PanelCvar_q("_pos");
vector myTarget = myPos;
int i;
for (i = 0; i < hud_panels_COUNT; ++i) {
- panel = hud_panels[i];
+ panel = hud_panels_from(i);
if(!(panel.panel_configflags & PANEL_CONFIG_MAIN)) continue;
if(panel == highlightedPanel) continue;
HUD_Panel_UpdatePosSize();
float ratio = mySize.x/mySize.y;
int i;
for (i = 0; i < hud_panels_COUNT; ++i) {
- panel = hud_panels[i];
+ panel = hud_panels_from(i);
if(!(panel.panel_configflags & PANEL_CONFIG_MAIN)) continue;
if(panel == highlightedPanel) continue;
HUD_Panel_UpdatePosSize();
{
for(i = 0; i < hud_panels_COUNT; ++i)
{
- panel = hud_panels[i];
+ panel = hud_panels_from(i);
if(!(panel.panel_configflags & PANEL_CONFIG_MAIN))
continue;
if (panel == tab_panels[i] || panel == starting_panel)
i = panel_order[j];
j += 1;
- panel = hud_panels[i];
+ panel = hud_panels_from(i);
if(!(panel.panel_configflags & PANEL_CONFIG_MAIN)) continue;
HUD_Panel_UpdatePosSize();
i = panel_order[j];
j += 1;
- panel = hud_panels[i];
+ panel = hud_panels_from(i);
if(!(panel.panel_configflags & PANEL_CONFIG_MAIN))
continue;
HUD_Panel_UpdatePosSize();
// move
if(allow_move && mousepos.x > panel_pos.x && mousepos.y > panel_pos.y && mousepos.x < panel_pos.x + panel_size.x && mousepos.y < panel_pos.y + panel_size.y)
{
- highlightedPanel = hud_panels[i];
+ highlightedPanel = hud_panels_from(i);
HUD_Panel_FirstInDrawQ(i);
highlightedAction = 1;
panel_click_distance = mousepos - panel_pos;
// resize from topleft border
else if(mousepos.x >= panel_pos.x - border && mousepos.y >= panel_pos.y - border && mousepos.x <= panel_pos.x + 0.5 * panel_size.x && mousepos.y <= panel_pos.y + 0.5 * panel_size.y)
{
- highlightedPanel = hud_panels[i];
+ highlightedPanel = hud_panels_from(i);
HUD_Panel_FirstInDrawQ(i);
highlightedAction = 2;
resizeCorner = 1;
// resize from topright border
else if(mousepos.x >= panel_pos.x + 0.5 * panel_size.x && mousepos.y >= panel_pos.y - border && mousepos.x <= panel_pos.x + panel_size.x + border && mousepos.y <= panel_pos.y + 0.5 * panel_size.y)
{
- highlightedPanel = hud_panels[i];
+ highlightedPanel = hud_panels_from(i);
HUD_Panel_FirstInDrawQ(i);
highlightedAction = 2;
resizeCorner = 2;
// resize from bottomleft border
else if(mousepos.x >= panel_pos.x - border && mousepos.y >= panel_pos.y + 0.5 * panel_size.y && mousepos.x <= panel_pos.x + 0.5 * panel_size.x && mousepos.y <= panel_pos.y + panel_size.y + border)
{
- highlightedPanel = hud_panels[i];
+ highlightedPanel = hud_panels_from(i);
HUD_Panel_FirstInDrawQ(i);
highlightedAction = 2;
resizeCorner = 3;
// resize from bottomright border
else if(mousepos.x >= panel_pos.x + 0.5 * panel_size.x && mousepos.y >= panel_pos.y + 0.5 * panel_size.y && mousepos.x <= panel_pos.x + panel_size.x + border && mousepos.y <= panel_pos.y + panel_size.y + border)
{
- highlightedPanel = hud_panels[i];
+ highlightedPanel = hud_panels_from(i);
HUD_Panel_FirstInDrawQ(i);
highlightedAction = 2;
resizeCorner = 4;
setcursormode(1);
hudShiftState = 0;
for(i = hud_panels_COUNT - 1; i >= 0; --i)
- hud_panels[panel_order[i]].update_time = time;
+ hud_panels_from(panel_order[i]).update_time = time;
}
// NOTE this check is necessary because _menu_alpha isn't updated the frame the menu gets enabled