コード例 #1
0
 // Token: 0x06002A0D RID: 10765 RVA: 0x00104C26 File Offset: 0x00103026
 public static void hand(bool state)
 {
     Characters.active.hand = state;
     Characters.apply(false, false);
     if (Characters.onCharacterUpdated != null)
     {
         Characters.onCharacterUpdated(Characters.selected, Characters.active);
     }
 }
コード例 #2
0
 public static void open()
 {
     if (MenuSurvivorsClothingUI.active)
     {
         return;
     }
     MenuSurvivorsClothingUI.active = true;
     Characters.apply(false, true);
     MenuSurvivorsClothingUI.container.lerpPositionScale(0f, 0f, ESleekLerp.EXPONENTIAL, 20f);
 }
コード例 #3
0
 public static void close()
 {
     if (!MenuSurvivorsAppearanceUI.active)
     {
         return;
     }
     MenuSurvivorsAppearanceUI.active = false;
     Characters.apply(true, true);
     MenuSurvivorsAppearanceUI.container.lerpPositionScale(0f, 1f, ESleekLerp.EXPONENTIAL, 20f);
 }
コード例 #4
0
 // Token: 0x06002A03 RID: 10755 RVA: 0x00104AC0 File Offset: 0x00102EC0
 public static void skillify(EPlayerSkillset skillset)
 {
     Characters.active.skillset = skillset;
     if (Characters.onCharacterUpdated != null)
     {
         Characters.onCharacterUpdated(Characters.selected, Characters.active);
     }
     Characters.active.applyHero();
     Characters.apply();
 }
コード例 #5
0
 public static void close()
 {
     if (!MenuSurvivorsClothingUI.active)
     {
         return;
     }
     MenuSurvivorsClothingUI.active = false;
     if (!MenuSurvivorsClothingBoxUI.active && !MenuSurvivorsClothingInspectUI.active && !MenuSurvivorsClothingDeleteUI.active && !MenuSurvivorsClothingItemUI.active)
     {
         Characters.apply(true, true);
     }
     MenuSurvivorsClothingUI.container.lerpPositionScale(0f, 1f, ESleekLerp.EXPONENTIAL, 20f);
 }
コード例 #6
0
 // Token: 0x06002A07 RID: 10759 RVA: 0x00104B36 File Offset: 0x00102F36
 public static void paintSkin(Color color)
 {
     Characters.active.skin = color;
     Characters.apply(false, false);
 }
コード例 #7
0
 // Token: 0x06002A06 RID: 10758 RVA: 0x00104B22 File Offset: 0x00102F22
 public static void growBeard(byte beard)
 {
     Characters.active.beard = beard;
     Characters.apply(false, false);
 }
コード例 #8
0
 // Token: 0x06002A05 RID: 10757 RVA: 0x00104B0E File Offset: 0x00102F0E
 public static void growHair(byte hair)
 {
     Characters.active.hair = hair;
     Characters.apply(false, false);
 }
コード例 #9
0
 // Token: 0x06002A04 RID: 10756 RVA: 0x00104AFA File Offset: 0x00102EFA
 public static void growFace(byte face)
 {
     Characters.active.face = face;
     Characters.apply(false, false);
 }
