diff --git a/OneGateApp/Pages/GamingPage.xaml b/OneGateApp/Pages/GamingPage.xaml index c30259e..3b23f36 100644 --- a/OneGateApp/Pages/GamingPage.xaml +++ b/OneGateApp/Pages/GamingPage.xaml @@ -32,25 +32,55 @@ - + + + - - - + + + + + + + diff --git a/OneGateApp/Pages/GamingPage.xaml.cs b/OneGateApp/Pages/GamingPage.xaml.cs index 8e02167..46ad267 100644 --- a/OneGateApp/Pages/GamingPage.xaml.cs +++ b/OneGateApp/Pages/GamingPage.xaml.cs @@ -2,6 +2,7 @@ using NeoOrder.OneGate.Models; using NeoOrder.OneGate.Properties; using NeoOrder.OneGate.Services; +using System.Collections.ObjectModel; using TabBar = NeoOrder.OneGate.Controls.Views.TabBar; namespace NeoOrder.OneGate.Pages; @@ -17,6 +18,9 @@ public partial class GamingPage : ContentPage public LoadingService LoadingService { get; } public CachedCollection DApps { get; } + public List GamesIdRecent { get; private set; } = []; + public ObservableCollection GamesRecent { get; private set { field = value; OnPropertyChanged(); } } = []; + public bool HasRecentGames { get; private set { field = value; OnPropertyChanged(); } } public DApp[] Games { get; private set { field = value; OnPropertyChanged(); } } = []; public DApp[] GamesFiltered { get; private set { field = value; OnPropertyChanged(); } } = []; public string[] GameTypes { get; private set { field = value; OnPropertyChanged(); } } = [Strings.All]; @@ -41,6 +45,8 @@ protected override void OnAppearing() base.OnAppearing(); if (this.ShouldRefresh()) LoadingService.BeginLoad(); + else + LoadRecentGames(); } protected override void OnSizeAllocated(double width, double height) @@ -52,6 +58,7 @@ protected override void OnSizeAllocated(double width, double height) async Task LoadSettingsAsync() { allowRestrictedContent = await DAppContentPolicy.GetAllowRestrictedContentAsync(dbContext); + GamesIdRecent = await dbContext.Settings.GetAsync>("dapps/recent") ?? []; } async Task LoadDAppsAsync() @@ -89,6 +96,15 @@ void OnDataLoaded(object? sender, EventArgs e) .ToArray(); HasGameTypeFilters = GameTypes.Length > 2; ApplyGameTypeFilter(gameTypeTabBar.SelectedTab); + LoadRecentGames(); + } + + void LoadRecentGames() + { + GamesRecent = new(GamesIdRecent + .Select(id => Games.FirstOrDefault(p => p.Id == id)) + .OfType()); + HasRecentGames = GamesRecent.Count > 0; } void ApplyGameTypeFilter(string? selectedGameType) diff --git a/OneGateApp/Pages/LaunchDAppPage.xaml.cs b/OneGateApp/Pages/LaunchDAppPage.xaml.cs index 8109e97..4155a82 100644 --- a/OneGateApp/Pages/LaunchDAppPage.xaml.cs +++ b/OneGateApp/Pages/LaunchDAppPage.xaml.cs @@ -99,6 +99,7 @@ public async void ApplyQueryAttributes(IDictionary query) recents.RemoveAt(recents.Count - 1); await dbContext.Settings.PutAsync("dapps/recent", recents); if (DApp.IsRegularApp) GlobalStates.Invalidate(); + if (DApp.IsGamingApp) GlobalStates.Invalidate(); } } diff --git a/OneGateApp/Properties/Strings.Designer.cs b/OneGateApp/Properties/Strings.Designer.cs index ec3693d..74f36fa 100644 --- a/OneGateApp/Properties/Strings.Designer.cs +++ b/OneGateApp/Properties/Strings.Designer.cs @@ -1093,6 +1093,24 @@ internal static string Gaming { } } + /// + /// 查找类似 Pull down to refresh the game catalog. 的本地化字符串。 + /// + internal static string GamingEmptyState { + get { + return ResourceManager.GetString("GamingEmptyState", resourceCulture); + } + } + + /// + /// 查找类似 Recently played 的本地化字符串。 + /// + internal static string GamingRecentPlayed { + get { + return ResourceManager.GetString("GamingRecentPlayed", resourceCulture); + } + } + /// /// 查找类似 General 的本地化字符串。 /// diff --git a/OneGateApp/Properties/Strings.de.resx b/OneGateApp/Properties/Strings.de.resx index 7fe1d61..c85788c 100644 --- a/OneGateApp/Properties/Strings.de.resx +++ b/OneGateApp/Properties/Strings.de.resx @@ -789,6 +789,12 @@ Mit dem Fortfahren bestätigen Sie, dass Sie alle damit verbundenen Risiken voll Gaming + + Zum Aktualisieren des Spielekatalogs nach unten ziehen. + + + Zuletzt gespielt + Spieltyp @@ -992,4 +998,4 @@ Es wird empfohlen, den NEP-2-Schlüssel und das Passwort getrennt aufzubewahren Nicht verfügbar - \ No newline at end of file + diff --git a/OneGateApp/Properties/Strings.es.resx b/OneGateApp/Properties/Strings.es.resx index 54a4fcf..34e218a 100644 --- a/OneGateApp/Properties/Strings.es.resx +++ b/OneGateApp/Properties/Strings.es.resx @@ -789,6 +789,12 @@ Al continuar, usted reconoce que comprende plenamente y acepta todos los riesgos Juegos + + Desliza hacia abajo para actualizar el catálogo de juegos. + + + Jugados recientemente + Tipo de juego @@ -992,4 +998,4 @@ Se recomienda almacenar la clave NEP-2 y la contraseña por separado y realizar No disponible - \ No newline at end of file + diff --git a/OneGateApp/Properties/Strings.fr.resx b/OneGateApp/Properties/Strings.fr.resx index 7ace373..ffa3a63 100644 --- a/OneGateApp/Properties/Strings.fr.resx +++ b/OneGateApp/Properties/Strings.fr.resx @@ -789,6 +789,12 @@ En continuant, vous reconnaissez comprendre pleinement et accepter tous les risq Jeux + + Tirez vers le bas pour actualiser le catalogue de jeux. + + + Joués récemment + Type de jeu @@ -992,4 +998,4 @@ Il est recommandé de conserver séparément la clé NEP-2 et le mot de passe, e Indisponible - \ No newline at end of file + diff --git a/OneGateApp/Properties/Strings.id.resx b/OneGateApp/Properties/Strings.id.resx index 2dc0fa2..0e1176a 100644 --- a/OneGateApp/Properties/Strings.id.resx +++ b/OneGateApp/Properties/Strings.id.resx @@ -789,6 +789,12 @@ Dengan melanjutkan, Anda menyatakan bahwa Anda sepenuhnya memahami dan menerima Game + + Tarik ke bawah untuk menyegarkan katalog game. + + + Baru dimainkan + Jenis game @@ -992,4 +998,4 @@ Disarankan untuk menyimpan kunci NEP-2 dan kata sandinya secara terpisah serta m Tidak tersedia - \ No newline at end of file + diff --git a/OneGateApp/Properties/Strings.it.resx b/OneGateApp/Properties/Strings.it.resx index 4d0b7d8..10513bd 100644 --- a/OneGateApp/Properties/Strings.it.resx +++ b/OneGateApp/Properties/Strings.it.resx @@ -789,6 +789,12 @@ Continuando, confermi di aver compreso pienamente e accettato tutti i rischi ass Giochi + + Trascina verso il basso per aggiornare il catalogo dei giochi. + + + Giocati di recente + Tipo di gioco @@ -992,4 +998,4 @@ Si consiglia di conservare separatamente la chiave NEP-2 e la password e di eseg Non disponibile - \ No newline at end of file + diff --git a/OneGateApp/Properties/Strings.ja.resx b/OneGateApp/Properties/Strings.ja.resx index 8946ac8..e6c4fa9 100644 --- a/OneGateApp/Properties/Strings.ja.resx +++ b/OneGateApp/Properties/Strings.ja.resx @@ -789,6 +789,12 @@ ゲーム + + 下に引いてゲームカタログを更新します。 + + + 最近プレイ + ゲームタイプ @@ -992,4 +998,4 @@ NEP-2 とパスワードは別々に保管し、それぞれを安全にバッ 利用不可 - \ No newline at end of file + diff --git a/OneGateApp/Properties/Strings.ko.resx b/OneGateApp/Properties/Strings.ko.resx index 49ab1e6..8326550 100644 --- a/OneGateApp/Properties/Strings.ko.resx +++ b/OneGateApp/Properties/Strings.ko.resx @@ -789,6 +789,12 @@ 게임 + + 아래로 당겨 게임 카탈로그를 새로고침하세요. + + + 최근 플레이 + 게임 유형 @@ -992,4 +998,4 @@ NEP-2와 비밀번호는 별도로 보관하고 각각 안전하게 백업하는 사용할 수 없음 - \ No newline at end of file + diff --git a/OneGateApp/Properties/Strings.nl.resx b/OneGateApp/Properties/Strings.nl.resx index 835df89..13524f6 100644 --- a/OneGateApp/Properties/Strings.nl.resx +++ b/OneGateApp/Properties/Strings.nl.resx @@ -789,6 +789,12 @@ Door door te gaan bevestigt u dat u alle bijbehorende risico's volledig begrijpt Games + + Trek omlaag om de gamecatalogus te vernieuwen. + + + Recent gespeeld + Speltype @@ -992,4 +998,4 @@ Het wordt aanbevolen om de NEP-2-sleutel en het wachtwoord apart op te slaan en Niet beschikbaar - \ No newline at end of file + diff --git a/OneGateApp/Properties/Strings.pt-BR.resx b/OneGateApp/Properties/Strings.pt-BR.resx index ca5676c..12d81ce 100644 --- a/OneGateApp/Properties/Strings.pt-BR.resx +++ b/OneGateApp/Properties/Strings.pt-BR.resx @@ -789,6 +789,12 @@ Ao continuar, você reconhece que compreende totalmente e aceita todos os riscos Jogos + + Puxe para baixo para atualizar o catálogo de jogos. + + + Jogados recentemente + Tipo de jogo @@ -992,4 +998,4 @@ Recomenda-se armazenar a chave NEP-2 e a senha separadamente e fazer backups seg Indisponível - \ No newline at end of file + diff --git a/OneGateApp/Properties/Strings.resx b/OneGateApp/Properties/Strings.resx index a643776..c7c9340 100644 --- a/OneGateApp/Properties/Strings.resx +++ b/OneGateApp/Properties/Strings.resx @@ -813,6 +813,12 @@ By continuing, you acknowledge that you fully understand and accept all associat Gaming + + Pull down to refresh the game catalog. + + + Recently played + Game type diff --git a/OneGateApp/Properties/Strings.ru.resx b/OneGateApp/Properties/Strings.ru.resx index 521dd3b..4706cf4 100644 --- a/OneGateApp/Properties/Strings.ru.resx +++ b/OneGateApp/Properties/Strings.ru.resx @@ -789,6 +789,12 @@ Игры + + Потяните вниз, чтобы обновить каталог игр. + + + Недавно сыгранные + Тип игры @@ -992,4 +998,4 @@ Недоступно - \ No newline at end of file + diff --git a/OneGateApp/Properties/Strings.tr.resx b/OneGateApp/Properties/Strings.tr.resx index c01cb15..4075f44 100644 --- a/OneGateApp/Properties/Strings.tr.resx +++ b/OneGateApp/Properties/Strings.tr.resx @@ -789,6 +789,12 @@ Devam ederek, ilgili tüm riskleri tamamen anladığınızı ve kabul ettiğiniz Oyun + + Oyun kataloğunu yenilemek için aşağı çekin. + + + Son oynananlar + Oyun türü @@ -992,4 +998,4 @@ NEP-2 anahtarı ile şifreyi ayrı ayrı saklamanız ve güvenli şekilde yedekl Kullanılamıyor - \ No newline at end of file + diff --git a/OneGateApp/Properties/Strings.vi.resx b/OneGateApp/Properties/Strings.vi.resx index 3c565a0..17d9229 100644 --- a/OneGateApp/Properties/Strings.vi.resx +++ b/OneGateApp/Properties/Strings.vi.resx @@ -789,6 +789,12 @@ Khi tiếp tục, bạn xác nhận rằng bạn đã hiểu đầy đủ và ch Trò chơi + + Kéo xuống để làm mới danh mục trò chơi. + + + Đã chơi gần đây + Thể loại trò chơi @@ -992,4 +998,4 @@ Nên lưu trữ riêng khóa NEP-2 và mật khẩu, đồng thời sao lưu ch Không khả dụng - \ No newline at end of file + diff --git a/OneGateApp/Properties/Strings.zh-Hans.resx b/OneGateApp/Properties/Strings.zh-Hans.resx index bd43896..c352f5a 100644 --- a/OneGateApp/Properties/Strings.zh-Hans.resx +++ b/OneGateApp/Properties/Strings.zh-Hans.resx @@ -813,6 +813,12 @@ 游戏 + + 下拉刷新游戏目录。 + + + 最近玩过 + 游戏类型 diff --git a/OneGateApp/Properties/Strings.zh-Hant.resx b/OneGateApp/Properties/Strings.zh-Hant.resx index 0b0ee86..d1fa364 100644 --- a/OneGateApp/Properties/Strings.zh-Hant.resx +++ b/OneGateApp/Properties/Strings.zh-Hant.resx @@ -789,6 +789,12 @@ 遊戲 + + 下拉重新整理遊戲目錄。 + + + 最近玩過 + 遊戲類型 @@ -1016,4 +1022,4 @@ 不可用 - \ No newline at end of file +