]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Better names for 3 fields
authorterencehill <piuntn@gmail.com>
Mon, 27 Apr 2015 19:11:16 +0000 (21:11 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 27 Apr 2015 19:11:16 +0000 (21:11 +0200)
qcsrc/menu/item/listbox.qc
qcsrc/menu/xonotic/charmap.qc

index 558c8a4ea7d92176d3cd40b1b31442aeed6e5694..2bc24b2664591827cf58983c700aac697c3d218f 100644 (file)
@@ -10,8 +10,8 @@ CLASS(ListBox) EXTENDS(Item)
        METHOD(ListBox, mouseRelease, float(entity, vector))
        METHOD(ListBox, focusLeave, void(entity))
        ATTRIB(ListBox, focusable, float, 1)
-       ATTRIB(ListBox, highlightedItem, int, -1)
-       ATTRIB(ListBox, highlightedItemTime, float, 0)
+       ATTRIB(ListBox, focusedItem, int, -1)
+       ATTRIB(ListBox, focusedItemTime, float, 0)
        ATTRIB(ListBox, allowFocusSound, float, 1)
        ATTRIB(ListBox, selectedItem, int, 0)
        ATTRIB(ListBox, size, vector, '0 0 0')
@@ -188,10 +188,10 @@ float ListBox_mouseMove(entity me, vector pos)
        if(pos_x < 1 - me.controlWidth)
        {
                float x;
-               x = me.highlightedItem;
-               me.highlightedItem = me.getItemAtPos(me, me.scrollPos + pos.y);
-               if(x != me.highlightedItem)
-                       me.highlightedItemTime = time;
+               x = me.focusedItem;
+               me.focusedItem = me.getItemAtPos(me, me.scrollPos + pos.y);
+               if(x != me.focusedItem)
+                       me.focusedItemTime = time;
        }
        return 1;
 }
@@ -305,7 +305,7 @@ void ListBox_focusLeave(entity me)
        // by a mouse click on an item of the list
        // for example showing a dialog on right click
        me.pressed = 0;
-       me.highlightedItem = -1;
+       me.focusedItem = -1;
 }
 void ListBox_updateControlTopBottom(entity me)
 {
@@ -397,7 +397,7 @@ void ListBox_draw(entity me)
                vector relSize = eX * (1 - me.controlWidth) + eY * me.getItemHeight(me, i);
                absSize = boxToGlobalSize(relSize, me.size);
                draw_scale = boxToGlobalSize(relSize, oldscale);
-               me.drawListBoxItem(me, i, absSize, (me.selectedItem == i), (me.highlightedItem == i) ? me.highlightedItemTime : 0);
+               me.drawListBoxItem(me, i, absSize, (me.selectedItem == i), (me.focusedItem == i) ? me.focusedItemTime : 0);
                y += relSize.y;
        }
        draw_ClearClip();
index 0ba72a5d83404ff3fee24deb3d9d93aac7fccb36..ba21ba8c8d9fd0875740294fdd6266832c24f257 100644 (file)
@@ -17,7 +17,7 @@ CLASS(XonoticCharmap) EXTENDS(Item)
        ATTRIB(XonoticCharmap, realFontSize, vector, '0 0 0')
        ATTRIB(XonoticCharmap, realCellSize, vector, '0 0 0')
        ATTRIB(XonoticCharmap, focusedCell, vector, '-1 -1 0')
-       ATTRIB(XonoticCharmap, previouslyFocusedCell, vector, '-1 -1 0')
+       ATTRIB(XonoticCharmap, pressedCell, vector, '-1 -1 0')
 ENDCLASS(XonoticCharmap)
 entity makeXonoticCharmap(entity controlledInputBox);
 #endif
@@ -117,7 +117,7 @@ float XonoticCharmap_mousePress(entity me, vector coords)
        if(me.focusedCell.x >= 0)
        {
                me.pressed = 1;
-               me.previouslyFocusedCell = me.focusedCell;
+               me.pressedCell = me.focusedCell;
        }
 
        return 1;
@@ -130,7 +130,7 @@ float XonoticCharmap_mouseRelease(entity me, vector coords)
 
        me.mouseMove(me, coords);
 
-       if(me.focusedCell == me.previouslyFocusedCell)
+       if(me.focusedCell == me.pressedCell)
                me.enterChar(me);
 
        me.pressed = 0;
@@ -223,7 +223,7 @@ void XonoticCharmap_draw(entity me)
                        // Draw focused cell
                        if(cell == me.focusedCell && me.focused)
                        {
-                               if(!me.pressed || me.focusedCell == me.previouslyFocusedCell)
+                               if(!me.pressed || me.focusedCell == me.pressedCell)
                                {
                                        cellPos_x = mod(me.focusedCell.x, CHARMAP_COLS) / CHARMAP_COLS;
                                        cellPos_y = mod(me.focusedCell.y, CHARMAP_ROWS) / CHARMAP_ROWS;