]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix some more floats in arrays
authorMario <zacjardine@y7mail.com>
Sat, 25 Apr 2015 02:52:46 +0000 (12:52 +1000)
committerMario <zacjardine@y7mail.com>
Sat, 25 Apr 2015 02:52:46 +0000 (12:52 +1000)
qcsrc/menu/item/listbox.qc
qcsrc/menu/item/textslider.qc
qcsrc/menu/xonotic/keybinder.qc
qcsrc/menu/xonotic/serverlist.qc
qcsrc/menu/xonotic/weaponslist.qc

index 178b12b9a047ea3645cb89ca8fa09326ddb692f2..478a2063ff74f71c7921d505134e0a1578ca500c 100644 (file)
@@ -10,7 +10,7 @@ CLASS(ListBox) EXTENDS(Item)
        METHOD(ListBox, focusLeave, void(entity))
        ATTRIB(ListBox, focusable, float, 1)
        ATTRIB(ListBox, allowFocusSound, float, 1)
-       ATTRIB(ListBox, selectedItem, float, 0)
+       ATTRIB(ListBox, selectedItem, int, 0)
        ATTRIB(ListBox, size, vector, '0 0 0')
        ATTRIB(ListBox, origin, vector, '0 0 0')
        ATTRIB(ListBox, scrollPos, float, 0) // measured in window heights, fixed when needed
index 6e9d65efaf612d06d0e4d9a1053645feda08ec10..93d4090e02f762e3c2269683e795fb4ba716204b 100644 (file)
@@ -12,7 +12,7 @@ CLASS(TextSlider) EXTENDS(Slider)
        METHOD(TextSlider, configureTextSliderValues, void(entity, string))
        ATTRIBARRAY(TextSlider, valueStrings, string, 256)
        ATTRIBARRAY(TextSlider, valueIdentifiers, string, 256)
-       ATTRIB(TextSlider, nValues, float, 0)
+       ATTRIB(TextSlider, nValues, int, 0)
 ENDCLASS(TextSlider)
 #endif
 
index eb1afc0a59b90a2f8fca79372dcfa26fc8c2d23b..5c2b898f21acdd93e4d9eaa5d8d33753fd6dc001 100644 (file)
@@ -251,7 +251,7 @@ void XonoticKeyBinder_doubleClickListBoxItem(entity me, float i, vector where)
 {
        KeyBinder_Bind_Change(NULL, me);
 }
-void XonoticKeyBinder_setSelected(entity me, float i)
+void XonoticKeyBinder_setSelected(entity me, int i)
 {
        // handling of "unselectable" items
        i = floor(0.5 + bound(0, i, me.nItems - 1));
@@ -280,8 +280,7 @@ void XonoticKeyBinder_setSelected(entity me, float i)
 }
 float XonoticKeyBinder_keyDown(entity me, int key, bool ascii, float shift)
 {
-       float r;
-       r = 1;
+       bool r = true;
        switch(key)
        {
                case K_ENTER:
index db7ac84814b8f5fe765b654282ac0771eb05f4df..29877c5d5e888a8c16a9469ab480580176e018a2 100644 (file)
@@ -126,10 +126,10 @@ void ServerList_Info_Click(entity btn, entity me);
 void ServerList_Update_favoriteButton(entity btn, entity me);
 
 // fields for category entities
-const float MAX_CATEGORIES = 9;
-const float CATEGORY_FIRST = 1;
+const int MAX_CATEGORIES = 9;
+const int CATEGORY_FIRST = 1;
 entity categories[MAX_CATEGORIES];
-float category_ent_count;
+int category_ent_count;
 .string cat_name;
 .string cat_string;
 .string cat_enoverride_string;
@@ -138,9 +138,9 @@ float category_ent_count;
 .float cat_dioverride;
 
 // fields for drawing categories
-float category_name[MAX_CATEGORIES];
-float category_item[MAX_CATEGORIES];
-float category_draw_count;
+int category_name[MAX_CATEGORIES];
+int category_item[MAX_CATEGORIES];
+int category_draw_count;
 
 #define SLIST_CATEGORIES \
        SLIST_CATEGORY(CAT_FAVORITED,    "",            "",             ZCTX(_("SLCAT^Favorites"))) \
index 1d3b897fc055664f9ed1a3cf98765ed8ae9ad4ee..46d4e273f089004d503c074149e39d7da1f9e222 100644 (file)
@@ -65,9 +65,8 @@ void XonoticWeaponsList_resizeNotify(entity me, vector relOrigin, vector relSize
 }
 float XonoticWeaponsList_mouseDrag(entity me, vector pos)
 {
-       float f, i;
-       i = me.selectedItem;
-       f = SUPER(XonoticWeaponsList).mouseDrag(me, pos);
+       int i = me.selectedItem;
+       float f = SUPER(XonoticWeaponsList).mouseDrag(me, pos);
 
        if(me.pressed != 1) // don't change priority if the person is just scrolling
        {