コード例 #10
0
        // Token: 0x06002A1C RID: 10780 RVA: 0x00105C74 File Offset: 0x00104074
        public static void load()
        {
            Characters.initialApply = false;
            Provider.provider.economyService.refreshInventory();
            if (Characters.list != null)
            {
                byte b = 0;
                while ((int)b < Characters.list.Length)
                {
                    if (Characters.list[(int)b] != null)
                    {
                        if (Characters.onCharacterUpdated != null)
                        {
                            Characters.onCharacterUpdated(b, Characters.list[(int)b]);
                        }
                    }
                    b += 1;
                }
                return;
            }
            Characters.list          = new Character[(int)(Customization.FREE_CHARACTERS + Customization.PRO_CHARACTERS)];
            Characters._packageSkins = new List <ulong>();
            if (ReadWrite.fileExists("/Characters.dat", true))
            {
                Block block = ReadWrite.readBlock("/Characters.dat", true, 0);
                if (block != null)
                {
                    byte b2 = block.readByte();
                    if (b2 >= 12)
                    {
                        if (b2 >= 14)
                        {
                            ushort num = block.readUInt16();
                            for (ushort num2 = 0; num2 < num; num2 += 1)
                            {
                                ulong num3 = block.readUInt64();
                                if (num3 != 0UL)
                                {
                                    Characters.packageSkins.Add(num3);
                                }
                            }
                        }
                        Characters._selected = block.readByte();
                        if (!Provider.isPro && Characters.selected >= Customization.FREE_CHARACTERS)
                        {
                            Characters._selected = 0;
                        }
                        byte b3 = 0;
                        while ((int)b3 < Characters.list.Length)
                        {
                            ushort newShirt           = block.readUInt16();
                            ushort newPants           = block.readUInt16();
                            ushort newHat             = block.readUInt16();
                            ushort newBackpack        = block.readUInt16();
                            ushort newVest            = block.readUInt16();
                            ushort newMask            = block.readUInt16();
                            ushort newGlasses         = block.readUInt16();
                            ulong  newPackageShirt    = block.readUInt64();
                            ulong  newPackagePants    = block.readUInt64();
                            ulong  newPackageHat      = block.readUInt64();
                            ulong  newPackageBackpack = block.readUInt64();
                            ulong  newPackageVest     = block.readUInt64();
                            ulong  newPackageMask     = block.readUInt64();
                            ulong  newPackageGlasses  = block.readUInt64();
                            ushort newPrimaryItem     = block.readUInt16();
                            byte[] newPrimaryState    = block.readByteArray();
                            ushort newSecondaryItem   = block.readUInt16();
                            byte[] newSecondaryState  = block.readByteArray();
                            byte   b4     = block.readByte();
                            byte   b5     = block.readByte();
                            byte   b6     = block.readByte();
                            Color  color  = block.readColor();
                            Color  color2 = block.readColor();
                            Color  newMarkerColor;
                            if (b2 > 20)
                            {
                                newMarkerColor = block.readColor();
                            }
                            else
                            {
                                newMarkerColor = Customization.MARKER_COLORS[UnityEngine.Random.Range(0, Customization.MARKER_COLORS.Length)];
                            }
                            bool   newHand = block.readBoolean();
                            string newName = block.readString();
                            if (b2 < 19)
                            {
                                newName = Provider.clientName;
                            }
                            string   newNick  = block.readString();
                            CSteamID csteamID = block.readSteamID();
                            byte     b7       = block.readByte();
                            if (!Provider.provider.communityService.checkGroup(csteamID))
                            {
                                csteamID = CSteamID.Nil;
                            }
                            if (b7 >= Customization.SKILLSETS)
                            {
                                b7 = 0;
                            }
                            if (b2 < 16)
                            {
                                b7 = (byte)UnityEngine.Random.Range(1, (int)Customization.SKILLSETS);
                            }
                            if (b2 > 16 && b2 < 20)
                            {
                                block.readBoolean();
                            }
                            if (!Provider.isPro)
                            {
                                if (b4 >= Customization.FACES_FREE)
                                {
                                    b4 = (byte)UnityEngine.Random.Range(0, (int)Customization.FACES_FREE);
                                }
                                if (b5 >= Customization.HAIRS_FREE)
                                {
                                    b5 = (byte)UnityEngine.Random.Range(0, (int)Customization.HAIRS_FREE);
                                }
                                if (b6 >= Customization.BEARDS_FREE)
                                {
                                    b6 = 0;
                                }
                                if (!Customization.checkSkin(color))
                                {
                                    color = Customization.SKINS[UnityEngine.Random.Range(0, Customization.SKINS.Length)];
                                }
                                if (!Customization.checkColor(color2))
                                {
                                    color2 = Customization.COLORS[UnityEngine.Random.Range(0, Customization.COLORS.Length)];
                                }
                            }
                            Characters.list[(int)b3] = new Character(newShirt, newPants, newHat, newBackpack, newVest, newMask, newGlasses, newPackageShirt, newPackagePants, newPackageHat, newPackageBackpack, newPackageVest, newPackageMask, newPackageGlasses, newPrimaryItem, newPrimaryState, newSecondaryItem, newSecondaryState, b4, b5, b6, color, color2, newMarkerColor, newHand, newName, newNick, csteamID, (EPlayerSkillset)b7);
                            if (Characters.onCharacterUpdated != null)
                            {
                                Characters.onCharacterUpdated(b3, Characters.list[(int)b3]);
                            }
                            b3 += 1;
                        }
                    }
                    else
                    {
                        byte b8 = 0;
                        while ((int)b8 < Characters.list.Length)
                        {
                            Characters.list[(int)b8] = new Character();
                            if (Characters.onCharacterUpdated != null)
                            {
                                Characters.onCharacterUpdated(b8, Characters.list[(int)b8]);
                            }
                            b8 += 1;
                        }
                    }
                }
            }
            else
            {
                Characters._selected = 0;
            }
            byte b9 = 0;

            while ((int)b9 < Characters.list.Length)
            {
                if (Characters.list[(int)b9] == null)
                {
                    Characters.list[(int)b9] = new Character();
                    if (Characters.onCharacterUpdated != null)
                    {
                        Characters.onCharacterUpdated(b9, Characters.list[(int)b9]);
                    }
                }
                b9 += 1;
            }
            Characters.apply();
            Characters.hasLoaded = true;
        }
