diff --git a/src/Ryujinx/Assets/locales.json b/src/Ryujinx/Assets/locales.json index 30e0c0cf8..39897c240 100644 --- a/src/Ryujinx/Assets/locales.json +++ b/src/Ryujinx/Assets/locales.json @@ -748,32 +748,7 @@ } }, { - "ID": "MenuBarTools", - "Translations": { - "ar_SA": "_الأدوات", - "de_DE": "", - "el_GR": "_Εργαλεία", - "en_US": "_Tools", - "es_ES": "_Herramientas", - "fr_FR": "_Outils", - "he_IL": "_כלים", - "it_IT": "_Strumenti", - "ja_JP": "ツール(_T)", - "ko_KR": "도구(_T)", - "no_NO": "_Verktøy", - "pl_PL": "_Narzędzia", - "pt_BR": "_Ferramentas", - "ru_RU": "_Инструменты", - "sv_SE": "V_erktyg", - "th_TH": "_เครื่องมือ", - "tr_TR": "_Araçlar", - "uk_UA": "_Інструменти", - "zh_CN": "工具(_T)", - "zh_TW": "工具(_T)" - } - }, - { - "ID": "MenuBarToolsInstallFirmware", + "ID": "MenuBarActionsInstallFirmware", "Translations": { "ar_SA": "تثبيت البرنامج الثابت", "de_DE": "Firmware installieren", @@ -798,7 +773,7 @@ } }, { - "ID": "MenuBarFileToolsInstallFirmwareFromFile", + "ID": "MenuBarActionsInstallFirmwareFromFile", "Translations": { "ar_SA": "تثبيت برنامج ثابت من XCI أو ZIP", "de_DE": "Firmware von einer XCI- oder einer ZIP-Datei installieren", @@ -823,7 +798,7 @@ } }, { - "ID": "MenuBarFileToolsInstallFirmwareFromDirectory", + "ID": "MenuBarActionsInstallFirmwareFromDirectory", "Translations": { "ar_SA": "تثبيت برنامج ثابت من مجلد", "de_DE": "Firmware aus einem Verzeichnis installieren", @@ -848,7 +823,7 @@ } }, { - "ID": "MenuBarToolsInstallKeys", + "ID": "MenuBarActionsInstallKeys", "Translations": { "ar_SA": "", "de_DE": "", @@ -873,7 +848,7 @@ } }, { - "ID": "MenuBarFileToolsInstallKeysFromFile", + "ID": "MenuBarFileActionsInstallKeysFromFile", "Translations": { "ar_SA": "", "de_DE": "", @@ -898,7 +873,7 @@ } }, { - "ID": "MenuBarFileToolsInstallKeysFromFolder", + "ID": "MenuBarFileActionsInstallKeysFromFolder", "Translations": { "ar_SA": "", "de_DE": "", @@ -923,7 +898,7 @@ } }, { - "ID": "MenuBarToolsManageFileTypes", + "ID": "MenuBarActionsManageFileTypes", "Translations": { "ar_SA": "إدارة أنواع الملفات", "de_DE": "Dateitypen verwalten", @@ -948,7 +923,7 @@ } }, { - "ID": "MenuBarToolsInstallFileTypes", + "ID": "MenuBarActionsInstallFileTypes", "Translations": { "ar_SA": "تثبيت أنواع الملفات", "de_DE": "Dateitypen installieren", @@ -973,7 +948,7 @@ } }, { - "ID": "MenuBarToolsUninstallFileTypes", + "ID": "MenuBarActionsUninstallFileTypes", "Translations": { "ar_SA": "إزالة أنواع الملفات", "de_DE": "Dateitypen deinstallieren", @@ -998,7 +973,7 @@ } }, { - "ID": "MenuBarToolsXCITrimmer", + "ID": "MenuBarActionsXCITrimmer", "Translations": { "ar_SA": "", "de_DE": "", @@ -22973,4 +22948,4 @@ } } ] -} +} \ No newline at end of file diff --git a/src/Ryujinx/UI/Controls/DlcSelectView.axaml.cs b/src/Ryujinx/UI/Controls/DlcSelectView.axaml.cs index c2144da2d..c011ca110 100644 --- a/src/Ryujinx/UI/Controls/DlcSelectView.axaml.cs +++ b/src/Ryujinx/UI/Controls/DlcSelectView.axaml.cs @@ -3,14 +3,11 @@ using Avalonia.Controls; using Avalonia.Markup.Xaml; using Avalonia.Styling; using FluentAvalonia.UI.Controls; -using LibHac.Tools.FsSystem.NcaUtils; -using Ryujinx.Ava.Common; using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.Common.Models; using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.ViewModels; using Ryujinx.Ava.Utilities.AppLibrary; -using Ryujinx.Ava.Utilities.Compat; using System.Threading.Tasks; namespace Ryujinx.Ava.UI.Controls @@ -22,9 +19,9 @@ namespace Ryujinx.Ava.UI.Controls InitializeComponent(); } - #nullable enable +#nullable enable public static async Task Show(ulong selectedTitleId, ApplicationLibrary appLibrary) - #nullable disable +#nullable disable { DlcSelectViewModel viewModel = new(selectedTitleId, appLibrary); @@ -52,4 +49,3 @@ namespace Ryujinx.Ava.UI.Controls } } } - diff --git a/src/Ryujinx/UI/Helpers/Commands.cs b/src/Ryujinx/UI/Helpers/Commands.cs index df24a7da1..868b49158 100644 --- a/src/Ryujinx/UI/Helpers/Commands.cs +++ b/src/Ryujinx/UI/Helpers/Commands.cs @@ -12,9 +12,9 @@ namespace Ryujinx.Ava.UI.Helpers public static RelayCommand CreateConditional(Action action, Func canExecute) => new(action, canExecute); - public static RelayCommand CreateWithArg(Action action) + public static RelayCommand Create(Action action) => new(action); - public static RelayCommand CreateConditionalWithArg(Action action, Predicate canExecute) + public static RelayCommand CreateConditional(Action action, Predicate canExecute) => new(action, canExecute); public static AsyncRelayCommand Create(Func action) @@ -24,11 +24,11 @@ namespace Ryujinx.Ava.UI.Helpers public static AsyncRelayCommand CreateSilentFail(Func action) => new(action, AsyncRelayCommandOptions.FlowExceptionsToTaskScheduler); - public static AsyncRelayCommand CreateWithArg(Func action) + public static AsyncRelayCommand Create(Func action) => new(action, AsyncRelayCommandOptions.None); - public static AsyncRelayCommand CreateConcurrentWithArg(Func action) + public static AsyncRelayCommand CreateConcurrent(Func action) => new(action, AsyncRelayCommandOptions.AllowConcurrentExecutions); - public static AsyncRelayCommand CreateSilentFailWithArg(Func action) + public static AsyncRelayCommand CreateSilentFail(Func action) => new(action, AsyncRelayCommandOptions.FlowExceptionsToTaskScheduler); public static AsyncRelayCommand CreateConditional(Func action, Func canExecute) @@ -38,11 +38,11 @@ namespace Ryujinx.Ava.UI.Helpers public static AsyncRelayCommand CreateSilentFailConditional(Func action, Func canExecute) => new(action, canExecute, AsyncRelayCommandOptions.FlowExceptionsToTaskScheduler); - public static AsyncRelayCommand CreateConditionalWithArg(Func action, Predicate canExecute) + public static AsyncRelayCommand CreateConditional(Func action, Predicate canExecute) => new(action, canExecute, AsyncRelayCommandOptions.None); - public static AsyncRelayCommand CreateConcurrentConditionalWithArg(Func action, Predicate canExecute) + public static AsyncRelayCommand CreateConcurrentConditional(Func action, Predicate canExecute) => new(action, canExecute, AsyncRelayCommandOptions.AllowConcurrentExecutions); - public static AsyncRelayCommand CreateSilentFailConditionalWithArg(Func action, Predicate canExecute) + public static AsyncRelayCommand CreateSilentFailConditional(Func action, Predicate canExecute) => new(action, canExecute, AsyncRelayCommandOptions.FlowExceptionsToTaskScheduler); } } diff --git a/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml b/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml index 6bce21851..1cd06bb7b 100644 --- a/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml +++ b/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml @@ -208,7 +208,7 @@ Name="ActionsMenuItem" VerticalAlignment="Center" Header="{ext:Locale MenuBarActions}" - IsEnabled="{Binding IsGameRunning}"> + IsVisible="{Binding !EnableNonGameRunningControls}"> - - - - + + + + - - - + + + - - - + + + - + diff --git a/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs b/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs index 521460012..9a63c022d 100644 --- a/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs +++ b/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs @@ -37,26 +37,20 @@ namespace Ryujinx.Ava.UI.Views.Main ToggleFileTypesMenuItem.ItemsSource = GenerateToggleFileTypeItems(); ChangeLanguageMenuItem.ItemsSource = GenerateLanguageMenuItems(); - MiiAppletMenuItem.Command = new AsyncRelayCommand(OpenMiiApplet); - CloseRyujinxMenuItem.Command = new RelayCommand(CloseWindow); - OpenSettingsMenuItem.Command = new AsyncRelayCommand(OpenSettings); - PauseEmulationMenuItem.Command = new RelayCommand(() => ViewModel.AppHost?.Pause()); - ResumeEmulationMenuItem.Command = new RelayCommand(() => ViewModel.AppHost?.Resume()); - StopEmulationMenuItem.Command = new AsyncRelayCommand(() => ViewModel.AppHost?.ShowExitPrompt().OrCompleted()); - CheatManagerMenuItem.Command = new AsyncRelayCommand(async () => - { - try - { - await OpenCheatManagerForCurrentApp(); - } catch {} - }); - InstallFileTypesMenuItem.Command = new AsyncRelayCommand(InstallFileTypes); - UninstallFileTypesMenuItem.Command = new AsyncRelayCommand(UninstallFileTypes); - XciTrimmerMenuItem.Command = new AsyncRelayCommand(() => XCITrimmerWindow.Show(ViewModel)); - AboutWindowMenuItem.Command = new AsyncRelayCommand(AboutWindow.Show); - CompatibilityListMenuItem.Command = new AsyncRelayCommand(CompatibilityList.Show); + MiiAppletMenuItem.Command = Commands.Create(OpenMiiApplet); + CloseRyujinxMenuItem.Command = Commands.Create(CloseWindow); + OpenSettingsMenuItem.Command = Commands.Create(OpenSettings); + PauseEmulationMenuItem.Command = Commands.Create(() => ViewModel.AppHost?.Pause()); + ResumeEmulationMenuItem.Command = Commands.Create(() => ViewModel.AppHost?.Resume()); + StopEmulationMenuItem.Command = Commands.Create(() => ViewModel.AppHost?.ShowExitPrompt().OrCompleted()); + CheatManagerMenuItem.Command = Commands.CreateSilentFail(OpenCheatManagerForCurrentApp); + InstallFileTypesMenuItem.Command = Commands.Create(InstallFileTypes); + UninstallFileTypesMenuItem.Command = Commands.Create(UninstallFileTypes); + XciTrimmerMenuItem.Command = Commands.Create(XCITrimmerWindow.Show); + AboutWindowMenuItem.Command = Commands.Create(AboutWindow.Show); + CompatibilityListMenuItem.Command = Commands.Create(CompatibilityList.Show); - UpdateMenuItem.Command = new AsyncRelayCommand(async () => + UpdateMenuItem.Command = Commands.Create(async () => { if (Updater.CanUpdate(true)) await Updater.BeginUpdateAsync(true); @@ -64,12 +58,12 @@ namespace Ryujinx.Ava.UI.Views.Main FaqMenuItem.Command = SetupGuideMenuItem.Command = - LdnGuideMenuItem.Command = new RelayCommand(OpenHelper.OpenUrl); + LdnGuideMenuItem.Command = Commands.Create(OpenHelper.OpenUrl); WindowSize720PMenuItem.Command = WindowSize1080PMenuItem.Command = WindowSize1440PMenuItem.Command = - WindowSize2160PMenuItem.Command = new RelayCommand(ChangeWindowSize); + WindowSize2160PMenuItem.Command = Commands.Create(ChangeWindowSize); } private IEnumerable GenerateToggleFileTypeItems() => diff --git a/src/Ryujinx/UI/Windows/XCITrimmerWindow.axaml.cs b/src/Ryujinx/UI/Windows/XCITrimmerWindow.axaml.cs index bc53ec245..31036f47c 100644 --- a/src/Ryujinx/UI/Windows/XCITrimmerWindow.axaml.cs +++ b/src/Ryujinx/UI/Windows/XCITrimmerWindow.axaml.cs @@ -28,14 +28,14 @@ namespace Ryujinx.Ava.UI.Windows InitializeComponent(); } - public static async Task Show(MainWindowViewModel mainWindowViewModel) + public static async Task Show() { ContentDialog contentDialog = new() { PrimaryButtonText = string.Empty, SecondaryButtonText = string.Empty, CloseButtonText = string.Empty, - Content = new XCITrimmerWindow(mainWindowViewModel), + Content = new XCITrimmerWindow(RyujinxApp.MainWindow.ViewModel), Title = string.Format(LocaleManager.Instance[LocaleKeys.XCITrimmerWindowTitle]), };