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(); } }
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); } }
private void Open() { switch (SelectionType) { case SelectionType.Level: ReubenController.EditLevel(SelectedLevel); break; case SelectionType.World: ReubenController.EditWorld(SelectedWorld); break; } }
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); } } }
private void New() { switch (SelectionType) { case SelectionType.Level: ReubenController.CreateNewLevel(SelectedWorld); break; case SelectionType.World: ReubenController.CreateNewWorld(); break; } }
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(); } }
private void graphicsEditorToolStripMenuItem_Click(object sender, EventArgs e) { ReubenController.OpenGraphicsEditor(); }
private void paletteManagerToolStripMenuItem_Click(object sender, EventArgs e) { ReubenController.OpenPaletteViewer(); }
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; } }
private void currentLevelToolStripMenuItem_Click(object sender, EventArgs e) { ReubenController.ReloadLevel(); }
private void dToolStripMenuItem_Click(object sender, EventArgs e) { ReubenController.ImportLevel(); }
private void levelAsToolStripMenuItem_Click(object sender, EventArgs e) { ReubenController.SaveCurrentLevelToFile(); }
private void paletteFileToolStripMenuItem_Click(object sender, EventArgs e) { ReubenController.DefaulPaletteFile(); }
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; } }
private void compileROMToolStripMenuItem_Click(object sender, EventArgs e) { ReubenController.CompileRom(false); saveToRom.Text = ProjectController.ProjectManager.CurrentProject.ROMFile; saveToRom.Visible = true; }
private void dumpRawLevelToFileToolStripMenuItem_Click(object sender, EventArgs e) { ReubenController.DumpRawLevel(); }
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; } }
private void MnuNewLevel_Click(object sender, EventArgs e) { ReubenController.CreateNewLevel(); }
private void layoutManagerToolStripMenuItem_Click(object sender, EventArgs e) { ReubenController.OpenLayoutManager(); }
private void graphicsToolStripMenuFromValue_Click(object sender, EventArgs e) { ReubenController.ReloadGraphics(); }