From: terencehill Date: Fri, 22 May 2020 13:50:06 +0000 (+0200) Subject: Remove the HUD_WriteCvars hook as it's no longer needed now. Mods using it must simpl... X-Git-Tag: xonotic-v0.8.5~1041^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=46d043b2a15b8f4e958a9c14001fba0a15ee4add;p=xonotic%2Fxonotic-data.pk3dir.git Remove the HUD_WriteCvars hook as it's no longer needed now. Mods using it must simply change _HUD_WriteCvars(float fh) into _Export(int fh) --- diff --git a/qcsrc/client/hud/hud.qh b/qcsrc/client/hud/hud.qh index 58f46b8af..2c12a6150 100644 --- a/qcsrc/client/hud/hud.qh +++ b/qcsrc/client/hud/hud.qh @@ -16,7 +16,7 @@ REGISTER_REGISTRY(hud_panels) #define _REGISTER_HUD_PANEL(id, draw_func, export_func, configflags, showflags) \ void draw_func(); \ - void export_func(entity panel, int fh); \ + void export_func(int fh); \ REGISTER(hud_panels, HUD_PANEL, id, m_id, new_pure(hud_panel)) { \ this.panel_id = this.m_id; \ this.panel_draw = draw_func; \ @@ -154,7 +154,7 @@ float panel_bg_padding; string panel_bg_padding_str; classfield(HUDPanel) .void() panel_draw; -classfield(HUDPanel) .void(entity panel, int fh) panel_export; +classfield(HUDPanel) .void(int fh) panel_export; // chat panel can be reduced / moved while the mapvote is active // let know the mapvote panel about chat pos and size diff --git a/qcsrc/client/hud/hud_config.qc b/qcsrc/client/hud/hud_config.qc index 6858a84b2..c4ae095ac 100644 --- a/qcsrc/client/hud/hud_config.qc +++ b/qcsrc/client/hud/hud_config.qc @@ -72,10 +72,9 @@ void HUD_Panel_ExportCfg(string cfgname) HUD_Write_PanelCvar("_bg_alpha"); HUD_Write_PanelCvar("_bg_border"); HUD_Write_PanelCvar("_bg_padding"); - panel.panel_export(panel, fh); + panel.panel_export(fh); HUD_Write("\n"); } - MUTATOR_CALLHOOK(HUD_WriteCvars, fh); HUD_Write("menu_sync\n"); // force the menu to reread the cvars, so that the dialogs are updated diff --git a/qcsrc/client/hud/panel/ammo.qc b/qcsrc/client/hud/panel/ammo.qc index fbe1aa5ce..5abbbf036 100644 --- a/qcsrc/client/hud/panel/ammo.qc +++ b/qcsrc/client/hud/panel/ammo.qc @@ -10,7 +10,7 @@ // Ammo (#1) -void HUD_Ammo_Export(entity panel, int fh) +void HUD_Ammo_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files HUD_Write_Cvar("hud_panel_ammo_onlycurrent"); diff --git a/qcsrc/client/hud/panel/centerprint.qc b/qcsrc/client/hud/panel/centerprint.qc index 1b2f3fe04..2f5aab5ed 100644 --- a/qcsrc/client/hud/panel/centerprint.qc +++ b/qcsrc/client/hud/panel/centerprint.qc @@ -7,7 +7,7 @@ // CenterPrint (#16) -void HUD_CenterPrint_Export(entity panel, int fh) +void HUD_CenterPrint_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files HUD_Write_Cvar("hud_panel_centerprint_align"); diff --git a/qcsrc/client/hud/panel/chat.qc b/qcsrc/client/hud/panel/chat.qc index 7b405d5bb..78cc6a0ef 100644 --- a/qcsrc/client/hud/panel/chat.qc +++ b/qcsrc/client/hud/panel/chat.qc @@ -6,7 +6,7 @@ // Chat (#12) -void HUD_Chat_Export(entity panel, int fh) +void HUD_Chat_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files } diff --git a/qcsrc/client/hud/panel/engineinfo.qc b/qcsrc/client/hud/panel/engineinfo.qc index db376a2ce..908aa1def 100644 --- a/qcsrc/client/hud/panel/engineinfo.qc +++ b/qcsrc/client/hud/panel/engineinfo.qc @@ -5,7 +5,7 @@ // Engine info (#13) -void HUD_EngineInfo_Export(entity panel, int fh) +void HUD_EngineInfo_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files HUD_Write_Cvar("hud_panel_engineinfo_framecounter_time"); diff --git a/qcsrc/client/hud/panel/healtharmor.qc b/qcsrc/client/hud/panel/healtharmor.qc index d63b3d97b..b1a931193 100644 --- a/qcsrc/client/hud/panel/healtharmor.qc +++ b/qcsrc/client/hud/panel/healtharmor.qc @@ -7,7 +7,7 @@ // Health/armor (#3) -void HUD_HealthArmor_Export(entity panel, int fh) +void HUD_HealthArmor_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files HUD_Write_Cvar("hud_panel_healtharmor_combined"); diff --git a/qcsrc/client/hud/panel/infomessages.qc b/qcsrc/client/hud/panel/infomessages.qc index 803491f84..363465dfb 100644 --- a/qcsrc/client/hud/panel/infomessages.qc +++ b/qcsrc/client/hud/panel/infomessages.qc @@ -8,7 +8,7 @@ // Info messages (#14) -void HUD_InfoMessages_Export(entity panel, int fh) +void HUD_InfoMessages_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files HUD_Write_Cvar("hud_panel_infomessages_flip"); diff --git a/qcsrc/client/hud/panel/modicons.qc b/qcsrc/client/hud/panel/modicons.qc index b206609b3..0a8b8cf5e 100644 --- a/qcsrc/client/hud/panel/modicons.qc +++ b/qcsrc/client/hud/panel/modicons.qc @@ -9,7 +9,7 @@ // Mod icons (#10) -void HUD_ModIcons_Export(entity panel, int fh) +void HUD_ModIcons_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files HUD_Write_Cvar("hud_panel_modicons_ca_layout"); diff --git a/qcsrc/client/hud/panel/notify.qc b/qcsrc/client/hud/panel/notify.qc index b562fdb61..bfb23bf2c 100644 --- a/qcsrc/client/hud/panel/notify.qc +++ b/qcsrc/client/hud/panel/notify.qc @@ -5,7 +5,7 @@ // Notifications (#4) -void HUD_Notify_Export(entity panel, int fh) +void HUD_Notify_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files HUD_Write_Cvar("hud_panel_notify_flip"); diff --git a/qcsrc/client/hud/panel/physics.qc b/qcsrc/client/hud/panel/physics.qc index e2be0de00..a451f924b 100644 --- a/qcsrc/client/hud/panel/physics.qc +++ b/qcsrc/client/hud/panel/physics.qc @@ -9,7 +9,7 @@ // Physics (#15) -void HUD_Physics_Export(entity panel, int fh) +void HUD_Physics_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files HUD_Write_Cvar("hud_panel_physics_speed_unit_show"); diff --git a/qcsrc/client/hud/panel/powerups.qc b/qcsrc/client/hud/panel/powerups.qc index d68a60f31..1662415ed 100644 --- a/qcsrc/client/hud/panel/powerups.qc +++ b/qcsrc/client/hud/panel/powerups.qc @@ -7,7 +7,7 @@ // Powerups (#2) -void HUD_Powerups_Export(entity panel, int fh) +void HUD_Powerups_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files HUD_Write_Cvar("hud_panel_powerups_iconalign"); diff --git a/qcsrc/client/hud/panel/pressedkeys.qc b/qcsrc/client/hud/panel/pressedkeys.qc index ed9ab7ded..73bd583bc 100644 --- a/qcsrc/client/hud/panel/pressedkeys.qc +++ b/qcsrc/client/hud/panel/pressedkeys.qc @@ -6,7 +6,7 @@ // Pressed keys (#11) -void HUD_PressedKeys_Export(entity panel, int fh) +void HUD_PressedKeys_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files HUD_Write_Cvar("hud_panel_pressedkeys_aspect"); diff --git a/qcsrc/client/hud/panel/quickmenu.qc b/qcsrc/client/hud/panel/quickmenu.qc index de7489ca8..66ee555b4 100644 --- a/qcsrc/client/hud/panel/quickmenu.qc +++ b/qcsrc/client/hud/panel/quickmenu.qc @@ -10,7 +10,7 @@ // QuickMenu (#23) -void HUD_QuickMenu_Export(entity panel, int fh) +void HUD_QuickMenu_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files HUD_Write_Cvar("hud_panel_quickmenu_align"); diff --git a/qcsrc/client/hud/panel/racetimer.qc b/qcsrc/client/hud/panel/racetimer.qc index 326d77653..cd0b26e0b 100644 --- a/qcsrc/client/hud/panel/racetimer.qc +++ b/qcsrc/client/hud/panel/racetimer.qc @@ -7,7 +7,7 @@ // Race timer (#8) -void HUD_RaceTimer_Export(entity panel, int fh) +void HUD_RaceTimer_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files } diff --git a/qcsrc/client/hud/panel/radar.qc b/qcsrc/client/hud/panel/radar.qc index 073715695..b75b36d33 100644 --- a/qcsrc/client/hud/panel/radar.qc +++ b/qcsrc/client/hud/panel/radar.qc @@ -12,7 +12,7 @@ // Radar (#6) -void HUD_Radar_Export(entity panel, int fh) +void HUD_Radar_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files HUD_Write_Cvar("hud_panel_radar_foreground_alpha"); diff --git a/qcsrc/client/hud/panel/score.qc b/qcsrc/client/hud/panel/score.qc index a4820d74c..10aec79ff 100644 --- a/qcsrc/client/hud/panel/score.qc +++ b/qcsrc/client/hud/panel/score.qc @@ -10,7 +10,7 @@ // Score (#7) -void HUD_Score_Export(entity panel, int fh) +void HUD_Score_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files HUD_Write_Cvar("hud_panel_score_rankings"); diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 5ab3688f3..962759011 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -16,7 +16,7 @@ // Scoreboard (#24) -void Scoreboard_Draw_Export(entity panel, int fh) +void Scoreboard_Draw_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files HUD_Write_Cvar("hud_panel_scoreboard_fadeinspeed"); diff --git a/qcsrc/client/hud/panel/timer.qc b/qcsrc/client/hud/panel/timer.qc index 3cb587c0b..8bb4ade6a 100644 --- a/qcsrc/client/hud/panel/timer.qc +++ b/qcsrc/client/hud/panel/timer.qc @@ -6,7 +6,7 @@ // Timer (#5) -void HUD_Timer_Export(entity panel, int fh) +void HUD_Timer_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files } diff --git a/qcsrc/client/hud/panel/vote.qc b/qcsrc/client/hud/panel/vote.qc index 0dd509163..4aab1b93b 100644 --- a/qcsrc/client/hud/panel/vote.qc +++ b/qcsrc/client/hud/panel/vote.qc @@ -7,7 +7,7 @@ // Vote (#9) -void HUD_Vote_Export(entity panel, int fh) +void HUD_Vote_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files HUD_Write_Cvar("hud_panel_vote_alreadyvoted_alpha"); diff --git a/qcsrc/client/hud/panel/weapons.qc b/qcsrc/client/hud/panel/weapons.qc index 4f452e04b..f7444daaa 100644 --- a/qcsrc/client/hud/panel/weapons.qc +++ b/qcsrc/client/hud/panel/weapons.qc @@ -8,7 +8,7 @@ // Weapons (#0) -void HUD_Weapons_Export(entity panel, int fh) +void HUD_Weapons_Export(int fh) { HUD_Write_Cvar("hud_panel_weapons_accuracy"); HUD_Write_Cvar("hud_panel_weapons_label"); diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index c206e773f..c025bdd46 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -10,7 +10,7 @@ // MapVote (#21) -void MapVote_Draw_Export(entity panel, int fh) +void MapVote_Draw_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files HUD_Write_Cvar("hud_panel_mapvote_highlight_border"); diff --git a/qcsrc/client/mutators/events.qh b/qcsrc/client/mutators/events.qh index e9778b795..0629c2a9f 100644 --- a/qcsrc/client/mutators/events.qh +++ b/qcsrc/client/mutators/events.qh @@ -170,12 +170,6 @@ MUTATOR_HOOKABLE(DrawScoreboard, EV_NO_ARGS); /**/ MUTATOR_HOOKABLE(DrawInfoMessages, EV_DrawInfoMessages); -/** Called when drawing info messages, allows adding new info messages */ -#define EV_HUD_WriteCvars(i, o) \ - /** file */ i(float, MUTATOR_ARGV_0_float) \ - /**/ -MUTATOR_HOOKABLE(HUD_WriteCvars, EV_HUD_WriteCvars); - /** Called when the view model is being animated (setorigin is called after the hook, so you only need to modify origin here if desired) */ #define EV_DrawViewModel(i, o) \ /** entity id */ i(entity, MUTATOR_ARGV_0_entity) \ diff --git a/qcsrc/common/minigames/cl_minigames_hud.qc b/qcsrc/common/minigames/cl_minigames_hud.qc index a1d9a2577..0acdb0da5 100644 --- a/qcsrc/common/minigames/cl_minigames_hud.qc +++ b/qcsrc/common/minigames/cl_minigames_hud.qc @@ -10,22 +10,22 @@ #include #include -void HUD_MinigameBoard_Export(entity panel, int fh) +void HUD_MinigameBoard_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files } -void HUD_MinigameStatus_Export(entity panel, int fh) +void HUD_MinigameStatus_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files } -void HUD_MinigameHelp_Export(entity panel, int fh) +void HUD_MinigameHelp_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files } -void HUD_MinigameMenu_Export(entity panel, int fh) +void HUD_MinigameMenu_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files } diff --git a/qcsrc/common/mutators/mutator/itemstime/itemstime.qc b/qcsrc/common/mutators/mutator/itemstime/itemstime.qc index 5ee7faae8..78a5624c3 100644 --- a/qcsrc/common/mutators/mutator/itemstime/itemstime.qc +++ b/qcsrc/common/mutators/mutator/itemstime/itemstime.qc @@ -187,7 +187,7 @@ MUTATOR_HOOKFUNCTION(itemstime, PlayerSpawn) // ItemsTime (#22) -void HUD_ItemsTime_Export(entity panel, int fh) +void HUD_ItemsTime_Export(int fh) { // allow saving cvars that aesthetically change the panel into hud skin files HUD_Write_Cvar("hud_panel_itemstime_iconalign");