Exemple #1
0
        public void GetGeneralUnlocks(ICLIFlags toolFlags)
        {
            string basePath;

            if (toolFlags is ExtractFlags flags)
            {
                basePath = flags.OutputPath;
            }
            else
            {
                throw new Exception("no output path");
            }

            foreach (var key in TrackedFiles[0x54])
            {
                STUGlobalInventoryMaster invMaster = GetInstance <STUGlobalInventoryMaster>(key);
                if (invMaster == null)
                {
                    continue;
                }

                var achivementUnlocks = invMaster.AchievementUnlocks?.Unlocks?.Select(it => GatherUnlock((ulong)it)).ToList();
                SprayAndIcon.SaveItems(basePath, null, "General", "Achievements", flags, achivementUnlocks);

                if (invMaster.EventGeneralUnlocks != null)
                {
                    foreach (var eventUnlocks in invMaster.EventGeneralUnlocks)
                    {
                        if (eventUnlocks?.Unlocks?.Unlocks == null)
                        {
                            continue;
                        }

                        var eventKey = ItemEvents.GetInstance().EventsNormal[(uint)eventUnlocks.Event];
                        var unlocks  = eventUnlocks.Unlocks.Unlocks.Select(it => GatherUnlock((ulong)it)).ToList();
                        SprayAndIcon.SaveItems(basePath, null, "General", eventKey, flags, unlocks);
                    }
                }

                if (invMaster.LevelUnlocks != null)
                {
                    var unlocks = new HashSet <ItemInfo>();
                    foreach (var levelUnlocks in invMaster.LevelUnlocks)
                    {
                        if (levelUnlocks?.Unlocks == null)
                        {
                            continue;
                        }
                        foreach (var unlock in levelUnlocks.Unlocks)
                        {
                            unlocks.Add(GatherUnlock(unlock));
                        }
                    }

                    SprayAndIcon.SaveItems(basePath, null, "General", "Standard", flags, unlocks.ToList());
                    Portrait.SaveItems(basePath, null, "General", "Standard", flags, unlocks.ToList());
                }
            }
        }
Exemple #2
0
        public Dictionary <string, HashSet <ItemInfo> > GetUnlocks()
        {
            Dictionary <string, HashSet <ItemInfo> > @return = new Dictionary <string, HashSet <ItemInfo> >();

            foreach (ulong key in TrackedFiles[0x54])
            {
                STUGlobalInventoryMaster invMaster = GetInstance <STUGlobalInventoryMaster>(key);
                if (invMaster == null)
                {
                    continue;
                }

                @return["Achievement"] = GatherUnlocks(invMaster.AchievementUnlocks?.Unlocks?.Select(it => (ulong)it));

                @return["Standard"] = new HashSet <ItemInfo>();

                if (invMaster.LevelUnlocks != null)
                {
                    foreach (STUAdditionalUnlocks levelUnlocks in invMaster.LevelUnlocks)
                    {
                        if (levelUnlocks?.Unlocks == null)
                        {
                            continue;
                        }

                        foreach (ItemInfo info in GatherUnlocks(levelUnlocks.Unlocks.Select(it => (ulong)it)))
                        {
                            @return["Standard"].Add(info);
                        }
                    }
                }

                if (invMaster.EventGeneralUnlocks != null)
                {
                    foreach (STULootBoxUnlocks eventUnlocks in invMaster.EventGeneralUnlocks)
                    {
                        if (eventUnlocks?.Unlocks?.Unlocks == null)
                        {
                            continue;
                        }

                        string eventKey = $"Event/{ItemEvents.GetInstance().EventsNormal[(uint)eventUnlocks.Event]}";

                        if ([email protected](eventKey))
                        {
                            @return[eventKey] = new HashSet <ItemInfo>();
                        }

                        foreach (ItemInfo info in GatherUnlocks(eventUnlocks.Unlocks.Unlocks.Select(it => (ulong)it)))
                        {
                            @return[eventKey].Add(info);
                        }
                    }
                }
            }

            return(@return);
        }