From 52b647792e5bfd00b630a9e4b039166c4f921be4 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Thu, 30 Jan 2014 18:38:38 +0100 Subject: [PATCH] Add a facility to FORCE cvars to be saved, EVEN if non-saved in our config and in the engine. --- defaultXonotic.cfg | 4 ++++ post-config.cfg | 6 ++++++ quake.rc | 2 ++ 3 files changed, 12 insertions(+) create mode 100644 post-config.cfg diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index c6fa7642b..78f03451d 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1581,3 +1581,7 @@ set cl_simpleitems_postfix "_simple" "posfix to add fo model name when simple it set cl_fullbright_items 0 "enable fullbright items (if server allows, controled by g_fullbrightitems)" set cl_weapon_stay_color "2 0.5 0.5" "Color of picked up weapons when g_weapon_stay > 0" set cl_weapon_stay_alpha 0.75 "Alpha of picked up weapons when g_weapon_stay > 0" + +// Facility for config.cfg use ONLY. +// Interpreted in post-config.cfg. +seta cl_forced_saved_cvars "" "These cvars will always be saved, despite engine/Xonotic cvar saving status" diff --git a/post-config.cfg b/post-config.cfg new file mode 100644 index 000000000..7fb4ea4af --- /dev/null +++ b/post-config.cfg @@ -0,0 +1,6 @@ +// Mark all cvars listed in cl_forced_saved_cvars as saved. That way they'll never disappear from config.cfg. +alias _cl_forced_saved_cvars_next "set _forced_saved_cvar_ doit; set _forced_saved_cvar_${1 ?} done; _cl_forced_saved_cvars_chck ${* ?}" +alias _cl_forced_saved_cvars_chck "_cl_forced_saved_cvars_$_forced_saved_cvar_ ${* ?}" +alias _cl_forced_saved_cvars_doit "seta $1 \"${$1}\"; _cl_forced_saved_cvars_next ${2- ?}" +alias _cl_forced_saved_cvars_done "" +_cl_forced_saved_cvars_next $cl_forced_saved_cvars diff --git a/quake.rc b/quake.rc index 5dd32c8ac..9330d6a67 100644 --- a/quake.rc +++ b/quake.rc @@ -11,3 +11,5 @@ stuffcmds //startdemos //play announcer/male/welcome.ogg crypto_keygen 0 http://ca.xonotic.org/?ca=0&key= + +exec post-config.cfg -- 2.39.2