コード例 #11
0
 // Token: 0x06002A18 RID: 10776 RVA: 0x001057F8 File Offset: 0x00103BF8
 private static void onInventoryRefreshed()
 {
     if (Characters.clothes != null && Characters.list != null && Characters.packageSkins != null)
     {
         for (int i = Characters.packageSkins.Count - 1; i >= 0; i--)
         {
             ulong num = Characters.packageSkins[i];
             if (num != 0UL && Provider.provider.economyService.getInventoryItem(num) == 0)
             {
                 Characters.packageSkins.RemoveAt(i);
             }
         }
         for (int j = 0; j < Characters.list.Length; j++)
         {
             Character character = Characters.list[j];
             if (character != null)
             {
                 if (character.packageShirt != 0UL && Provider.provider.economyService.getInventoryItem(character.packageShirt) == 0)
                 {
                     character.packageShirt = 0UL;
                 }
                 if (character.packagePants != 0UL && Provider.provider.economyService.getInventoryItem(character.packagePants) == 0)
                 {
                     character.packagePants = 0UL;
                 }
                 if (character.packageHat != 0UL && Provider.provider.economyService.getInventoryItem(character.packageHat) == 0)
                 {
                     character.packageHat = 0UL;
                 }
                 if (character.packageBackpack != 0UL && Provider.provider.economyService.getInventoryItem(character.packageBackpack) == 0)
                 {
                     character.packageBackpack = 0UL;
                 }
                 if (character.packageVest != 0UL && Provider.provider.economyService.getInventoryItem(character.packageVest) == 0)
                 {
                     character.packageVest = 0UL;
                 }
                 if (character.packageMask != 0UL && Provider.provider.economyService.getInventoryItem(character.packageMask) == 0)
                 {
                     character.packageMask = 0UL;
                 }
                 if (character.packageGlasses != 0UL && Provider.provider.economyService.getInventoryItem(character.packageGlasses) == 0)
                 {
                     character.packageGlasses = 0UL;
                 }
             }
         }
         if (!Characters.initialApply)
         {
             Characters.initialApply = true;
             Characters.apply();
         }
     }
     if (Characters.hasDropped)
     {
         return;
     }
     Characters.hasDropped = true;
     if (Characters.hasPlayed)
     {
         Provider.provider.economyService.dropInventory();
     }
 }
