Compare commits
3 Commits
Canary-1.2
...
Canary-1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
259526430c | ||
|
|
b5fafb6394 | ||
|
|
323c356d9c |
@@ -169,8 +169,8 @@
|
|||||||
<AdditionalFiles Include="Assets\locales.json" />
|
<AdditionalFiles Include="Assets\locales.json" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Update="Utilities\Compat\CompatibilityList.axaml.cs">
|
<Compile Update="Utilities\Compat\CompatibilityContentDialog.axaml.cs">
|
||||||
<DependentUpon>CompatibilityList.axaml</DependentUpon>
|
<DependentUpon>CompatibilityContentDialog.axaml</DependentUpon>
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
ToolTip.Tip="{ext:Locale LoadTitleUpdatesFromFolderTooltip}" />
|
ToolTip.Tip="{ext:Locale LoadTitleUpdatesFromFolderTooltip}" />
|
||||||
<MenuItem Header="{ext:Locale MenuBarFileOpenApplet}" IsEnabled="{Binding IsAppletMenuActive}" Icon="{ext:Icon mdi-launch}">
|
<MenuItem Header="{ext:Locale MenuBarFileOpenApplet}" IsEnabled="{Binding IsAppletMenuActive}" Icon="{ext:Icon mdi-launch}">
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Click="OpenMiiApplet"
|
Name="MiiAppletMenuItem"
|
||||||
Header="{ext:Locale MenuBarFileOpenAppletOpenMiiApplet}"
|
Header="{ext:Locale MenuBarFileOpenAppletOpenMiiApplet}"
|
||||||
Icon="{ext:Icon fa-solid fa-person}"
|
Icon="{ext:Icon fa-solid fa-person}"
|
||||||
ToolTip.Tip="{ext:Locale MenuBarFileOpenAppletOpenMiiAppletToolTip}" />
|
ToolTip.Tip="{ext:Locale MenuBarFileOpenAppletOpenMiiAppletToolTip}" />
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
ToolTip.Tip="{ext:Locale OpenRyujinxLogsTooltip}" />
|
ToolTip.Tip="{ext:Locale OpenRyujinxLogsTooltip}" />
|
||||||
<Separator />
|
<Separator />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Click="CloseWindow"
|
Name="CloseRyujinxMenuItem"
|
||||||
Header="{ext:Locale MenuBarFileExit}"
|
Header="{ext:Locale MenuBarFileExit}"
|
||||||
Icon="{ext:Icon fa-solid fa-xmark}"
|
Icon="{ext:Icon fa-solid fa-xmark}"
|
||||||
ToolTip.Tip="{ext:Locale ExitTooltip}" />
|
ToolTip.Tip="{ext:Locale ExitTooltip}" />
|
||||||
@@ -167,7 +167,7 @@
|
|||||||
Header="{ext:Locale MenuBarShowFileTypes}" />
|
Header="{ext:Locale MenuBarShowFileTypes}" />
|
||||||
<Separator />
|
<Separator />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Click="OpenSettings"
|
Name="OpenSettingsMenuItem"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
Header="{ext:Locale MenuBarOptionsSettings}"
|
Header="{ext:Locale MenuBarOptionsSettings}"
|
||||||
Icon="{ext:Icon fa-solid fa-gear}"
|
Icon="{ext:Icon fa-solid fa-gear}"
|
||||||
@@ -210,21 +210,21 @@
|
|||||||
Header="{ext:Locale MenuBarActions}"
|
Header="{ext:Locale MenuBarActions}"
|
||||||
IsEnabled="{Binding IsGameRunning}">
|
IsEnabled="{Binding IsGameRunning}">
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Click="PauseEmulation_Click"
|
Name="PauseEmulationMenuItem"
|
||||||
Header="{ext:Locale MenuBarOptionsPauseEmulation}"
|
Header="{ext:Locale MenuBarOptionsPauseEmulation}"
|
||||||
Icon="{ext:Icon fa-solid fa-pause}"
|
Icon="{ext:Icon fa-solid fa-pause}"
|
||||||
InputGesture="{Binding PauseKey}"
|
InputGesture="{Binding PauseKey}"
|
||||||
IsEnabled="{Binding !IsPaused}"
|
IsEnabled="{Binding !IsPaused}"
|
||||||
IsVisible="{Binding !IsPaused}" />
|
IsVisible="{Binding !IsPaused}" />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Click="ResumeEmulation_Click"
|
Name="ResumeEmulationMenuItem"
|
||||||
Header="{ext:Locale MenuBarOptionsResumeEmulation}"
|
Header="{ext:Locale MenuBarOptionsResumeEmulation}"
|
||||||
Icon="{ext:Icon fa-solid fa-play}"
|
Icon="{ext:Icon fa-solid fa-play}"
|
||||||
InputGesture="{Binding PauseKey}"
|
InputGesture="{Binding PauseKey}"
|
||||||
IsEnabled="{Binding IsPaused}"
|
IsEnabled="{Binding IsPaused}"
|
||||||
IsVisible="{Binding IsPaused}" />
|
IsVisible="{Binding IsPaused}" />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Click="StopEmulation_Click"
|
Name="StopEmulationMenuItem"
|
||||||
Header="{ext:Locale MenuBarOptionsStopEmulation}"
|
Header="{ext:Locale MenuBarOptionsStopEmulation}"
|
||||||
Icon="{ext:Icon fa-solid fa-stop}"
|
Icon="{ext:Icon fa-solid fa-stop}"
|
||||||
InputGesture="Escape"
|
InputGesture="Escape"
|
||||||
@@ -233,17 +233,15 @@
|
|||||||
<MenuItem Command="{Binding SimulateWakeUpMessage}" Header="{ext:Locale MenuBarOptionsSimulateWakeUpMessage}" />
|
<MenuItem Command="{Binding SimulateWakeUpMessage}" Header="{ext:Locale MenuBarOptionsSimulateWakeUpMessage}" />
|
||||||
<Separator />
|
<Separator />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Name="ScanAmiiboMenuItem"
|
Command="{Binding OpenAmiiboWindow}"
|
||||||
AttachedToVisualTree="ScanAmiiboMenuItem_AttachedToVisualTree"
|
AttachedToVisualTree="ScanAmiiboMenuItem_AttachedToVisualTree"
|
||||||
Click="OpenAmiiboWindow"
|
|
||||||
Header="{ext:Locale MenuBarActionsScanAmiibo}"
|
Header="{ext:Locale MenuBarActionsScanAmiibo}"
|
||||||
Icon="{ext:Icon mdi-cube-scan}"
|
Icon="{ext:Icon mdi-cube-scan}"
|
||||||
InputGesture="Ctrl + A"
|
InputGesture="Ctrl + A"
|
||||||
IsEnabled="{Binding IsAmiiboRequested}" />
|
IsEnabled="{Binding IsAmiiboRequested}" />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Name="ScanAmiiboMenuItemFromBin"
|
Command="{Binding OpenBinFile}"
|
||||||
AttachedToVisualTree="ScanBinAmiiboMenuItem_AttachedToVisualTree"
|
AttachedToVisualTree="ScanBinAmiiboMenuItem_AttachedToVisualTree"
|
||||||
Click="OpenBinFile"
|
|
||||||
Header="{ext:Locale MenuBarActionsScanAmiiboBin}"
|
Header="{ext:Locale MenuBarActionsScanAmiiboBin}"
|
||||||
Icon="{ext:Icon mdi-cube-scan}"
|
Icon="{ext:Icon mdi-cube-scan}"
|
||||||
IsVisible="{Binding CanScanAmiiboBinaries}"
|
IsVisible="{Binding CanScanAmiiboBinaries}"
|
||||||
@@ -262,7 +260,7 @@
|
|||||||
InputGesture="{Binding ShowUiKey}"
|
InputGesture="{Binding ShowUiKey}"
|
||||||
IsEnabled="{Binding IsGameRunning}" />
|
IsEnabled="{Binding IsGameRunning}" />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Click="OpenCheatManagerForCurrentApp"
|
Name="CheatManagerMenuItem"
|
||||||
Header="{ext:Locale GameListContextMenuManageCheat}"
|
Header="{ext:Locale GameListContextMenuManageCheat}"
|
||||||
Icon="{ext:Icon fa-solid fa-code}"
|
Icon="{ext:Icon fa-solid fa-code}"
|
||||||
IsEnabled="{Binding IsGameRunning}" />
|
IsEnabled="{Binding IsGameRunning}" />
|
||||||
@@ -277,56 +275,55 @@
|
|||||||
<MenuItem Command="{Binding InstallFirmwareFromFolder}" Header="{ext:Locale MenuBarFileToolsInstallFirmwareFromDirectory}" Icon="{ext:Icon mdi-folder-cog}" />
|
<MenuItem Command="{Binding InstallFirmwareFromFolder}" Header="{ext:Locale MenuBarFileToolsInstallFirmwareFromDirectory}" Icon="{ext:Icon mdi-folder-cog}" />
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="{ext:Locale MenuBarToolsManageFileTypes}" IsVisible="{Binding ManageFileTypesVisible}">
|
<MenuItem Header="{ext:Locale MenuBarToolsManageFileTypes}" IsVisible="{Binding ManageFileTypesVisible}">
|
||||||
<MenuItem Header="{ext:Locale MenuBarToolsInstallFileTypes}" Click="InstallFileTypes_Click" IsEnabled="{Binding AreMimeTypesRegistered, Converter={x:Static BoolConverters.Not}}" />
|
<MenuItem Name="InstallFileTypesMenuItem" Header="{ext:Locale MenuBarToolsInstallFileTypes}" IsEnabled="{Binding AreMimeTypesRegistered, Converter={x:Static BoolConverters.Not}}" />
|
||||||
<MenuItem Header="{ext:Locale MenuBarToolsUninstallFileTypes}" Click="UninstallFileTypes_Click" IsEnabled="{Binding AreMimeTypesRegistered}" />
|
<MenuItem Name="UninstallFileTypesMenuItem" Header="{ext:Locale MenuBarToolsUninstallFileTypes}" IsEnabled="{Binding AreMimeTypesRegistered}" />
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<Separator />
|
<Separator />
|
||||||
<MenuItem Header="{ext:Locale MenuBarToolsXCITrimmer}" IsEnabled="{Binding EnableNonGameRunningControls}" Click="OpenXCITrimmerWindow" Icon="{ext:Icon fa-solid fa-scissors}" />
|
<MenuItem Name="XciTrimmerMenuItem" Header="{ext:Locale MenuBarToolsXCITrimmer}" IsEnabled="{Binding EnableNonGameRunningControls}" Icon="{ext:Icon fa-solid fa-scissors}" />
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem VerticalAlignment="Center" Header="{ext:Locale MenuBarView}">
|
<MenuItem VerticalAlignment="Center" Header="{ext:Locale MenuBarView}">
|
||||||
<MenuItem VerticalAlignment="Center" Header="{ext:Locale MenuBarViewWindow}">
|
<MenuItem VerticalAlignment="Center" Header="{ext:Locale MenuBarViewWindow}">
|
||||||
<MenuItem Header="{ext:Locale MenuBarViewWindow720}" Tag="1280 720" Click="ChangeWindowSize_Click" />
|
<MenuItem Name="WindowSize720PMenuItem" Header="{ext:Locale MenuBarViewWindow720}" CommandParameter="1280 720" />
|
||||||
<MenuItem Header="{ext:Locale MenuBarViewWindow1080}" Tag="1920 1080" Click="ChangeWindowSize_Click" />
|
<MenuItem Name="WindowSize1080PMenuItem" Header="{ext:Locale MenuBarViewWindow1080}" CommandParameter="1920 1080" />
|
||||||
<MenuItem Header="{ext:Locale MenuBarViewWindow1440}" Tag="2560 1440" Click="ChangeWindowSize_Click" />
|
<MenuItem Name="WindowSize1440PMenuItem" Header="{ext:Locale MenuBarViewWindow1440}" CommandParameter="2560 1440" />
|
||||||
<MenuItem Header="{ext:Locale MenuBarViewWindow2160}" Tag="3840 2160" Click="ChangeWindowSize_Click" />
|
<MenuItem Name="WindowSize2160PMenuItem" Header="{ext:Locale MenuBarViewWindow2160}" CommandParameter="3840 2160" />
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem VerticalAlignment="Center" Header="{ext:Locale MenuBarHelp}">
|
<MenuItem VerticalAlignment="Center" Header="{ext:Locale MenuBarHelp}">
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Click="OpenAboutWindow"
|
Name="AboutWindowMenuItem"
|
||||||
Header="{ext:Locale MenuBarHelpAbout}"
|
Header="{ext:Locale MenuBarHelpAbout}"
|
||||||
Icon="{ext:Icon fa-solid fa-circle-info}"
|
Icon="{ext:Icon fa-solid fa-circle-info}"
|
||||||
ToolTip.Tip="{ext:Locale OpenAboutTooltip}" />
|
ToolTip.Tip="{ext:Locale OpenAboutTooltip}" />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Name="UpdateMenuItem"
|
Name="UpdateMenuItem"
|
||||||
IsEnabled="{Binding CanUpdate}"
|
IsEnabled="{Binding CanUpdate}"
|
||||||
Click="CheckForUpdates"
|
|
||||||
Header="{ext:Locale MenuBarHelpCheckForUpdates}"
|
Header="{ext:Locale MenuBarHelpCheckForUpdates}"
|
||||||
Icon="{ext:Icon mdi-update}"
|
Icon="{ext:Icon mdi-update}"
|
||||||
ToolTip.Tip="{ext:Locale CheckUpdatesTooltip}" />
|
ToolTip.Tip="{ext:Locale CheckUpdatesTooltip}" />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Click="OpenCompatibilityList"
|
Name="CompatibilityListMenuItem"
|
||||||
Header="{ext:Locale CompatibilityListOpen}"
|
Header="{ext:Locale CompatibilityListOpen}"
|
||||||
Icon="{ext:Icon mdi-gamepad}"/>
|
Icon="{ext:Icon mdi-gamepad}"/>
|
||||||
<Separator />
|
<Separator />
|
||||||
<MenuItem VerticalAlignment="Center" Header="{ext:Locale MenuBarHelpFaqAndGuides}" Icon="{ext:Icon fa-solid fa-question}" >
|
<MenuItem VerticalAlignment="Center" Header="{ext:Locale MenuBarHelpFaqAndGuides}" Icon="{ext:Icon fa-solid fa-question}" >
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Click="MenuItem_OnClick"
|
Name="FaqMenuItem"
|
||||||
Header="{ext:Locale MenuBarHelpFaq}"
|
Header="{ext:Locale MenuBarHelpFaq}"
|
||||||
Icon="{ext:Icon fa-github}"
|
Icon="{ext:Icon fa-github}"
|
||||||
Tag="https://github.com/GreemDev/Ryujinx/wiki/FAQ-and-Troubleshooting"
|
CommandParameter="https://github.com/GreemDev/Ryujinx/wiki/FAQ-and-Troubleshooting"
|
||||||
ToolTip.Tip="{ext:Locale MenuBarHelpFaqTooltip}" />
|
ToolTip.Tip="{ext:Locale MenuBarHelpFaqTooltip}" />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Click="MenuItem_OnClick"
|
Name="SetupGuideMenuItem"
|
||||||
Header="{ext:Locale MenuBarHelpSetup}"
|
Header="{ext:Locale MenuBarHelpSetup}"
|
||||||
Icon="{ext:Icon fa-github}"
|
Icon="{ext:Icon fa-github}"
|
||||||
Tag="https://github.com/GreemDev/Ryujinx/wiki/Ryujinx-Setup-&-Configuration-Guide"
|
CommandParameter="https://github.com/GreemDev/Ryujinx/wiki/Ryujinx-Setup-&-Configuration-Guide"
|
||||||
ToolTip.Tip="{ext:Locale MenuBarHelpSetupTooltip}" />
|
ToolTip.Tip="{ext:Locale MenuBarHelpSetupTooltip}" />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Click="MenuItem_OnClick"
|
Name="LdnGuideMenuItem"
|
||||||
Header="{ext:Locale MenuBarHelpMultiplayer}"
|
Header="{ext:Locale MenuBarHelpMultiplayer}"
|
||||||
Icon="{ext:Icon fa-github}"
|
Icon="{ext:Icon fa-github}"
|
||||||
Tag="https://github.com/GreemDev/Ryujinx/wiki/Multiplayer%E2%80%90(LDN%E2%80%90Local%E2%80%90Wireless)%E2%80%90Guide"
|
CommandParameter="https://github.com/GreemDev/Ryujinx/wiki/Multiplayer%E2%80%90(LDN%E2%80%90Local%E2%80%90Wireless)%E2%80%90Guide"
|
||||||
ToolTip.Tip="{ext:Locale MenuBarHelpMultiplayerTooltip}" />
|
ToolTip.Tip="{ext:Locale MenuBarHelpMultiplayerTooltip}" />
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.Layout;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
|
using CommunityToolkit.Mvvm.Input;
|
||||||
using Gommon;
|
using Gommon;
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
@@ -17,6 +18,7 @@ using Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.Views.Main
|
namespace Ryujinx.Ava.UI.Views.Main
|
||||||
{
|
{
|
||||||
@@ -34,6 +36,34 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||||||
|
|
||||||
ToggleFileTypesMenuItem.ItemsSource = GenerateToggleFileTypeItems();
|
ToggleFileTypesMenuItem.ItemsSource = GenerateToggleFileTypeItems();
|
||||||
ChangeLanguageMenuItem.ItemsSource = GenerateLanguageMenuItems();
|
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(OpenCheatManagerForCurrentApp);
|
||||||
|
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);
|
||||||
|
|
||||||
|
UpdateMenuItem.Command = new AsyncRelayCommand(async () =>
|
||||||
|
{
|
||||||
|
if (Updater.CanUpdate(true))
|
||||||
|
await Updater.BeginUpdateAsync(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
FaqMenuItem.Command =
|
||||||
|
SetupGuideMenuItem.Command =
|
||||||
|
LdnGuideMenuItem.Command = new RelayCommand<string>(OpenHelper.OpenUrl);
|
||||||
|
|
||||||
|
WindowSize720PMenuItem.Command =
|
||||||
|
WindowSize1080PMenuItem.Command =
|
||||||
|
WindowSize1440PMenuItem.Command =
|
||||||
|
WindowSize2160PMenuItem.Command = new RelayCommand<string>(ChangeWindowSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
private CheckBox[] GenerateToggleFileTypeItems() =>
|
private CheckBox[] GenerateToggleFileTypeItems() =>
|
||||||
@@ -74,8 +104,10 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||||||
|
|
||||||
MenuItem menuItem = new()
|
MenuItem menuItem = new()
|
||||||
{
|
{
|
||||||
Padding = new Thickness(10, 0, 0, 0),
|
Padding = new Thickness(15, 0, 0, 0),
|
||||||
Header = " " + languageName,
|
Margin = new Thickness(3, 0, 3, 0),
|
||||||
|
HorizontalAlignment = HorizontalAlignment.Stretch,
|
||||||
|
Header = languageName,
|
||||||
Command = MiniCommand.Create(() => MainWindowViewModel.ChangeLanguage(language))
|
Command = MiniCommand.Create(() => MainWindowViewModel.ChangeLanguage(language))
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -96,22 +128,7 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void StopEmulation_Click(object sender, RoutedEventArgs e)
|
public async Task OpenSettings()
|
||||||
{
|
|
||||||
await ViewModel.AppHost?.ShowExitPrompt().OrCompleted()!;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void PauseEmulation_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
ViewModel.AppHost?.Pause();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ResumeEmulation_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
ViewModel.AppHost?.Resume();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async void OpenSettings(object sender, RoutedEventArgs e)
|
|
||||||
{
|
{
|
||||||
Window.SettingsWindow = new(Window.VirtualFileSystem, Window.ContentManager);
|
Window.SettingsWindow = new(Window.VirtualFileSystem, Window.ContentManager);
|
||||||
|
|
||||||
@@ -124,7 +141,7 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||||||
|
|
||||||
public static readonly AppletMetadata MiiApplet = new("miiEdit", 0x0100000000001009);
|
public static readonly AppletMetadata MiiApplet = new("miiEdit", 0x0100000000001009);
|
||||||
|
|
||||||
public async void OpenMiiApplet(object sender, RoutedEventArgs e)
|
public async Task OpenMiiApplet()
|
||||||
{
|
{
|
||||||
if (MiiApplet.CanStart(ViewModel.ContentManager, out var appData, out var nacpData))
|
if (MiiApplet.CanStart(ViewModel.ContentManager, out var appData, out var nacpData))
|
||||||
{
|
{
|
||||||
@@ -132,13 +149,7 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void OpenAmiiboWindow(object sender, RoutedEventArgs e)
|
public async Task OpenCheatManagerForCurrentApp()
|
||||||
=> await ViewModel.OpenAmiiboWindow();
|
|
||||||
|
|
||||||
public async void OpenBinFile(object sender, RoutedEventArgs e)
|
|
||||||
=> await ViewModel.OpenBinFile();
|
|
||||||
|
|
||||||
public async void OpenCheatManagerForCurrentApp(object sender, RoutedEventArgs e)
|
|
||||||
{
|
{
|
||||||
if (!ViewModel.IsGameRunning)
|
if (!ViewModel.IsGameRunning)
|
||||||
return;
|
return;
|
||||||
@@ -166,7 +177,7 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||||||
ViewModel.IsAmiiboBinRequested = ViewModel.IsAmiiboRequested && AmiiboBinReader.HasAmiiboKeyFile;
|
ViewModel.IsAmiiboBinRequested = ViewModel.IsAmiiboRequested && AmiiboBinReader.HasAmiiboKeyFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void InstallFileTypes_Click(object sender, RoutedEventArgs e)
|
private async Task InstallFileTypes()
|
||||||
{
|
{
|
||||||
ViewModel.AreMimeTypesRegistered = FileAssociationHelper.Install();
|
ViewModel.AreMimeTypesRegistered = FileAssociationHelper.Install();
|
||||||
if (ViewModel.AreMimeTypesRegistered)
|
if (ViewModel.AreMimeTypesRegistered)
|
||||||
@@ -175,7 +186,7 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogInstallFileTypesErrorMessage]);
|
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogInstallFileTypesErrorMessage]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void UninstallFileTypes_Click(object sender, RoutedEventArgs e)
|
private async Task UninstallFileTypes()
|
||||||
{
|
{
|
||||||
ViewModel.AreMimeTypesRegistered = !FileAssociationHelper.Uninstall();
|
ViewModel.AreMimeTypesRegistered = !FileAssociationHelper.Uninstall();
|
||||||
if (!ViewModel.AreMimeTypesRegistered)
|
if (!ViewModel.AreMimeTypesRegistered)
|
||||||
@@ -184,11 +195,8 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogUninstallFileTypesErrorMessage]);
|
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogUninstallFileTypesErrorMessage]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void ChangeWindowSize_Click(object sender, RoutedEventArgs e)
|
private void ChangeWindowSize(string resolution)
|
||||||
{
|
{
|
||||||
if (sender is not MenuItem { Tag: string resolution })
|
|
||||||
return;
|
|
||||||
|
|
||||||
(int resolutionWidth, int resolutionHeight) = resolution.Split(' ', 2)
|
(int resolutionWidth, int resolutionHeight) = resolution.Split(' ', 2)
|
||||||
.Into(parts =>
|
.Into(parts =>
|
||||||
(int.Parse(parts[0]), int.Parse(parts[1]))
|
(int.Parse(parts[0]), int.Parse(parts[1]))
|
||||||
@@ -201,7 +209,7 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||||||
double windowWidthScaled = (resolutionWidth * Program.WindowScaleFactor);
|
double windowWidthScaled = (resolutionWidth * Program.WindowScaleFactor);
|
||||||
double windowHeightScaled = ((resolutionHeight + barsHeight) * Program.WindowScaleFactor);
|
double windowHeightScaled = ((resolutionHeight + barsHeight) * Program.WindowScaleFactor);
|
||||||
|
|
||||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
Dispatcher.UIThread.Post(() =>
|
||||||
{
|
{
|
||||||
ViewModel.WindowState = WindowState.Normal;
|
ViewModel.WindowState = WindowState.Normal;
|
||||||
|
|
||||||
@@ -209,24 +217,7 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void CheckForUpdates(object sender, RoutedEventArgs e)
|
public void CloseWindow() => Window.Close();
|
||||||
{
|
|
||||||
if (Updater.CanUpdate(true))
|
|
||||||
await Updater.BeginUpdateAsync(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void MenuItem_OnClick(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (sender is MenuItem { Tag: string url })
|
|
||||||
OpenHelper.OpenUrl(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async void OpenXCITrimmerWindow(object sender, RoutedEventArgs e) => await XCITrimmerWindow.Show(ViewModel);
|
|
||||||
|
|
||||||
public async void OpenAboutWindow(object sender, RoutedEventArgs e) => await AboutWindow.Show();
|
|
||||||
|
|
||||||
public void CloseWindow(object sender, RoutedEventArgs e) => Window.Close();
|
|
||||||
|
|
||||||
private async void OpenCompatibilityList(object sender, RoutedEventArgs e) => await CompatibilityList.Show();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<ui:ContentDialog xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="using:Ryujinx.Ava.Utilities.Compat"
|
||||||
|
xmlns:ui="using:FluentAvalonia.UI.Controls"
|
||||||
|
xmlns:ext="using:Ryujinx.Ava.Common.Markup"
|
||||||
|
x:Class="Ryujinx.Ava.Utilities.Compat.CompatibilityContentDialog"
|
||||||
|
mc:Ignorable="d" d:DesignWidth="600" d:DesignHeight="400"
|
||||||
|
CloseButtonText="{ext:Locale SettingsButtonClose}"
|
||||||
|
DefaultButton="Close"
|
||||||
|
x:DataType="local:CompatibilityViewModel">
|
||||||
|
<ui:ContentDialog.DataContext>
|
||||||
|
<local:CompatibilityViewModel/>
|
||||||
|
</ui:ContentDialog.DataContext>
|
||||||
|
<ui:ContentDialog.Resources>
|
||||||
|
<x:Double x:Key="ContentDialogMaxWidth">900</x:Double>
|
||||||
|
</ui:ContentDialog.Resources>
|
||||||
|
</ui:ContentDialog>
|
||||||
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using FluentAvalonia.UI.Controls;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Ryujinx.Ava.Utilities.Compat
|
||||||
|
{
|
||||||
|
public partial class CompatibilityContentDialog : ContentDialog
|
||||||
|
{
|
||||||
|
protected override Type StyleKeyOverride => typeof(ContentDialog);
|
||||||
|
|
||||||
|
public CompatibilityContentDialog() => InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -11,25 +11,24 @@
|
|||||||
<UserControl.DataContext>
|
<UserControl.DataContext>
|
||||||
<local:CompatibilityViewModel />
|
<local:CompatibilityViewModel />
|
||||||
</UserControl.DataContext>
|
</UserControl.DataContext>
|
||||||
<StackPanel Orientation="Vertical">
|
<Grid RowDefinitions="Auto,*">
|
||||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
<Grid Grid.Row="0" ColumnDefinitions="*,Auto,Auto">
|
||||||
<TextBox Watermark="{ext:Locale CompatibilityListSearchBoxWatermark}" TextChanged="TextBox_OnTextChanged" />
|
<TextBox Grid.Column="0" HorizontalAlignment="Stretch" Watermark="{ext:Locale CompatibilityListSearchBoxWatermark}" TextChanged="TextBox_OnTextChanged" />
|
||||||
<CheckBox Margin="7, 0, 0, 0" IsChecked="{Binding OnlyShowOwnedGames}" />
|
<CheckBox Grid.Column="1" Margin="7, 0, 0, 0" IsChecked="{Binding OnlyShowOwnedGames}" />
|
||||||
<TextBlock Margin="-3, 0, 0, 0" Text="{ext:Locale CompatibilityListOnlyShowOwnedGames}" />
|
<TextBlock Grid.Column="2" Margin="-10, 0, 0, 0" Text="{ext:Locale CompatibilityListOnlyShowOwnedGames}" />
|
||||||
</StackPanel>
|
</Grid>
|
||||||
<ScrollViewer>
|
<ScrollViewer Grid.Row="1">
|
||||||
<ListBox Margin="5"
|
<ListBox Margin="0,5, 0, 0"
|
||||||
Padding="10"
|
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
ItemsSource="{Binding CurrentEntries}">
|
ItemsSource="{Binding CurrentEntries}">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate DataType="{x:Type local:CompatibilityEntry}">
|
<DataTemplate DataType="{x:Type local:CompatibilityEntry}">
|
||||||
<Grid HorizontalAlignment="Center" Width="500" ColumnDefinitions="Auto,Auto,Auto,*"
|
<Grid Width="750" ColumnDefinitions="Auto,Auto,Auto,*"
|
||||||
Margin="5">
|
Margin="5">
|
||||||
<TextBlock Grid.Column="0"
|
<TextBlock Grid.Column="0"
|
||||||
FontFamily="{StaticResource JetBrainsMono}"
|
FontFamily="{StaticResource JetBrainsMono}"
|
||||||
Text="{Binding GameName}"
|
Text="{Binding GameName}"
|
||||||
Width="140"
|
Width="333"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
<TextBlock Grid.Column="1"
|
<TextBlock Grid.Column="1"
|
||||||
Width="135"
|
Width="135"
|
||||||
@@ -55,5 +54,5 @@
|
|||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</StackPanel>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
using Avalonia;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls;
|
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
using Avalonia.Styling;
|
using Avalonia.Styling;
|
||||||
using FluentAvalonia.UI.Controls;
|
|
||||||
using Ryujinx.Ava.Common.Locale;
|
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
using Ryujinx.Ava.UI.Windows;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.Utilities.Compat
|
namespace Ryujinx.Ava.Utilities.Compat
|
||||||
@@ -16,11 +11,8 @@ namespace Ryujinx.Ava.Utilities.Compat
|
|||||||
{
|
{
|
||||||
await CompatibilityHelper.InitAsync();
|
await CompatibilityHelper.InitAsync();
|
||||||
|
|
||||||
ContentDialog contentDialog = new()
|
CompatibilityContentDialog contentDialog = new()
|
||||||
{
|
{
|
||||||
PrimaryButtonText = string.Empty,
|
|
||||||
SecondaryButtonText = string.Empty,
|
|
||||||
CloseButtonText = LocaleManager.Instance[LocaleKeys.SettingsButtonClose],
|
|
||||||
Content = new CompatibilityList { DataContext = new CompatibilityViewModel(RyujinxApp.MainWindow.ViewModel.ApplicationLibrary) }
|
Content = new CompatibilityList { DataContext = new CompatibilityViewModel(RyujinxApp.MainWindow.ViewModel.ApplicationLibrary) }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -53,4 +45,3 @@ namespace Ryujinx.Ava.Utilities.Compat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user