From 46d043b2a15b8f4e958a9c14001fba0a15ee4add Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 22 May 2020 15:50:06 +0200 Subject: [PATCH 1/1] 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) --- qcsrc/client/hud/hud.qh | 4 ++-- qcsrc/client/hud/hud_config.qc | 3 +-- qcsrc/client/hud/panel/ammo.qc | 2 +- qcsrc/client/hud/panel/centerprint.qc | 2 +- qcsrc/client/hud/panel/chat.qc | 2 +- qcsrc/client/hud/panel/engineinfo.qc | 2 +- qcsrc/client/hud/panel/healtharmor.qc | 2 +- qcsrc/client/hud/panel/infomessages.qc | 2 +- qcsrc/client/hud/panel/modicons.qc | 2 +- qcsrc/client/hud/panel/notify.qc | 2 +- qcsrc/client/hud/panel/physics.qc | 2 +- qcsrc/client/hud/panel/powerups.qc | 2 +- qcsrc/client/hud/panel/pressedkeys.qc | 2 +- qcsrc/client/hud/panel/quickmenu.qc | 2 +- qcsrc/client/hud/panel/racetimer.qc | 2 +- qcsrc/client/hud/panel/radar.qc | 2 +- qcsrc/client/hud/panel/score.qc | 2 +- qcsrc/client/hud/panel/scoreboard.qc | 2 +- qcsrc/client/hud/panel/timer.qc | 2 +- qcsrc/client/hud/panel/vote.qc | 2 +- qcsrc/client/hud/panel/weapons.qc | 2 +- qcsrc/client/mapvoting.qc | 2 +- qcsrc/client/mutators/events.qh | 6 ------ qcsrc/common/minigames/cl_minigames_hud.qc | 8 ++++---- qcsrc/common/mutators/mutator/itemstime/itemstime.qc | 2 +- 25 files changed, 28 insertions(+), 35 deletions(-) diff --git a/qcsrc/client/hud/hud.qh b/qcsrc/client/hud/hud.qh index 58f46b8af9..2c12a6150e 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 6858a84b21..c4ae095ac3 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 fbe1aa5ce2..5abbbf036b 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 1b2f3fe044..2f5aab5ed9 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 7b405d5bb1..78cc6a0ef9 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 db376a2ce8..908aa1defe 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 d63b3d97bc..b1a9311939 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 803491f843..363465dfb7 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 b206609b3f..0a8b8cf5ed 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 b562fdb61c..bfb23bf2c7 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 e2be0de005..a451f924b0 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 d68a60f318..1662415edd 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 ed9ab7ded6..73bd583bcd 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 de7489ca80..66ee555b43 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 326d776539..cd0b26e0bd 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 0737156952..b75b36d33f 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 a4820d74c1..10aec79ff6 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 5ab3688f37..962759011a 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 3cb587c0ba..8bb4ade6a1 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 0dd509163f..4aab1b93bb 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 4f452e04b8..f7444daaa3 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 c206e773f8..c025bdd465 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 e9778b795c..0629c2a9f0 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 a1d9a25778..0acdb0da59 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 5ee7faae84..78a5624c31 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"); -- 2.39.2