Exemplo n.º 1
0
        private void menuItemTilePalette_Click(object sender, EventArgs e)
        {
            TilemapToolSourcePalette palette = this.PushTilePalette();

            if (palette.Pane != null)
            {
                palette.Pane.Activate();
                palette.Focus();
            }
        }
Exemplo n.º 2
0
        private TilemapToolSourcePalette RequestTilePalette()
        {
            // Create a new tile palette, if none is available right now
            if (this.tilePalette == null || this.tilePalette.IsDisposed)
            {
                this.tilePalette = new TilemapToolSourcePalette();
                this.tilePalette.VisibleChanged += this.tilePalette_VisibleChanged;
                this.tilePalette.HideOnClose     = true;

                // If there are cached settings available, apply them to the new palette
                if (this.tilePaletteSettings != null)
                {
                    this.tilePalette.LoadUserData(this.tilePaletteSettings);
                }
            }

            // If we're not creating it as part of the loading procedure, add it to the main docking layout directly
            if (!this.isLoading)
            {
                this.tilePalette.Show(DualityEditorApp.MainForm.MainDockPanel);
            }

            return(this.tilePalette);
        }