コード例 #12
0
        // Token: 0x06002A17 RID: 10775 RVA: 0x001053D0 File Offset: 0x001037D0
        public static void apply(bool showItems, bool showCosmetics)
        {
            if (Characters.active == null)
            {
                Debug.LogError("Failed to find an active character.");
                return;
            }
            if (Characters.clothes == null)
            {
                Debug.LogError("Failed to find character clothes.");
                return;
            }
            Characters.character.localScale = new Vector3((float)((!Characters.active.hand) ? 1 : -1), 1f, 1f);
            if (showItems)
            {
                Characters.clothes.shirt    = Characters.active.shirt;
                Characters.clothes.pants    = Characters.active.pants;
                Characters.clothes.hat      = Characters.active.hat;
                Characters.clothes.backpack = Characters.active.backpack;
                Characters.clothes.vest     = Characters.active.vest;
                Characters.clothes.mask     = Characters.active.mask;
                Characters.clothes.glasses  = Characters.active.glasses;
            }
            else
            {
                Characters.clothes.shirt    = 0;
                Characters.clothes.pants    = 0;
                Characters.clothes.hat      = 0;
                Characters.clothes.backpack = 0;
                Characters.clothes.vest     = 0;
                Characters.clothes.mask     = 0;
                Characters.clothes.glasses  = 0;
            }
            if (showCosmetics)
            {
                if (Characters.active.packageShirt != 0UL)
                {
                    Characters.clothes.visualShirt = Provider.provider.economyService.getInventoryItem(Characters.active.packageShirt);
                }
                else
                {
                    Characters.clothes.visualShirt = 0;
                }
                if (Characters.active.packagePants != 0UL)
                {
                    Characters.clothes.visualPants = Provider.provider.economyService.getInventoryItem(Characters.active.packagePants);
                }
                else
                {
                    Characters.clothes.visualPants = 0;
                }
                if (Characters.active.packageHat != 0UL)
                {
                    Characters.clothes.visualHat = Provider.provider.economyService.getInventoryItem(Characters.active.packageHat);
                }
                else
                {
                    Characters.clothes.visualHat = 0;
                }
                if (Characters.active.packageBackpack != 0UL)
                {
                    Characters.clothes.visualBackpack = Provider.provider.economyService.getInventoryItem(Characters.active.packageBackpack);
                }
                else
                {
                    Characters.clothes.visualBackpack = 0;
                }
                if (Characters.active.packageVest != 0UL)
                {
                    Characters.clothes.visualVest = Provider.provider.economyService.getInventoryItem(Characters.active.packageVest);
                }
                else
                {
                    Characters.clothes.visualVest = 0;
                }
                if (Characters.active.packageMask != 0UL)
                {
                    Characters.clothes.visualMask = Provider.provider.economyService.getInventoryItem(Characters.active.packageMask);
                }
                else
                {
                    Characters.clothes.visualMask = 0;
                }
                if (Characters.active.packageGlasses != 0UL)
                {
                    Characters.clothes.visualGlasses = Provider.provider.economyService.getInventoryItem(Characters.active.packageGlasses);
                }
                else
                {
                    Characters.clothes.visualGlasses = 0;
                }
            }
            else
            {
                Characters.clothes.visualShirt    = 0;
                Characters.clothes.visualPants    = 0;
                Characters.clothes.visualHat      = 0;
                Characters.clothes.visualBackpack = 0;
                Characters.clothes.visualVest     = 0;
                Characters.clothes.visualMask     = 0;
                Characters.clothes.visualGlasses  = 0;
            }
            Characters.clothes.face  = Characters.active.face;
            Characters.clothes.hair  = Characters.active.hair;
            Characters.clothes.beard = Characters.active.beard;
            Characters.clothes.skin  = Characters.active.skin;
            Characters.clothes.color = Characters.active.color;
            Characters.clothes.hand  = Characters.active.hand;
            Characters.clothes.apply();
            byte b = 0;

            while ((int)b < Characters.slots.Length)
            {
                Characters.apply(b, showItems);
                b += 1;
            }
        }
コード例 #13
0
 // Token: 0x06002A16 RID: 10774 RVA: 0x001053C7 File Offset: 0x001037C7
 public static void apply()
 {
     Characters.apply(true, true);
 }
