feat(ui): show all available Amiibo if no series selected

This commit is contained in:
VewDev 2025-06-23 18:43:51 +02:00
parent c2a9e806e8
commit 7375a00f01
3 changed files with 41 additions and 25 deletions

View file

@ -15675,26 +15675,26 @@
{
"ID": "AmiiboOptionsShowAllLabel",
"Translations": {
"ar_SA": "إظهار كل أميبو",
"de_DE": "Zeige alle Amiibos",
"el_GR": "Εμφάνιση όλων των Amiibo",
"en_US": "Show All Amiibo",
"es_ES": "Mostrar todos los Amiibo",
"fr_FR": "Afficher tous les Amiibo",
"he_IL": "הצג את כל האמיבואים",
"it_IT": "Mostra tutti gli amiibo",
"ja_JP": "すべての Amiibo を表示",
"ko_KR": "모든 Amiibo 표시",
"no_NO": "Vis alle Amiibo",
"pl_PL": "Pokaż Wszystkie Amiibo",
"pt_BR": "Exibir Todos os Amiibos",
"ru_RU": "Показать все Amiibo",
"sv_SE": "Visa alla Amiibo",
"th_TH": "แสดง Amiibo ทั้งหมด",
"tr_TR": "Tüm Amiibo'ları Göster",
"uk_UA": "Показати всі Amiibo",
"zh_CN": "显示所有 Amiibo",
"zh_TW": "顯示所有 Amiibo"
"ar_SA": "",
"de_DE": "",
"el_GR": "",
"en_US": "Show incompatible Amiibo for this game",
"es_ES": "Mostrar Amiibo incompatibles con este juego",
"fr_FR": "",
"he_IL": "",
"it_IT": "",
"ja_JP": "",
"ko_KR": "",
"no_NO": "",
"pl_PL": "",
"pt_BR": "",
"ru_RU": "",
"sv_SE": "",
"th_TH": "",
"tr_TR": "",
"uk_UA": "",
"zh_CN": "",
"zh_TW": ""
}
},
{

View file

@ -342,14 +342,24 @@ namespace Ryujinx.Ava.UI.ViewModels
{
_amiibos.Clear();
List<AmiiboApi> amiiboSortedList;
// If no series selected, just display all available amiibos
if (_seriesSelectedIndex < 0)
{
return;
amiiboSortedList = _amiiboList
.OrderBy(amiibo => amiibo.AmiiboSeries)
.ThenBy(x => x.Name)
.ToList();
}
else
{
amiiboSortedList = _amiiboList
.Where(amiibo => amiibo.AmiiboSeries == _amiiboSeries[SeriesSelectedIndex])
.OrderBy(amiibo => amiibo.Name).ToList();
}
List<AmiiboApi> amiiboSortedList = _amiiboList
.Where(amiibo => amiibo.AmiiboSeries == _amiiboSeries[SeriesSelectedIndex])
.OrderBy(amiibo => amiibo.Name).ToList();
for (int i = 0; i < amiiboSortedList.Count; i++)
{
@ -386,7 +396,7 @@ namespace Ryujinx.Ava.UI.ViewModels
Usage = string.Empty;
if (_amiiboSelectedIndex < 0)
if (_amiiboSelectedIndex < 0 || _amiibos.Count < 1)
{
return;
}

View file

@ -56,6 +56,12 @@
SelectionMode="Single"
ItemsSource="{Binding AmiiboList}"
SelectedIndex="{Binding AmiiboSelectedIndex}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Margin="10, 0, 0 ,0" Text="{Binding Name}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<StackPanel Margin="20">
<Image Source="{Binding AmiiboImage}" Height="350" Width="150" HorizontalAlignment="Center" />