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')
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;
}
// 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)
{
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();
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
if(me.focusedCell.x >= 0)
{
me.pressed = 1;
- me.previouslyFocusedCell = me.focusedCell;
+ me.pressedCell = me.focusedCell;
}
return 1;
me.mouseMove(me, coords);
- if(me.focusedCell == me.previouslyFocusedCell)
+ if(me.focusedCell == me.pressedCell)
me.enterChar(me);
me.pressed = 0;
// 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;