override public void FrequentStep() { base.FrequentStep(); twin cursorPos = UpdateCursorPos(); if (!xxi.Input_Key_ShowPalette()) { xxi.SetState(xxi.state_edit); } else { KeyCode k = xxi.keys.GetCurrentKey(); if (paletteGrid.CellPosInBounds(cursorPos)) { AuthorCell cell = (AuthorCell)paletteGrid.GetCell(cursorPos); bool cellSelectable = (cell != null && cell.type != (byte)AuthorCell_SuperType.Unused); bool inputIsNumber = (k >= KeyCode.Alpha0 && k <= KeyCode.Alpha9); bool inputIsAlpha = (k >= KeyCode.A && k <= KeyCode.Z); if (cellSelectable && (inputIsNumber || inputIsAlpha)) { xxi.Input_SetKeyCellValue(k, cell.value); } } } }
//// INTERNAL void Paint(twin cellPos, ushort cellValue) { if (editGrid.CellPosInBounds(cellPos)) { AuthorCell cell = (AuthorCell)editGrid.GetCell(cellPos); if (cell != null && cell.GetCellType(cellValue) != (byte)AuthorCell_SuperType.Unused) { cell.SetValue(cellValue); } } }