예제 #1
0
        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);
                    }
                }
            }
        }
예제 #2
0
 //// 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);
         }
     }
 }
예제 #3
0
 void PasteCol(ushort[] edgeData, int col, NavdiGrid grid)
 {
     if (col < 0)
     {
         col = grid.options.size_cellsInGrid.x + col;
     }
     for (int y = 0; y < edgeData.Length; y++)
     {
         grid.GetCell(col, y).SetValue(edgeData[y]);
     }
 }
예제 #4
0
 void PasteRow(ushort[] edgeData, int row, NavdiGrid grid)
 {
     if (row < 0)
     {
         row = grid.options.size_cellsInGrid.y + row;
     }
     for (int x = 0; x < edgeData.Length; x++)
     {
         grid.GetCell(x, row).SetValue(edgeData[x]);
     }
 }
예제 #5
0
 ushort[] CopyCol(int col, NavdiGrid grid)
 {
     if (col < 0)
     {
         col = grid.options.size_cellsInGrid.x + col;
     }
     ushort[] edge = new ushort[grid.options.size_cellsInGrid.y];
     for (int y = 0; y < edge.Length; y++)
     {
         edge[y] = grid.GetCell(col, y).value;
     }
     return(edge);
 }
예제 #6
0
 ushort[] CopyRow(int row, NavdiGrid grid)
 {
     if (row < 0)
     {
         row = grid.options.size_cellsInGrid.y + row;
     }
     ushort[] edge = new ushort[grid.options.size_cellsInGrid.x];
     for (int x = 0; x < edge.Length; x++)
     {
         edge[x] = grid.GetCell(x, row).value;
     }
     return(edge);
 }