Inheritance: CellSurface, IInput
コード例 #1
0
ファイル: FilesPanel.cs プロジェクト: Thraka/SadConsoleEditor
        public override int Redraw(SadConsole.Controls.ControlBase control)
        {
            if (control == NewButton)
            {
                NewButton.Position = new Point(1, NewButton.Position.Y);
            }
            else if (control == LoadButton)
            {
                LoadButton.Position = new Point(NewButton.Bounds.Right + 2, NewButton.Position.Y);
            }
            else if (control == SaveButton)
            {
                SaveButton.Position = new Point(1, SaveButton.Position.Y);
            }
            else if (control == ResizeButton)
            {
                ResizeButton.Position = new Point(SaveButton.Bounds.Right + 2, SaveButton.Position.Y);
                return(-1);
            }
            else if (control == CloseButton)
            {
                CloseButton.Position = new Point(ResizeButton.Bounds.Right + 2, SaveButton.Position.Y);
            }
            else if (control == documentsTitle)
            {
                return(1);
            }

            return(0);
        }
コード例 #2
0
        public BoxToolPanel()
        {
            Title = "Settings";

            fillBoxOption = new CheckBox(18, 1);
            fillBoxOption.Text = "Fill";

            useCharBorder = new CheckBox(18, 1);
            useCharBorder.Text = "Char. Border";
            useCharBorder.IsSelectedChanged += (s, o) => { characterPicker.IsVisible = useCharBorder.IsSelected; EditorConsoleManager.ToolsPane.RedrawPanels(); };

            lineForeColor = new Controls.ColorPresenter("Border Fore", Settings.Green, 18);
            lineForeColor.SelectedColor = Color.White;

            lineBackColor = new Controls.ColorPresenter("Border Back", Settings.Green, 18);
            lineBackColor.SelectedColor = Color.Black;

            fillColor = new Controls.ColorPresenter("Fill Color", Settings.Green, 18);
            fillColor.SelectedColor = Color.Black;

            characterPicker = new Controls.CharacterPicker(Settings.Red, Settings.Color_ControlBack, Settings.Green);
            characterPicker.IsVisible = false;

            Controls = new ControlBase[] { lineForeColor, lineBackColor, fillColor, fillBoxOption, useCharBorder, characterPicker };
        }
コード例 #3
0
        public override int Redraw(ControlBase control)
        {
            if (control == skipEmptyColor)
                return 1;

            return 0;
        }
コード例 #4
0
        public CircleToolPanel()
        {
            Title = "Circle Status";

            statusBox = new DrawingSurface(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 2);
            RedrawBox();
            Controls = new ControlBase[] { statusBox };
        }
