Esempio n. 1
0
        private void toolNew_Click(object sender, EventArgs e)
        {
            MapEditorManager.IgnoreInput = true;

            frmProperty dialog = new frmProperty();
            DialogResult result = dialog.ShowDialog(this);
            if (result == DialogResult.Cancel)
                return;

            Map newMap = MapEditorManager.ApplyMapProperties(dialog.Map);
            newMap.Texture = MapEditorManager.GameInstance.Engine.TextureManager.GetTexture(newMap.TextureName);
            newMap = MapEditorManager.ResizeMap(newMap, dialog.NewMapSize);

            MapEditorManager.SetCurrentMap(newMap);

            this.DisplayMapProperties(newMap);
            this.DisplayTileSheet(newMap);

            this.currentmaplocation = null;

            MapEditorManager.IgnoreInput = false;
        }
Esempio n. 2
0
        private void btnMapProperties_Click(object sender, EventArgs e)
        {
            if (MapEditorManager.CurrentMap != null)
            {
                frmProperty dialog = new frmProperty(MapEditorManager.CurrentMap);
                var result = dialog.ShowDialog(this);

                if (result == DialogResult.OK)
                {
                    MapEditorManager.ApplyMapProperties(MapEditorManager.CurrentMap);
                    if (dialog.NewMapSize != dialog.LastMapSize)
                    {
                        var tmpmap = MapEditorManager.ResizeMap(MapEditorManager.CurrentMap, dialog.NewMapSize);
                        MapEditorManager.SetCurrentMap(tmpmap);
                    }

                    this.DisplayMapProperties(MapEditorManager.CurrentMap);

                    this.UpdateScrollBars();

                    MapEditorManager.OnMapChanged();
                }
            }
        }