UI: Added more auto-pause settings for more flexibility

This commit is contained in:
Sour 2018-03-21 21:14:51 -04:00
parent 8cb541a8a9
commit f14747e110
15 changed files with 6915 additions and 6774 deletions

5
.editorconfig Normal file
View file

@ -0,0 +1,5 @@
root = true
[*]
indent_style = tab
indent_size = 3

View file

@ -10,6 +10,8 @@ namespace Mesen.GUI.Config
public bool SingleInstance = true;
public bool PauseWhenInBackground = false;
public bool PauseWhenInMenusAndConfig = false;
public bool PauseWhenInDebuggingTools = false;
public bool AllowBackgroundInput = false;
public bool AutoLoadIpsPatches = true;
public bool AllowInvalidInput = false;
@ -174,7 +176,7 @@ namespace Mesen.GUI.Config
InteropEmu.SetFlag(EmulationFlags.FdsAutoInsertDisk, preferenceInfo.FdsAutoInsertDisk);
InteropEmu.SetFlag(EmulationFlags.PauseOnMovieEnd, preferenceInfo.PauseOnMovieEnd);
InteropEmu.SetFlag(EmulationFlags.AllowBackgroundInput, preferenceInfo.AllowBackgroundInput);
InteropEmu.SetFlag(EmulationFlags.PauseWhenInBackground, preferenceInfo.PauseWhenInBackground);
InteropEmu.SetFlag(EmulationFlags.PauseWhenInBackground, preferenceInfo.PauseWhenInBackground || preferenceInfo.PauseWhenInMenusAndConfig || preferenceInfo.PauseWhenInDebuggingTools);
InteropEmu.SetFlag(EmulationFlags.DisableGameDatabase, preferenceInfo.DisableGameDatabase);
InteropEmu.SetFlag(EmulationFlags.DisableOsd, preferenceInfo.DisableOsd);
InteropEmu.SetFlag(EmulationFlags.AllowMismatchingSaveStates, preferenceInfo.AllowMismatchingSaveStates);

View file

@ -334,7 +334,12 @@
<Control ID="chkConfirmExitResetPower">Confirma abans d'un reinici/aturada o abans de sortir de Mesen</Control>
<Control ID="chkPauseOnMovieEnd">Pausa l'emulació en acabar una pel·lícula</Control>
<Control ID="chkAllowBackgroundInput">Permet l'entrada d'ordres encara que Mesen es trobi en segon pla</Control>
<Control ID="chkPauseWhenInBackground">Pausa l'emulació quan Mesen es trobi en segon pla</Control>
<Control ID="lblPauseIn">Pause when in:</Control>
<Control ID="chkPauseWhenInBackground">Background</Control>
<Control ID="chkPauseInMenuAndConfig">Menus and config dialogs</Control>
<Control ID="chkPauseInDebugger">Debugging tools</Control>
<Control ID="chkAutoLoadIps">Carrega els pedaços IPS/BPS automàticament</Control>
<Control ID="chkHidePauseOverlay">Amaga la pantalla de pausa</Control>
<Control ID="chkDisplayMovieIcons">Mostra una icona d'iniciar/gravar al reproduir o gravar una pel·lícula</Control>

View file

@ -333,7 +333,12 @@
<Control ID="chkConfirmExitResetPower">Mostrar mensaje de confirmación antes de reiniciar/detener o salir</Control>
<Control ID="chkPauseOnMovieEnd">Pausar la emulación al finalizar el video</Control>
<Control ID="chkAllowBackgroundInput">Permitir entradas aunque Mesen esté en segundo plano</Control>
<Control ID="chkPauseWhenInBackground">Pausar la emulación cuando Mesen esté en segundo plano</Control>
<Control ID="lblPauseIn">Pause when in:</Control>
<Control ID="chkPauseWhenInBackground">Background</Control>
<Control ID="chkPauseInMenuAndConfig">Menus and config dialogs</Control>
<Control ID="chkPauseInDebugger">Debugging tools</Control>
<Control ID="chkAutoLoadIps">Cargar los parches IPS/BPS automáticamente</Control>
<Control ID="chkHidePauseOverlay">Ocultar la pantalla de pausa</Control>
<Control ID="chkDisplayMovieIcons">Mostrar icono de iniciar/grabar al reproducir o grabar un video</Control>

View file

@ -335,6 +335,12 @@
<Control ID="chkConfirmExitResetPower">Confirmer avant un redémarrage/arrêt ou avant de quitter Mesen</Control>
<Control ID="chkPauseOnMovieEnd">Pauser l'émulation à la fin d'un film</Control>
<Control ID="chkAllowBackgroundInput">Permettre les entrées lorsque Mesen est en arrière-plan</Control>
<Control ID="lblPauseIn">Mettre en pause dans:</Control>
<Control ID="chkPauseWhenInBackground">Arrière-plan</Control>
<Control ID="chkPauseInMenuAndConfig">Menus et options</Control>
<Control ID="chkPauseInDebugger">Outils de debug</Control>
<Control ID="chkPauseWhenInBackground">Pauser l'émulation lorsque Mesen est en arrière-plan</Control>
<Control ID="chkAutoLoadIps">Charger les fichiers IPS/BPS automatiquement</Control>
<Control ID="chkHidePauseOverlay">Ne pas afficher l'écran de pause</Control>

