コード例 #1
0
 private void projectToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!MnuDebug.Enabled)
     {
         MnuDebug.Enabled = MnuEditor.Enabled = MnuExport.Enabled = MnuImport.Enabled = MnuNewLevel.Enabled = MnuProject.Enabled = MnuReload.Enabled = MnuTools.Enabled = MnuWindows.Enabled = ReubenController.CreateNewProject();
     }
     else
     {
         ReubenController.CreateNewProject();
     }
 }
コード例 #2
0
        private void BtnOpenLevel_Click(object sender, EventArgs e)
        {
            LevelInfo li = ProjectController.LevelManager.GetLevelInfo(CurrentPointer.LevelGuid);

            if (li == null)
            {
                MessageBox.Show("The level could no longer be found in the project");
            }
            else
            {
                ReubenController.EditLevel(li);
            }
        }
コード例 #3
0
ファイル: ProjectView.cs プロジェクト: bonimy/reuben-smb3-1
        private void Open()
        {
            switch (SelectionType)
            {
            case SelectionType.Level:

                ReubenController.EditLevel(SelectedLevel);
                break;

            case SelectionType.World:
                ReubenController.EditWorld(SelectedWorld);
                break;
            }
        }
コード例 #4
0
 private void toolStripMenuToValue_Click(object sender, EventArgs e)
 {
     if (ProjectController.ProjectManager.CurrentProject != null)
     {
         if (string.IsNullOrEmpty(ProjectController.ProjectManager.CurrentProject.ROMFile))
         {
             ReubenController.CompileRom(false);
         }
         else
         {
             ReubenController.CompileRom(true);
         }
     }
 }
コード例 #5
0
ファイル: ProjectView.cs プロジェクト: bonimy/reuben-smb3-1
        private void New()
        {
            switch (SelectionType)
            {
            case SelectionType.Level:
                ReubenController.CreateNewLevel(SelectedWorld);
                break;


            case SelectionType.World:
                ReubenController.CreateNewWorld();
                break;
            }
        }
コード例 #6
0
 private void map16EditorToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (ActiveMdiChild != null)
     {
         if (ActiveMdiChild is LevelEditor)
         {
             Level l = ((LevelEditor)ActiveMdiChild).CurrentLevel;
             ReubenController.OpenBlockEditor(l.Type, 0, l.GraphicsBank, l.AnimationBank, l.Palette);
         }
         else
         {
             World w = ((WorldEditor)ActiveMdiChild).CurrentWorld;
             ReubenController.OpenBlockEditor(w.Type, 0, 0x70, w.GraphicsBank, w.Palette);
         }
     }
     else
     {
         ReubenController.OpenBlockEditor();
     }
 }
コード例 #7
0
 private void graphicsEditorToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ReubenController.OpenGraphicsEditor();
 }
コード例 #8
0
 private void paletteManagerToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ReubenController.OpenPaletteViewer();
 }
コード例 #9
0
 private void projectToolStripMenuFromValue_Click(object sender, EventArgs e)
 {
     compileROMToolStripMenuItem.Enabled = MnuDebug.Enabled = MnuEditor.Enabled = MnuExport.Enabled = MnuImport.Enabled = MnuNewLevel.Enabled = MnuProject.Enabled = MnuReload.Enabled = MnuTools.Enabled = MnuWindows.Enabled = ReubenController.OpenProject();
     if (File.Exists(ProjectController.ProjectManager.CurrentProject.ROMFile))
     {
         saveToRom.Text    = ProjectController.ProjectManager.CurrentProject.ROMFile;
         saveToRom.Visible = true;
     }
     else
     {
         saveToRom.Visible = false;
     }
 }
コード例 #10
0
 private void currentLevelToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ReubenController.ReloadLevel();
 }
コード例 #11
0
 private void dToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ReubenController.ImportLevel();
 }
コード例 #12
0
 private void levelAsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ReubenController.SaveCurrentLevelToFile();
 }
コード例 #13
0
 private void paletteFileToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ReubenController.DefaulPaletteFile();
 }
