X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fhud_config.qc;h=9b768e0258ddcfe566b60b456cca7c119f84b1bd;hb=717defe5e02506bb5c857025d71fb605d6eb8c55;hp=61f0d4dcb59f94bf49ce37f3c63c0debd372a7e5;hpb=eb5aac3757e45db2f8b8a685691b51228c03f7a2;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud/hud_config.qc b/qcsrc/client/hud/hud_config.qc index 61f0d4dcb..9b768e025 100644 --- a/qcsrc/client/hud/hud_config.qc +++ b/qcsrc/client/hud/hud_config.qc @@ -62,7 +62,7 @@ void HUD_Panel_ExportCfg(string cfgname) // common cvars for all panels for (int i = 0; i < REGISTRY_COUNT(hud_panels); ++i) { - panel = hud_panels_from(i); + panel = REGISTRY_GET(hud_panels, i); HUD_Write_PanelCvar("_pos"); HUD_Write_PanelCvar("_size"); @@ -103,7 +103,7 @@ vector HUD_Panel_CheckMove(vector myPos, vector mySize) vector myTarget = myPos; int i; for (i = 0; i < REGISTRY_COUNT(hud_panels); ++i) { - panel = hud_panels_from(i); + panel = REGISTRY_GET(hud_panels, i); if(!(panel.panel_configflags & PANEL_CONFIG_MAIN)) continue; if(panel == highlightedPanel) continue; HUD_Panel_UpdatePosSize(); @@ -200,7 +200,7 @@ vector HUD_Panel_CheckResize(vector mySize, vector resizeorigin) { float ratio = mySize.x/mySize.y; int i; for (i = 0; i < REGISTRY_COUNT(hud_panels); ++i) { - panel = hud_panels_from(i); + panel = REGISTRY_GET(hud_panels, i); if(!(panel.panel_configflags & PANEL_CONFIG_MAIN)) continue; if(panel == highlightedPanel) continue; HUD_Panel_UpdatePosSize(); @@ -647,7 +647,7 @@ LABEL(find_tab_panel) { for(i = 0; i < REGISTRY_COUNT(hud_panels); ++i) { - panel = hud_panels_from(i); + panel = REGISTRY_GET(hud_panels, i); if(!(panel.panel_configflags & PANEL_CONFIG_MAIN)) continue; if (panel == tab_panels[i] || panel == starting_panel) @@ -799,7 +799,7 @@ int HUD_Panel_Check_Mouse_Pos(bool allow_move) i = panel_order[j]; j += 1; - panel = hud_panels_from(i); + panel = REGISTRY_GET(hud_panels, i); if(!(panel.panel_configflags & PANEL_CONFIG_MAIN)) continue; HUD_Panel_UpdatePosSize(); @@ -879,7 +879,7 @@ void HUD_Panel_Highlight(float allow_move) i = panel_order[j]; j += 1; - panel = hud_panels_from(i); + panel = REGISTRY_GET(hud_panels, i); if(!(panel.panel_configflags & PANEL_CONFIG_MAIN)) continue; HUD_Panel_UpdatePosSize(); @@ -889,7 +889,7 @@ void HUD_Panel_Highlight(float allow_move) // 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_from(i); + highlightedPanel = REGISTRY_GET(hud_panels, i); HUD_Panel_FirstInDrawQ(i); highlightedAction = 1; panel_click_distance = mousepos - panel_pos; @@ -898,7 +898,7 @@ void HUD_Panel_Highlight(float allow_move) // 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_from(i); + highlightedPanel = REGISTRY_GET(hud_panels, i); HUD_Panel_FirstInDrawQ(i); highlightedAction = 2; resizeCorner = 1; @@ -909,7 +909,7 @@ void HUD_Panel_Highlight(float allow_move) // 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_from(i); + highlightedPanel = REGISTRY_GET(hud_panels, i); HUD_Panel_FirstInDrawQ(i); highlightedAction = 2; resizeCorner = 2; @@ -921,7 +921,7 @@ void HUD_Panel_Highlight(float allow_move) // 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_from(i); + highlightedPanel = REGISTRY_GET(hud_panels, i); HUD_Panel_FirstInDrawQ(i); highlightedAction = 2; resizeCorner = 3; @@ -933,7 +933,7 @@ void HUD_Panel_Highlight(float allow_move) // 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_from(i); + highlightedPanel = REGISTRY_GET(hud_panels, i); HUD_Panel_FirstInDrawQ(i); highlightedAction = 2; resizeCorner = 4; @@ -1083,7 +1083,7 @@ void HUD_Configure_Frame() { hudShiftState = 0; for(i = REGISTRY_COUNT(hud_panels) - 1; i >= 0; --i) - hud_panels_from(panel_order[i]).update_time = time; + REGISTRY_GET(hud_panels, panel_order[i]).update_time = time; } // NOTE this check is necessary because _menu_alpha isn't updated the frame the menu gets enabled