View file

@ -335,7 +335,12 @@
<Control ID="chkConfirmExitResetPower">リセットと再起度とMesenを終了する前に確認する</Control>
<Control ID="chkPauseOnMovieEnd">動画が終わると自動的にポーズする</Control>
<Control ID="chkAllowBackgroundInput">Mesenが最前面ではない時でも、コントローラの入力を受け付ける</Control>
<Control ID="chkPauseWhenInBackground">Mesenが最前面ではない時、自動的にポーズする</Control>
<Control ID="lblPauseIn">自動ポーズ条件:</Control>
<Control ID="chkPauseWhenInBackground">最前面ではない時</Control>
<Control ID="chkPauseInMenuAndConfig">メニューと設定画面</Control>
<Control ID="chkPauseInDebugger">デバッグツール</Control>
<Control ID="chkAutoLoadIps">自動的にパッチファイルIPS・BPSをロードする</Control>
<Control ID="chkHidePauseOverlay">ポーズ画面を隠す</Control>
<Control ID="chkDisplayMovieIcons">動画の録画や再生の際、アイコンを表示する</Control>

View file

@ -333,7 +333,12 @@
<Control ID="chkConfirmExitResetPower">Exibir diálogo de confirmação antes de reiniciar, desligar ou sair</Control>
<Control ID="chkPauseOnMovieEnd">Pausar a emulação ao finalizar o vídeo</Control>
<Control ID="chkAllowBackgroundInput">Permitir comandos enquanto o Mesen estiver em segundo plano</Control>
<Control ID="chkPauseWhenInBackground">Pausar a emulação quando o Mesen estiver em segundo plano</Control>
<Control ID="lblPauseIn">Pause when in:</Control>
<Control ID="chkPauseWhenInBackground">Background</Control>
<Control ID="chkPauseInMenuAndConfig">Menus and config dialogs</Control>
<Control ID="chkPauseInDebugger">Debugging tools</Control>
<Control ID="chkAutoLoadIps">Carregar os arquivos IPS/BPS automaticamente</Control>
<Control ID="chkHidePauseOverlay">Ocultar a tela de pausa</Control>
<Control ID="chkDisplayMovieIcons">Exibir ícone de reprodução/gravação ao reproduzir ou gravar um filme</Control>

View file

@ -333,7 +333,12 @@
<Control ID="chkConfirmExitResetPower">Display confirmation dialog before reset/power cycle/exit</Control>
<Control ID="chkPauseOnMovieEnd">Ставить на паузу после проигрывания записи</Control>
<Control ID="chkAllowBackgroundInput">Разрешить ввод в фоне</Control>
<Control ID="chkPauseWhenInBackground">Ставить на паузу при потере фокуса</Control>
<Control ID="lblPauseIn">Pause when in:</Control>
<Control ID="chkPauseWhenInBackground">Background</Control>
<Control ID="chkPauseInMenuAndConfig">Menus and config dialogs</Control>
<Control ID="chkPauseInDebugger">Debugging tools</Control>
<Control ID="chkAutoLoadIps">Автоматически загружать IPS/BPS</Control>
<Control ID="chkHidePauseOverlay">Hide the pause screen</Control>
<Control ID="chkDisplayMovieIcons">Display play/record icon when playing or recording a movie</Control>

View file

@ -333,7 +333,12 @@
<Control ID="chkConfirmExitResetPower">Відобразити діалогове вікно підтвердження перед скиданням/перезавантаженням/вихом</Control>
<Control ID="chkPauseOnMovieEnd">Ставити на паузу після програвання запису</Control>
<Control ID="chkAllowBackgroundInput">Дозволити введення в тлі</Control>
<Control ID="chkPauseWhenInBackground">Ставити на паузу при втраті фокуса</Control>
<Control ID="lblPauseIn">Pause when in:</Control>
<Control ID="chkPauseWhenInBackground">Background</Control>
<Control ID="chkPauseInMenuAndConfig">Menus and config dialogs</Control>
<Control ID="chkPauseInDebugger">Debugging tools</Control>
<Control ID="chkAutoLoadIps">Автоматично завантажувати IPS/BPS</Control>
<Control ID="chkHidePauseOverlay">Приховати екран паузи</Control>
<Control ID="chkDisplayMovieIcons">Відображати значок відтворення/запису при відтворенні або запису відео</Control>

View file

