예제 #1
0
        public void Restart()
        {
            FileSelectorPanel.Controls.Clear();
            AddButton_Click(null, null);
            AddButton_Click(null, null);

            if (!Game.IsNullInstance() && !MainForm.CurrentlyOpenRom.EndsWith(".xml"))
            {
                if (MainForm.CurrentlyOpenRom.Contains("|"))
                {
                    var pieces = MainForm.CurrentlyOpenRom.Split('|');

                    var directory = Path.GetDirectoryName(pieces[0]) ?? "";
                    var filename  = Path.ChangeExtension(pieces[1], ".xml");

                    NameBox.Text = Path.Combine(directory, filename);
                }
                else
                {
                    NameBox.Text = Path.ChangeExtension(MainForm.CurrentlyOpenRom, ".xml");
                }

                if (SystemDropDown.Items.Contains(Emulator.SystemId))
                {
                    SystemDropDown.SelectedItem = Emulator.SystemId;
                }
                else if (Emulator is SMS sms && sms.IsGameGear)
                {
                    SystemDropDown.SelectedItem = "Game Gear";
                }

                FileSelectors.First().Path = MainForm.CurrentlyOpenRom;
                Recalculate();
            }
        }
예제 #2
0
        private void MultiGameCreator_Load(object sender, EventArgs e)
        {
            AddButton_Click(null, null);
            AddButton_Click(null, null);

            if (!Global.Game.IsNullInstance && !GlobalWin.MainForm.CurrentlyOpenRom.EndsWith(".xml"))
            {
                string currentRom = GlobalWin.MainForm.CurrentlyOpenRom;
                if (GlobalWin.MainForm.CurrentlyOpenRom.Contains("|"))
                {
                    var pieces = GlobalWin.MainForm.CurrentlyOpenRom.Split('|');

                    var directory = Path.GetDirectoryName(pieces[0]);
                    var filename  = Path.ChangeExtension(pieces[1], ".xml");

                    NameBox.Text = Path.Combine(directory, filename);
                }
                else
                {
                    NameBox.Text = Path.ChangeExtension(GlobalWin.MainForm.CurrentlyOpenRom, ".xml");
                }

                if (SystemDropDown.Items.Contains(Emulator.SystemId))
                {
                    SystemDropDown.SelectedItem = Emulator.SystemId;
                }

                FileSelectors.First().SetName(GlobalWin.MainForm.CurrentlyOpenRom);
            }
        }
예제 #3
0
        private void MultiGameCreator_Load(object sender, EventArgs e)
        {
            AddButton_Click(null, null);
            AddButton_Click(null, null);

            if (!Global.Game.IsNullInstance() && !MainForm.CurrentlyOpenRom.EndsWith(".xml"))
            {
                if (MainForm.CurrentlyOpenRom.Contains("|"))
                {
                    var pieces = MainForm.CurrentlyOpenRom.Split('|');

                    var directory = Path.GetDirectoryName(pieces[0]) ?? "";
                    var filename  = Path.ChangeExtension(pieces[1], ".xml");

                    NameBox.Text = Path.Combine(directory, filename);
                }
                else
                {
                    NameBox.Text = Path.ChangeExtension(MainForm.CurrentlyOpenRom, ".xml");
                }

                if (SystemDropDown.Items.Contains(Emulator.SystemId))
                {
                    SystemDropDown.SelectedItem = Emulator.SystemId;
                }
                else if (Emulator is SMS sms && sms.IsGameGear)
                {
                    SystemDropDown.SelectedItem = "Game Gear";
                }

                FileSelectors.First().Path = MainForm.CurrentlyOpenRom;
            }
        }