UI: Option to automatically Hide UI when game launches
Quality of life feature. Removes the need to manually hide UI every time the game launches
This commit is contained in:
parent
9df1366fa1
commit
c7270334ea
@ -17,7 +17,7 @@ namespace Ryujinx.UI.Common.Configuration
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The current version of the file format
|
/// The current version of the file format
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const int CurrentVersion = 57;
|
public const int CurrentVersion = 58;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Version of the configuration file format
|
/// Version of the configuration file format
|
||||||
@ -351,6 +351,11 @@ namespace Ryujinx.UI.Common.Configuration
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool StartFullscreen { get; set; }
|
public bool StartFullscreen { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Start games with UI hidden
|
||||||
|
/// </summary>
|
||||||
|
public bool StartNoUI { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Show console window
|
/// Show console window
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -638,6 +638,15 @@ namespace Ryujinx.UI.Common.Configuration
|
|||||||
configurationFileUpdated = true;
|
configurationFileUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (configurationFileFormat.Version < 58)
|
||||||
|
{
|
||||||
|
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 17.");
|
||||||
|
|
||||||
|
configurationFileFormat.StartNoUI = false;
|
||||||
|
|
||||||
|
configurationFileUpdated = true;
|
||||||
|
}
|
||||||
|
|
||||||
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
|
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
|
||||||
Graphics.ResScale.Value = configurationFileFormat.ResScale;
|
Graphics.ResScale.Value = configurationFileFormat.ResScale;
|
||||||
Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
|
Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
|
||||||
@ -719,6 +728,7 @@ namespace Ryujinx.UI.Common.Configuration
|
|||||||
UI.GridSize.Value = configurationFileFormat.GridSize;
|
UI.GridSize.Value = configurationFileFormat.GridSize;
|
||||||
UI.ApplicationSort.Value = configurationFileFormat.ApplicationSort;
|
UI.ApplicationSort.Value = configurationFileFormat.ApplicationSort;
|
||||||
UI.StartFullscreen.Value = configurationFileFormat.StartFullscreen;
|
UI.StartFullscreen.Value = configurationFileFormat.StartFullscreen;
|
||||||
|
UI.StartNoUI.Value = configurationFileFormat.StartNoUI;
|
||||||
UI.ShowConsole.Value = configurationFileFormat.ShowConsole;
|
UI.ShowConsole.Value = configurationFileFormat.ShowConsole;
|
||||||
UI.WindowStartup.WindowSizeWidth.Value = configurationFileFormat.WindowStartup.WindowSizeWidth;
|
UI.WindowStartup.WindowSizeWidth.Value = configurationFileFormat.WindowStartup.WindowSizeWidth;
|
||||||
UI.WindowStartup.WindowSizeHeight.Value = configurationFileFormat.WindowStartup.WindowSizeHeight;
|
UI.WindowStartup.WindowSizeHeight.Value = configurationFileFormat.WindowStartup.WindowSizeHeight;
|
||||||
|
@ -149,6 +149,11 @@ namespace Ryujinx.UI.Common.Configuration
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ReactiveObject<bool> StartFullscreen { get; private set; }
|
public ReactiveObject<bool> StartFullscreen { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Start games with UI hidden
|
||||||
|
/// </summary>
|
||||||
|
public ReactiveObject<bool> StartNoUI { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Hide / Show Console Window
|
/// Hide / Show Console Window
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -189,6 +194,7 @@ namespace Ryujinx.UI.Common.Configuration
|
|||||||
WindowStartup = new WindowStartupSettings();
|
WindowStartup = new WindowStartupSettings();
|
||||||
BaseStyle = new ReactiveObject<string>();
|
BaseStyle = new ReactiveObject<string>();
|
||||||
StartFullscreen = new ReactiveObject<bool>();
|
StartFullscreen = new ReactiveObject<bool>();
|
||||||
|
StartNoUI = new ReactiveObject<bool>();
|
||||||
GameListViewMode = new ReactiveObject<int>();
|
GameListViewMode = new ReactiveObject<int>();
|
||||||
ShowNames = new ReactiveObject<bool>();
|
ShowNames = new ReactiveObject<bool>();
|
||||||
GridSize = new ReactiveObject<int>();
|
GridSize = new ReactiveObject<int>();
|
||||||
|
@ -124,6 +124,7 @@ namespace Ryujinx.UI.Common.Configuration
|
|||||||
ApplicationSort = UI.ApplicationSort,
|
ApplicationSort = UI.ApplicationSort,
|
||||||
IsAscendingOrder = UI.IsAscendingOrder,
|
IsAscendingOrder = UI.IsAscendingOrder,
|
||||||
StartFullscreen = UI.StartFullscreen,
|
StartFullscreen = UI.StartFullscreen,
|
||||||
|
StartNoUI = UI.StartNoUI,
|
||||||
ShowConsole = UI.ShowConsole,
|
ShowConsole = UI.ShowConsole,
|
||||||
EnableKeyboard = Hid.EnableKeyboard,
|
EnableKeyboard = Hid.EnableKeyboard,
|
||||||
EnableMouse = Hid.EnableMouse,
|
EnableMouse = Hid.EnableMouse,
|
||||||
@ -230,6 +231,7 @@ namespace Ryujinx.UI.Common.Configuration
|
|||||||
UI.ApplicationSort.Value = 0;
|
UI.ApplicationSort.Value = 0;
|
||||||
UI.IsAscendingOrder.Value = true;
|
UI.IsAscendingOrder.Value = true;
|
||||||
UI.StartFullscreen.Value = false;
|
UI.StartFullscreen.Value = false;
|
||||||
|
UI.StartNoUI.Value = false;
|
||||||
UI.ShowConsole.Value = true;
|
UI.ShowConsole.Value = true;
|
||||||
UI.WindowStartup.WindowSizeWidth.Value = 1280;
|
UI.WindowStartup.WindowSizeWidth.Value = 1280;
|
||||||
UI.WindowStartup.WindowSizeHeight.Value = 760;
|
UI.WindowStartup.WindowSizeHeight.Value = 760;
|
||||||
|
@ -1049,6 +1049,14 @@ namespace Ryujinx.Ava
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
|
{
|
||||||
|
if (_viewModel.StartGamesWithoutUI)
|
||||||
|
{
|
||||||
|
_viewModel.ShowMenuAndStatusBar = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
_renderer = Device.Gpu.Renderer is ThreadedRenderer tr ? tr.BaseRenderer : Device.Gpu.Renderer;
|
_renderer = Device.Gpu.Renderer is ThreadedRenderer tr ? tr.BaseRenderer : Device.Gpu.Renderer;
|
||||||
|
|
||||||
_renderer.ScreenCaptured += Renderer_ScreenCaptured;
|
_renderer.ScreenCaptured += Renderer_ScreenCaptured;
|
||||||
|
@ -549,6 +549,30 @@
|
|||||||
"zh_TW": "使用全螢幕模式啟動遊戲"
|
"zh_TW": "使用全螢幕模式啟動遊戲"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"ID": "MenuBarOptionsStartGamesWithoutUI",
|
||||||
|
"Translations": {
|
||||||
|
"ar_SA": "",
|
||||||
|
"de_DE": "",
|
||||||
|
"el_GR": "",
|
||||||
|
"en_US": "Start Games with UI Hidden",
|
||||||
|
"es_ES": "",
|
||||||
|
"fr_FR": "",
|
||||||
|
"he_IL": "",
|
||||||
|
"it_IT": "",
|
||||||
|
"ja_JP": "",
|
||||||
|
"ko_KR": "",
|
||||||
|
"no_NO": "",
|
||||||
|
"pl_PL": "",
|
||||||
|
"pt_BR": "",
|
||||||
|
"ru_RU": "",
|
||||||
|
"th_TH": "",
|
||||||
|
"tr_TR": "",
|
||||||
|
"uk_UA": "",
|
||||||
|
"zh_CN": "",
|
||||||
|
"zh_TW": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"ID": "MenuBarOptionsStopEmulation",
|
"ID": "MenuBarOptionsStopEmulation",
|
||||||
"Translations": {
|
"Translations": {
|
||||||
|
@ -853,6 +853,19 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool StartGamesWithoutUI
|
||||||
|
{
|
||||||
|
get => ConfigurationState.Instance.UI.StartNoUI;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
ConfigurationState.Instance.UI.StartNoUI.Value = value;
|
||||||
|
|
||||||
|
ConfigurationState.Instance.ToFileFormat().SaveConfig(Program.ConfigurationPath);
|
||||||
|
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool ShowConsole
|
public bool ShowConsole
|
||||||
{
|
{
|
||||||
get => ConfigurationState.Instance.UI.ShowConsole;
|
get => ConfigurationState.Instance.UI.ShowConsole;
|
||||||
@ -1590,6 +1603,11 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
StartGamesInFullscreen = !StartGamesInFullscreen;
|
StartGamesInFullscreen = !StartGamesInFullscreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ToggleStartGamesWithoutUI()
|
||||||
|
{
|
||||||
|
StartGamesWithoutUI = !StartGamesWithoutUI;
|
||||||
|
}
|
||||||
|
|
||||||
public void ToggleShowConsole()
|
public void ToggleShowConsole()
|
||||||
{
|
{
|
||||||
ShowConsole = !ShowConsole;
|
ShowConsole = !ShowConsole;
|
||||||
|
@ -119,6 +119,29 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</MenuItem.Styles>
|
</MenuItem.Styles>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
<MenuItem
|
||||||
|
Padding="0"
|
||||||
|
Command="{Binding ToggleStartGamesWithoutUI}"
|
||||||
|
Header="{ext:Locale MenuBarOptionsStartGamesWithoutUI}">
|
||||||
|
<MenuItem.Icon>
|
||||||
|
<CheckBox
|
||||||
|
MinWidth="{DynamicResource CheckBoxSize}"
|
||||||
|
MinHeight="{DynamicResource CheckBoxSize}"
|
||||||
|
IsChecked="{Binding StartGamesWithoutUI, Mode=TwoWay}"
|
||||||
|
Padding="0" />
|
||||||
|
</MenuItem.Icon>
|
||||||
|
<MenuItem.Styles>
|
||||||
|
<Style Selector="Viewbox#PART_IconPresenter">
|
||||||
|
<Setter Property="MaxHeight" Value="36" />
|
||||||
|
<Setter Property="MinHeight" Value="36" />
|
||||||
|
<Setter Property="MaxWidth" Value="36" />
|
||||||
|
<Setter Property="MinWidth" Value="36" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="ContentPresenter#PART_HeaderPresenter">
|
||||||
|
<Setter Property="Padding" Value="-10,0,0,0" />
|
||||||
|
</Style>
|
||||||
|
</MenuItem.Styles>
|
||||||
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Padding="0"
|
Padding="0"
|
||||||
IsVisible="{Binding ShowConsoleVisible}"
|
IsVisible="{Binding ShowConsoleVisible}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user