private void BtnApplyGlobally_Click(object sender, EventArgs e) { ConfirmForm cForm = new ConfirmForm(); cForm.StartPosition = FormStartPosition.CenterParent; cForm.Owner = ReubenController.MainWindow; if (cForm.Confirm("Are you sure you want to apply this definiton to block " + BlsBlocks.SelectedTileIndex.ToHexString() + " in every definition set?")) { bool first = true; foreach (BlockDefinition bDef in ProjectController.BlockManager.AllDefinitions) { if (first) { first = false; continue; } Block b = bDef[BlsBlocks.SelectedTileIndex]; b[0, 0] = BlvCurrent.CurrentBlock[0, 0]; b[0, 1] = BlvCurrent.CurrentBlock[0, 1]; b[1, 0] = BlvCurrent.CurrentBlock[1, 0]; b[1, 1] = BlvCurrent.CurrentBlock[1, 1]; b.Description = BlockDescription.Text; b.BlockProperty = BlvCurrent.CurrentBlock.BlockProperty; } } }
private void BtnDelete_Click(object sender, EventArgs e) { ConfirmForm cForm = new ConfirmForm(); cForm.StartPosition = FormStartPosition.CenterParent; cForm.Owner = ReubenController.MainWindow; if (cForm.Confirm("Are you sure you want to remove this layout?")) { ProjectController.LayoutManager.RemoveLayout(CmbLayouts.SelectedItem as BlockLayout); } }
private void toolStripMenuFromValue_Click(object sender, EventArgs e) { ConfirmForm cForm = new ConfirmForm(); cForm.StartPosition = FormStartPosition.CenterParent; cForm.Owner = ReubenController.MainWindow; if (cForm.Confirm("Resetting the music list requires all levels and worlds to be closed.")) { ProjectController.MusicManager.LoadDefault(); ProjectController.Save(); } }
private void specialGraphicsToolStripMenuItem_Click(object sender, EventArgs e) { ConfirmForm cForm = new ConfirmForm(); cForm.StartPosition = FormStartPosition.CenterParent; cForm.Owner = ReubenController.MainWindow; if (cForm.Confirm("Resetting the special graphics requires all levels and worlds to be closed.")) { ProjectController.SpecialManager.LoadDefaultSpecialGraphics(); ProjectController.Save(); } }
private void BtnRemove_Click(object sender, EventArgs e) { ConfirmForm cForm = new ConfirmForm(); cForm.StartPosition = FormStartPosition.CenterParent; cForm.Owner = ReubenController.MainWindow; if (cForm.Confirm("Are you sure you want to remove this palette? Any\nlevel referring to this palette will resort to the first\npalette in your list.")) { ProjectController.PaletteManager.RemovePalette(CmbPalettes.SelectedItem as PaletteInfo); } cForm.Dispose(); }
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 allEditorDefinitionsToolStripMenuItem_Click(object sender, EventArgs e) { ConfirmForm cForm = new ConfirmForm(); cForm.StartPosition = FormStartPosition.CenterParent; cForm.Owner = ReubenController.MainWindow; if (cForm.Confirm("Resetting the all editor definitions requires all levels and worlds to be closed.")) { ProjectController.SpriteManager.LoadDefaultSprites(); ProjectController.MusicManager.LoadDefault(); ProjectController.SpecialManager.LoadDefaultSpecialGraphics(); ProjectController.SpecialManager.LoadDefaultSpecials(); ProjectController.Save(); } }
private void blockPropertiesToolStripMenuItem_Click(object sender, EventArgs e) { ConfirmForm cForm = new ConfirmForm(); cForm.StartPosition = FormStartPosition.CenterParent; cForm.Owner = ReubenController.MainWindow; if (cForm.Confirm("Resetting the default block properties requires all levels and worlds to be closed.")) { ProjectController.SpecialManager.LoadDefaultSpecials(); ProjectController.Save(); } }