From: terencehill Date: Sun, 25 Jun 2017 20:28:34 +0000 (+0200) Subject: Remove a kind of redundant parameter from REGISTER_HUD_PANEL X-Git-Tag: xonotic-v0.8.5~2693 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f6538b57569afb7e8bc8ca4e27157885f9354de5;p=xonotic%2Fxonotic-data.pk3dir.git Remove a kind of redundant parameter from REGISTER_HUD_PANEL --- diff --git a/qcsrc/client/hud/hud.qh b/qcsrc/client/hud/hud.qh index ca668f628..8eaef9068 100644 --- a/qcsrc/client/hud/hud.qh +++ b/qcsrc/client/hud/hud.qh @@ -11,12 +11,12 @@ REGISTRY(hud_panels, BITS(6)) #define hud_panels_from(i) _hud_panels_from(i, NULL) REGISTER_REGISTRY(hud_panels) -#define REGISTER_HUD_PANEL(id, draw_func, name, configflags, showflags) \ +#define REGISTER_HUD_PANEL(id, draw_func, configflags, showflags) \ void draw_func(); \ REGISTER(hud_panels, HUD_PANEL, id, m_id, new_pure(hud_panel)) { \ this.panel_id = this.m_id; \ this.panel_draw = draw_func; \ - this.panel_name = #name; \ + this.panel_name = strzone(strtolower(#id)); \ this.panel_configflags = configflags; \ this.panel_showflags = showflags; \ } @@ -206,31 +206,31 @@ int prev_p_health, prev_p_armor; void HUD_ItemsTime(); -REGISTER_HUD_PANEL(WEAPONS, HUD_Weapons, weapons, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // WEAPONS -REGISTER_HUD_PANEL(AMMO, HUD_Ammo, ammo, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // AMMO -REGISTER_HUD_PANEL(POWERUPS, HUD_Powerups, powerups, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // POWERUPS -REGISTER_HUD_PANEL(HEALTHARMOR, HUD_HealthArmor, healtharmor, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // HEALTHARMOR -REGISTER_HUD_PANEL(NOTIFY, HUD_Notify, notify, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME ) // NOTIFY -REGISTER_HUD_PANEL(TIMER, HUD_Timer, timer, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // TIMER -REGISTER_HUD_PANEL(RADAR, HUD_Radar, radar, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // RADAR -REGISTER_HUD_PANEL(SCORE, HUD_Score, score, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME ) // SCORE -REGISTER_HUD_PANEL(RACETIMER, HUD_RaceTimer, racetimer, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // RACETIMER -REGISTER_HUD_PANEL(VOTE, HUD_Vote, vote, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // VOTE -REGISTER_HUD_PANEL(MODICONS, HUD_ModIcons, modicons, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_WITH_SB) // MODICONS -REGISTER_HUD_PANEL(PRESSEDKEYS, HUD_PressedKeys, pressedkeys, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // PRESSEDKEYS -REGISTER_HUD_PANEL(CHAT, HUD_Chat, chat, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // CHAT -REGISTER_HUD_PANEL(ENGINEINFO, HUD_EngineInfo, engineinfo, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // ENGINEINFO -REGISTER_HUD_PANEL(INFOMESSAGES, HUD_InfoMessages, infomessages, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // INFOMESSAGES -REGISTER_HUD_PANEL(PHYSICS, HUD_Physics, physics, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // PHYSICS -REGISTER_HUD_PANEL(CENTERPRINT, HUD_CenterPrint, centerprint, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_WITH_SB) // CENTERPRINT -REGISTER_HUD_PANEL(MINIGAME_BOARD, HUD_MinigameBoard, minigameboard, PANEL_CONFIG_NO , PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // MINIGAME_BOARD -REGISTER_HUD_PANEL(MINIGAME_STATUS, HUD_MinigameStatus, minigamestatus, PANEL_CONFIG_NO , PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // MINIGAME_STATUS -REGISTER_HUD_PANEL(MINIGAME_HELP, HUD_MinigameHelp, minigamehelp, PANEL_CONFIG_NO , PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // MINIGAME_HELP -REGISTER_HUD_PANEL(MINIGAME_MENU, HUD_MinigameMenu, minigamemenu, PANEL_CONFIG_NO , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // MINIGAME_MENU -REGISTER_HUD_PANEL(MAPVOTE, MapVote_Draw, mapvote, PANEL_CONFIG_NO , PANEL_SHOW_MAPVOTE ) // MAPVOTE -REGISTER_HUD_PANEL(ITEMSTIME, HUD_ItemsTime, itemstime, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // ITEMSTIME -REGISTER_HUD_PANEL(QUICKMENU, HUD_QuickMenu, quickmenu, PANEL_CONFIG_MAIN , PANEL_SHOW_MAINGAME ) // QUICKMENU -REGISTER_HUD_PANEL(SCOREBOARD, Scoreboard_Draw, scoreboard, PANEL_CONFIG_NO , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // SCOREBOARD +REGISTER_HUD_PANEL(WEAPONS, HUD_Weapons, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // WEAPONS +REGISTER_HUD_PANEL(AMMO, HUD_Ammo, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // AMMO +REGISTER_HUD_PANEL(POWERUPS, HUD_Powerups, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // POWERUPS +REGISTER_HUD_PANEL(HEALTHARMOR, HUD_HealthArmor, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // HEALTHARMOR +REGISTER_HUD_PANEL(NOTIFY, HUD_Notify, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME ) // NOTIFY +REGISTER_HUD_PANEL(TIMER, HUD_Timer, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // TIMER +REGISTER_HUD_PANEL(RADAR, HUD_Radar, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // RADAR +REGISTER_HUD_PANEL(SCORE, HUD_Score, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME ) // SCORE +REGISTER_HUD_PANEL(RACETIMER, HUD_RaceTimer, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // RACETIMER +REGISTER_HUD_PANEL(VOTE, HUD_Vote, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // VOTE +REGISTER_HUD_PANEL(MODICONS, HUD_ModIcons, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_WITH_SB) // MODICONS +REGISTER_HUD_PANEL(PRESSEDKEYS, HUD_PressedKeys, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // PRESSEDKEYS +REGISTER_HUD_PANEL(CHAT, HUD_Chat, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // CHAT +REGISTER_HUD_PANEL(ENGINEINFO, HUD_EngineInfo, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // ENGINEINFO +REGISTER_HUD_PANEL(INFOMESSAGES, HUD_InfoMessages, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // INFOMESSAGES +REGISTER_HUD_PANEL(PHYSICS, HUD_Physics, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // PHYSICS +REGISTER_HUD_PANEL(CENTERPRINT, HUD_CenterPrint, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_WITH_SB) // CENTERPRINT +REGISTER_HUD_PANEL(MINIGAMEBOARD, HUD_MinigameBoard, PANEL_CONFIG_NO , PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // MINIGAMEBOARD +REGISTER_HUD_PANEL(MINIGAMESTATUS, HUD_MinigameStatus, PANEL_CONFIG_NO , PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // MINIGAMESTATUS +REGISTER_HUD_PANEL(MINIGAMEHELP, HUD_MinigameHelp, PANEL_CONFIG_NO , PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // MINIGAMEHELP +REGISTER_HUD_PANEL(MINIGAMEMENU, HUD_MinigameMenu, PANEL_CONFIG_NO , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // MINIGAMEMENU +REGISTER_HUD_PANEL(MAPVOTE, MapVote_Draw, PANEL_CONFIG_NO , PANEL_SHOW_MAPVOTE ) // MAPVOTE +REGISTER_HUD_PANEL(ITEMSTIME, HUD_ItemsTime, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // ITEMSTIME +REGISTER_HUD_PANEL(QUICKMENU, HUD_QuickMenu, PANEL_CONFIG_MAIN , PANEL_SHOW_MAINGAME ) // QUICKMENU +REGISTER_HUD_PANEL(SCOREBOARD, Scoreboard_Draw, PANEL_CONFIG_NO , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // SCOREBOARD // always add new panels to the end of list // Because calling lots of functions in QC apparently cuts fps in half on many machines: diff --git a/qcsrc/common/minigames/cl_minigames_hud.qc b/qcsrc/common/minigames/cl_minigames_hud.qc index 1a6d4ff52..5b0ee3c5b 100644 --- a/qcsrc/common/minigames/cl_minigames_hud.qc +++ b/qcsrc/common/minigames/cl_minigames_hud.qc @@ -427,7 +427,7 @@ void HUD_MinigameMenu_Open() // Handles mouse input on to minigame menu panel void HUD_MinigameMenu_MouseInput() { - panel = HUD_PANEL(MINIGAME_MENU); + panel = HUD_PANEL(MINIGAMEMENU); HUD_Panel_LoadCvars(); @@ -575,7 +575,7 @@ float HUD_Minigame_InputEvent(float bInputType, float nPrimary, float nSecondary { mousepos_x = nPrimary; mousepos_y = nSecondary; - if ( active_minigame && HUD_mouse_over(HUD_PANEL(MINIGAME_BOARD)) ) + if ( active_minigame && HUD_mouse_over(HUD_PANEL(MINIGAMEBOARD)) ) active_minigame.minigame_event(active_minigame,"mouse_moved",mousepos); return true; @@ -613,7 +613,7 @@ float HUD_Minigame_InputEvent(float bInputType, float nPrimary, float nSecondary string action = bInputType == 0 ? "pressed" : "released"; if ( nPrimary >= K_MOUSE1 && nPrimary <= K_MOUSE16 ) { - if ( HUD_mouse_over(HUD_PANEL(MINIGAME_BOARD)) ) + if ( HUD_mouse_over(HUD_PANEL(MINIGAMEBOARD)) ) device = "mouse"; } else @@ -629,7 +629,7 @@ float HUD_Minigame_InputEvent(float bInputType, float nPrimary, float nSecondary if ( bInputType == 0 ) { if ( nPrimary == K_MOUSE1 && HUD_MinigameMenu_activeitem && - HUD_mouse_over(HUD_PANEL(MINIGAME_MENU)) ) + HUD_mouse_over(HUD_PANEL(MINIGAMEMENU)) ) { HUD_MinigameMenu_Click(HUD_MinigameMenu_activeitem); return true; @@ -685,7 +685,7 @@ void HUD_Minigame_Mouse() if (!autocvar_hud_cursormode) update_mousepos(); - if ( HUD_MinigameMenu_IsOpened() && HUD_mouse_over(HUD_PANEL(MINIGAME_MENU)) ) + if ( HUD_MinigameMenu_IsOpened() && HUD_mouse_over(HUD_PANEL(MINIGAMEMENU)) ) HUD_MinigameMenu_MouseInput(); draw_cursor_normal(mousepos, '1 1 1', panel_fg_alpha);