コード例 #1
0
ファイル: FuncToolBlueprint.cs プロジェクト: tarsupin/Nexus
        private void SwitchToSelectTool()
        {
            this.ClearBlueprint();
            FuncToolSelect selectFunc = (FuncToolSelect)FuncTool.funcToolMap[(byte)FuncToolEnum.Select];

            EditorTools.SetFuncTool(selectFunc);
        }
コード例 #2
0
ファイル: FuncToolSelect.cs プロジェクト: tarsupin/Nexus
        private void EndSelection()
        {
            this.activity = SelectActivity.HasSelection;

            // If we're currently using selection as a temporary tool, force it to be an active tool now that we have a selected area.
            if (EditorTools.tempTool is FuncToolSelect)
            {
                EditorTools.SetFuncTool(this);
            }
        }
コード例 #3
0
ファイル: EditorScene.cs プロジェクト: tarsupin/Nexus
        public override void StartScene()
        {
            // Set Default Tool to Selection Tool
            EditorTools.SetFuncTool(FuncTool.funcToolMap[(byte)FuncToolEnum.Select]);

            // Important Components
            Systems.camera.UpdateScene(this.CurrentRoom);
            Systems.camera.SetInputMoveSpeed(15);

            UIHandler.SetMouseVisible(true);
            Cursor.UpdateMouseState();

            // End Music
            Systems.music.StopMusic();
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
ファイル: FuncToolSelect.cs プロジェクト: tarsupin/Nexus
        private void RunCopyOrCut(EditorRoomScene scene, bool cut)
        {
            // Set the Blueprint FuncTool as active.
            FuncToolBlueprint bpFunc = (FuncToolBlueprint)FuncTool.funcToolMap[(byte)FuncToolEnum.Blueprint];

            EditorTools.SetFuncTool(bpFunc);

            // Handle Offsets
            sbyte xOffset = 0;
            sbyte yOffset = 0;

            short left   = this.xStart <= this.xEnd ? this.xStart : this.xEnd;
            short top    = this.yStart <= this.yEnd ? this.yStart : this.yEnd;
            short right  = this.xStart <= this.xEnd ? this.xEnd : this.xStart;
            short bottom = this.yStart <= this.yEnd ? this.yEnd : this.yStart;

            if (Cursor.TileGridX >= left && Cursor.TileGridX <= right)
            {
                xOffset = (sbyte)(left - Cursor.TileGridX);
            }
            if (Cursor.TileGridY >= top && Cursor.TileGridY <= bottom)
            {
                yOffset = (sbyte)(top - Cursor.TileGridY);
            }

            // Load Blueprint Tiles
            bpFunc.PrepareBlueprint(scene, this.xStart, this.yStart, this.xEnd, this.yEnd, xOffset, yOffset);

            // If the selection was cut, remove the tiles:
            if (cut)
            {
                this.CutTiles(scene);
            }

            this.ClearSelection();
        }
コード例 #6
0
 public override void ActivateFuncButton()
 {
     EditorTools.SetFuncTool(FuncTool.funcToolMap[(byte)FuncToolEnum.Select]);
     GameValues.LastAction = "EditorSelectTool";
 }