diff --git a/MDRPC/Models/ActivityModel.cs b/MDRPC/Models/ActivityModel.cs index 608b14c..9969ac7 100644 --- a/MDRPC/Models/ActivityModel.cs +++ b/MDRPC/Models/ActivityModel.cs @@ -1,7 +1,4 @@ -using Il2CppAssets.Scripts.PeroTools.Commons; -using Il2CppAssets.Scripts.PeroTools.Nice.Datas; -using Il2CppAssets.Scripts.PeroTools.Nice.Interface; -using MDRPC.Patches; +using Il2CppAssets.Scripts.Database; namespace MDRPC.Models; @@ -24,21 +21,14 @@ public ActivityModel(bool isPlaying, string levelInfo) // Song songInfo = !string.IsNullOrEmpty(levelInfo) ? levelInfo.Split(" - ") : null; - // Account - var account = Singleton.instance["Account"]; + playerName = DataHelper.nickname; + playerLevel = DataHelper.Level; - playerName = account["PlayerName"].GetResult(); - playerLevel = Math.Ceiling(account["Exp"].GetResult() / 100d); - - if (isPlaying) + if (isPlaying) { - songLevel = new SongLevelModel( - HideBmsCheckPatch.Level, - HideBmsCheckPatch.Difficulty - ); - - playerElfin = ElfinModel.GetName(account["SelectedElfinIndex"].GetResult()); - playerCharacter = CharacterModel.GetName(account["SelectedRoleIndex"].GetResult()); + songLevel = new SongLevelModel(); + playerElfin = ElfinModel.GetName(); + playerCharacter = CharacterModel.GetName(); } } diff --git a/MDRPC/Models/CharacterModel.cs b/MDRPC/Models/CharacterModel.cs index 6fa4df0..b746d77 100644 --- a/MDRPC/Models/CharacterModel.cs +++ b/MDRPC/Models/CharacterModel.cs @@ -11,18 +11,18 @@ internal class CharacterModel { "Marija" } }; - public static string GetName(int id) + public static string GetName() { - var entity = GlobalDataBase.dbConfig.m_ConfigDic["character"].Cast().GetLocal().GetInfoByIndex(id); + var entity = GlobalDataBase + .dbConfig + .m_ConfigDic["character"] + .Cast() + .GetLocal() + .GetInfoByIndex(DataHelper.selectedRoleIndex); - if (entity != null) - { - if (CosCharacters.Contains(entity.characterName, StringComparer.OrdinalIgnoreCase)) - return $"{entity.cosName} {entity.characterName}"; + if (CosCharacters.Contains(entity.characterName, StringComparer.OrdinalIgnoreCase)) + return $"{entity.cosName} {entity.characterName}"; - return entity.characterName; - } - - return id.ToString(); - } + return entity.characterName; + } } diff --git a/MDRPC/Models/ElfinModel.cs b/MDRPC/Models/ElfinModel.cs index 0ddae2e..7381ba7 100644 --- a/MDRPC/Models/ElfinModel.cs +++ b/MDRPC/Models/ElfinModel.cs @@ -4,13 +4,14 @@ namespace MDRPC.Models; internal class ElfinModel { - public static string GetName(int id) + public static string GetName() { - var entity = GlobalDataBase.dbConfig.m_ConfigDic["elfin"].Cast().GetLocal().GetInfoByIndex(id); - - if (entity != null) - return entity.name; - - return id.ToString(); + return GlobalDataBase + .dbConfig + .m_ConfigDic["elfin"] + .Cast() + .GetLocal() + .GetInfoByIndex(DataHelper.selectedElfinIndex) + .name; } }