mirror of
https://git.ryujinx.app/kenji-nx/ryujinx.git
synced 2025-12-14 16:37:07 +00:00
UI: Only show Amiibo bin scan menu item if the key file exists
This commit is contained in:
parent
9b5151dddb
commit
87067b5b32
4 changed files with 8 additions and 5 deletions
|
|
@ -333,10 +333,9 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
|
||||||
return Path.Combine(AppDataManager.KeysDirPath, "key_retail.bin");
|
return Path.Combine(AppDataManager.KeysDirPath, "key_retail.bin");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool HasKeyRetailBinPath()
|
public static bool HasKeyRetailBinPath => File.Exists(GetKeyRetailBinPath());
|
||||||
{
|
|
||||||
return File.Exists(GetKeyRetailBinPath());
|
|
||||||
}
|
|
||||||
public static DateTime DateTimeFromTag(ushort value)
|
public static DateTime DateTimeFromTag(ushort value)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
||||||
|
|
@ -307,6 +307,9 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanScanAmiiboBinaries => AmiiboBinReader.HasKeyRetailBinPath;
|
||||||
|
|
||||||
public bool ShowLoadProgress
|
public bool ShowLoadProgress
|
||||||
{
|
{
|
||||||
get => _showLoadProgress;
|
get => _showLoadProgress;
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,7 @@
|
||||||
AttachedToVisualTree="ScanBinAmiiboMenuItem_AttachedToVisualTree"
|
AttachedToVisualTree="ScanBinAmiiboMenuItem_AttachedToVisualTree"
|
||||||
Click="OpenBinFile"
|
Click="OpenBinFile"
|
||||||
Header="{locale:Locale MenuBarActionsScanAmiiboBin}"
|
Header="{locale:Locale MenuBarActionsScanAmiiboBin}"
|
||||||
|
IsVisible="{Binding CanScanAmiiboBinaries}"
|
||||||
IsEnabled="{Binding IsAmiiboBinRequested}" />
|
IsEnabled="{Binding IsAmiiboBinRequested}" />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding TakeScreenshot}"
|
Command="{Binding TakeScreenshot}"
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@ namespace Ryujinx.Ava.UI.Views.Main
|
||||||
private void ScanBinAmiiboMenuItem_AttachedToVisualTree(object sender, VisualTreeAttachmentEventArgs e)
|
private void ScanBinAmiiboMenuItem_AttachedToVisualTree(object sender, VisualTreeAttachmentEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is MenuItem)
|
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)
|
private async void InstallFileTypes_Click(object sender, RoutedEventArgs e)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue