示例#1
0
            private string DumpGUID(IndentHelper indentHelper, ulong guid)
            {
                string baseString = $"\r\n{indentHelper + 1}[{GetGUIDTypeName(guid)}]";

                STUInstance[] instances;
                switch (GUID.Type(guid))
                {
                default:
                    return("");

                case 0x7C:
                case 0xA9:
                    return($"{baseString} \"{GetOWString(guid, _handler, _map)}\"");

                case 0x90:
                    instances = GetInstances(guid, _handler, _map);
                    if (instances[0] == null)
                    {
                        return(null);
                    }
                    STUEncryptionKey encryptionKey = instances[0] as STUEncryptionKey;
                    return($"{baseString} {encryptionKey?.KeyNameProper}:{encryptionKey?.Key}");

                case 0xA5:
                    instances = GetInstances(guid, _handler, _map);
                    STUUnlock unlock      = instances.OfType <STUUnlock>().First();
                    string    baseString2 = $"\r\n{indentHelper + 1}[{GetGUIDTypeName(guid)}";
                    if (unlock == null)
                    {
                        return(null);
                    }
                    if (unlock is STUUnlock_Currency)
                    {
                        return($"{baseString2}:Credits] {(unlock as STUUnlock_Currency).Amount} Credits");
                    }
                    else if (unlock is STULevelPortrait)
                    {
                        STULevelPortrait portrait = unlock as STULevelPortrait;
                        return
                            ($"{baseString2}:Credits] {portrait.Tier} Star:{portrait.Star} Level:{portrait.Level}");
                    }
                    else if (unlock is STUCompetitiveCurrencyReward)
                    {
                        STUCompetitiveCurrencyReward competitiveCurrencyReward = unlock as STUCompetitiveCurrencyReward;
                        return
                            ($"{baseString2}:CompetitivePoints] {competitiveCurrencyReward.Amount} points");
                    }
                    else
                    {
                        return($"{baseString2}:{unlock.GetType().Name}] \"{GetOWString(unlock.CosmeticName, _handler, _map)}\"");
                    }

                case 0x9E:
                    instances = GetInstances(guid, _handler, _map);
                    if (instances[0] == null)
                    {
                        return(null);
                    }
                    STULoadout ability = instances[0] as STULoadout;
                    return($"{baseString} \"{GetOWString(ability?.Name, _handler, _map)}\" ({ability?.Category})");

                case 0xC5:
                    instances = GetInstances(guid, _handler, _map);
                    if (instances[0] == null)
                    {
                        return(null);
                    }
                    STUGamemode gamemode = instances[0] as STUGamemode;
                    return($"{baseString} \"{GetOWString(gamemode?.DisplayName, _handler, _map)}\"");

                case 0xC6:
                    instances = GetInstances(guid, _handler, _map);
                    if (instances[0] == null)
                    {
                        return(null);
                    }
                    STUGameRulesetSchema gameRulsetSchema = instances[0] as STUGameRulesetSchema;
                    return($"{baseString} \"{GetOWString(gameRulsetSchema?.Name, _handler, _map)}\"");

                case 0x75:
                    instances = GetInstances(guid, _handler, _map);
                    if (instances[0] == null)
                    {
                        return(null);
                    }
                    STUHero hero = instances[0] as STUHero;
                    return($"{baseString} \"{GetOWString(hero?.Name, _handler, _map)}\"");
                }
            }
示例#2
0
        public static MapInfo GetMap(ulong key)
        {
            STUMap map = GetInstance <STUMap>(key);

            if (map == null)
            {
                return(null);
            }

            string nameA = GetString(map.DisplayName);
            string nameB = GetString(map.VariantName);

            string descA   = GetString(map.DescriptionA);
            string descB   = GetString(map.DescriptionB);
            string subline = GetString(map.SublineString);

            string stateA = GetString(map.StateStringA);
            string stateB = GetString(map.StateStringB);

            List <GamemodeInfo> gamemodes = null;

            if (map.Gamemodes != null)
            {
                gamemodes = new List <GamemodeInfo>();
                foreach (Common.STUGUID guid in map.Gamemodes)
                {
                    STUGamemode gamemode = GetInstance <STUGamemode>(guid);
                    if (gamemode == null)
                    {
                        continue;
                    }

                    gamemodes.Add(new GamemodeInfo {
                        Name = GetString(gamemode.DisplayName),
                        GUID = guid
                    });
                }
            }

            if (!string.IsNullOrEmpty(nameA) && !string.IsNullOrEmpty(nameB) && nameB.Equals(nameA))
            {
                nameB = null;
            }

            if (!string.IsNullOrEmpty(descA) && !string.IsNullOrEmpty(descB) && descB.Equals(descA))
            {
                descB = null;
            }

            string uniqueName;

            if (nameA == null)
            {
                uniqueName = $"Title Screen:{GUID.Index(key):X}";
            }
            else
            {
                uniqueName = nameA + $":{GUID.Index(key):X}";
            }
            return(new MapInfo(uniqueName, key, nameA, nameB, descA, descB, subline, stateA, stateB,
                               map.MapDataResource1, map.MapDataResource2, gamemodes));
        }
示例#3
0
        protected string GetGamemode(ulong guid)
        {
            STUGamemode gamemode = GetInstance <STUGamemode>(guid);

            return(GetString(gamemode?.DisplayName));
        }