protected override void OnLayerSelectionChanged(LayerSelectionChangedEventArgs args)
        {
            base.OnLayerSelectionChanged(args);
            Tileset         tileset      = this.SelectedTileset.Res;
            VisualLayerNode selectedNode = args.SelectedNodeTag as VisualLayerNode;

            // Update global editor selection, so an Object Inspector can pick up the layer for editing
            if (selectedNode != null)
            {
                DualityEditorApp.Select(this, new ObjectSelection(new object[] { selectedNode.VisualLayer }));
            }
            else
            {
                DualityEditorApp.Deselect(this, obj => obj is TilesetRenderInput);
            }

            // Update the TilesetView to show the appropriate layer
            if (tileset != null)
            {
                int layerIndex = (selectedNode != null) ?
                                 tileset.RenderConfig.IndexOf(selectedNode.VisualLayer) :
                                 -1;

                if (layerIndex == -1)
                {
                    layerIndex = 0;
                }

                this.TilesetView.DisplayedConfigIndex = layerIndex;
            }
        }
Example #2
0
        protected override void OnLayerSelectionChanged(LayerSelectionChangedEventArgs args)
        {
            base.OnLayerSelectionChanged(args);

            // There always needs to be a selected collision layer.
            if (args.SelectedNodeTag == null)
            {
                this.SelectLayer(this.layerNodes[0]);
            }
            // Set the internal selected layer index to the one matching the selected node
            else if (args.SelectedNodeTag is CollisionInfoLayerNode)
            {
                this.editLayerIndex = (args.SelectedNodeTag as CollisionInfoLayerNode).LayerIndex;
            }

            this.TilesetView.Invalidate();
        }
Example #3
0
        protected override void OnLayerSelectionChanged(LayerSelectionChangedEventArgs args)
        {
            base.OnLayerSelectionChanged(args);
            Tileset           tileset      = this.SelectedTileset.Res;
            AutoTileInputNode selectedNode = args.SelectedNodeTag as AutoTileInputNode;

            // Update global editor selection, so an Object Inspector can pick up the AutoTile for editing
            if (selectedNode != null)
            {
                DualityEditorApp.Select(this, new ObjectSelection(new object[] { selectedNode.AutoTileInput }));
            }
            else
            {
                DualityEditorApp.Deselect(this, obj => obj is TilesetAutoTileInput);
            }

            this.TilesetView.Invalidate();
        }
Example #4
0
        protected override void OnLayerSelectionChanged(LayerSelectionChangedEventArgs args)
        {
            base.OnLayerSelectionChanged(args);

            if (args.SelectedNodeTag == this.treeNodeOffsetLayer)
            {
                this.editMode = EditMode.Offset;
            }
            else if (args.SelectedNodeTag == this.treeNodeVerticalLayer)
            {
                this.editMode = EditMode.Vertical;
            }
            else
            {
                this.SelectLayer(this.treeNodeOffsetLayer);
            }

            this.TilesetView.Invalidate();
        }
        protected override void OnLayerSelectionChanged(LayerSelectionChangedEventArgs args)
        {
            base.OnLayerSelectionChanged(args);

            if (args.SelectedNodeTag == this.treeNodeOffsetLayer)
                this.editMode = EditMode.Offset;
            else if (args.SelectedNodeTag == this.treeNodeVerticalLayer)
                this.editMode = EditMode.Vertical;
            else
                this.SelectLayer(this.treeNodeOffsetLayer);

            this.TilesetView.Invalidate();
        }
 /// <summary>
 /// Called when the user item selection of the provided <see cref="LayerModel"/> has changed.
 /// </summary>
 protected virtual void OnLayerSelectionChanged(LayerSelectionChangedEventArgs args)
 {
 }
 internal void RaiseOnLayerSelectionChanged(LayerSelectionChangedEventArgs args)
 {
     OnLayerSelectionChanged(args);
 }
        protected override void OnLayerSelectionChanged(LayerSelectionChangedEventArgs args)
        {
            base.OnLayerSelectionChanged(args);
            Tileset tileset = this.SelectedTileset.Res;
            VisualLayerNode selectedNode = args.SelectedNodeTag as VisualLayerNode;

            // Update global editor selection, so an Object Inspector can pick up the layer for editing
            if (selectedNode != null)
                DualityEditorApp.Select(this, new ObjectSelection(new object[] { selectedNode.VisualLayer }));
            else
                DualityEditorApp.Deselect(this, obj => obj is TilesetRenderInput);

            // Update the TilesetView to show the appropriate layer
            if (tileset != null)
            {
                int layerIndex = (selectedNode != null) ?
                    tileset.RenderConfig.IndexOf(selectedNode.VisualLayer) :
                    -1;

                if (layerIndex == -1)
                    layerIndex = 0;

                this.TilesetView.DisplayedConfigIndex = layerIndex;
            }
        }
Example #9
0
        private void layerView_SelectionChanged(object sender, EventArgs e)
        {
            TreeNodeAdv viewNode = this.layerView.SelectedNode;
            LayerSelectionChangedEventArgs args = new LayerSelectionChangedEventArgs(viewNode);

            this.buttonRemoveLayer.Enabled = (viewNode != null);

            if (this.activeMode != null)
                this.activeMode.RaiseOnLayerSelectionChanged(args);
        }
        protected override void OnLayerSelectionChanged(LayerSelectionChangedEventArgs args)
        {
            base.OnLayerSelectionChanged(args);
            Tileset tileset = this.SelectedTileset.Res;
            AutoTileInputNode selectedNode = args.SelectedNodeTag as AutoTileInputNode;

            // Update global editor selection, so an Object Inspector can pick up the AutoTile for editing
            if (selectedNode != null)
                DualityEditorApp.Select(this, new ObjectSelection(new object[] { selectedNode.AutoTileInput }));
            else
                DualityEditorApp.Deselect(this, obj => obj is TilesetAutoTileInput);

            this.TilesetView.Invalidate();
        }
Example #11
0
 /// <summary>
 /// Called when the user item selection of the provided <see cref="LayerModel"/> has changed.
 /// </summary>
 protected virtual void OnLayerSelectionChanged(LayerSelectionChangedEventArgs args)
 {
 }
Example #12
0
 internal void RaiseOnLayerSelectionChanged(LayerSelectionChangedEventArgs args)
 {
     OnLayerSelectionChanged(args);
 }
        protected override void OnLayerSelectionChanged(LayerSelectionChangedEventArgs args)
        {
            base.OnLayerSelectionChanged(args);

            // There always needs to be a selected collision layer.
            if (args.SelectedNodeTag == null)
                this.SelectLayer(this.layerNodes[0]);
            // Set the internal selected layer index to the one matching the selected node
            else if (args.SelectedNodeTag is CollisionInfoLayerNode)
                this.editLayerIndex = (args.SelectedNodeTag as CollisionInfoLayerNode).LayerIndex;

            this.TilesetView.Invalidate();
        }