mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-09 20:29:11 +00:00
working on issue #4929
This commit is contained in:
parent
5a900f38c5
commit
b6478ea388
7 changed files with 47 additions and 3 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
using Avalonia.Controls;
|
||||||
using Gtk;
|
using Gtk;
|
||||||
using LibHac.Common;
|
using LibHac.Common;
|
||||||
using LibHac.Common.Keys;
|
using LibHac.Common.Keys;
|
||||||
|
@ -1442,7 +1443,19 @@ namespace Ryujinx.UI
|
||||||
_pauseEmulation.Sensitive = false;
|
_pauseEmulation.Sensitive = false;
|
||||||
_resumeEmulation.Sensitive = false;
|
_resumeEmulation.Sensitive = false;
|
||||||
UpdateMenuItem.Sensitive = true;
|
UpdateMenuItem.Sensitive = true;
|
||||||
RendererWidget?.Exit();
|
|
||||||
|
Logger.Warning?.Print(LogClass.Emulation, "afgadfgasgfgsjhfgdsjfgds" + ConfigurationState.Instance.CloseOnEmulatorStop.Value);
|
||||||
|
//Shutdown if "Close Ryujinx on Emulator Stop" is enabled
|
||||||
|
if (ConfigurationState.Instance.CloseOnEmulatorStop.Value)
|
||||||
|
{
|
||||||
|
Logger.Warning?.Print(LogClass.Emulation, "Shut Ryujinx down" + ConfigurationState.Instance.CloseOnEmulatorStop.Value);
|
||||||
|
UserControl.CloseWindow();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Logger.Warning?.Print(LogClass.Emulation, "Don't shut Ryujinx down" + ConfigurationState.Instance.CloseOnEmulatorStop.Value);
|
||||||
|
RendererWidget?.Exit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PauseEmulation_Pressed(object sender, EventArgs args)
|
private void PauseEmulation_Pressed(object sender, EventArgs args)
|
||||||
|
@ -1451,7 +1464,7 @@ namespace Ryujinx.UI
|
||||||
_resumeEmulation.Sensitive = true;
|
_resumeEmulation.Sensitive = true;
|
||||||
_emulationContext.System.TogglePauseEmulation(true);
|
_emulationContext.System.TogglePauseEmulation(true);
|
||||||
Title = TitleHelper.ActiveApplicationTitle(_emulationContext.Processes.ActiveApplication, Program.Version, "Paused");
|
Title = TitleHelper.ActiveApplicationTitle(_emulationContext.Processes.ActiveApplication, Program.Version, "Paused");
|
||||||
Logger.Info?.Print(LogClass.Emulation, "Emulation was paused");
|
Logger.Info?.Print(LogClass.Emulation, "Emulation was dinkleberry");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ResumeEmulation_Pressed(object sender, EventArgs args)
|
private void ResumeEmulation_Pressed(object sender, EventArgs args)
|
||||||
|
|
|
@ -53,6 +53,7 @@ namespace Ryujinx.UI.Windows
|
||||||
[GUI] CheckButton _discordToggle;
|
[GUI] CheckButton _discordToggle;
|
||||||
[GUI] CheckButton _checkUpdatesToggle;
|
[GUI] CheckButton _checkUpdatesToggle;
|
||||||
[GUI] CheckButton _showConfirmExitToggle;
|
[GUI] CheckButton _showConfirmExitToggle;
|
||||||
|
[GUI] CheckButton _closeOnEmulatorStopToggle;
|
||||||
[GUI] RadioButton _hideCursorNever;
|
[GUI] RadioButton _hideCursorNever;
|
||||||
[GUI] RadioButton _hideCursorOnIdle;
|
[GUI] RadioButton _hideCursorOnIdle;
|
||||||
[GUI] RadioButton _hideCursorAlways;
|
[GUI] RadioButton _hideCursorAlways;
|
||||||
|
@ -230,6 +231,11 @@ namespace Ryujinx.UI.Windows
|
||||||
_showConfirmExitToggle.Click();
|
_showConfirmExitToggle.Click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ConfigurationState.Instance.CloseOnEmulatorStop)
|
||||||
|
{
|
||||||
|
_closeOnEmulatorStopToggle.Click();
|
||||||
|
}
|
||||||
|
|
||||||
switch (ConfigurationState.Instance.HideCursor.Value)
|
switch (ConfigurationState.Instance.HideCursor.Value)
|
||||||
{
|
{
|
||||||
case HideCursorMode.Never:
|
case HideCursorMode.Never:
|
||||||
|
@ -627,6 +633,7 @@ namespace Ryujinx.UI.Windows
|
||||||
ConfigurationState.Instance.EnableDiscordIntegration.Value = _discordToggle.Active;
|
ConfigurationState.Instance.EnableDiscordIntegration.Value = _discordToggle.Active;
|
||||||
ConfigurationState.Instance.CheckUpdatesOnStart.Value = _checkUpdatesToggle.Active;
|
ConfigurationState.Instance.CheckUpdatesOnStart.Value = _checkUpdatesToggle.Active;
|
||||||
ConfigurationState.Instance.ShowConfirmExit.Value = _showConfirmExitToggle.Active;
|
ConfigurationState.Instance.ShowConfirmExit.Value = _showConfirmExitToggle.Active;
|
||||||
|
ConfigurationState.Instance.CloseOnEmulatorStop.Value = _closeOnEmulatorStopToggle.Active;
|
||||||
ConfigurationState.Instance.HideCursor.Value = hideCursor;
|
ConfigurationState.Instance.HideCursor.Value = hideCursor;
|
||||||
ConfigurationState.Instance.Graphics.EnableVsync.Value = _vSyncToggle.Active;
|
ConfigurationState.Instance.Graphics.EnableVsync.Value = _vSyncToggle.Active;
|
||||||
ConfigurationState.Instance.Graphics.EnableShaderCache.Value = _shaderCacheToggle.Active;
|
ConfigurationState.Instance.Graphics.EnableShaderCache.Value = _shaderCacheToggle.Active;
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Configuration;
|
using Ryujinx.Common.Configuration;
|
||||||
using Ryujinx.Common.Configuration.Hid;
|
using Ryujinx.Common.Configuration.Hid;
|
||||||
using Ryujinx.Common.Configuration.Multiplayer;
|
using Ryujinx.Common.Configuration.Multiplayer;
|
||||||
|
@ -162,6 +163,11 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool ShowConfirmExit { get; set; }
|
public bool ShowConfirmExit { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Close Ryujinx on Emulator Stop
|
||||||
|
/// </summary>
|
||||||
|
public bool CloseOnEmulatorStop { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether to hide cursor on idle, always or never
|
/// Whether to hide cursor on idle, always or never
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -626,6 +626,11 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ReactiveObject<bool> ShowConfirmExit { get; private set; }
|
public ReactiveObject<bool> ShowConfirmExit { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Close Ryujinx on Emulator Stop
|
||||||
|
/// </summary>
|
||||||
|
public ReactiveObject<bool> CloseOnEmulatorStop { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Hide Cursor on Idle
|
/// Hide Cursor on Idle
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -642,6 +647,7 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
EnableDiscordIntegration = new ReactiveObject<bool>();
|
EnableDiscordIntegration = new ReactiveObject<bool>();
|
||||||
CheckUpdatesOnStart = new ReactiveObject<bool>();
|
CheckUpdatesOnStart = new ReactiveObject<bool>();
|
||||||
ShowConfirmExit = new ReactiveObject<bool>();
|
ShowConfirmExit = new ReactiveObject<bool>();
|
||||||
|
CloseOnEmulatorStop = new ReactiveObject<bool>();
|
||||||
HideCursor = new ReactiveObject<HideCursorMode>();
|
HideCursor = new ReactiveObject<HideCursorMode>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -678,6 +684,7 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
EnableDiscordIntegration = EnableDiscordIntegration,
|
EnableDiscordIntegration = EnableDiscordIntegration,
|
||||||
CheckUpdatesOnStart = CheckUpdatesOnStart,
|
CheckUpdatesOnStart = CheckUpdatesOnStart,
|
||||||
ShowConfirmExit = ShowConfirmExit,
|
ShowConfirmExit = ShowConfirmExit,
|
||||||
|
CloseOnEmulatorStop = CloseOnEmulatorStop,
|
||||||
HideCursor = HideCursor,
|
HideCursor = HideCursor,
|
||||||
EnableVsync = Graphics.EnableVsync,
|
EnableVsync = Graphics.EnableVsync,
|
||||||
EnableShaderCache = Graphics.EnableShaderCache,
|
EnableShaderCache = Graphics.EnableShaderCache,
|
||||||
|
@ -785,6 +792,7 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
EnableDiscordIntegration.Value = true;
|
EnableDiscordIntegration.Value = true;
|
||||||
CheckUpdatesOnStart.Value = true;
|
CheckUpdatesOnStart.Value = true;
|
||||||
ShowConfirmExit.Value = true;
|
ShowConfirmExit.Value = true;
|
||||||
|
CloseOnEmulatorStop.Value = false;
|
||||||
HideCursor.Value = HideCursorMode.OnIdle;
|
HideCursor.Value = HideCursorMode.OnIdle;
|
||||||
Graphics.EnableVsync.Value = true;
|
Graphics.EnableVsync.Value = true;
|
||||||
Graphics.EnableShaderCache.Value = true;
|
Graphics.EnableShaderCache.Value = true;
|
||||||
|
@ -1056,6 +1064,8 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
|
|
||||||
configurationFileFormat.ShowConfirmExit = true;
|
configurationFileFormat.ShowConfirmExit = true;
|
||||||
|
|
||||||
|
configurationFileFormat.CloseOnEmulatorStop = false;
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
configurationFileUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1472,6 +1482,7 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
EnableDiscordIntegration.Value = configurationFileFormat.EnableDiscordIntegration;
|
EnableDiscordIntegration.Value = configurationFileFormat.EnableDiscordIntegration;
|
||||||
CheckUpdatesOnStart.Value = configurationFileFormat.CheckUpdatesOnStart;
|
CheckUpdatesOnStart.Value = configurationFileFormat.CheckUpdatesOnStart;
|
||||||
ShowConfirmExit.Value = configurationFileFormat.ShowConfirmExit;
|
ShowConfirmExit.Value = configurationFileFormat.ShowConfirmExit;
|
||||||
|
CloseOnEmulatorStop.Value = configurationFileFormat.CloseOnEmulatorStop;
|
||||||
HideCursor.Value = configurationFileFormat.HideCursor;
|
HideCursor.Value = configurationFileFormat.HideCursor;
|
||||||
Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync;
|
Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync;
|
||||||
Graphics.EnableShaderCache.Value = configurationFileFormat.EnableShaderCache;
|
Graphics.EnableShaderCache.Value = configurationFileFormat.EnableShaderCache;
|
||||||
|
|
|
@ -92,6 +92,7 @@
|
||||||
"SettingsTabGeneralEnableDiscordRichPresence": "Enable Discord Rich Presence",
|
"SettingsTabGeneralEnableDiscordRichPresence": "Enable Discord Rich Presence",
|
||||||
"SettingsTabGeneralCheckUpdatesOnLaunch": "Check for Updates on Launch",
|
"SettingsTabGeneralCheckUpdatesOnLaunch": "Check for Updates on Launch",
|
||||||
"SettingsTabGeneralShowConfirmExitDialog": "Show \"Confirm Exit\" Dialog",
|
"SettingsTabGeneralShowConfirmExitDialog": "Show \"Confirm Exit\" Dialog",
|
||||||
|
"SettingsTabGeneralCloseOnEmulatorStop": "Close Ryujinx on Emulator Stop",
|
||||||
"SettingsTabGeneralHideCursor": "Hide Cursor:",
|
"SettingsTabGeneralHideCursor": "Hide Cursor:",
|
||||||
"SettingsTabGeneralHideCursorNever": "Never",
|
"SettingsTabGeneralHideCursorNever": "Never",
|
||||||
"SettingsTabGeneralHideCursorOnIdle": "On Idle",
|
"SettingsTabGeneralHideCursorOnIdle": "On Idle",
|
||||||
|
|
|
@ -132,6 +132,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
public bool EnableDiscordIntegration { get; set; }
|
public bool EnableDiscordIntegration { get; set; }
|
||||||
public bool CheckUpdatesOnStart { get; set; }
|
public bool CheckUpdatesOnStart { get; set; }
|
||||||
public bool ShowConfirmExit { get; set; }
|
public bool ShowConfirmExit { get; set; }
|
||||||
|
public bool CloseOnEmulatorStop { get; set; }
|
||||||
public int HideCursor { get; set; }
|
public int HideCursor { get; set; }
|
||||||
public bool EnableDockedMode { get; set; }
|
public bool EnableDockedMode { get; set; }
|
||||||
public bool EnableKeyboard { get; set; }
|
public bool EnableKeyboard { get; set; }
|
||||||
|
@ -405,6 +406,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
EnableDiscordIntegration = config.EnableDiscordIntegration;
|
EnableDiscordIntegration = config.EnableDiscordIntegration;
|
||||||
CheckUpdatesOnStart = config.CheckUpdatesOnStart;
|
CheckUpdatesOnStart = config.CheckUpdatesOnStart;
|
||||||
ShowConfirmExit = config.ShowConfirmExit;
|
ShowConfirmExit = config.ShowConfirmExit;
|
||||||
|
CloseOnEmulatorStop = config.CloseOnEmulatorStop;
|
||||||
HideCursor = (int)config.HideCursor.Value;
|
HideCursor = (int)config.HideCursor.Value;
|
||||||
|
|
||||||
GameDirectories.Clear();
|
GameDirectories.Clear();
|
||||||
|
@ -489,6 +491,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
config.EnableDiscordIntegration.Value = EnableDiscordIntegration;
|
config.EnableDiscordIntegration.Value = EnableDiscordIntegration;
|
||||||
config.CheckUpdatesOnStart.Value = CheckUpdatesOnStart;
|
config.CheckUpdatesOnStart.Value = CheckUpdatesOnStart;
|
||||||
config.ShowConfirmExit.Value = ShowConfirmExit;
|
config.ShowConfirmExit.Value = ShowConfirmExit;
|
||||||
|
config.CloseOnEmulatorStop.Value = CloseOnEmulatorStop;
|
||||||
config.HideCursor.Value = (HideCursorMode)HideCursor;
|
config.HideCursor.Value = (HideCursorMode)HideCursor;
|
||||||
|
|
||||||
if (_directoryChanged)
|
if (_directoryChanged)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<UserControl
|
<UserControl
|
||||||
x:Class="Ryujinx.Ava.UI.Views.Settings.SettingsUiView"
|
x:Class="Ryujinx.Ava.UI.Views.Settings.SettingsUiView"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
@ -36,6 +36,9 @@
|
||||||
<CheckBox IsChecked="{Binding ShowConfirmExit}">
|
<CheckBox IsChecked="{Binding ShowConfirmExit}">
|
||||||
<TextBlock Text="{locale:Locale SettingsTabGeneralShowConfirmExitDialog}" />
|
<TextBlock Text="{locale:Locale SettingsTabGeneralShowConfirmExitDialog}" />
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
|
<CheckBox IsChecked="{Binding CloseOnEmulatorStop}">
|
||||||
|
<TextBlock Text="{locale:Locale SettingsTabGeneralCloseOnEmulatorStop}" />
|
||||||
|
</CheckBox>
|
||||||
<StackPanel Margin="0, 15, 0, 0" Orientation="Horizontal">
|
<StackPanel Margin="0, 15, 0, 0" Orientation="Horizontal">
|
||||||
<TextBlock VerticalAlignment="Center"
|
<TextBlock VerticalAlignment="Center"
|
||||||
Text="{locale:Locale SettingsTabGeneralHideCursor}"
|
Text="{locale:Locale SettingsTabGeneralHideCursor}"
|
||||||
|
|
Loading…
Reference in a new issue