feat(bookmark): ゲームのお気に入り(ブックマーク)登録機能および優先ソート・フィルターを追加
- GameItemBase に IsBookmarked プロパティおよび関連バインディング項目を追加 - 一覧カード内星アイコン、詳細ヘッダーボタン、右クリックコンテキストメニューからブックマーク切替可能に - ソート順に「★ ブックマーク優先」を追加し、サブフィルターに「★ ブックマークのみ」絞り込みを追加 - キャッシュ保存(UnifiedGameCacheEntry)にブックマーク状態を永続化し次回起動時も保持 - ステータスバーにブックマーク登録件数の集計表示を追加
This commit is contained in:
1 parent
59519208f3
commit
c0989362a9
6 files changed
+123
-8
No files matched your search
@@ -40,6 +40,7 @@ namespace GameLauncher.Models
|
||||
public bool TkoolFilterAsarOnly { get; set; }
|
||||
public bool TkoolFilterRgssOnly { get; set; }
|
||||
public bool TkoolFilterAllRgss { get; set; }
|
||||
public bool FilterBookmarkedOnly { get; set; }
|
||||
public string UnityBackendFilter { get; set; } = "All";
|
||||
public bool UnityFilterSaveOnly { get; set; }
|
||||
}
|
||||
@@ -56,8 +57,9 @@ namespace GameLauncher.Models
|
||||
if (x is not GameItemBase a || y is not GameItemBase b)
|
||||
return 0;
|
||||
|
||||
return SortOrder switch
|
||||
return this.SortOrder switch
|
||||
{
|
||||
GameSortOrder.BookmarkedFirst => CompareBookmarkedFirst(a, b),
|
||||
GameSortOrder.LastLaunchedDesc => CompareNullableDateTimeDesc(a.LastLaunched, b.LastLaunched, a.Title, b.Title),
|
||||
GameSortOrder.LastLaunchedAsc => CompareNullableDateTimeAsc(a.LastLaunched, b.LastLaunched, a.Title, b.Title),
|
||||
GameSortOrder.FolderLastModifiedDesc => CompareNullableDateTimeDesc(a.FolderLastModified, b.FolderLastModified, a.Title, b.Title),
|
||||
@@ -69,6 +71,15 @@ namespace GameLauncher.Models
|
||||
};
|
||||
}
|
||||
|
||||
private static int CompareBookmarkedFirst(GameItemBase a, GameItemBase b)
|
||||
{
|
||||
if (a.IsBookmarked != b.IsBookmarked)
|
||||
{
|
||||
return a.IsBookmarked ? -1 : 1;
|
||||
}
|
||||
return CompareNullableDateTimeDesc(a.LastLaunched, b.LastLaunched, a.Title, b.Title);
|
||||
}
|
||||
|
||||
private static int CompareNullableDateTimeDesc(DateTime? d1, DateTime? d2, string title1, string title2)
|
||||
{
|
||||
if (d1.HasValue && d2.HasValue)
|
||||
|
||||
Reference in new issue
Block a user