コード例 #14
0
 // Token: 0x06002A14 RID: 10772 RVA: 0x00105121 File Offset: 0x00103521
 private static void apply(byte slot)
 {
     Characters.apply(slot, true);
 }
コード例 #15
0
        // Token: 0x06002A10 RID: 10768 RVA: 0x00104D00 File Offset: 0x00103100
        public static void package(ulong package)
        {
            int inventoryItem = Provider.provider.economyService.getInventoryItem(package);

            if (inventoryItem == 0)
            {
                return;
            }
            ushort num;
            ushort num2;

            Provider.provider.economyService.getInventoryTargetID(inventoryItem, out num, out num2);
            if (num == 0 && num2 == 0)
            {
                return;
            }
            ItemAsset itemAsset = (ItemAsset)Assets.find(EAssetType.ITEM, num);

            if (itemAsset == null || itemAsset.proPath == null || itemAsset.proPath.Length == 0)
            {
                if (Provider.provider.economyService.getInventorySkinID(inventoryItem) == 0)
                {
                    return;
                }
                if (!Characters.packageSkins.Remove(package))
                {
                    for (int i = 0; i < Characters.packageSkins.Count; i++)
                    {
                        ulong num3 = Characters.packageSkins[i];
                        if (num3 != 0UL)
                        {
                            int inventoryItem2 = Provider.provider.economyService.getInventoryItem(num3);
                            if (inventoryItem2 != 0)
                            {
                                ushort num4;
                                ushort num5;
                                Provider.provider.economyService.getInventoryTargetID(inventoryItem2, out num4, out num5);
                                if ((num != 0 && num == num4) || (num2 != 0 && num2 == num5))
                                {
                                    Characters.packageSkins.RemoveAt(i);
                                    break;
                                }
                            }
                        }
                    }
                    Characters.packageSkins.Add(package);
                }
            }
            if (itemAsset != null)
            {
                if (itemAsset.type == EItemType.SHIRT)
                {
                    if (Characters.active.packageShirt == package)
                    {
                        Characters.active.packageShirt = 0UL;
                    }
                    else
                    {
                        Characters.active.packageShirt = package;
                    }
                }
                else if (itemAsset.type == EItemType.PANTS)
                {
                    if (Characters.active.packagePants == package)
                    {
                        Characters.active.packagePants = 0UL;
                    }
                    else
                    {
                        Characters.active.packagePants = package;
                    }
                }
                else if (itemAsset.type == EItemType.HAT)
                {
                    if (Characters.active.packageHat == package)
                    {
                        Characters.active.packageHat = 0UL;
                    }
                    else
                    {
                        Characters.active.packageHat = package;
                    }
                }
                else if (itemAsset.type == EItemType.BACKPACK)
                {
                    if (Characters.active.packageBackpack == package)
                    {
                        Characters.active.packageBackpack = 0UL;
                    }
                    else
                    {
                        Characters.active.packageBackpack = package;
                    }
                }
                else if (itemAsset.type == EItemType.VEST)
                {
                    if (Characters.active.packageVest == package)
                    {
                        Characters.active.packageVest = 0UL;
                    }
                    else
                    {
                        Characters.active.packageVest = package;
                    }
                }
                else if (itemAsset.type == EItemType.MASK)
                {
                    if (Characters.active.packageMask == package)
                    {
                        Characters.active.packageMask = 0UL;
                    }
                    else
                    {
                        Characters.active.packageMask = package;
                    }
                }
                else if (itemAsset.type == EItemType.GLASSES)
                {
                    if (Characters.active.packageGlasses == package)
                    {
                        Characters.active.packageGlasses = 0UL;
                    }
                    else
                    {
                        Characters.active.packageGlasses = package;
                    }
                }
            }
            Characters.apply(false, true);
            if (Characters.onCharacterUpdated != null)
            {
                Characters.onCharacterUpdated(Characters.selected, Characters.active);
            }
        }
コード例 #16
0
 // Token: 0x06002A08 RID: 10760 RVA: 0x00104B4A File Offset: 0x00102F4A
 public static void paintColor(Color color)
 {
     Characters.active.color = color;
     Characters.apply(false, false);
 }