From ff8665d58f48860a53a77fc89a781abdb7ed0bd2 Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 27 Apr 2015 21:11:16 +0200 Subject: [PATCH] Better names for 3 fields --- qcsrc/menu/item/listbox.qc | 16 ++++++++-------- qcsrc/menu/xonotic/charmap.qc | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/qcsrc/menu/item/listbox.qc b/qcsrc/menu/item/listbox.qc index 558c8a4ea..2bc24b266 100644 --- a/qcsrc/menu/item/listbox.qc +++ b/qcsrc/menu/item/listbox.qc @@ -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(); diff --git a/qcsrc/menu/xonotic/charmap.qc b/qcsrc/menu/xonotic/charmap.qc index 0ba72a5d8..ba21ba8c8 100644 --- a/qcsrc/menu/xonotic/charmap.qc +++ b/qcsrc/menu/xonotic/charmap.qc @@ -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; -- 2.39.2