mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-11-25 00:40:13 +01:00
46c8129bf5
* Avalonia: Another Cleanup This PR is a cleanup to the avalonia code recently added: - Some XAML file are autoformatted like a previous PR. - Dlc is renamed to DownloadableContent (Locale exclude). - DownloadableContentManagerWindow is a bit improved (Fixes #3491). - Some nits here and there. * Fix GTK * Remove AttachDebugDevTools * Fix last warning * Fix JSON fields
60 lines
1.7 KiB
C#
60 lines
1.7 KiB
C#
using Avalonia;
|
|
using Avalonia.Interactivity;
|
|
using Ryujinx.Ava.Common.Locale;
|
|
using Ryujinx.Ava.Ui.Models;
|
|
using Ryujinx.Ava.Ui.ViewModels;
|
|
|
|
namespace Ryujinx.Ava.Ui.Windows
|
|
{
|
|
public partial class AmiiboWindow : StyleableWindow
|
|
{
|
|
public AmiiboWindow(bool showAll, string lastScannedAmiiboId, string titleId)
|
|
{
|
|
ViewModel = new AmiiboWindowViewModel(this, lastScannedAmiiboId, titleId);
|
|
|
|
ViewModel.ShowAllAmiibo = showAll;
|
|
|
|
DataContext = ViewModel;
|
|
|
|
InitializeComponent();
|
|
|
|
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance["Amiibo"];
|
|
}
|
|
|
|
public AmiiboWindow()
|
|
{
|
|
ViewModel = new AmiiboWindowViewModel(this, string.Empty, string.Empty);
|
|
|
|
DataContext = ViewModel;
|
|
|
|
InitializeComponent();
|
|
|
|
if (Program.PreviewerDetached)
|
|
{
|
|
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance["Amiibo"];
|
|
}
|
|
}
|
|
|
|
public bool IsScanned { get; set; }
|
|
public Amiibo.AmiiboApi ScannedAmiibo { get; set; }
|
|
public AmiiboWindowViewModel ViewModel { get; set; }
|
|
|
|
private void ScanButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (ViewModel.AmiiboSelectedIndex > -1)
|
|
{
|
|
Amiibo.AmiiboApi amiibo = ViewModel.AmiiboList[ViewModel.AmiiboSelectedIndex];
|
|
ScannedAmiibo = amiibo;
|
|
IsScanned = true;
|
|
Close();
|
|
}
|
|
}
|
|
|
|
private void CancelButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
IsScanned = false;
|
|
|
|
Close();
|
|
}
|
|
}
|
|
} |