Exemplo n.º 1
0
        public LevelEditor(NSMBLevel Level)
        {
            InitializeComponent();

            this.Level = Level;
            this.GFX = Level.GFX;
            coordinateViewer1.EdControl = levelEditorControl1;
            //This is supposed to reduce flickering on stuff like the side panel...
            //But it doesn't :(
            this.SetStyle(
              ControlStyles.AllPaintingInWmPaint|
              ControlStyles.UserPaint |
              ControlStyles.DoubleBuffer, true); 
            
            if (Properties.Settings.Default.mdi)
                this.MdiParent = MdiParentForm.instance;
            if (Properties.Settings.Default.LevelMaximized)
                this.WindowState = FormWindowState.Maximized;

            smallBlockOverlaysToolStripMenuItem.Checked = Properties.Settings.Default.SmallBlockOverlays;
            showResizeHandles.Checked = Properties.Settings.Default.ShowResizeHandles;

            LanguageManager.ApplyToContainer(this, "LevelEditor");
            this.Text = LanguageManager.Get("General", "EditingSomething") + " " + Level.name;
            // these need to be added manually
            reloadTilesets.Text = LanguageManager.Get("LevelEditor", "reloadTilesets");
            smallBlockOverlaysToolStripMenuItem.Text = LanguageManager.Get("LevelEditor", "smallBlockOverlaysToolStripMenuItem");
            showResizeHandles.Text = LanguageManager.Get("LevelEditor", "showResizeHandles");
            setBgImageButton.Text = LanguageManager.Get("LevelEditor", "setBgImageButton");
            removeBgButton.Text = LanguageManager.Get("LevelEditor", "removeBgButton");
            moveBGToolStripMenuItem.Text = LanguageManager.Get("LevelEditor", "moveBGToolStripMenuItem");
            openImage.Filter = LanguageManager.Get("Filters", "image");

            levelEditorControl1.LoadUndoManager(undoButton, redoButton);

            Level.enableWrite();
            levelEditorControl1.Initialise(GFX, Level, this);

            oem = new ObjectsEditionMode(Level, levelEditorControl1);
            bgdragem = new BackgroundDragEditionMode(Level, levelEditorControl1);

            levelEditorControl1.SetEditionMode(oem);
            levelEditorControl1.minimapctrl = minimapControl1;

            tools = new ToolsForm(levelEditorControl1);
            sprEvents = new SpriteEventsViewer(levelEditorControl1);
            MinimapForm = new LevelMinimap(Level, levelEditorControl1);
            levelEditorControl1.minimap = MinimapForm;
            MinimapForm.Text = string.Format(LanguageManager.Get("LevelEditor", "MinimapTitle"), Level.name);
            minimapControl1.loadMinimap(Level, levelEditorControl1);
            this.Icon = Properties.Resources.nsmbe;

            if (Properties.Settings.Default.AutoBackup > 0)
            {
                backupTimer.Interval = Properties.Settings.Default.AutoBackup * 60000;
                backupTimer.Start();
            }
        }
Exemplo n.º 2
0
        public LevelEditor(NSMBLevel Level)
        {
            InitializeComponent();

            this.Level = Level;
            this.GFX   = Level.GFX;
            coordinateViewer1.EdControl = levelEditorControl1;
            //This is supposed to reduce flickering on stuff like the side panel...
            //But it doesn't :(
            this.SetStyle(
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.UserPaint |
                ControlStyles.DoubleBuffer, true);

            if (Properties.Settings.Default.mdi)
            {
                this.MdiParent = MdiParentForm.instance;
            }
            if (Properties.Settings.Default.LevelMaximized)
            {
                this.WindowState = FormWindowState.Maximized;
            }

            smallBlockOverlaysToolStripMenuItem.Checked = Properties.Settings.Default.SmallBlockOverlays;
            showResizeHandles.Checked = Properties.Settings.Default.ShowResizeHandles;

            LanguageManager.ApplyToContainer(this, "LevelEditor");
            this.Text = LanguageManager.Get("General", "EditingSomething") + " " + Level.name;
            // these need to be added manually
            reloadTilesets.Text = LanguageManager.Get("LevelEditor", "reloadTilesets");
            smallBlockOverlaysToolStripMenuItem.Text = LanguageManager.Get("LevelEditor", "smallBlockOverlaysToolStripMenuItem");
            showResizeHandles.Text       = LanguageManager.Get("LevelEditor", "showResizeHandles");
            setBgImageButton.Text        = LanguageManager.Get("LevelEditor", "setBgImageButton");
            removeBgButton.Text          = LanguageManager.Get("LevelEditor", "removeBgButton");
            moveBGToolStripMenuItem.Text = LanguageManager.Get("LevelEditor", "moveBGToolStripMenuItem");
            openImage.Filter             = LanguageManager.Get("Filters", "image");

            levelEditorControl1.LoadUndoManager(undoButton, redoButton);

            Level.enableWrite();
            levelEditorControl1.Initialise(GFX, Level, this);

            oem      = new ObjectsEditionMode(Level, levelEditorControl1);
            bgdragem = new BackgroundDragEditionMode(Level, levelEditorControl1);

            levelEditorControl1.SetEditionMode(oem);
            levelEditorControl1.minimapctrl = minimapControl1;

            tools       = new ToolsForm(levelEditorControl1);
            sprEvents   = new SpriteEventsViewer(levelEditorControl1);
            MinimapForm = new LevelMinimap(Level, levelEditorControl1);
            levelEditorControl1.minimap = MinimapForm;
            MinimapForm.Text            = string.Format(LanguageManager.Get("LevelEditor", "MinimapTitle"), Level.name);
            minimapControl1.loadMinimap(Level, levelEditorControl1);
            this.Icon = Properties.Resources.nsmbe;

            if (Properties.Settings.Default.AutoBackup > 0)
            {
                backupTimer.Interval = Properties.Settings.Default.AutoBackup * 60000;
                backupTimer.Start();
            }
        }