settings: add Show Confirm Exist toggle (#1856)

This commit is contained in:
Bruno Macabeus 2021-01-14 22:30:52 +00:00 committed by GitHub
parent 5be6ec6364
commit 1e5b37c94f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 63 additions and 5 deletions

View file

@ -1,5 +1,5 @@
{
"version": 18,
"version": 20,
"res_scale": 1,
"res_scale_custom": 1,
"max_anisotropy": -1,
@ -21,6 +21,7 @@
"docked_mode": false,
"enable_discord_integration": true,
"check_updates_on_start": true,
"show_confirm_exit": true,
"enable_vsync": true,
"enable_shader_cache": true,
"enable_ptc": true,

View file

@ -154,7 +154,7 @@ namespace Ryujinx.Ui
{
if (keyboard.IsKeyDown(OpenTK.Input.Key.Escape))
{
if (GtkDialog.CreateExitDialog())
if (!ConfigurationState.Instance.ShowConfirmExit || GtkDialog.CreateExitDialog())
{
Exit();
}

View file

@ -907,7 +907,7 @@ namespace Ryujinx.Ui
private void Exit_Pressed(object sender, EventArgs args)
{
if (!_gameLoaded || GtkDialog.CreateExitDialog())
if (!_gameLoaded || !ConfigurationState.Instance.ShowConfirmExit || GtkDialog.CreateExitDialog())
{
End();
}
@ -915,7 +915,7 @@ namespace Ryujinx.Ui
private void Window_Close(object sender, DeleteEventArgs args)
{
if (!_gameLoaded || GtkDialog.CreateExitDialog())
if (!_gameLoaded || !ConfigurationState.Instance.ShowConfirmExit || GtkDialog.CreateExitDialog())
{
End();
}

View file

@ -41,6 +41,7 @@ namespace Ryujinx.Ui.Windows
[GUI] CheckButton _dockedModeToggle;
[GUI] CheckButton _discordToggle;
[GUI] CheckButton _checkUpdatesToggle;
[GUI] CheckButton _showConfirmExitToggle;
[GUI] CheckButton _vSyncToggle;
[GUI] CheckButton _shaderCacheToggle;
[GUI] CheckButton _ptcToggle;
@ -176,6 +177,11 @@ namespace Ryujinx.Ui.Windows
_checkUpdatesToggle.Click();
}
if (ConfigurationState.Instance.ShowConfirmExit)
{
_showConfirmExitToggle.Click();
}
if (ConfigurationState.Instance.Graphics.EnableVsync)
{
_vSyncToggle.Click();
@ -393,6 +399,7 @@ namespace Ryujinx.Ui.Windows
ConfigurationState.Instance.System.EnableDockedMode.Value = _dockedModeToggle.Active;
ConfigurationState.Instance.EnableDiscordIntegration.Value = _discordToggle.Active;
ConfigurationState.Instance.CheckUpdatesOnStart.Value = _checkUpdatesToggle.Active;
ConfigurationState.Instance.ShowConfirmExit.Value = _showConfirmExitToggle.Active;
ConfigurationState.Instance.Graphics.EnableVsync.Value = _vSyncToggle.Active;
ConfigurationState.Instance.Graphics.EnableShaderCache.Value = _shaderCacheToggle.Active;
ConfigurationState.Instance.System.EnablePtc.Value = _ptcToggle.Active;

View file

@ -137,6 +137,22 @@
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="_showConfirmExitToggle">
<property name="label" translatable="yes">Show "Confirm Exit" Dialog</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="halign">start</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>

View file

@ -1199,6 +1199,17 @@
false
]
},
"show_confirm_exit": {
"$id": "#/properties/show_confirm_exit",
"type": "boolean",
"title": "Show \"Confirm Exit\" Dialog",
"description": "Check to shows the \"Confirm Exit\" dialog when closing Ryujinx.",
"default": true,
"examples": [
true,
false
]
},
"enable_vsync": {
"$id": "#/properties/enable_vsync",
"type": "boolean",