1
0
mirror of synced 2025-01-27 08:43:40 +01:00

Temporary dbsongunlockables file

This commit is contained in:
0auBSQ 2023-08-18 17:57:13 +09:00
parent a2b8f92046
commit c0e2da6762
2 changed files with 73 additions and 0 deletions

View 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();
}
}
}

View File

@ -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;
}
}