Temporary dbsongunlockables file
This commit is contained in:
parent
a2b8f92046
commit
c0e2da6762
71
TJAPlayer3/Databases/DBSongUnlockables.cs
Normal file
71
TJAPlayer3/Databases/DBSongUnlockables.cs
Normal file
@ -0,0 +1,71 @@
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using static TJAPlayer3.DBSongUnlockables;
|
||||
|
||||
namespace TJAPlayer3
|
||||
{
|
||||
internal class DBSongUnlockables : CSavableT<Dictionary<string, SongUnlockable>>
|
||||
{
|
||||
/* DISPLAYED : Song displayed in song select, only a lock appearing on the side, audio preview plays
|
||||
* GRAYED : Box grayed, song preview does not play
|
||||
* HIDDEN : Song not appears on the song select list until being unlocked
|
||||
*/
|
||||
public enum EHiddenIndex
|
||||
{
|
||||
DISPLAYED = 0,
|
||||
GRAYED = 1,
|
||||
HIDDEN = 2
|
||||
}
|
||||
|
||||
public DBSongUnlockables()
|
||||
{
|
||||
_fn = @".\Databases\SongUnlockables.json";
|
||||
base.tDBInitSavable();
|
||||
}
|
||||
public class SongUnlockable
|
||||
{
|
||||
[JsonProperty("HiddenIndex")]
|
||||
public EHiddenIndex hiddenIndex;
|
||||
|
||||
[JsonProperty("Rarity")]
|
||||
public string rarity;
|
||||
|
||||
[JsonProperty("UnlockCondition")]
|
||||
public DBUnlockables.CUnlockConditions unlockConditions;
|
||||
}
|
||||
|
||||
public void tGetUnlockedItems(int _player, ModalQueue mq)
|
||||
{
|
||||
int player = TJAPlayer3.GetActualPlayer(_player);
|
||||
var _sf = TJAPlayer3.SaveFileInstances[player].data.NamePlateTitles;
|
||||
bool _edited = false;
|
||||
|
||||
foreach (KeyValuePair<string, SongUnlockable> item in data)
|
||||
{
|
||||
var _npvKey = item.Key;
|
||||
if (!_sf.ContainsKey(_npvKey))
|
||||
{
|
||||
var _fulfilled = item.Value.unlockConditions.tConditionMetWrapper(player, DBUnlockables.CUnlockConditions.EScreen.Internal).Item1;
|
||||
|
||||
if (_fulfilled)
|
||||
{
|
||||
/*
|
||||
_sf.Add(_npvKey, item.Value.nameplateInfo);
|
||||
_edited = true;
|
||||
mq.tAddModal(
|
||||
new Modal(
|
||||
Modal.EModalType.Title,
|
||||
HRarity.tRarityToModalInt(item.Value.rarity),
|
||||
item.Value.nameplateInfo.cld.GetString(item.Key)
|
||||
),
|
||||
_player);
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_edited)
|
||||
TJAPlayer3.SaveFileInstances[player].tApplyHeyaChanges();
|
||||
}
|
||||
}
|
||||
}
|
@ -10,10 +10,12 @@ namespace TJAPlayer3
|
||||
DBCDN = new DBCDN();
|
||||
DBEncyclopediaMenus = new DBEncyclopediaMenus();
|
||||
DBNameplateUnlockables = new DBNameplateUnlockables();
|
||||
DBSongUnlockables = new DBSongUnlockables();
|
||||
}
|
||||
|
||||
public DBCDN DBCDN;
|
||||
public DBEncyclopediaMenus DBEncyclopediaMenus;
|
||||
public DBNameplateUnlockables DBNameplateUnlockables;
|
||||
public DBSongUnlockables DBSongUnlockables;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user