public void Parse(ICLIFlags toolFlags) { var unlocks = GetUnlocks(); if (toolFlags is ListFlags flags) { if (flags.JSON) { ParseJSON(unlocks, flags); return; } } ListHeroUnlocks.DisplayUnlocks("Other", unlocks.OtherUnlocks); if (unlocks.LootBoxesUnlocks != null) { foreach (LootBoxUnlocks lootBoxUnlocks in unlocks.LootBoxesUnlocks) { string boxName = LootBox.GetName(lootBoxUnlocks.LootBoxType); ListHeroUnlocks.DisplayUnlocks(boxName, lootBoxUnlocks.Unlocks); } } if (unlocks.AdditionalUnlocks != null) { foreach (AdditionalUnlocks additionalUnlocks in unlocks.AdditionalUnlocks) { ListHeroUnlocks.DisplayUnlocks($"Level {additionalUnlocks.Level}", additionalUnlocks.Unlocks); } } }
private static IDictionary <ulong, string> GetHeroItemMapping() { Log("Generating hero to item mapping"); Dictionary <ulong, string> @return = new Dictionary <ulong, string>(); foreach (var key in TrackedFiles[0x75]) { STUHero hero = GetInstance <STUHero>(key); if (hero?.LootboxUnlocks == null) { continue; } string heroName = GetString(hero.Name); Dictionary <string, HashSet <ItemInfo> > unlocks = ListHeroUnlocks.GetUnlocksForHero(hero.LootboxUnlocks); foreach (KeyValuePair <string, HashSet <ItemInfo> > unlockPair in unlocks) { if (unlockPair.Value?.Count == 0 || unlockPair.Value == null) { continue; } foreach (ItemInfo unlock in unlockPair.Value) { @return[unlock.GUID] = heroName; } } } return(@return); }