Add a facility to FORCE cvars to be saved, EVEN if non-saved in our config and in...
authorRudolf Polzer <divverent@xonotic.org>
Thu, 30 Jan 2014 17:38:38 +0000 (18:38 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 30 Jan 2014 17:38:38 +0000 (18:38 +0100)
defaultXonotic.cfg
post-config.cfg [new file with mode: 0644]
quake.rc

index c6fa764..78f0345 100644 (file)
@@ -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 (file)
index 0000000..7fb4ea4
--- /dev/null
@@ -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
index 5dd32c8..9330d6a 100644 (file)
--- 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