-
-void XonoticCharmap_draw(entity me)
-{
- string character;
- vector cell, cellPos, charPos;
- cell = '0 0 0';
- cellPos = '0 0 0';
- charPos = '0 0 0';
-
- float CHAR_OFFSET_X = me.realCellSize_x / 2;
- float CHAR_OFFSET_Y = (me.realCellSize_y - me.realFontSize_y) / 2;
-
- for(cell_y = 0; cell_y < CHARMAP_ROWS; ++cell_y)
- {
- charPos_y = cell_y / CHARMAP_ROWS + CHAR_OFFSET_Y;
- for(cell_x = 0; cell_x < CHARMAP_COLS; ++cell_x)
- {
- character = charmap_cellToChar(cell);
-
- if(character == "")
- continue;
-
- // Draw focused cell
- if(cell == me.focusedCell && me.focused)
- {
- if(!me.pressed || me.focusedCell == me.previouslyFocusedCell)
- {
- cellPos_x = mod(me.focusedCell_x, CHARMAP_COLS) / CHARMAP_COLS;
- cellPos_y = mod(me.focusedCell_y, CHARMAP_ROWS) / CHARMAP_ROWS;
- draw_Fill(cellPos, me.realCellSize, SKINCOLOR_CHARMAP_FOCUS, SKINALPHA_CHARMAP_FOCUS);
- }
- }
-
- // Draw character
- charPos_x = cell_x / CHARMAP_COLS + CHAR_OFFSET_X;
- draw_CenterText(charPos, character, me.realFontSize, SKINCOLOR_CHARMAP_CHAR, SKINALPHA_CHARMAP_CHAR, 0);
- }
- }
-}