From 1e7170ac98afaf468a67879756ff86b5913e0354 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 7 Mar 2017 23:21:26 +1000 Subject: [PATCH] Add a hook to save custom HUD cvars from a mutator --- qcsrc/client/hud/hud_config.qc | 2 ++ qcsrc/client/mutators/events.qh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/qcsrc/client/hud/hud_config.qc b/qcsrc/client/hud/hud_config.qc index f2b23e392..c358cf643 100644 --- a/qcsrc/client/hud/hud_config.qc +++ b/qcsrc/client/hud/hud_config.qc @@ -226,6 +226,8 @@ void HUD_Panel_ExportCfg(string cfgname) } HUD_Write("\n"); } + MUTATOR_CALLHOOK(HUD_WriteCvars); + HUD_Write("menu_sync\n"); // force the menu to reread the cvars, so that the dialogs are updated LOG_INFOF(_("^2Successfully exported to %s! (Note: It's saved in data/data/)\n"), filename); diff --git a/qcsrc/client/mutators/events.qh b/qcsrc/client/mutators/events.qh index edd178199..248fc3039 100644 --- a/qcsrc/client/mutators/events.qh +++ b/qcsrc/client/mutators/events.qh @@ -164,3 +164,5 @@ MUTATOR_HOOKABLE(DrawScoreboard, EV_NO_ARGS); /** mySize */ i(vector, MUTATOR_ARGV_1_vector) \ /**/ MUTATOR_HOOKABLE(DrawInfoMessages, EV_DrawInfoMessages); + +MUTATOR_HOOKABLE(HUD_WriteCvars, EV_NO_ARGS); -- 2.39.2