mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2024-12-22 06:25:48 +00:00
UI: Only show Amiibo bin scan menu item if the key file exists
This commit is contained in:
parent
221524d879
commit
381921390a
5 changed files with 11 additions and 66 deletions
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 48 KiB |
|
@ -333,10 +333,9 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
|
|||
return Path.Combine(AppDataManager.KeysDirPath, "key_retail.bin");
|
||||
}
|
||||
|
||||
public static bool HasKeyRetailBinPath()
|
||||
{
|
||||
return File.Exists(GetKeyRetailBinPath());
|
||||
}
|
||||
public static bool HasKeyRetailBinPath => File.Exists(GetKeyRetailBinPath());
|
||||
|
||||
|
||||
public static DateTime DateTimeFromTag(ushort value)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -127,6 +127,9 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
|
||||
public IEnumerable<LdnGameData> LastLdnGameData;
|
||||
|
||||
// The UI specifically uses a thicker bordered variant of the icon to avoid crunching out the border at lower resolutions.
|
||||
// For an example of this, download canary 1.2.95, then open the settings menu, and look at the icon in the top-left.
|
||||
// The border gets reduced to colored pixels in the 4 corners.
|
||||
public static readonly Bitmap IconBitmap =
|
||||
new(Assembly.GetAssembly(typeof(ConfigurationState))!.GetManifestResourceStream("Ryujinx.UI.Common.Resources.Logo_Thiccjinx.png")!);
|
||||
|
||||
|
@ -330,6 +333,9 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool CanScanAmiiboBinaries => AmiiboBinReader.HasKeyRetailBinPath;
|
||||
|
||||
public bool ShowLoadProgress
|
||||
{
|
||||
get => _showLoadProgress;
|
||||
|
|
|
@ -247,6 +247,7 @@
|
|||
Click="OpenBinFile"
|
||||
Header="{ext:Locale MenuBarActionsScanAmiiboBin}"
|
||||
Icon="{ext:Icon mdi-cube-scan}"
|
||||
IsVisible="{Binding CanScanAmiiboBinaries}"
|
||||
IsEnabled="{Binding IsAmiiboBinRequested}" />
|
||||
<MenuItem
|
||||
Command="{Binding TakeScreenshot}"
|
||||
|
|
|
@ -178,7 +178,7 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||
private void ScanBinAmiiboMenuItem_AttachedToVisualTree(object sender, VisualTreeAttachmentEventArgs e)
|
||||
{
|
||||
if (sender is MenuItem)
|
||||
ViewModel.IsAmiiboBinRequested = ViewModel.IsAmiiboRequested && AmiiboBinReader.HasKeyRetailBinPath();
|
||||
ViewModel.IsAmiiboBinRequested = ViewModel.IsAmiiboRequested && AmiiboBinReader.HasKeyRetailBinPath;
|
||||
}
|
||||
|
||||
private async void InstallFileTypes_Click(object sender, RoutedEventArgs e)
|
||||
|
|
Loading…
Reference in a new issue