Esempio n. 1
0
        //-----------------------------------------------------------------------------
        // Constructor
        //-----------------------------------------------------------------------------
        public EditorForm()
        {
            InitializeComponent();

            // Create the editor control instance.
            editorControl = new EditorControl(this);

            // Initialize world tree view.
            worldTreeView.EditorControl = editorControl;

            // Initialize property grid.
            propertyGrid.Initialize(editorControl);

            // Create the level display.
            levelDisplay				= new LevelDisplay();
            levelDisplay.EditorControl	= editorControl;
            levelDisplay.Name			= "levelDisplay";
            levelDisplay.Dock			= DockStyle.Fill;
            levelDisplay.EditorForm		= this;
            panelWorld.Controls.Add(this.levelDisplay);

            // Create the tileset display.
            tileDisplay					= new TileDisplay();
            tileDisplay.EditorControl	= editorControl;
            tileDisplay.Name			= "tileDisplay";
            tileDisplay.Dock			= DockStyle.Fill;
            tileDisplay.EditorForm		= this;
            panelTiles2.Controls.Add(tileDisplay);

            activeControl = null;
            objectEditorForm = null;

            statusLabelTask.Text = null;

            // Setup layer combo-box.
            this.comboBoxWorldLayer.Items.Add("Layer 1");
            this.comboBoxWorldLayer.Items.Add("Layer 2");
            this.comboBoxWorldLayer.Items.Add("Layer 3");
            this.comboBoxWorldLayer.Items.Add("Events");
            this.comboBoxWorldLayer.SelectedIndex = 0;

            // Create tools.
            this.toolButtons = new ToolStripButton[] {
                buttonToolPointer,
                buttonToolPlace,
                buttonToolSquare,
                buttonToolFill,
                buttonToolSelection,
                buttonToolEyedropper
            };

            // Add hotkeys.
            hotKeyCommands = new Dictionary<Keys, HotKeyAction>();
            hotKeyCommands.Add(Keys.PageUp, delegate() { cycleLayerUpToolStripMenuItem_Click(null, null); });
            hotKeyCommands.Add(Keys.PageDown, delegate() { cycleLayerUpToolStripMenuItem1_Click(null, null); });
            hotKeyCommands.Add(Keys.M, delegate() { buttonTool_Click(this.buttonToolPointer, null); });
            hotKeyCommands.Add(Keys.P, delegate() { buttonTool_Click(this.buttonToolPlace, null); });
            hotKeyCommands.Add(Keys.O, delegate() { buttonTool_Click(this.buttonToolSquare, null); });
            hotKeyCommands.Add(Keys.F, delegate() { buttonTool_Click(this.buttonToolFill, null); });
            hotKeyCommands.Add(Keys.S, delegate() { buttonTool_Click(this.buttonToolSelection, null); });
            hotKeyCommands.Add(Keys.K, delegate() { buttonTool_Click(this.buttonToolEyedropper, null); });
        }
 public void Initialize(ObjectEditor objectEditor)
 {
     this.objectEditor = objectEditor;
 }
Esempio n. 3
0
        //-----------------------------------------------------------------------------
        // Methods
        //-----------------------------------------------------------------------------
        public void OpenObjectPropertiesEditor(IPropertyObject propertyObject)
        {
            if (propertyObject != null) {
                editorControl.OpenObjectProperties(propertyObject);

                if (objectEditorForm == null || objectEditorForm.IsDisposed) {
                    objectEditorForm = new ObjectEditor(editorControl);
                    objectEditorForm.SetObject(propertyObject);
                    objectEditorForm.Show(this);
                }
                else {
                    objectEditorForm.SetObject(propertyObject);
                }
            }
        }
Esempio n. 4
0
 public void Initialize(ObjectEditor objectEditor)
 {
     this.objectEditor = objectEditor;
 }