@ -1,4 +1,5 @@
using System;
using Mesen.GUI.Config;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
@ -11,18 +12,50 @@ namespace Mesen.GUI.Forms
{
public class BaseForm : Form
{
public delegate bool ProcessCmdKeyHandler(Keys keyData);
public event ProcessCmdKeyHandler OnProcessCmdKey;
protected ToolTip toolTip;
private System.ComponentModel.IContainer components;
private bool _iconSet = false;
protected int _inMenu = 0;
private static Timer _tmrUpdateBackground;
public delegate bool ProcessCmdKeyHandler(Keys keyData);
public event ProcessCmdKeyHandler OnProcessCmdKey;
static BaseForm()
{
bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);
if(!designMode) {
_tmrUpdateBackground = new Timer();
_tmrUpdateBackground.Start();
_tmrUpdateBackground.Tick += tmrUpdateBackground_Tick;
}
}
public BaseForm()
{
InitializeComponent();
}
private static void tmrUpdateBackground_Tick(object sender, EventArgs e)
{
Form focusedForm = null;
foreach(Form form in Application.OpenForms) {
if(form.ContainsFocus) {
focusedForm = form;
break;
}
}
bool needPause = ConfigManager.Config.PreferenceInfo.PauseWhenInBackground && focusedForm == null;
if(focusedForm != null) {
needPause |= ConfigManager.Config.PreferenceInfo.PauseWhenInMenusAndConfig && focusedForm is BaseForm && ((BaseForm)focusedForm)._inMenu > 0;
needPause |= ConfigManager.Config.PreferenceInfo.PauseWhenInMenusAndConfig && !(focusedForm is BaseInputForm) && !focusedForm.GetType().FullName.Contains("Debugger");
needPause |= ConfigManager.Config.PreferenceInfo.PauseWhenInDebuggingTools && focusedForm.GetType().FullName.Contains("Debugger");
}
InteropEmu.SetFlag(EmulationFlags.InBackground, needPause);
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
bool? result = OnProcessCmdKey?.Invoke(keyData);

View file

@ -10,23 +10,16 @@ namespace Mesen.GUI.Forms
{
public class BaseInputForm : BaseForm, IMessageFilter
{
private static Stack<Form> _inputForms = new Stack<Form>();
private const int WM_KEYDOWN = 0x100;
private const int WM_KEYUP = 0x101;
private const int WM_SYSKEYDOWN = 0x104;
private const int WM_SYSKEYUP = 0x105;
private Timer _tmrUpdateBackground;
public BaseInputForm()
{
bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);
if(!designMode) {
_inputForms.Push(this);
Application.AddMessageFilter(this);
this._tmrUpdateBackground = new Timer();
this._tmrUpdateBackground.Start();
this._tmrUpdateBackground.Tick += tmrUpdateBackground_Tick;
}
}
@ -57,9 +50,6 @@ namespace Mesen.GUI.Forms
{
base.OnFormClosed(e);
Application.RemoveMessageFilter(this);
_tmrUpdateBackground.Stop();
_tmrUpdateBackground.Dispose();
_inputForms.Pop();
}
protected override void OnLoad(EventArgs e)
@ -86,17 +76,5 @@ namespace Mesen.GUI.Forms
base.OnActivated(e);
InteropEmu.ResetKeyState();
}
private void tmrUpdateBackground_Tick(object sender, EventArgs e)
{
UpdateFocusFlag();
}
private void UpdateFocusFlag()
{
if(_inputForms.Peek() == this) {
InteropEmu.SetFlag(EmulationFlags.InBackground, !this.ContainsFocus);
}
}
}
}

View file

