9 me.configureXonoticPicker(me);
15 me.realCellSize =
eX / me.columns +
eY / me.rows;
20 vector prevFocusedCell = me.focusedCell;
21 me.focusedCell_x =
floor(coords.x * me.columns);
22 me.focusedCell_y =
floor(coords.y * me.rows);
24 if(me.focusedCell.x < 0 || me.focusedCell.y < 0 ||
25 me.focusedCell.x >= me.columns || me.focusedCell.y >= me.rows)
27 me.focusedCell =
'-1 -1 0';
31 if(me.focusedCell != prevFocusedCell)
32 me.focusedCellAlpha = SKINALPHA_LISTBOX_FOCUSED;
39 return me.mouseMove(me, coords);
44 this.mouseMove(
this, pos);
46 if(this.focusedCell.x >= 0)
49 this.pressedCell = this.focusedCell;
60 me.mouseMove(me, coords);
62 if(me.focusedCell == me.pressedCell)
63 me.cellSelect(me, me.focusedCell);
76 me.focusedCell =
eY * (me.rows - 1);
79 me.moveFocus(me, me.focusedCell,
'-1 0 0');
84 me.focusedCell =
eX * (me.columns - 1);
87 me.moveFocus(me, me.focusedCell,
'1 0 0');
91 me.moveFocus(me, me.focusedCell,
'0 -1 0');
95 me.moveFocus(me, me.focusedCell,
'0 1 0');
101 me.cellSelect(me, me.focusedCell);
109 me.focusedCell_x =
mod(me.focusedCell.x + step.x + me.columns, me.columns);
110 me.focusedCell_y =
mod(me.focusedCell.y + step.y + me.rows, me.rows);
112 if(me.focusedCell != initialCell)
113 if(!me.cellIsValid(me, me.focusedCell))
114 me.moveFocus(me, initialCell, step);
116 me.focusedCellAlpha = SKINALPHA_LISTBOX_FOCUSED;
121 me.selectedCell = cell;
137 me.focusable = !me.disabled;
147 for(cell_y = 0; cell.y < me.rows; ++cell.y)
149 cellPos_y =
mod(cell.y, me.rows) / me.rows;
150 for(cell_x = 0; cell.x < me.columns; ++cell.x)
152 if(!me.cellIsValid(me, cell))
155 cellPos_x =
mod(cell.x, me.columns) / me.columns;
157 if(cell == me.selectedCell)
158 draw_Fill(cellPos, me.realCellSize, SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
159 else if(cell == me.focusedCell && me.focused)
161 if(!me.pressed || me.focusedCell == me.pressedCell)
163 me.focusedCellAlpha =
getFadedAlpha(me.focusedCellAlpha, SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED);
164 draw_Fill(cellPos, me.realCellSize, SKINCOLOR_LISTBOX_FOCUSED, me.focusedCellAlpha);
168 me.cellDraw(me, cell, cellPos);
bool XonoticPicker_cellIsValid(entity me, vector cell)
float XonoticPicker_keyDown(entity me, float key, float ascii, float shift)
void XonoticPicker_moveFocus(entity me, vector initialCell, vector step)
#define METHOD(cname, name, prototype)
float XonoticPicker_mouseMove(entity me, vector coords)
float XonoticPicker_mouseRelease(entity me, vector coords)
void XonoticPicker_cellSelect(entity me, vector cell)
void XonoticPicker_configureXonoticPicker(entity me)
void XonoticPicker_draw(entity me)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
void XonoticPicker_cellDraw(entity me, vector cell, vector cellPos)
entity makeXonoticPicker()
float XonoticPicker_mouseDrag(entity me, vector coords)