Пример #1
0
        public static DialogResult DoGBPrefsDialog(
            Config config,
            IDialogParent dialogParent,
            IGameInfo game,
            IMovieSession movieSession,
            ISettingsAdapter settable)
        {
            var s  = (Gameboy.GambatteSettings)settable.GetSettings();
            var ss = (Gameboy.GambatteSyncSettings)settable.GetSyncSettings();

            using var dlg = new GBPrefs(dialogParent.DialogController);
            dlg.gbPrefControl1.PutSettings(config, game, movieSession, s, ss);
            var result = dialogParent.ShowDialogAsChild(dlg);

            if (result.IsOk())
            {
                dlg.gbPrefControl1.GetSettings(out s, out ss);
                settable.PutCoreSettings(s);
                if (dlg.gbPrefControl1.SyncSettingsChanged)
                {
                    settable.PutCoreSyncSettings(ss);
                }
            }
            return(result);
        }
Пример #2
0
        public static void DoGBPrefsDialog(IMainFormForConfig mainForm, Config config, IGameInfo game, IMovieSession movieSession, Gameboy gb)
        {
            var s  = gb.GetSettings();
            var ss = gb.GetSyncSettings();

            using var dlg = new GBPrefs(mainForm.DialogController);
            dlg.gbPrefControl1.PutSettings(config, game, movieSession, s, ss);
            dlg.gbPrefControl1.ColorGameBoy = gb.IsCGBMode() && (!gb.IsCGBDMGMode() || ss.EnableBIOS);
            if (mainForm.ShowDialogAsChild(dlg).IsOk())
            {
                dlg.gbPrefControl1.GetSettings(out s, out ss);
                gb.PutSettings(s);
                if (dlg.gbPrefControl1.SyncSettingsChanged)
                {
                    mainForm.PutCoreSyncSettings(ss);
                }
            }
        }
Пример #3
0
        public static void DoGBPrefsDialog(IMainFormForConfig mainForm, Gameboy gb)
        {
            var s  = gb.GetSettings();
            var ss = gb.GetSyncSettings();

            using var dlg = new GBPrefs();
            dlg.gbPrefControl1.PutSettings(s, ss);
            dlg.gbPrefControl1.ColorGameBoy = gb.IsCGBMode();
            if (mainForm.ShowDialogAsChild(dlg) == DialogResult.OK)
            {
                dlg.gbPrefControl1.GetSettings(out s, out ss);
                gb.PutSettings(s);
                if (dlg.gbPrefControl1.SyncSettingsChanged)
                {
                    mainForm.PutCoreSyncSettings(ss);
                }
            }
        }
Пример #4
0
        public static void DoGBPrefsDialog(IWin32Window owner)
        {
            var gb = (Gameboy)Global.Emulator;
            var s  = gb.GetSettings();
            var ss = gb.GetSyncSettings();

            using (var dlg = new GBPrefs())
            {
                dlg.gbPrefControl1.PutSettings(s, ss);
                dlg.gbPrefControl1.ColorGameBoy = gb.IsCGBMode();
                if (dlg.ShowDialog(owner) == DialogResult.OK)
                {
                    dlg.gbPrefControl1.GetSettings(out s, out ss);
                    gb.PutSettings(s);
                    if (dlg.gbPrefControl1.SyncSettingsChanged)
                    {
                        GlobalWin.MainForm.PutCoreSyncSettings(ss);
                    }
                }
            }
        }