2022-07-08 18:47:11 +00:00
|
|
|
using Avalonia.Interactivity;
|
|
|
|
using Ryujinx.Ava.Common.Locale;
|
2022-12-29 14:24:05 +00:00
|
|
|
using Ryujinx.Ava.UI.Models;
|
|
|
|
using Ryujinx.Ava.UI.ViewModels;
|
2022-07-08 18:47:11 +00:00
|
|
|
|
2022-12-29 14:24:05 +00:00
|
|
|
namespace Ryujinx.Ava.UI.Windows
|
2022-07-08 18:47:11 +00:00
|
|
|
{
|
2022-07-24 17:38:38 +00:00
|
|
|
public partial class AmiiboWindow : StyleableWindow
|
2022-07-08 18:47:11 +00:00
|
|
|
{
|
|
|
|
public AmiiboWindow(bool showAll, string lastScannedAmiiboId, string titleId)
|
|
|
|
{
|
|
|
|
ViewModel = new AmiiboWindowViewModel(this, lastScannedAmiiboId, titleId);
|
|
|
|
|
|
|
|
ViewModel.ShowAllAmiibo = showAll;
|
|
|
|
|
|
|
|
DataContext = ViewModel;
|
|
|
|
|
|
|
|
InitializeComponent();
|
2022-07-28 22:41:34 +00:00
|
|
|
|
2022-07-08 18:47:11 +00:00
|
|
|
Title = $"Ryujinx {Program.Version} - " + LocaleManager.Instance["Amiibo"];
|
|
|
|
}
|
|
|
|
|
|
|
|
public AmiiboWindow()
|
|
|
|
{
|
|
|
|
ViewModel = new AmiiboWindowViewModel(this, string.Empty, string.Empty);
|
|
|
|
|
|
|
|
DataContext = ViewModel;
|
|
|
|
|
|
|
|
InitializeComponent();
|
2022-07-28 22:41:34 +00:00
|
|
|
|
2022-07-08 18:47:11 +00:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|