コード例 #1
0
        void OnEditModeSelected(GUIDropDown dropDown, GUIDropDownButton btn)
        {
            EditorToolType mode = (EditorToolType)btn.Index;

            SetToolType(mode);
            screen.WorldEditor.SetToolType(mode);
        }
コード例 #2
0
        private void SwitchTool(EditorToolType tool)
        {
            EditorTool currentTool = new EditorTool()
            {
                Tool = tool, TextureUVFixer = _editor.Tool.TextureUVFixer, GridSize = _editor.Tool.GridSize
            };

            _editor.Tool = currentTool;
        }
コード例 #3
0
 public EditorTool(EditorScreen screen, WorldEditor editor,
                   EditorToolType type, Key keyBind)
 {
     Renderer = screen.Window.Renderer;
     Editor   = editor;
     UI       = screen.UI;
     Screen   = screen;
     Type     = type;
     KeyBind  = keyBind;
 }
コード例 #4
0
        public void SetToolType(EditorToolType mode)
        {
            for (int i = 0; i < editModeButtons.Length; i++)
            {
                editModeButtons[i].Toggled = false;
            }

            editModeButtons[(int)mode].Toggled = true;
            currentToolLabel.Text = string.Format("Current Tool: {0}", mode);
        }
コード例 #5
0
        public TerrainEditorTool(EditorScreen screen, WorldEditor editor,
                                 EditorToolType type, Key keyBind)
            : base(screen, editor, type, keyBind)
        {
            TerrainEditor = Editor.TerrainEditor;
            entRenderer   = Renderer.GetRenderer3D <EntityRenderer>();

            if (cursorCube == null)
            {
                cursorCube = new DebugCube(Color4.White, Block.CUBE_SIZE);
            }
        }
コード例 #6
0
        public void SetToolType(EditorToolType type)
        {
            EditorTool tool;

            if (tools.TryGetValue(type, out tool))
            {
                EquipTool(tool);
            }
            else
            {
                throw new ArgumentException("No such terrain tool of type '" + type.ToString() + "' is defined!");
            }
        }