1
0
mirror of synced 2024-11-24 15:40:22 +01:00

Favorite songs folder 1st version (need to add back buttons and random, + few visual fixes)

This commit is contained in:
0aubsq 2022-03-03 09:20:26 +01:00
parent c0c2880b43
commit a1e6e203d8
8 changed files with 84 additions and 1 deletions

View File

@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TJAPlayer3
{
internal class CSongDict
{
private static Dictionary<string, C曲リストード> nodes = new Dictionary<string, C曲リストード>();
public static C曲リストード tGetNodeFromID(string id)
{
if (nodes.ContainsKey(id))
return nodes[id].Clone();
return null;
}
public static void tAddSongNode(string id, C曲リストード node)
{
if (!nodes.ContainsKey(id))
nodes.Add(id, node.Clone());
}
#region [Extra methods]
public static List<C曲リストード> tFetchFavoriteFolder(C曲リストード parent)
{
List<C曲リストード> childList = new List<C曲リストード>();
foreach (string id in TJAPlayer3.Favorites.data.favorites[TJAPlayer3.SaveFile])
{
var node = tGetNodeFromID(id);
if (node != null)
{
node.r親ード = parent;
node.isChangedBgType = parent.isChangedBgType;
node.isChangedBgColor = parent.isChangedBgColor;
node.isChangedBoxType = parent.isChangedBoxType;
node.isChangedBoxColor = parent.isChangedBoxColor;
childList.Add(node);
}
}
return childList;
}
#endregion
}
}

View File

@ -388,7 +388,9 @@ namespace TJAPlayer3
c曲リストード.nLevel = dtx.LEVELtaiko;
c曲リストード.uniqueId = dtx.uniqueID;
c曲リストード.arスコア[ n ] = new Cスコア();
CSongDict.tAddSongNode(c曲リストード.uniqueId.data.id, c曲リストード);
c曲リストード.arスコア[ n ] = new Cスコア();
c曲リストード.arスコア[ n ].. = str基点フォルダ + fileinfo.Name;
c曲リストード.arスコア[ n ].. = str基点フォルダ;
c曲リストード.arスコア[ n ].. = fileinfo.Length;
@ -957,6 +959,9 @@ namespace TJAPlayer3
}
}
// Removed the pre-made recently played songs folder, so players will have total control on it's shape and visuals
/*
#region [ "最近遊んだ曲"BOXを生成する ]
if(list曲ルート.Count > 0)
@ -990,6 +995,7 @@ namespace TJAPlayer3
}
#endregion
*/
this.t曲リストへ後処理を適用する(this.list曲ルート);

View File

@ -658,6 +658,13 @@ namespace TJAPlayer3
break;
case C曲リストード.Eード種別.BOX:
{
// 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現在選択中の曲);
}
CSongSelectSongManager.disable();
TJAPlayer3.Skin.sound決定音.t再生する();

View File

@ -121,6 +121,7 @@
<Compile Include="Animations\IAnimatable.cs" />
<Compile Include="Animations\Linear.cs" />
<Compile Include="Common\CCrypto.cs" />
<Compile Include="Common\CSongDict.cs" />
<Compile Include="Common\Favorites.cs" />
<Compile Include="Common\ConfigManager.cs" />
<Compile Include="Common\Discord.cs" />

View File

@ -0,0 +1,10 @@
#TITLE:Favorite songs
#GENRE:Favorite
#FORECOLOR:#FFFFFF
#BACKCOLOR:#673100
#BOXEXPLANATION1:Challenge some of
#BOXEXPLANATION2:your favorite songs !
#BOXEXPLANATION3:(Toggle with Left CTRL)
#BGTYPE:10
#BOXTYPE:0
#BOXCOLOR:#c71b3b

View File

@ -0,0 +1,7 @@
#TITLE:Recently played songs
#GENRE:
#FORECOLOR:#FFFFFF
#BACKCOLOR:#164748
#BOXEXPLANATION1:Play recently played songs !
#BGTYPE:9
#BOXTYPE:9