コード例 #1
0
ファイル: Map16Editor.cs プロジェクト: bonimy/reuben-smb3
        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;
                }
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        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();
            }
        }
コード例 #4
0
        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();
            }
        }
コード例 #5
0
        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();
        }
コード例 #6
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;
            }
        }
コード例 #7
0
        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();
        }
コード例 #8
0
ファイル: ProjectView.cs プロジェクト: AbuSLmLm/reuben-smb3
        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;
            }
        }
コード例 #9
0
ファイル: Map16Editor.cs プロジェクト: AbuSLmLm/reuben-smb3
        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;
                }
            }
        }
コード例 #10
0
ファイル: LayoutEditor.cs プロジェクト: AbuSLmLm/reuben-smb3
        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);
            }
        }
コード例 #11
0
ファイル: Main.cs プロジェクト: AbuSLmLm/reuben-smb3
        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();
            }
        }
コード例 #12
0
ファイル: Main.cs プロジェクト: AbuSLmLm/reuben-smb3
        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();
            }
        }
コード例 #13
0
ファイル: Main.cs プロジェクト: AbuSLmLm/reuben-smb3
        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();
            }
        }