@ -32,6 +32,7 @@ namespace Mesen.GUI.Forms.Config
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmPreferences));
this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
this.chkPauseOnMovieEnd = new System.Windows.Forms.CheckBox();
this.chkDeveloperMode = new System.Windows.Forms.CheckBox();
this.lblPauseBackgroundSettings = new System.Windows.Forms.Label();
this.chkSingleInstance = new System.Windows.Forms.CheckBox();
@ -44,13 +45,16 @@ namespace Mesen.GUI.Forms.Config
this.chkDisplayMovieIcons = new System.Windows.Forms.CheckBox();
this.chkAutoHideMenu = new System.Windows.Forms.CheckBox();
this.chkHidePauseOverlay = new System.Windows.Forms.CheckBox();
this.chkAllowBackgroundInput = new System.Windows.Forms.CheckBox();
this.chkPauseWhenInBackground = new System.Windows.Forms.CheckBox();
this.chkPauseOnMovieEnd = new System.Windows.Forms.CheckBox();
this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel();
this.btnOpenMesenFolder = new System.Windows.Forms.Button();
this.btnResetSettings = new System.Windows.Forms.Button();
this.chkConfirmExitResetPower = new System.Windows.Forms.CheckBox();
this.flowLayoutPanel8 = new System.Windows.Forms.FlowLayoutPanel();
this.lblPauseIn = new System.Windows.Forms.Label();
this.chkPauseWhenInBackground = new System.Windows.Forms.CheckBox();
this.chkPauseInMenuAndConfig = new System.Windows.Forms.CheckBox();
this.chkPauseInDebugger = new System.Windows.Forms.CheckBox();
this.chkAllowBackgroundInput = new System.Windows.Forms.CheckBox();
this.tabMain = new System.Windows.Forms.TabControl();
this.tpgGeneral = new System.Windows.Forms.TabPage();
this.tpgShortcuts = new System.Windows.Forms.TabPage();
@ -73,6 +77,7 @@ namespace Mesen.GUI.Forms.Config
this.btnResync = new System.Windows.Forms.Button();
this.grpAutomaticSaves = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
this.chkAllowMismatchingSaveStates = new Mesen.GUI.Controls.ctrlRiskyOption();
this.chkAutoSaveNotify = new System.Windows.Forms.CheckBox();
this.flpAutoSave = new System.Windows.Forms.FlowLayoutPanel();
this.chkAutoSave = new System.Windows.Forms.CheckBox();
@ -146,10 +151,10 @@ namespace Mesen.GUI.Forms.Config
this.lblUiDisplaySettings = new System.Windows.Forms.Label();
this.lblGameSelectionScreenSettings = new System.Windows.Forms.Label();
this.tmrSyncDateTime = new System.Windows.Forms.Timer(this.components);
this.chkAllowMismatchingSaveStates = new Mesen.GUI.Controls.ctrlRiskyOption();
this.tlpMain.SuspendLayout();
this.flowLayoutPanel2.SuspendLayout();
this.tableLayoutPanel5.SuspendLayout();
this.flowLayoutPanel8.SuspendLayout();
this.tabMain.SuspendLayout();
this.tpgGeneral.SuspendLayout();
this.tpgShortcuts.SuspendLayout();
@ -193,25 +198,25 @@ namespace Mesen.GUI.Forms.Config
//
this.tlpMain.ColumnCount = 1;
this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tlpMain.Controls.Add(this.chkDeveloperMode, 0, 13);
this.tlpMain.Controls.Add(this.chkDeveloperMode, 0, 15);
this.tlpMain.Controls.Add(this.lblPauseBackgroundSettings, 0, 3);
this.tlpMain.Controls.Add(this.chkSingleInstance, 0, 2);
this.tlpMain.Controls.Add(this.chkAutomaticallyCheckForUpdates, 0, 1);
this.tlpMain.Controls.Add(this.flowLayoutPanel2, 0, 0);
this.tlpMain.Controls.Add(this.lblMiscSettings, 0, 8);
this.tlpMain.Controls.Add(this.chkAutoLoadIps, 0, 9);
this.tlpMain.Controls.Add(this.chkDisplayMovieIcons, 0, 12);
this.tlpMain.Controls.Add(this.chkAutoHideMenu, 0, 10);
this.tlpMain.Controls.Add(this.chkHidePauseOverlay, 0, 4);
this.tlpMain.Controls.Add(this.lblMiscSettings, 0, 10);
this.tlpMain.Controls.Add(this.chkAutoLoadIps, 0, 11);
this.tlpMain.Controls.Add(this.chkDisplayMovieIcons, 0, 14);
this.tlpMain.Controls.Add(this.chkAutoHideMenu, 0, 12);
this.tlpMain.Controls.Add(this.chkHidePauseOverlay, 0, 5);
this.tlpMain.Controls.Add(this.tableLayoutPanel5, 0, 17);
this.tlpMain.Controls.Add(this.chkConfirmExitResetPower, 0, 13);
this.tlpMain.Controls.Add(this.flowLayoutPanel8, 0, 4);
this.tlpMain.Controls.Add(this.chkPauseOnMovieEnd, 0, 6);
this.tlpMain.Controls.Add(this.chkAllowBackgroundInput, 0, 7);
this.tlpMain.Controls.Add(this.chkPauseWhenInBackground, 0, 6);
this.tlpMain.Controls.Add(this.chkPauseOnMovieEnd, 0, 5);
this.tlpMain.Controls.Add(this.tableLayoutPanel5, 0, 15);
this.tlpMain.Controls.Add(this.chkConfirmExitResetPower, 0, 11);
this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.tlpMain.Location = new System.Drawing.Point(3, 3);
this.tlpMain.Name = "tlpMain";
this.tlpMain.RowCount = 16;
this.tlpMain.RowCount = 18;
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
@ -220,6 +225,8 @@ namespace Mesen.GUI.Forms.Config
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
@ -228,13 +235,25 @@ namespace Mesen.GUI.Forms.Config
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tlpMain.Size = new System.Drawing.Size(483, 387);
this.tlpMain.TabIndex = 1;
//
// chkPauseOnMovieEnd
//
this.chkPauseOnMovieEnd.AutoSize = true;
this.chkPauseOnMovieEnd.Location = new System.Drawing.Point(13, 143);
this.chkPauseOnMovieEnd.Margin = new System.Windows.Forms.Padding(13, 3, 3, 3);
this.chkPauseOnMovieEnd.Name = "chkPauseOnMovieEnd";
this.chkPauseOnMovieEnd.Size = new System.Drawing.Size(199, 17);
this.chkPauseOnMovieEnd.TabIndex = 29;
this.chkPauseOnMovieEnd.Text = "Pause when a movie finishes playing";
this.chkPauseOnMovieEnd.UseVisualStyleBackColor = true;
//
// chkDeveloperMode
//
this.chkDeveloperMode.AutoSize = true;
this.chkDeveloperMode.Location = new System.Drawing.Point(13, 299);
this.chkDeveloperMode.Location = new System.Drawing.Point(13, 301);
this.chkDeveloperMode.Margin = new System.Windows.Forms.Padding(13, 3, 3, 3);
this.chkDeveloperMode.Name = "chkDeveloperMode";
this.chkDeveloperMode.Size = new System.Drawing.Size(138, 17);
@ -308,7 +327,7 @@ namespace Mesen.GUI.Forms.Config
this.lblMiscSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.lblMiscSettings.AutoSize = true;
this.lblMiscSettings.ForeColor = System.Drawing.SystemColors.GrayText;
this.lblMiscSettings.Location = new System.Drawing.Point(0, 191);
this.lblMiscSettings.Location = new System.Drawing.Point(0, 193);
this.lblMiscSettings.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
this.lblMiscSettings.Name = "lblMiscSettings";
this.lblMiscSettings.Size = new System.Drawing.Size(73, 13);
@ -318,7 +337,7 @@ namespace Mesen.GUI.Forms.Config
// chkAutoLoadIps
//
this.chkAutoLoadIps.AutoSize = true;
this.chkAutoLoadIps.Location = new System.Drawing.Point(13, 207);
this.chkAutoLoadIps.Location = new System.Drawing.Point(13, 209);
this.chkAutoLoadIps.Margin = new System.Windows.Forms.Padding(13, 3, 3, 3);
this.chkAutoLoadIps.Name = "chkAutoLoadIps";
this.chkAutoLoadIps.Size = new System.Drawing.Size(198, 17);
@ -329,7 +348,7 @@ namespace Mesen.GUI.Forms.Config
// chkDisplayMovieIcons
//
this.chkDisplayMovieIcons.AutoSize = true;
this.chkDisplayMovieIcons.Location = new System.Drawing.Point(13, 276);
this.chkDisplayMovieIcons.Location = new System.Drawing.Point(13, 278);
this.chkDisplayMovieIcons.Margin = new System.Windows.Forms.Padding(13, 3, 3, 3);
this.chkDisplayMovieIcons.Name = "chkDisplayMovieIcons";
this.chkDisplayMovieIcons.Size = new System.Drawing.Size(304, 17);
@ -340,7 +359,7 @@ namespace Mesen.GUI.Forms.Config
// chkAutoHideMenu
//
this.chkAutoHideMenu.AutoSize = true;
this.chkAutoHideMenu.Location = new System.Drawing.Point(13, 230);
this.chkAutoHideMenu.Location = new System.Drawing.Point(13, 232);
this.chkAutoHideMenu.Margin = new System.Windows.Forms.Padding(13, 3, 3, 3);
this.chkAutoHideMenu.Name = "chkAutoHideMenu";
this.chkAutoHideMenu.Size = new System.Drawing.Size(158, 17);
@ -351,7 +370,7 @@ namespace Mesen.GUI.Forms.Config
// chkHidePauseOverlay
//
this.chkHidePauseOverlay.AutoSize = true;
this.chkHidePauseOverlay.Location = new System.Drawing.Point(13, 95);
this.chkHidePauseOverlay.Location = new System.Drawing.Point(13, 120);
this.chkHidePauseOverlay.Margin = new System.Windows.Forms.Padding(13, 3, 3, 3);
this.chkHidePauseOverlay.Name = "chkHidePauseOverlay";
this.chkHidePauseOverlay.Size = new System.Drawing.Size(133, 17);
@ -359,40 +378,6 @@ namespace Mesen.GUI.Forms.Config
this.chkHidePauseOverlay.Text = "Hide the pause screen";
this.chkHidePauseOverlay.UseVisualStyleBackColor = true;
//
// chkAllowBackgroundInput
//
this.chkAllowBackgroundInput.AutoSize = true;
this.chkAllowBackgroundInput.Location = new System.Drawing.Point(13, 164);
this.chkAllowBackgroundInput.Margin = new System.Windows.Forms.Padding(13, 3, 3, 3);
this.chkAllowBackgroundInput.Name = "chkAllowBackgroundInput";
this.chkAllowBackgroundInput.Size = new System.Drawing.Size(177, 17);
this.chkAllowBackgroundInput.TabIndex = 14;
this.chkAllowBackgroundInput.Text = "Allow input when in background";
this.chkAllowBackgroundInput.UseVisualStyleBackColor = true;
//
// chkPauseWhenInBackground
//
this.chkPauseWhenInBackground.AutoSize = true;
this.chkPauseWhenInBackground.Location = new System.Drawing.Point(13, 141);
this.chkPauseWhenInBackground.Margin = new System.Windows.Forms.Padding(13, 3, 3, 3);
this.chkPauseWhenInBackground.Name = "chkPauseWhenInBackground";
this.chkPauseWhenInBackground.Size = new System.Drawing.Size(204, 17);
this.chkPauseWhenInBackground.TabIndex = 13;
this.chkPauseWhenInBackground.Text = "Pause emulation when in background";
this.chkPauseWhenInBackground.UseVisualStyleBackColor = true;
this.chkPauseWhenInBackground.CheckedChanged += new System.EventHandler(this.chkPauseWhenInBackground_CheckedChanged);
//
// chkPauseOnMovieEnd
//
this.chkPauseOnMovieEnd.AutoSize = true;
this.chkPauseOnMovieEnd.Location = new System.Drawing.Point(13, 118);
this.chkPauseOnMovieEnd.Margin = new System.Windows.Forms.Padding(13, 3, 3, 3);
this.chkPauseOnMovieEnd.Name = "chkPauseOnMovieEnd";
this.chkPauseOnMovieEnd.Size = new System.Drawing.Size(199, 17);
this.chkPauseOnMovieEnd.TabIndex = 15;
this.chkPauseOnMovieEnd.Text = "Pause when a movie finishes playing";
this.chkPauseOnMovieEnd.UseVisualStyleBackColor = true;
//
// tableLayoutPanel5
//
this.tableLayoutPanel5.ColumnCount = 3;
@ -435,7 +420,7 @@ namespace Mesen.GUI.Forms.Config
// chkConfirmExitResetPower
//
this.chkConfirmExitResetPower.AutoSize = true;
this.chkConfirmExitResetPower.Location = new System.Drawing.Point(13, 253);
this.chkConfirmExitResetPower.Location = new System.Drawing.Point(13, 255);
this.chkConfirmExitResetPower.Margin = new System.Windows.Forms.Padding(13, 3, 3, 3);
this.chkConfirmExitResetPower.Name = "chkConfirmExitResetPower";
this.chkConfirmExitResetPower.Size = new System.Drawing.Size(293, 17);
@ -443,6 +428,72 @@ namespace Mesen.GUI.Forms.Config
this.chkConfirmExitResetPower.Text = "Display confirmation dialog before reset/power cycle/exit";
this.chkConfirmExitResetPower.UseVisualStyleBackColor = true;
//
// flowLayoutPanel8
//
this.flowLayoutPanel8.Controls.Add(this.lblPauseIn);
this.flowLayoutPanel8.Controls.Add(this.chkPauseWhenInBackground);
this.flowLayoutPanel8.Controls.Add(this.chkPauseInMenuAndConfig);
this.flowLayoutPanel8.Controls.Add(this.chkPauseInDebugger);
this.flowLayoutPanel8.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel8.Location = new System.Drawing.Point(7, 95);
this.flowLayoutPanel8.Margin = new System.Windows.Forms.Padding(7, 3, 0, 0);
this.flowLayoutPanel8.Name = "flowLayoutPanel8";
this.flowLayoutPanel8.Size = new System.Drawing.Size(476, 22);
this.flowLayoutPanel8.TabIndex = 28;
//
// lblPauseIn
//
this.lblPauseIn.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblPauseIn.AutoSize = true;
this.lblPauseIn.Location = new System.Drawing.Point(3, 4);
this.lblPauseIn.Margin = new System.Windows.Forms.Padding(3, 0, 3, 1);
this.lblPauseIn.Name = "lblPauseIn";
this.lblPauseIn.Size = new System.Drawing.Size(80, 13);
this.lblPauseIn.TabIndex = 0;
this.lblPauseIn.Text = "Pause when in:";
//
// chkPauseWhenInBackground
//
this.chkPauseWhenInBackground.AutoSize = true;
this.chkPauseWhenInBackground.Location = new System.Drawing.Point(89, 3);
this.chkPauseWhenInBackground.Name = "chkPauseWhenInBackground";
this.chkPauseWhenInBackground.Size = new System.Drawing.Size(84, 17);
this.chkPauseWhenInBackground.TabIndex = 13;
this.chkPauseWhenInBackground.Text = "Background";
this.chkPauseWhenInBackground.UseVisualStyleBackColor = true;
this.chkPauseWhenInBackground.CheckedChanged += new System.EventHandler(this.chkPauseWhenInBackground_CheckedChanged);
//
// chkPauseInMenuAndConfig
//
this.chkPauseInMenuAndConfig.AutoSize = true;
this.chkPauseInMenuAndConfig.Location = new System.Drawing.Point(179, 3);
this.chkPauseInMenuAndConfig.Name = "chkPauseInMenuAndConfig";
this.chkPauseInMenuAndConfig.Size = new System.Drawing.Size(142, 17);
this.chkPauseInMenuAndConfig.TabIndex = 16;
this.chkPauseInMenuAndConfig.Text = "Menu and config dialogs";
this.chkPauseInMenuAndConfig.UseVisualStyleBackColor = true;
//
// chkPauseInDebugger
//
this.chkPauseInDebugger.AutoSize = true;
this.chkPauseInDebugger.Location = new System.Drawing.Point(327, 3);
this.chkPauseInDebugger.Name = "chkPauseInDebugger";
this.chkPauseInDebugger.Size = new System.Drawing.Size(103, 17);
this.chkPauseInDebugger.TabIndex = 18;
this.chkPauseInDebugger.Text = "Debugging tools";
this.chkPauseInDebugger.UseVisualStyleBackColor = true;
//
// chkAllowBackgroundInput
//
this.chkAllowBackgroundInput.AutoSize = true;
this.chkAllowBackgroundInput.Location = new System.Drawing.Point(13, 166);
this.chkAllowBackgroundInput.Margin = new System.Windows.Forms.Padding(13, 3, 3, 3);
this.chkAllowBackgroundInput.Name = "chkAllowBackgroundInput";
this.chkAllowBackgroundInput.Size = new System.Drawing.Size(177, 17);
this.chkAllowBackgroundInput.TabIndex = 14;
this.chkAllowBackgroundInput.Text = "Allow input when in background";
this.chkAllowBackgroundInput.UseVisualStyleBackColor = true;
//
// tabMain
//
this.tabMain.Controls.Add(this.tpgGeneral);
@ -712,6 +763,17 @@ namespace Mesen.GUI.Forms.Config
this.tableLayoutPanel4.Size = new System.Drawing.Size(471, 71);
this.tableLayoutPanel4.TabIndex = 0;
//
// chkAllowMismatchingSaveStates
//
this.chkAllowMismatchingSaveStates.Checked = false;
this.chkAllowMismatchingSaveStates.Dock = System.Windows.Forms.DockStyle.Fill;
this.chkAllowMismatchingSaveStates.Location = new System.Drawing.Point(0, 46);
this.chkAllowMismatchingSaveStates.MinimumSize = new System.Drawing.Size(0, 21);
this.chkAllowMismatchingSaveStates.Name = "chkAllowMismatchingSaveStates";
this.chkAllowMismatchingSaveStates.Size = new System.Drawing.Size(471, 23);
this.chkAllowMismatchingSaveStates.TabIndex = 7;
this.chkAllowMismatchingSaveStates.Text = "Allow save states to be loaded on modified ROMs (e.g IPS patches)";
//
// chkAutoSaveNotify
//
this.chkAutoSaveNotify.Anchor = System.Windows.Forms.AnchorStyles.Left;
@ -785,7 +847,7 @@ namespace Mesen.GUI.Forms.Config
this.lblAutoSave.AutoSize = true;
this.lblAutoSave.Location = new System.Drawing.Point(262, 5);
this.lblAutoSave.Name = "lblAutoSave";
this.lblAutoSave.Size = new System.Drawing.Size(99, 13);
this.lblAutoSave.Size = new System.Drawing.Size(43, 13);
this.lblAutoSave.TabIndex = 2;
this.lblAutoSave.Text = "minutes";
//
@ -1721,17 +1783,6 @@ namespace Mesen.GUI.Forms.Config
this.tmrSyncDateTime.Enabled = true;
this.tmrSyncDateTime.Tick += new System.EventHandler(this.tmrSyncDateTime_Tick);
//
// chkAllowMismatchingSaveStates
//
this.chkAllowMismatchingSaveStates.Checked = false;
this.chkAllowMismatchingSaveStates.Dock = System.Windows.Forms.DockStyle.Fill;
this.chkAllowMismatchingSaveStates.Location = new System.Drawing.Point(0, 46);
this.chkAllowMismatchingSaveStates.MinimumSize = new System.Drawing.Size(0, 21);
this.chkAllowMismatchingSaveStates.Name = "chkAllowMismatchingSaveStates";
this.chkAllowMismatchingSaveStates.Size = new System.Drawing.Size(471, 23);
this.chkAllowMismatchingSaveStates.TabIndex = 7;
this.chkAllowMismatchingSaveStates.Text = "Allow save states to be loaded on modified ROMs (e.g IPS patches)";
//
// frmPreferences
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -1753,6 +1804,8 @@ namespace Mesen.GUI.Forms.Config
this.flowLayoutPanel2.PerformLayout();
this.tableLayoutPanel5.ResumeLayout(false);
this.tableLayoutPanel5.PerformLayout();
this.flowLayoutPanel8.ResumeLayout(false);
this.flowLayoutPanel8.PerformLayout();
this.tabMain.ResumeLayout(false);
this.tpgGeneral.ResumeLayout(false);
this.tpgShortcuts.ResumeLayout(false);
@ -1819,7 +1872,6 @@ namespace Mesen.GUI.Forms.Config
private System.Windows.Forms.CheckBox chkFdsFormat;
private System.Windows.Forms.CheckBox chkMmoFormat;
private System.Windows.Forms.CheckBox chkAllowBackgroundInput;
private System.Windows.Forms.CheckBox chkPauseOnMovieEnd;
private System.Windows.Forms.Button btnOpenMesenFolder;
private System.Windows.Forms.CheckBox chkAutomaticallyCheckForUpdates;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2;
@ -1922,5 +1974,10 @@ namespace Mesen.GUI.Forms.Config
private System.Windows.Forms.CheckBox chkAlwaysOnTop;
private System.Windows.Forms.CheckBox chkShowFullPathInRecents;
private ctrlRiskyOption chkAllowMismatchingSaveStates;
private System.Windows.Forms.CheckBox chkPauseOnMovieEnd;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel8;
private System.Windows.Forms.Label lblPauseIn;
private System.Windows.Forms.CheckBox chkPauseInMenuAndConfig;
private System.Windows.Forms.CheckBox chkPauseInDebugger;
}
}

