private void SwitchToSelectTool() { this.ClearBlueprint(); FuncToolSelect selectFunc = (FuncToolSelect)FuncTool.funcToolMap[(byte)FuncToolEnum.Select]; EditorTools.SetFuncTool(selectFunc); }
public void CloneTile(short gridX, short gridY) { RoomFormat roomData = this.levelContent.data.rooms[this.roomID]; Dictionary <string, Dictionary <string, ArrayList> > layerData = null; bool isObject = false; if (LevelContent.VerifyTiles(roomData.obj, gridX, gridY)) { layerData = roomData.obj; isObject = true; } else if (LevelContent.VerifyTiles(roomData.main, gridX, gridY)) { layerData = roomData.main; } else if (LevelContent.VerifyTiles(roomData.fg, gridX, gridY)) { layerData = roomData.fg; } else if (LevelContent.VerifyTiles(roomData.bg, gridX, gridY)) { layerData = roomData.bg; } // If no tile is cloned, set the current Function Tool to "Select" if (layerData == null) { FuncToolSelect selectFunc = (FuncToolSelect)FuncTool.funcToolMap[(byte)FuncToolEnum.Select]; EditorTools.SetFuncTool(selectFunc); selectFunc.ClearSelection(); return; } // Get the Object from the Highlighted Tile (Search Front to Back until a tile is identified) byte[] tileData = LevelContent.GetTileData(layerData, gridX, gridY); // Identify the tile, and set it as the current editing tool (if applicable) TileTool clonedTool = TileTool.GetTileToolFromTileData(tileData, isObject); if (clonedTool is TileTool == true) { byte subIndex = clonedTool.subIndex; // Need to save this value to avoid subIndexSaves[] tracking. EditorTools.SetTileTool(clonedTool, (byte)clonedTool.index); clonedTool.SetSubIndex(subIndex); } }