From 3d70d8de6c6ca03801dca1b6ece637e946c4d32e Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 24 Apr 2015 22:08:50 +1000 Subject: [PATCH] Some more floats to ints/bools --- qcsrc/menu/xonotic/keybinder.qc | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/qcsrc/menu/xonotic/keybinder.qc b/qcsrc/menu/xonotic/keybinder.qc index a083207715..eb1afc0a59 100644 --- a/qcsrc/menu/xonotic/keybinder.qc +++ b/qcsrc/menu/xonotic/keybinder.qc @@ -1,7 +1,7 @@ #ifdef INTERFACE CLASS(XonoticKeyBinder) EXTENDS(XonoticListBox) METHOD(XonoticKeyBinder, configureXonoticKeyBinder, void(entity)) - ATTRIB(XonoticKeyBinder, rowsPerItem, float, 1) + ATTRIB(XonoticKeyBinder, rowsPerItem, int, 1) METHOD(XonoticKeyBinder, drawListBoxItem, void(entity, float, vector, float)) METHOD(XonoticKeyBinder, doubleClickListBoxItem, void(entity, float, vector)) METHOD(XonoticKeyBinder, resizeNotify, void(entity, vector, vector, vector, vector)) @@ -16,7 +16,7 @@ CLASS(XonoticKeyBinder) EXTENDS(XonoticListBox) ATTRIB(XonoticKeyBinder, columnKeysOrigin, float, 0) ATTRIB(XonoticKeyBinder, columnKeysSize, float, 0) - ATTRIB(XonoticKeyBinder, previouslySelected, float, -1) + ATTRIB(XonoticKeyBinder, previouslySelected, int, -1) ATTRIB(XonoticKeyBinder, inMouseHandler, float, 0) ATTRIB(XonoticKeyBinder, userbindEditButton, entity, NULL) ATTRIB(XonoticKeyBinder, keyGrabButton, entity, NULL) @@ -34,15 +34,15 @@ void KeyBinder_Bind_Edit(entity btn, entity me); const string KEY_NOT_BOUND_CMD = "// not bound"; -const float MAX_KEYS_PER_FUNCTION = 2; -const float MAX_KEYBINDS = 256; +const int MAX_KEYS_PER_FUNCTION = 2; +const int MAX_KEYBINDS = 256; string Xonotic_KeyBinds_Functions[MAX_KEYBINDS]; string Xonotic_KeyBinds_Descriptions[MAX_KEYBINDS]; -float Xonotic_KeyBinds_Count = -1; +int Xonotic_KeyBinds_Count = -1; void Xonotic_KeyBinds_Read() { - float fh; + int fh; string s; Xonotic_KeyBinds_Count = 0; @@ -71,7 +71,8 @@ entity makeXonoticKeyBinder() } void replace_bind(string from, string to) { - float n, j, k; + int n, j; + float k; // not sure if float or int n = tokenize(findkeysforcommand(from, 0)); // uses '...' strings for(j = 0; j < n; ++j) { @@ -130,9 +131,10 @@ void KeyBinder_Bind_Change(entity btn, entity me) me.clearButton.disabled = 1; keyGrabber = me; } -void XonoticKeyBinder_keyGrabbed(entity me, float key, float ascii) +void XonoticKeyBinder_keyGrabbed(entity me, int key, bool ascii) { - float n, j, k, nvalid; + int n, j, nvalid; + float k; string func; me.keyGrabButton.forcePressed = 0; @@ -276,7 +278,7 @@ void XonoticKeyBinder_setSelected(entity me, float i) me.userbindEditButton.disabled = (substring(Xonotic_KeyBinds_Descriptions[i], 0, 1) != "$"); SUPER(XonoticKeyBinder).setSelected(me, i); } -float XonoticKeyBinder_keyDown(entity me, float key, float ascii, float shift) +float XonoticKeyBinder_keyDown(entity me, int key, bool ascii, float shift) { float r; r = 1; @@ -298,10 +300,11 @@ float XonoticKeyBinder_keyDown(entity me, float key, float ascii, float shift) } return r; } -void XonoticKeyBinder_drawListBoxItem(entity me, float i, vector absSize, float isSelected) +void XonoticKeyBinder_drawListBoxItem(entity me, int i, vector absSize, bool isSelected) { string s; - float j, k, n; + int j, n; + float k; vector theColor; float theAlpha; string func, descr; -- 2.39.2