コード例 #5
0
        public HotspotToolPanel()
        {
            Title = "Hotspots";

            hotspotsListbox = new ListBox<HotspotListBoxItem>(Consoles.ToolPane.PanelWidthControls, 7);
            createButton = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            editButton = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            deleteButton = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            exportListButton = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            cloneHotspot = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            importListButton = new Button(Consoles.ToolPane.PanelWidthControls, 1);

            hotspotsListbox.SelectedItemChanged += hotspotsListbox_SelectedItemChanged;
            createButton.ButtonClicked += _createNewObjectButton_ButtonClicked;
            editButton.ButtonClicked += _editObjectButton_ButtonClicked;
            deleteButton.ButtonClicked += _deleteObjectButton_ButtonClicked;
            exportListButton.ButtonClicked += _exportListButton_ButtonClicked;
            cloneHotspot.ButtonClicked += CloneHotspot_ButtonClicked;
            importListButton.ButtonClicked += ImportListButton_ButtonClicked;

            editButton.IsEnabled = false;
            deleteButton.IsEnabled = false;
            cloneHotspot.IsEnabled = false;

            hotspotsListbox.HideBorder = true;

            createButton.Text = "Define New";
            editButton.Text = "Edit";
            deleteButton.Text = "Delete";
            exportListButton.Text = "Export";
            cloneHotspot.Text = "Clone";
            importListButton.Text = "Import";

            drawHotspotsCheckbox = new CheckBox(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            drawHotspotsCheckbox.IsSelected = true;
            drawHotspotsCheckbox.Text = "Draw hotspots";

            Controls = new ControlBase[] { createButton, null, hotspotsListbox, null, editButton, cloneHotspot, deleteButton, null, exportListButton, importListButton, null, drawHotspotsCheckbox };

            // Load the known object types.
            //if (System.IO.File.Exists(Settings.FileObjectTypes))
            //{
            //    using (var fileObject = System.IO.File.OpenRead(Settings.FileObjectTypes))
            //    {
            //        var serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(typeof(GameObject[]));

            //        var gameObjects = serializer.ReadObject(fileObject) as GameObject[];

            //        foreach (var item in gameObjects)
            //        {
            //            var newItem = new GameObjectMeta(item, true);
            //            hotspotsListbox.Items.Add(newItem);
            //        }
            //    }
            //}

            exportListButton.IsEnabled = hotspotsListbox.Items.Count != 0;
        }
コード例 #6
0
 public override int Redraw(ControlBase control)
 {
     if (control == setName)
     {
         control.Position = new Microsoft.Xna.Framework.Point(Consoles.ToolPane.PanelWidth - setName.Width - 1, control.Position.Y);
         return -1;
     }
     return 0;
 }
コード例 #7
0
        public override int Redraw(SadConsole.Controls.ControlBase control)
        {
            if (control == changeSpeedButton)
            {
                animationSpeedLabel.Fill(Settings.Green, Settings.Color_MenuBack, 0, null);
                animationSpeedLabel.Print(0, 0, new ColoredString("Speed: ", Settings.Green, Settings.Color_MenuBack) + new ColoredString(((AnimatedSurface)animations.SelectedItem).AnimationDuration.ToString(), Settings.Blue, Settings.Color_MenuBack));
                changeSpeedButton.Position = new Microsoft.Xna.Framework.Point(Consoles.ToolPane.PanelWidth - changeSpeedButton.Width - 1, animationSpeedLabel.Position.Y);
            }

            return(0);
        }
コード例 #8
0
        public RecolorToolPanel()
        {
            ignoreBackCheck = new CheckBox(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            ignoreBackCheck.Text = "Ignore Back";

            ignoreForeCheck = new CheckBox(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            ignoreForeCheck.Text = "Ignore Fore";

            Title = "Recolor Options";

            Controls = new ControlBase[] { ignoreForeCheck, ignoreBackCheck };
        }
コード例 #9
0
ファイル: ToolsPanel.cs プロジェクト: Thraka/SadConsoleEditor
        public ToolsPanel()
        {
            Title = "Tools";

            ToolsListBox = new ListBox(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 7);
            ToolsListBox.HideBorder = true;
            ToolsListBox.CanUseKeyboard = false;

            ToolsListBox.SelectedItemChanged += ToolsListBox_SelectedItemChanged;

            Controls = new ControlBase[] { ToolsListBox };
        }
コード例 #10
0
        public AnimationFramesPanel(Action<TextSurfaceBasic> frameChangeCallback)
        {
            Title = "Frames";

            removeSelected = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            removeSelected.Text = "Remove";
            removeSelected.ButtonClicked += removeSelected_ButtonClicked;

            moveSelectedUp = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            moveSelectedUp.Text = "Move Up";
            moveSelectedUp.ButtonClicked += moveSelectedUp_ButtonClicked;

            moveSelectedDown = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            moveSelectedDown.Text = "Move Down";
            moveSelectedDown.ButtonClicked += moveSelectedDown_ButtonClicked;

            addNewFrame = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            addNewFrame.Text = "Add New";
            addNewFrame.ButtonClicked += addNewFrame_ButtonClicked;

            addNewFrameFromFile = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            addNewFrameFromFile.Text = "Load From File";
            addNewFrameFromFile.ButtonClicked += addNewFrameFromFile_ButtonClicked;

            saveFrameToFile = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            saveFrameToFile.Text = "Save Frame to File";
            saveFrameToFile.ButtonClicked += saveFrameToFile_ButtonClicked;

            clonePreviousFrame = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            clonePreviousFrame.Text = "Copy prev. frame";
            clonePreviousFrame.ButtonClicked += clonePreviousFrame_ButtonClicked;

            // Frames area
            framesCounterBox = new DrawingSurface(Consoles.ToolPane.PanelWidthControls, 1);

            nextFrame = new Button(4, 1);
            nextFrame.Text = ">>";
            nextFrame.ShowEnds = false;
            nextFrame.ButtonClicked += nextFrame_ButtonClicked;

            previousFrame = new Button(4, 1);
            previousFrame.Text = "<<";
            previousFrame.ShowEnds = false;
            previousFrame.ButtonClicked += previousFrame_ButtonClicked;

            this.frameChangeCallback = frameChangeCallback;

            Controls = new ControlBase[] { framesCounterBox, previousFrame, nextFrame, removeSelected, addNewFrame, clonePreviousFrame, moveSelectedUp, moveSelectedDown, addNewFrameFromFile, saveFrameToFile};
        }
コード例 #11
0
        public SelectionToolAltPanel()
        {
            Title = "Sel.Rect Options";

            skipEmptyColor = new CheckBox(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            skipEmptyColor.Text = "Skip Empty";

            altEmptyColorCheck = new CheckBox(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            altEmptyColorCheck.Text = "Use Alt. Empty";

            altEmptyColor = new Controls.ColorPresenter("Alt. Empty Clr", Settings.Green, 18);
            altEmptyColor.SelectedColor = Color.Black;

            Controls = new ControlBase[] { skipEmptyColor, altEmptyColorCheck, altEmptyColor };
        }
コード例 #12
0
        public GameObjectManagementPanel()
        {
            Title = "Entities";
            GameObjectList = new ListBox<EntityListBoxItem>(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 4);
            GameObjectList.HideBorder = true;
            GameObjectList.SelectedItemChanged += GameObject_SelectedItemChanged;
            GameObjectList.CompareByReference = true;

            removeSelected = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            removeSelected.Text = "Remove";
            removeSelected.ButtonClicked += RemoveSelected_ButtonClicked;

            moveSelectedUp = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            moveSelectedUp.Text = "Move Up";
            moveSelectedUp.ButtonClicked += MoveSelectedUp_ButtonClicked;

            moveSelectedDown = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            moveSelectedDown.Text = "Move Down";
            moveSelectedDown.ButtonClicked += MoveSelectedDown_ButtonClicked;

            renameLayer = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            renameLayer.Text = "Rename";
            renameLayer.ButtonClicked += RenameEntity_ButtonClicked;

            importGameObject = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            importGameObject.Text = "Import File";
            importGameObject.ButtonClicked += ImportEntity_ButtonClicked;

            drawGameObjectsCheckbox = new CheckBox(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            drawGameObjectsCheckbox.IsSelected = true;
            drawGameObjectsCheckbox.Text = "Draw Objects";

            animationListTitle = new DrawingSurface(Consoles.ToolPane.PanelWidthControls, 2);
            animationListTitle.Print(0, 0, "Animations", Settings.Green);

            animationsListBox = new ListBox<AnimationListBoxItem>(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 4);
            animationsListBox.SelectedItemChanged += AnimationList_SelectedItemChanged;
            animationsListBox.HideBorder = true;
            animationsListBox.CompareByReference = true;

            playAnimationButton = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            playAnimationButton.Text = "Play Animation";
            playAnimationButton.ButtonClicked += (o, e) => { if (animationsListBox.SelectedItem != null) ((AnimatedTextSurface)animationsListBox.SelectedItem).Restart(); };

            Controls = new ControlBase[] { GameObjectList, removeSelected, moveSelectedUp, moveSelectedDown, renameLayer, importGameObject, null, drawGameObjectsCheckbox, null, animationListTitle,animationsListBox, null, playAnimationButton };

            GameObject_SelectedItemChanged(null, null);
        }
コード例 #13
0
        public RegionManagementPanel()
        {
            Title = "Zones";
            GameObjectList = new ListBox<EntityListBoxItem>(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 4);
            GameObjectList.HideBorder = true;
            GameObjectList.SelectedItemChanged += GameObject_SelectedItemChanged;
            GameObjectList.CompareByReference = true;

            removeSelected = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            removeSelected.Text = "Remove";
            removeSelected.ButtonClicked += RemoveSelected_ButtonClicked;

            moveSelectedUp = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            moveSelectedUp.Text = "Move Up";
            moveSelectedUp.ButtonClicked += MoveSelectedUp_ButtonClicked;

            moveSelectedDown = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            moveSelectedDown.Text = "Move Down";
            moveSelectedDown.ButtonClicked += MoveSelectedDown_ButtonClicked;

            renameZoneButton = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            renameZoneButton.Text = "Rename";
            renameZoneButton.ButtonClicked += RenameZone_ButtonClicked;

            addZoneButton = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            addZoneButton.Text = "Add New";
            addZoneButton.ButtonClicked += AddZone_ButtonClicked;

            editSettings = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            editSettings.Text = "Edit Settings";
            editSettings.ButtonClicked += EditSettings_ButtonClicked;

            zoneColorPresenter = new SadConsoleEditor.Controls.ColorPresenter("Zone Color", Settings.Green, SadConsoleEditor.Consoles.ToolPane.PanelWidthControls);
            zoneColorPresenter.SelectedColor = Color.Aqua;
            zoneColorPresenter.IsEnabled = false;
            zoneColorPresenter.ColorChanged += ZoneColorPresenter_ColorChanged;

            drawZonesCheckbox = new CheckBox(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            drawZonesCheckbox.IsSelected = true;
            drawZonesCheckbox.Text = "Draw zones";

            propertySurface = new DrawingSurface(Consoles.ToolPane.PanelWidthControls, 2);

            Controls = new ControlBase[] { addZoneButton, null, GameObjectList, removeSelected, moveSelectedUp, moveSelectedDown, renameZoneButton, editSettings, null, drawZonesCheckbox, null, zoneColorPresenter, propertySurface };

            GameObject_SelectedItemChanged(null, null);
        }
コード例 #14
0
ファイル: FilesPanel.cs プロジェクト: Thraka/SadConsoleEditor
        public FilesPanel()
        {
            Title = "File";

            NewButton = new Button(7, 1)
            {
                Text = "New",
                CanUseKeyboard = false,
            };
            NewButton.ButtonClicked += (o, e) => EditorConsoleManager.ShowNewEditorPopup();

            LoadButton = new Button(8, 1)
            {
                Text = "Load",
            };
            LoadButton.ButtonClicked += (o, e) => EditorConsoleManager.ShowLoadEditorPopup();

            SaveButton = new Button(8, 1)
            {
                Text = "Save",
            };
            SaveButton.ButtonClicked += (o, e) => EditorConsoleManager.SaveEditor();

            ResizeButton = new Button(10, 1)
            {
                Text = "Resize",
            };
            ResizeButton.ButtonClicked += (o, e) => EditorConsoleManager.ShowResizeEditorPopup();

            CloseButton = new Button(9, 1)
            {
                Text = "Close",
            };
            CloseButton.ButtonClicked += (o, e) => EditorConsoleManager.ShowCloseConsolePopup();

            DocumentsListbox = new ListBox<EditorListBoxItem>(Consoles.ToolPane.PanelWidthControls, 6);
            DocumentsListbox.HideBorder = true;
            DocumentsListbox.CompareByReference = true;

            DocumentsListbox.SelectedItemChanged += DocumentsListbox_SelectedItemChanged;

            documentsTitle = new DrawingSurface(13, 1);
            documentsTitle.Fill(Settings.Green, Settings.Color_MenuBack, 0, null);
            documentsTitle.Print(0, 0, new ColoredString("Opened Files", Settings.Green, Settings.Color_MenuBack));

            Controls = new ControlBase[] { NewButton, LoadButton, SaveButton, ResizeButton, CloseButton, documentsTitle, DocumentsListbox };
        }
コード例 #15
0
        public LayersPanel()
        {
            Title = "Layers";
            layers = new ListBox<LayerListBoxItem>(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 4);
            layers.HideBorder = true;
            layers.SelectedItemChanged += layers_SelectedItemChanged;
            layers.CompareByReference = true;

            removeSelected = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            removeSelected.Text = "Remove";
            removeSelected.ButtonClicked += removeSelected_ButtonClicked;

            moveSelectedUp = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            moveSelectedUp.Text = "Move Up";
            moveSelectedUp.ButtonClicked += moveSelectedUp_ButtonClicked;

            moveSelectedDown = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            moveSelectedDown.Text = "Move Down";
            moveSelectedDown.ButtonClicked += moveSelectedDown_ButtonClicked;

            toggleHideShow = new CheckBox(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            toggleHideShow.Text = "Show/Hide";
            toggleHideShow.TextAlignment = System.Windows.HorizontalAlignment.Center;
            toggleHideShow.IsSelectedChanged += toggleHideShow_IsSelectedChanged;

            addNewLayer = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            addNewLayer.Text = "Add New";
            addNewLayer.ButtonClicked += addNewLayer_ButtonClicked;

            renameLayer = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            renameLayer.Text = "Rename";
            renameLayer.ButtonClicked += renameLayer_ButtonClicked;

            addNewLayerFromFile = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            addNewLayerFromFile.Text = "Load From File";
            addNewLayerFromFile.ButtonClicked += addNewLayerFromFile_ButtonClicked;

            saveLayerToFile = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            saveLayerToFile.Text = "Save Layer to File";
            saveLayerToFile.ButtonClicked += saveLayerToFile_ButtonClicked;

            Controls = new ControlBase[] { layers, toggleHideShow, removeSelected, moveSelectedUp, moveSelectedDown, addNewLayer, renameLayer, addNewLayerFromFile, saveLayerToFile };
        }
コード例 #16
0
        public GameObjectNamePanel()
        {
            Title = "Game Object";

            nameTitle = new DrawingSurface(Consoles.ToolPane.PanelWidth - 3, 2);

            setName = new Button(3, 1);
            setName.ShowEnds = false;
            setName.Text = "Set";

            setName.ButtonClicked += (s, e) =>
            {
                Windows.RenamePopup rename = new Windows.RenamePopup(entity.Name);
                rename.Closed += (s2, e2) => { if (rename.DialogResult) entity.Name = rename.NewName; PrintName(); };
                rename.Center();
                rename.Show(true);
            };

            Controls = new ControlBase[] { setName, nameTitle };
        }
コード例 #17
0
        public override int Redraw(SadConsole.Controls.ControlBase control)
        {
            if (control == characterPicker)
            {
                characterPicker.Position = new Point(characterPicker.Position.X + 1, characterPicker.Position.Y);
            }

            if (control == useCharBorder)
            {
                return(1);
            }

            if (control != fillColor)
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }
コード例 #18
0
 /// <summary>
 /// Called when the tool pane redraws this pane on itself.
 /// </summary>
 /// <param name="control">The control being positioned during redraw.</param>
 /// <returns>Additional rows this redraw will use. Tools pane assumes the size of control + 1.</returns>
 public abstract int Redraw(ControlBase control);
コード例 #19
0
        public override int Redraw(ControlBase control)
        {
            if (control == saveBrush || control == move)
            {
                return 1;
            }

            return 0;
        }
コード例 #20
0
        public SelectionToolPanel(Action<TextSurface> loadBrushHandler, Func<TextSurface> saveBrushHandler)
        {
            reset = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            reset.Text = "Reset Steps";
            reset.ButtonClicked += (o, e) => State = CloneState.SelectingPoint1;

            loadBrush = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            loadBrush.Text = "Import Brush";
            loadBrush.ButtonClicked += _loadBrush_ButtonClicked;

            saveBrush = new Button(SadConsoleEditor.Consoles.ToolPane.PanelWidthControls, 1);
            saveBrush.Text = "Export Brush";
            saveBrush.ButtonClicked += _saveBrush_ButtonClicked;

            clone = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            clone.Text = "Clone";
            clone.ButtonClicked += clone_ButtonClicked;

            clear = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            clear.Text = "Clear";
            clear.ButtonClicked += clear_ButtonClicked;

            move = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            move.Text = "Move";
            move.ButtonClicked += move_ButtonClicked;

            Controls = new ControlBase[] { reset, loadBrush, saveBrush, clone, clear, move };

            this.loadBrushHandler = loadBrushHandler;
            this.saveBrushHandler = saveBrushHandler;

            Title = "Clone";
            State = CloneState.SelectingPoint1;
        }
コード例 #21
0
 public override int Redraw(ControlBase control)
 {
     return 0;
 }
コード例 #22
0
 public override int Redraw(SadConsole.Controls.ControlBase control)
 {
     return(control == GameObjectList ? 1 : 0);
 }
コード例 #23
0
 public override int Redraw(SadConsole.Controls.ControlBase control)
 {
     return(control == layers || control == toggleHideShow ? 1 : 0);
 }
コード例 #24
0
        public override int Redraw(ControlBase control)
        {
            if (control == framesCounterBox)
            {
                DrawFrameCount();
            }
            else if (control == nextFrame)
            {
                nextFrame.Position = new Microsoft.Xna.Framework.Point(previousFrame.Position.X + previousFrame.Width + 1, previousFrame.Position.Y);
                return 0;
            }

            else if (control == moveSelectedDown || control == addNewFrame)
                return 1;

            return 0;
        }
コード例 #25
0
        public override int Redraw(ControlBase control)
        {
            if (control == _characterPicker)
                control.Position = new Point(2, control.Position.Y + 1);

            return 0;
        }
コード例 #26
0
        public AnimationsPanel(Action<AnimatedTextSurface> animationChangeCallback)
        {
            Title = "Animations";
            animations = new ListBox(Consoles.ToolPane.PanelWidthControls, 4);
            animations.HideBorder = true;
            animations.SelectedItemChanged += animations_SelectedItemChanged;
            animations.CompareByReference = true;

            removeSelected = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            removeSelected.Text = "Remove";
            removeSelected.ButtonClicked += removeAnimation_ButtonClicked;

            addNewAnimation = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            addNewAnimation.Text = "Add New";
            addNewAnimation.ButtonClicked += addNewAnimation_ButtonClicked;

            renameAnimation = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            renameAnimation.Text = "Rename";
            renameAnimation.ButtonClicked += renameAnimation_ButtonClicked;

            addNewAnimationFromFile = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            addNewAnimationFromFile.Text = "Import Anim.";
            addNewAnimationFromFile.ButtonClicked += addNewAnimationFromFile_ButtonClicked;

            saveAnimationToFile = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            saveAnimationToFile.Text = "Export Anim.";
            saveAnimationToFile.ButtonClicked += saveAnimationToFile_ButtonClicked;

            changeSpeedButton = new Button(3, 1);
            changeSpeedButton.ShowEnds = false;
            changeSpeedButton.Text = "Set";
            changeSpeedButton.ButtonClicked += changeSpeedButton_ButtonClicked;

            cloneSelectedAnimationButton = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            cloneSelectedAnimationButton.Text = "Clone Sel. Anim";
            cloneSelectedAnimationButton.ButtonClicked += cloneSelectedAnimation_ButtonClicked;

            reverseAnimationButton = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            reverseAnimationButton.Text = "Reverse Animation";
            reverseAnimationButton.ButtonClicked += reverseAnimation_ButtonClicked; ;

            setCenterButton = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            setCenterButton.Text = "Set Center";
            setCenterButton.ButtonClicked += (s, e) => invokeCustomToolCallback(CustomTool.Center);

            setBoundingBoxButton = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            setBoundingBoxButton.Text = "Set Collision";
            setBoundingBoxButton.ButtonClicked += (s, e) => invokeCustomToolCallback(CustomTool.CollisionBox);

            animationSpeedLabel = new DrawingSurface(Consoles.ToolPane.PanelWidthControls - changeSpeedButton.Width, 1);

            repeatCheck = new CheckBox(Consoles.ToolPane.PanelWidthControls, 1);
            repeatCheck.Text = "Repeat";
            repeatCheck.IsSelectedChanged += repeatCheck_IsSelectedChanged;

            playPreview = new Button(Consoles.ToolPane.PanelWidthControls, 1);
            playPreview.Text = "Play Preview";
            playPreview.ButtonClicked += playPreview_ButtonClicked; ;

            this.animationChangeCallback = animationChangeCallback;
            //_invokeCustomToolCallback = invokeCustomToolCallback;

            Controls = new ControlBase[] { animations, null, removeSelected, addNewAnimation, renameAnimation, cloneSelectedAnimationButton, null, addNewAnimationFromFile, saveAnimationToFile, null, playPreview, null, animationSpeedLabel, changeSpeedButton, repeatCheck, null, reverseAnimationButton };
        }
コード例 #27
0
 public override int Redraw(SadConsole.Controls.ControlBase control)
 {
     return(0);
 }