]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/keybinder.qc
Merge remote-tracking branch 'origin/divVerent/crypto-fixes'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / keybinder.qc
index 6f3e56f72c8964d6f52aa6c62ed728eb1d5edc46..a083207715250430fc1a9dd465b66c8c68dca477 100644 (file)
@@ -38,7 +38,7 @@ const float MAX_KEYS_PER_FUNCTION = 2;
 const float MAX_KEYBINDS = 256;
 string Xonotic_KeyBinds_Functions[MAX_KEYBINDS];
 string Xonotic_KeyBinds_Descriptions[MAX_KEYBINDS];
-var float Xonotic_KeyBinds_Count = -1;
+float Xonotic_KeyBinds_Count = -1;
 
 void Xonotic_KeyBinds_Read()
 {
@@ -106,14 +106,14 @@ void XonoticKeyBinder_resizeNotify(entity me, vector relOrigin, vector relSize,
 {
        SUPER(XonoticKeyBinder).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
 
-       me.realFontSize_y = me.fontSize / (absSize_y * me.itemHeight);
-       me.realFontSize_x = me.fontSize / (absSize_x * (1 - me.controlWidth));
-       me.realUpperMargin = 0.5 * (1 - me.realFontSize_y);
+       me.realFontSize_y = me.fontSize / (absSize.y * me.itemHeight);
+       me.realFontSize_x = me.fontSize / (absSize.x * (1 - me.controlWidth));
+       me.realUpperMargin = 0.5 * (1 - me.realFontSize.y);
 
        me.columnFunctionOrigin = 0;
-       me.columnKeysSize = me.realFontSize_x * 12;
-       me.columnFunctionSize = 1 - me.columnKeysSize - 2 * me.realFontSize_x;
-       me.columnKeysOrigin = me.columnFunctionOrigin + me.columnFunctionSize + me.realFontSize_x;
+       me.columnKeysSize = me.realFontSize.x * 12;
+       me.columnFunctionSize = 1 - me.columnKeysSize - 2 * me.realFontSize.x;
+       me.columnKeysOrigin = me.columnFunctionOrigin + me.columnFunctionSize + me.realFontSize.x;
 
        if(me.userbindEditButton)
                me.userbindEditButton.disabled = (substring(Xonotic_KeyBinds_Descriptions[me.selectedItem], 0, 1) != "$");
@@ -170,6 +170,7 @@ void XonoticKeyBinder_keyGrabbed(entity me, float key, float ascii)
                                localcmd("\nbind \"", keynumtostring(k), "\" \"", KEY_NOT_BOUND_CMD, "\"\n");
                }
        }
+       m_play_click_sound(MENU_SOUND_SELECT);
        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");
@@ -233,13 +234,14 @@ void KeyBinder_Bind_Clear(entity btn, entity me)
                        //localcmd("\nunbind \"", keynumtostring(k), "\"\n");
                        localcmd("\nbind \"", keynumtostring(k), "\" \"", KEY_NOT_BOUND_CMD, "\"\n");
        }
+       m_play_click_sound(MENU_SOUND_CLEAR);
        localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state
        cvar_set("_hud_showbinds_reload", "1");
 }
 void KeyBinder_Bind_Reset_All(entity btn, entity me)
 {
        localcmd("unbindall\n");
-       localcmd("exec binds-default.cfg\n");
+       localcmd("exec binds-xonotic.cfg\n");
        localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state
        cvar_set("_hud_showbinds_reload", "1");
 }
@@ -326,7 +328,7 @@ void XonoticKeyBinder_drawListBoxItem(entity me, float i, vector absSize, float
                }
                theAlpha = SKINALPHA_KEYGRABBER_KEYS;
                theColor = SKINCOLOR_KEYGRABBER_KEYS;
-               extraMargin = me.realFontSize_x * 0.5;
+               extraMargin = me.realFontSize.x * 0.5;
        }
 
        if(substring(descr, 0, 1) == "$")