]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
New cvar _hud_showbinds_reload 0 "set it to 1 to reload binds if you changed any...
authorterencehill <piuntn@gmail.com>
Sat, 15 Dec 2012 15:03:27 +0000 (16:03 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 15 Dec 2012 15:03:27 +0000 (16:03 +0100)
_hud_common.cfg
qcsrc/client/View.qc
qcsrc/client/autocvars.qh
qcsrc/menu/xonotic/keybinder.c

index 5179bb2abfcddf226f547c457d0877e39d78f5b7..ba88a2a4fa6fedcd4f2343caeb2e8b1445b1893e 100644 (file)
@@ -35,6 +35,7 @@ alias hud_panel_radar_maximized "cl_cmd hud radar"
 // other hud cvars
 seta hud_showbinds 1   "what to show in the HUD to indicate certain keys to press: 0 display commands, 1 bound keys, 2 both"
 seta hud_showbinds_limit 2     "maximum number of bound keys to show for a command. 0 for unlimited"
+set _hud_showbinds_reload 0    "set it to 1 to reload binds if you changed any. It is reset to 0 automatically"
 
 seta hud_colorflash_alpha 0.5 "starting alpha of the color flash"
 
index 9ffe5a738c67634732ac4716a6fc8e7ccace8106..35fabadcfdd0712d3d2176020c3ddbe1f2b43894 100644 (file)
@@ -390,6 +390,13 @@ void CSQC_UpdateView(float w, float h)
 
        hud = getstati(STAT_HUD);
 
+       if(autocvar__hud_showbinds_reload) // menu can set this one
+       {
+               db_close(binddb);
+               binddb = db_create();
+               cvar_set("_hud_showbinds_reload", "0");
+       }
+
        if(checkextension("DP_CSQC_MINFPS_QUALITY"))
                view_quality = getproperty(VF_MINFPS_QUALITY);
        else
index ed56f718381cc0e2ecfe61c29d8e3ed2a59a261c..0d0941514bb622f377ff3f1c27dec9a740411f4f 100644 (file)
@@ -323,6 +323,7 @@ float autocvar_hud_panel_weapons_timeout_effect;
 float autocvar_hud_progressbar_alpha;
 float autocvar_hud_showbinds;
 float autocvar_hud_showbinds_limit;
+float autocvar__hud_showbinds_reload;
 float autocvar_hud_shownames;
 float autocvar_hud_shownames_enemies;
 float autocvar_hud_shownames_crosshairdistance;
index 1107e60abc6b3296e77dd9582bbe6613a267ef32..fbd7c3997f37bbbab8eae33a6f4cc30ac06d61a3 100644 (file)
@@ -80,6 +80,8 @@ void replace_bind(string from, string to)
                if(k != -1)
                        localcmd("\nbind \"", keynumtostring(k), "\" \"", to, "\"\n");
        }
+       if(n)
+               cvar_set("_hud_showbinds_reload", "1");
 }
 void XonoticKeyBinder_configureXonoticKeyBinder(entity me)
 {
@@ -161,6 +163,7 @@ void XonoticKeyBinder_keyGrabbed(entity me, float key, float ascii)
        }
        localcmd("\nbind \"", keynumtostring(key), "\" \"", func, "\"\n");
        localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state
+       cvar_set("_hud_showbinds_reload", "1");
 }
 void XonoticKeyBinder_editUserbind(entity me, string theName, string theCommandPress, string theCommandRelease)
 {
@@ -168,11 +171,11 @@ void XonoticKeyBinder_editUserbind(entity me, string theName, string theCommandP
 
        if(!me.userbindEditDialog)
                return;
-       
+
        func = Xonotic_KeyBinds_Functions[me.selectedItem];
        if(func == "")
                return;
-       
+
        descr = Xonotic_KeyBinds_Descriptions[me.selectedItem];
        if(substring(descr, 0, 1) != "$")
                return;
@@ -189,11 +192,11 @@ void KeyBinder_Bind_Edit(entity btn, entity me)
 
        if(!me.userbindEditDialog)
                return;
-       
+
        func = Xonotic_KeyBinds_Functions[me.selectedItem];
        if(func == "")
                return;
-       
+
        descr = Xonotic_KeyBinds_Descriptions[me.selectedItem];
        if(substring(descr, 0, 1) != "$")
                return;
@@ -222,6 +225,7 @@ void KeyBinder_Bind_Clear(entity btn, entity me)
                        localcmd("\nbind \"", keynumtostring(k), "\" \"", KEY_NOT_BOUND_CMD, "\"\n");
        }
        localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state
+       cvar_set("_hud_showbinds_reload", "1");
 }
 void XonoticKeyBinder_clickListBoxItem(entity me, float i, vector where)
 {