public override void Trigger(bool IsRedo)
        {
            Widgets.LayerPanel LayerPanel = Editor.MainWindow.MapWidget.MapViewerTiles.LayerPanel;
            bool MoveUp = this.MovedUp == IsRedo;

            if (MoveUp)
            {
                LayerPanel.MoveLayerUp(LayerIndex - 1, true);
            }
            else
            {
                LayerPanel.MoveLayerDown(LayerIndex + 1, true);
            }
        }
Esempio n. 2
0
        public MapViewerTiles(IContainer Parent) : base(Parent)
        {
            GridLayout.Columns.Add(new GridSize(288, Unit.Pixels));
            GridLayout.UpdateContainers();

            // Right sidebar
            Grid sidebargrid = new Grid(GridLayout);

            sidebargrid.SetGrid(0, 1, 2, 2);
            sidebargrid.SetRows(new GridSize(5), new GridSize(2, Unit.Pixels), new GridSize(2));
            sidebargrid.SetColumns(new GridSize(1));

            // Tileset part of right sidebar
            TilesPanel = new TilesPanel(sidebargrid);
            TilesPanel.SetBackgroundColor(28, 50, 73);
            TilesPanel.MapViewer = this;
            Editor.MainWindow.MapWidget.TilesPanel = TilesPanel;

            // Inner right sidebar divider
            Widget InnerRightSidebarDivider = new Widget(sidebargrid);

            InnerRightSidebarDivider.SetBackgroundColor(10, 23, 37);
            InnerRightSidebarDivider.SetGridRow(1);

            // Layers part of right sidebar
            LayerPanel = new LayerPanel(sidebargrid);
            LayerPanel.SetBackgroundColor(28, 50, 73);
            LayerPanel.SetGridRow(2);
            LayerPanel.MapViewer = this;
            Editor.MainWindow.MapWidget.LayerPanel = LayerPanel;

            SelectionBackground = new SelectionBackground(MainContainer);
            SelectionBackground.SetZIndex(2);

            Cursor = new CursorWidget(MainContainer);
            Cursor.ConsiderInAutoScrollCalculation = false;
            Cursor.SetZIndex(6);

            RegisterShortcuts(new List <Shortcut>()
            {
                new Shortcut(this, new Key(Keycode.ESCAPE), CancelSelection)
            });
        }