View file

@ -46,6 +46,9 @@ namespace Mesen.GUI.Forms.Config
AddBinding("FdsAutoInsertDisk", chkFdsAutoInsertDisk);
AddBinding("PauseWhenInBackground", chkPauseWhenInBackground);
AddBinding("PauseWhenInMenusAndConfig", chkPauseInMenuAndConfig);
AddBinding("PauseWhenInDebuggingTools", chkPauseInDebugger);
AddBinding("AllowBackgroundInput", chkAllowBackgroundInput);
AddBinding("ConfirmExitResetPower", chkConfirmExitResetPower);

View file

@ -46,6 +46,7 @@ namespace Mesen.GUI.Forms
this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator();
this.mnuSaveState = new System.Windows.Forms.ToolStripMenuItem();
this.mnuLoadState = new System.Windows.Forms.ToolStripMenuItem();
this.mnuLoadLastSession = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem7 = new System.Windows.Forms.ToolStripSeparator();
this.mnuRecentFiles = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripSeparator();
@ -204,7 +205,6 @@ namespace Mesen.GUI.Forms
this.mnuReportBug = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripSeparator();
this.mnuAbout = new System.Windows.Forms.ToolStripMenuItem();
this.mnuLoadLastSession = new System.Windows.Forms.ToolStripMenuItem();
this.panelRenderer.SuspendLayout();
this.panelInfo.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picIcon)).BeginInit();
@ -343,7 +343,9 @@ namespace Mesen.GUI.Forms
this.mnuFile.ShortcutKeyDisplayString = "";
this.mnuFile.Size = new System.Drawing.Size(37, 20);
this.mnuFile.Text = "File";
this.mnuFile.DropDownClosed += new System.EventHandler(this.mnu_DropDownClosed);
this.mnuFile.DropDownOpening += new System.EventHandler(this.mnuFile_DropDownOpening);
this.mnuFile.DropDownOpened += new System.EventHandler(this.mnu_DropDownOpened);
//
// mnuOpen
//
@ -371,6 +373,12 @@ namespace Mesen.GUI.Forms
this.mnuLoadState.Text = "Load State";
this.mnuLoadState.DropDownOpening += new System.EventHandler(this.mnuLoadState_DropDownOpening);
//
// mnuLoadLastSession
//
this.mnuLoadLastSession.Name = "mnuLoadLastSession";
this.mnuLoadLastSession.Size = new System.Drawing.Size(166, 22);
this.mnuLoadLastSession.Text = "Load Last Session";
//
// toolStripMenuItem7
//
this.toolStripMenuItem7.Name = "toolStripMenuItem7";
@ -417,7 +425,9 @@ namespace Mesen.GUI.Forms
this.mnuGame.Name = "mnuGame";
this.mnuGame.Size = new System.Drawing.Size(50, 20);
this.mnuGame.Text = "Game";
this.mnuGame.DropDownClosed += new System.EventHandler(this.mnu_DropDownClosed);
this.mnuGame.DropDownOpening += new System.EventHandler(this.mnuGame_DropDownOpening);
this.mnuGame.DropDownOpened += new System.EventHandler(this.mnu_DropDownOpened);
//
// mnuPause
//
@ -576,6 +586,8 @@ namespace Mesen.GUI.Forms
this.mnuOptions.Name = "mnuOptions";
this.mnuOptions.Size = new System.Drawing.Size(61, 20);
this.mnuOptions.Text = "Options";
this.mnuOptions.DropDownClosed += new System.EventHandler(this.mnu_DropDownClosed);
this.mnuOptions.DropDownOpened += new System.EventHandler(this.mnu_DropDownOpened);
//
// mnuEmulationSpeed
//
@ -1107,6 +1119,8 @@ namespace Mesen.GUI.Forms
this.mnuTools.Name = "mnuTools";
this.mnuTools.Size = new System.Drawing.Size(47, 20);
this.mnuTools.Text = "Tools";
this.mnuTools.DropDownClosed += new System.EventHandler(this.mnu_DropDownClosed);
this.mnuTools.DropDownOpened += new System.EventHandler(this.mnu_DropDownOpened);
//
// mnuNetPlay
//
@ -1468,7 +1482,9 @@ namespace Mesen.GUI.Forms
this.mnuDebug.Name = "mnuDebug";
this.mnuDebug.Size = new System.Drawing.Size(54, 20);
this.mnuDebug.Text = "Debug";
this.mnuDebug.DropDownClosed += new System.EventHandler(this.mnu_DropDownClosed);
this.mnuDebug.DropDownOpening += new System.EventHandler(this.mnuDebug_DropDownOpening);
this.mnuDebug.DropDownOpened += new System.EventHandler(this.mnu_DropDownOpened);
//
// mnuApuViewer
//
@ -1561,6 +1577,8 @@ namespace Mesen.GUI.Forms
this.mnuHelp.Name = "mnuHelp";
this.mnuHelp.Size = new System.Drawing.Size(44, 20);
this.mnuHelp.Text = "Help";
this.mnuHelp.DropDownClosed += new System.EventHandler(this.mnu_DropDownClosed);
this.mnuHelp.DropDownOpened += new System.EventHandler(this.mnu_DropDownOpened);
//
// mnuOnlineHelp
//
@ -1617,12 +1635,6 @@ namespace Mesen.GUI.Forms
this.mnuAbout.Text = "About";
this.mnuAbout.Click += new System.EventHandler(this.mnuAbout_Click);
//
// mnuLoadLastSession
//
this.mnuLoadLastSession.Name = "mnuLoadLastSession";
this.mnuLoadLastSession.Size = new System.Drawing.Size(166, 22);
this.mnuLoadLastSession.Text = "Load Last Session";
//
// frmMain
//
this.AllowDrop = true;

View file

@ -1265,5 +1265,20 @@ namespace Mesen.GUI.Forms
this.menuStrip.Visible = nsfPlayerPosition.Y < 30;
}
}
private void mnu_DropDownOpened(object sender, EventArgs e)
{
_inMenu++;
}
private void mnu_DropDownClosed(object sender, EventArgs e)
{
Task.Run(() => {
Thread.Sleep(100);
this.BeginInvoke((Action)(() => {
_inMenu--;
}));
});
}
}
}