コード例 #14
0
 public Main(string fileName)
 {
     InitializeComponent();
     ReubenController.MainWindow         = this;
     compileROMToolStripMenuItem.Enabled = MnuDebug.Enabled = MnuEditor.Enabled = MnuExport.Enabled = MnuImport.Enabled = MnuNewLevel.Enabled = MnuProject.Enabled = MnuReload.Enabled = MnuTools.Enabled = MnuWindows.Enabled = ReubenController.OpenProject(fileName);
     if (File.Exists(ProjectController.ProjectManager.CurrentProject.ROMFile))
     {
         saveToRom.Text    = ProjectController.ProjectManager.CurrentProject.ROMFile;
         saveToRom.Visible = true;
     }
     else
     {
         saveToRom.Visible = false;
     }
 }
コード例 #15
0
 private void compileROMToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ReubenController.CompileRom(false);
     saveToRom.Text    = ProjectController.ProjectManager.CurrentProject.ROMFile;
     saveToRom.Visible = true;
 }
コード例 #16
0
 private void dumpRawLevelToFileToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ReubenController.DumpRawLevel();
 }
コード例 #17
0
ファイル: ProjectView.cs プロジェクト: bonimy/reuben-smb3-1
        private void Delete()
        {
            ConfirmForm cForm = new ConfirmForm();

            cForm.StartPosition = FormStartPosition.CenterParent;
            cForm.Owner         = ReubenController.MainWindow;

            switch (SelectionType)
            {
            case SelectionType.Level:
                if (cForm.Confirm("Are you sure you want to permanently remove this level?"))
                {
                    ReubenController.CloseLevelEditor(SelectedLevel);
                    LevelInfo li = SelectedLevel;
                    WorldToNodes[SelectedWorld.WorldGuid].Nodes.Remove(LevelToNodes[li.LevelGuid]);
                    LevelToNodes.Remove(li.LevelGuid);
                    ProjectController.LevelManager.RemoveLevel(li);
                }
                break;

            case SelectionType.World:

                if (cForm.Confirm("Are you sure you want to permanently remove this world? All levels will be moved to No World."))
                {
                    ReubenController.CloseWorldEditor(SelectedWorld);
                    ProjectController.WorldManager.RemoveWorld(SelectedWorld);
                    WorldInfo noWorld   = ProjectController.WorldManager.GetNoWorld();
                    WorldInfo thisWorld = SelectedWorld;

                    foreach (TreeNode node in WorldToNodes[SelectedWorld.WorldGuid].Nodes)
                    {
                        LevelInfo li           = NodesToLevels[node];
                        TreeNode  oldWorldNode = WorldToNodes[SelectedWorld.WorldGuid];
                        TreeNode  newWorldNode = WorldToNodes[noWorld.WorldGuid];
                        TreeNode  lvlNode      = LevelToNodes[li.LevelGuid];
                        li.WorldGuid = noWorld.WorldGuid;
                        oldWorldNode.Nodes.Remove(lvlNode);
                        newWorldNode.Nodes.Add(lvlNode);
                    }

                    projectNode.Nodes.Remove(WorldToNodes[thisWorld.WorldGuid]);
                    NodesToWorlds.Remove(WorldToNodes[thisWorld.WorldGuid]);
                    WorldToNodes.Remove(thisWorld.WorldGuid);
                    ToolStripMenuItem removeThis = null;
                    foreach (ToolStripMenuItem menu in MnuMoveTo.DropDownItems)
                    {
                        if (menu.Tag == thisWorld)
                        {
                            removeThis = menu;
                            break;
                        }
                    }

                    if (removeThis != null)
                    {
                        MnuMoveTo.DropDownItems.Remove(removeThis);
                    }
                }
                break;
            }
        }
コード例 #18
0
 private void MnuNewLevel_Click(object sender, EventArgs e)
 {
     ReubenController.CreateNewLevel();
 }
コード例 #19
0
 private void layoutManagerToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ReubenController.OpenLayoutManager();
 }
コード例 #20
0
 private void graphicsToolStripMenuFromValue_Click(object sender, EventArgs e)
 {
     ReubenController.ReloadGraphics();
 }