From: Mario Date: Tue, 7 Mar 2017 13:21:26 +0000 (+1000) Subject: Add a hook to save custom HUD cvars from a mutator X-Git-Tag: xonotic-v0.8.2~110 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1e7170ac98afaf468a67879756ff86b5913e0354;p=xonotic%2Fxonotic-data.pk3dir.git Add a hook to save custom HUD cvars from a mutator --- 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);