Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Option to automatically Hide UI when game launches #462

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Ryujinx/AppHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ private void RenderLoop()
_viewModel.WindowState = WindowState.FullScreen;
}

if (_viewModel.WindowState is WindowState.FullScreen)
if (_viewModel.WindowState is WindowState.FullScreen || _viewModel.StartGamesWithoutUI)
{
_viewModel.ShowMenuAndStatusBar = false;
}
Expand Down
27 changes: 26 additions & 1 deletion src/Ryujinx/Assets/locales.json
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,31 @@
"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": "",
"sv_SE": "",
"th_TH": "",
"tr_TR": "",
"uk_UA": "",
"zh_CN": "",
"zh_TW": ""
}
},
{
"ID": "MenuBarOptionsStopEmulation",
"Translations": {
Expand Down Expand Up @@ -22598,4 +22623,4 @@
}
}
]
}
}
18 changes: 18 additions & 0 deletions src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,19 @@
}
}

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
{
get => ConfigurationState.Instance.UI.ShowConsole;
Expand Down Expand Up @@ -740,7 +753,7 @@
Applications.ToObservableChangeSet()
.Filter(Filter)
.Sort(GetComparer())
.Bind(out _appsObservableList).AsObservableList();

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / macOS Universal (Debug)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / macOS Universal (Debug)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / macOS Universal (Debug)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / macOS Universal (Debug)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / macOS Universal (Release)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / macOS Universal (Release)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / macOS Universal (Release)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / macOS Universal (Release)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / linux-x64 (Debug)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / linux-x64 (Debug)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / linux-x64 (Debug)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / linux-arm64 (Debug)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / linux-arm64 (Debug)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / linux-arm64 (Debug)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / osx-x64 (Debug)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / osx-x64 (Debug)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / linux-x64 (Release)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / linux-x64 (Release)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / linux-x64 (Release)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / linux-arm64 (Release)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / linux-arm64 (Release)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / linux-arm64 (Release)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / osx-x64 (Release)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

Check warning on line 756 in src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs

View workflow job for this annotation

GitHub Actions / pr_build / osx-x64 (Release)

The field Ryujinx.Ava.UI.ViewModels.MainWindowViewModel._appsObservableList is annotated with

OnPropertyChanged(nameof(AppsObservableList));
}
Expand Down Expand Up @@ -1192,6 +1205,11 @@
StartGamesInFullscreen = !StartGamesInFullscreen;
}

public void ToggleStartGamesWithoutUI()
{
StartGamesWithoutUI = !StartGamesWithoutUI;
}

public void ToggleShowConsole()
{
ShowConsole = !ShowConsole;
Expand Down
23 changes: 23 additions & 0 deletions src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,29 @@
</Style>
</MenuItem.Styles>
</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
Padding="0"
IsVisible="{Binding ShowConsoleVisible}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ConfigurationFileFormat
/// <summary>
/// The current version of the file format
/// </summary>
public const int CurrentVersion = 59;
public const int CurrentVersion = 60;

/// <summary>
/// Version of the configuration file format
Expand Down Expand Up @@ -351,6 +351,11 @@ public class ConfigurationFileFormat
/// </summary>
public bool StartFullscreen { get; set; }

/// <summary>
/// Start games with UI hidden
/// </summary>
public bool StartNoUI { get; set; }

/// <summary>
/// Show console window
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ in _migrations.OrderBy(x => x.Key))
UI.GridSize.Value = cff.GridSize;
UI.ApplicationSort.Value = cff.ApplicationSort;
UI.StartFullscreen.Value = cff.StartFullscreen;
UI.StartNoUI.Value = cff.StartNoUI;
UI.ShowConsole.Value = cff.ShowConsole;
UI.WindowStartup.WindowSizeWidth.Value = cff.WindowStartup.WindowSizeWidth;
UI.WindowStartup.WindowSizeHeight.Value = cff.WindowStartup.WindowSizeHeight;
Expand Down Expand Up @@ -414,7 +415,8 @@ in _migrations.OrderBy(x => x.Key))
// This was accidentally enabled by default when it was PRed. That is not what we want,
// so as a compromise users who want to use it will simply need to re-enable it once after updating.
cff.IgnoreApplet = false;
})
}),
(60, static cff => cff.StartNoUI = false)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ public WindowStartupSettings()
/// </summary>
public ReactiveObject<bool> StartFullscreen { get; private set; }

/// <summary>
/// Start games with UI hidden
/// </summary>
public ReactiveObject<bool> StartNoUI { get; private set; }

/// <summary>
/// Hide / Show Console Window
/// </summary>
Expand Down Expand Up @@ -192,6 +197,7 @@ public UISection()
WindowStartup = new WindowStartupSettings();
BaseStyle = new ReactiveObject<string>();
StartFullscreen = new ReactiveObject<bool>();
StartNoUI = new ReactiveObject<bool>();
GameListViewMode = new ReactiveObject<int>();
ShowNames = new ReactiveObject<bool>();
GridSize = new ReactiveObject<int>();
Expand Down
2 changes: 2 additions & 0 deletions src/Ryujinx/Utilities/Configuration/ConfigurationState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public ConfigurationFileFormat ToFileFormat()
ApplicationSort = UI.ApplicationSort,
IsAscendingOrder = UI.IsAscendingOrder,
StartFullscreen = UI.StartFullscreen,
StartNoUI = UI.StartNoUI,
ShowConsole = UI.ShowConsole,
EnableKeyboard = Hid.EnableKeyboard,
EnableMouse = Hid.EnableMouse,
Expand Down Expand Up @@ -233,6 +234,7 @@ public void LoadDefault()
UI.ApplicationSort.Value = 0;
UI.IsAscendingOrder.Value = true;
UI.StartFullscreen.Value = false;
UI.StartNoUI.Value = false;
UI.ShowConsole.Value = true;
UI.WindowStartup.WindowSizeWidth.Value = 1280;
UI.WindowStartup.WindowSizeHeight.Value = 760;
Expand Down
Loading