1
0
mirror of synced 2025-02-17 19:09:25 +01:00

Search by difficulty methods and current WIP folder (Search Oni/Ura Lv.8 charts for now)

This commit is contained in:
0aubsq 2022-03-15 16:39:15 +01:00
parent 7ef809da14
commit d0bfd0a340
4 changed files with 52 additions and 4 deletions

View File

@ -168,11 +168,12 @@ namespace TJAPlayer3
return childList;
}
// Generate recently played songs folder
public static List<C曲リストード> tFetchRecentlyPlayedSongsFolder(C曲リストード parent)
{
List<C曲リストード> childList = new List<C曲リストード>();
foreach (string id in TJAPlayer3.RecentlyPlayedSongs.data.recentlyplayedsongs[TJAPlayer3.SaveFile])
foreach (string id in TJAPlayer3.RecentlyPlayedSongs.data.recentlyplayedsongs[TJAPlayer3.SaveFile].Reverse())
{
var node = tReadaptChildNote(parent, tGetNodeFromID(id));
if (node != null)
@ -191,6 +192,34 @@ namespace TJAPlayer3
return childList;
}
// Generate search by difficulty folder
public static List<C曲リストード> tFetchSongsByDifficulty(C曲リストード parent, int difficulty = (int)Difficulty.Oni, int level = 8)
{
List<C曲リストード> childList = new List<C曲リストード>();
foreach (C曲リストード nodeT in nodes.Values)
{
var score = nodeT.nLevel;
if (score[difficulty] == level
|| (difficulty == (int)Difficulty.Oni && score[(int)Difficulty.Edit] == level)) // Oni includes Ura
{
var node = tReadaptChildNote(parent, nodeT);
if (node != null)
{
childList.Add(node);
}
}
}
// Generate back buttons
string favPath = "./" + parent.strタイトル + "/";
tReinsertBackButtons(parent, childList, favPath);
return childList;
}
#endregion
#region [Score tables methods]

View File

@ -657,9 +657,10 @@ namespace TJAPlayer3
}
break;
case C曲リストード.Eード種別.BOX:
{
{
#region [Pre-generated folders]
// Pre-generate the favorite folder if the folder's genre is "Favorite"
if (this.act曲リスト.r現在選択中の曲.strジャンル == "Favorite")
{
this.act曲リスト.r現在選択中の曲.list子リスト = CSongDict.tFetchFavoriteFolder(this.act曲リスト.r現在選択中の曲);
@ -668,7 +669,14 @@ namespace TJAPlayer3
{
this.act曲リスト.r現在選択中の曲.list子リスト = CSongDict.tFetchRecentlyPlayedSongsFolder(this.act曲リスト.r現在選択中の曲);
}
else if (this.act曲リスト.r現在選択中の曲.strジャンル == "SearchD")
{
// Todo : Add a small prompt to choose the difficulty
this.act曲リスト.r現在選択中の曲.list子リスト = CSongDict.tFetchSongsByDifficulty(this.act曲リスト.r現在選択中の曲, (int)Difficulty.Oni, 8);
}
#endregion
CSongSelectSongManager.disable();
TJAPlayer3.Skin.sound決定音.t再生する();

View File

@ -0,0 +1,11 @@
#TITLE:Search by difficulty
#GENRE:SearchD
#FORECOLOR:#FFFFFF
#BACKCOLOR:#213d18
#BOXEXPLANATION1:Search and play songs that
#BOXEXPLANATION2:fit your level !
#BOXEXPLANATION3:(WIP, currently set to Oni 8)
#BGTYPE:1
#BOXTYPE:0
#BOXCOLOR:#5ac736
#BGCOLOR:#80e65e