Пример #1
0
        // Token: 0x06003763 RID: 14179 RVA: 0x00183D2C File Offset: 0x0018212C
        public static void updatePage()
        {
            MenuSurvivorsClothingUI.availableBox.text = ItemTool.filterRarityRichText(MenuSurvivorsClothingUI.localization.format("Craft_Available", new object[]
            {
                Provider.provider.economyService.countInventoryPackages(19000)
            }));
            MenuSurvivorsClothingUI.pageBox.text = MenuSurvivorsClothingUI.localization.format("Page", new object[]
            {
                MenuSurvivorsClothingUI.page + 1,
                MenuSurvivorsClothingUI.pages
            });
            if (MenuSurvivorsClothingUI.packageButtons == null)
            {
                return;
            }
            int num = MenuSurvivorsClothingUI.packageButtons.Length * MenuSurvivorsClothingUI.page;

            for (int i = 0; i < MenuSurvivorsClothingUI.packageButtons.Length; i++)
            {
                if (num + i < MenuSurvivorsClothingUI.filteredItems.Count)
                {
                    MenuSurvivorsClothingUI.packageButtons[i].updateInventory(MenuSurvivorsClothingUI.filteredItems[num + i].m_itemId.m_SteamItemInstanceID, MenuSurvivorsClothingUI.filteredItems[num + i].m_iDefinition.m_SteamItemDef, MenuSurvivorsClothingUI.filteredItems[num + i].m_unQuantity, true, false);
                }
                else
                {
                    MenuSurvivorsClothingUI.packageButtons[i].updateInventory(0UL, 0, 0, false, false);
                }
            }
        }
 // Token: 0x06001C53 RID: 7251 RVA: 0x0009AAE8 File Offset: 0x00098EE8
 public ObjectNPCAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
 {
     this.npcName    = localization.format("Character");
     this.npcName    = ItemTool.filterRarityRichText(this.npcName);
     this.shirt      = data.readUInt16("Shirt");
     this.pants      = data.readUInt16("Pants");
     this.hat        = data.readUInt16("Hat");
     this.backpack   = data.readUInt16("Backpack");
     this.vest       = data.readUInt16("Vest");
     this.mask       = data.readUInt16("Mask");
     this.glasses    = data.readUInt16("Glasses");
     this.face       = data.readByte("Face");
     this.hair       = data.readByte("Hair");
     this.beard      = data.readByte("Beard");
     this.skin       = Palette.hex(data.readString("Color_Skin"));
     this.color      = Palette.hex(data.readString("Color_Hair"));
     this.isBackward = data.has("Backward");
     this.primary    = data.readUInt16("Primary");
     this.secondary  = data.readUInt16("Secondary");
     this.tertiary   = data.readUInt16("Tertiary");
     if (data.has("Equipped"))
     {
         this.equipped = (ESlotType)Enum.Parse(typeof(ESlotType), data.readString("Equipped"), true);
     }
     else
     {
         this.equipped = ESlotType.NONE;
     }
     this.dialogue = data.readUInt16("Dialogue");
     if (data.has("Pose"))
     {
         this.pose = (ENPCPose)Enum.Parse(typeof(ENPCPose), data.readString("Pose"), true);
     }
     else
     {
         this.pose = ENPCPose.STAND;
     }
     if (data.has("Pose_Lean"))
     {
         this.poseLean = data.readSingle("Pose_Lean");
     }
     if (data.has("Pose_Pitch"))
     {
         this.posePitch = data.readSingle("Pose_Pitch");
     }
     else
     {
         this.posePitch = 90f;
     }
     if (data.has("Pose_Head_Offset"))
     {
         this.poseHeadOffset = data.readSingle("Pose_Head_Offset");
     }
     else if (this.pose == ENPCPose.CROUCH)
     {
         this.poseHeadOffset = 0.1f;
     }
 }
Пример #3
0
        // Token: 0x06001A25 RID: 6693 RVA: 0x00091E50 File Offset: 0x00090250
        public ItemAsset(Bundle bundle, Local localization, byte[] hash) : base(bundle, localization, hash)
        {
            this._itemName        = localization.format("Name");
            this._itemDescription = localization.format("Description");
            this._itemDescription = ItemTool.filterRarityRichText(this.itemDescription);
            this._equip           = (AudioClip)bundle.load("Equip");
            GameObject gameObject = (GameObject)bundle.load("Animations");

            if (gameObject != null)
            {
                Animation component = gameObject.GetComponent <Animation>();
                this._animations = new AnimationClip[component.GetClipCount()];
                int         num        = 0;
                IEnumerator enumerator = component.GetEnumerator();
                try
                {
                    while (enumerator.MoveNext())
                    {
                        object         obj            = enumerator.Current;
                        AnimationState animationState = (AnimationState)obj;
                        this.animations[num] = animationState.clip;
                        num++;
                    }
                }
                finally
                {
                    IDisposable disposable;
                    if ((disposable = (enumerator as IDisposable)) != null)
                    {
                        disposable.Dispose();
                    }
                }
            }
            else
            {
                this._animations = new AnimationClip[0];
            }
            this._item = (GameObject)bundle.load("Item");
            if (this.item == null)
            {
                throw new NotSupportedException("Missing item gameobject");
            }
            if (this.item.transform.FindChild("Icon") != null && this.item.transform.FindChild("Icon").GetComponent <Camera>() != null)
            {
                Assets.errors.Add(this.itemName + " icon has a camera attached!");
            }
            if (!Dedicator.isDedicated)
            {
                this._albedoBase   = (Texture2D)bundle.load("Albedo_Base");
                this._metallicBase = (Texture2D)bundle.load("Metallic_Base");
                this._emissionBase = (Texture2D)bundle.load("Emission_Base");
            }
        }
Пример #4
0
        // Token: 0x06001D2C RID: 7468 RVA: 0x0009D240 File Offset: 0x0009B640
        public VendorAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
        {
            if (id < 2000 && !bundle.hasResource && !data.has("Bypass_ID_Limit"))
            {
                throw new NotSupportedException("ID < 2000");
            }
            this.vendorName        = localization.format("Name");
            this.vendorName        = ItemTool.filterRarityRichText(this.vendorName);
            this.vendorDescription = localization.format("Description");
            this.vendorDescription = ItemTool.filterRarityRichText(this.vendorDescription);
            this.buying            = new VendorBuying[(int)data.readByte("Buying")];
            byte b = 0;

            while ((int)b < this.buying.Length)
            {
                ushort          newID   = data.readUInt16("Buying_" + b + "_ID");
                uint            newCost = data.readUInt32("Buying_" + b + "_Cost");
                INPCCondition[] array   = new INPCCondition[(int)data.readByte("Buying_" + b + "_Conditions")];
                NPCTool.readConditions(data, localization, "Buying_" + b + "_Condition_", array, string.Concat(new object[]
                {
                    "vendor ",
                    id,
                    " buying ",
                    b
                }));
                this.buying[(int)b] = new VendorBuying(b, newID, newCost, array);
                b += 1;
            }
            this.selling = new VendorSelling[(int)data.readByte("Selling")];
            byte b2 = 0;

            while ((int)b2 < this.selling.Length)
            {
                ushort          newID2   = data.readUInt16("Selling_" + b2 + "_ID");
                uint            newCost2 = data.readUInt32("Selling_" + b2 + "_Cost");
                INPCCondition[] array2   = new INPCCondition[(int)data.readByte("Selling_" + b2 + "_Conditions")];
                NPCTool.readConditions(data, localization, "Selling_" + b2 + "_Condition_", array2, string.Concat(new object[]
                {
                    "vendor ",
                    id,
                    " selling ",
                    b2
                }));
                this.selling[(int)b2] = new VendorSelling(b2, newID2, newCost2, array2);
                b2 += 1;
            }
            bundle.unload();
        }
Пример #5
0
 public QuestAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
 {
     if (id < 2000 && !bundle.hasResource && !data.has("Bypass_ID_Limit"))
     {
         throw new NotSupportedException("ID < 2000");
     }
     this.questName        = localization.format("Name");
     this.questName        = ItemTool.filterRarityRichText(this.questName);
     this.questDescription = localization.format("Description");
     this.questDescription = ItemTool.filterRarityRichText(this.questDescription);
     this.conditions       = new INPCCondition[(int)data.readByte("Conditions")];
     NPCTool.readConditions(data, localization, "Condition_", this.conditions);
     this.rewards = new INPCReward[(int)data.readByte("Rewards")];
     NPCTool.readRewards(data, localization, "Reward_", this.rewards);
     bundle.unload();
 }
Пример #6
0
        // Token: 0x06001A26 RID: 6694 RVA: 0x00092038 File Offset: 0x00090438
        public ItemAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
        {
            this.isPro = data.has("Pro");
            if (id < 2000 && !bundle.hasResource && !this.isPro && !data.has("Bypass_ID_Limit"))
            {
                throw new NotSupportedException("ID < 2000");
            }
            if (!this.isPro)
            {
                this._itemName        = localization.format("Name");
                this._itemDescription = localization.format("Description");
                this._itemDescription = ItemTool.filterRarityRichText(this.itemDescription);
            }
            this.type = (EItemType)Enum.Parse(typeof(EItemType), data.readString("Type"), true);
            if (data.has("Rarity"))
            {
                this.rarity = (EItemRarity)Enum.Parse(typeof(EItemRarity), data.readString("Rarity"), true);
            }
            else
            {
                this.rarity = EItemRarity.COMMON;
            }
            if (this.isPro)
            {
                if (this.type == EItemType.SHIRT)
                {
                    this._proPath = "/Shirts";
                }
                else if (this.type == EItemType.PANTS)
                {
                    this._proPath = "/Pants";
                }
                else if (this.type == EItemType.HAT)
                {
                    this._proPath = "/Hats";
                }
                else if (this.type == EItemType.BACKPACK)
                {
                    this._proPath = "/Backpacks";
                }
                else if (this.type == EItemType.VEST)
                {
                    this._proPath = "/Vests";
                }
                else if (this.type == EItemType.MASK)
                {
                    this._proPath = "/Masks";
                }
                else if (this.type == EItemType.GLASSES)
                {
                    this._proPath = "/Glasses";
                }
                else if (this.type == EItemType.KEY)
                {
                    this._proPath = "/Keys";
                }
                else if (this.type == EItemType.BOX)
                {
                    this._proPath = "/Boxes";
                }
                this._proPath = this._proPath + "/" + this.name;
            }
            this.size_x = data.readByte("Size_X");
            if (this.size_x < 1)
            {
                this.size_x = 1;
            }
            this.size_y = data.readByte("Size_Y");
            if (this.size_y < 1)
            {
                this.size_y = 1;
            }
            this.size_z  = data.readSingle("Size_Z");
            this.size2_z = data.readSingle("Size2_Z");
            this.amount  = data.readByte("Amount");
            if (this.amount < 1)
            {
                this.amount = 1;
            }
            this.countMin = data.readByte("Count_Min");
            if (this.countMin < 1)
            {
                this.countMin = 1;
            }
            this.countMax = data.readByte("Count_Max");
            if (this.countMax < 1)
            {
                this.countMax = 1;
            }
            if (data.has("Quality_Min"))
            {
                this.qualityMin = data.readByte("Quality_Min");
            }
            else
            {
                this.qualityMin = 10;
            }
            if (data.has("Quality_Max"))
            {
                this.qualityMax = data.readByte("Quality_Max");
            }
            else
            {
                this.qualityMax = 90;
            }
            this.isBackward = data.has("Backward");
            this.useable    = data.readString("Useable");
            this.isUseable  = !string.IsNullOrEmpty(this.useable);
            if (this.isUseable)
            {
                this._equip = (AudioClip)bundle.load("Equip");
                if (!this.isPro)
                {
                    GameObject gameObject = (GameObject)bundle.load("Animations");
                    if (gameObject != null)
                    {
                        Animation component = gameObject.GetComponent <Animation>();
                        this._animations = new AnimationClip[component.GetClipCount()];
                        int         num        = 0;
                        IEnumerator enumerator = component.GetEnumerator();
                        try
                        {
                            while (enumerator.MoveNext())
                            {
                                object         obj            = enumerator.Current;
                                AnimationState animationState = (AnimationState)obj;
                                this.animations[num] = animationState.clip;
                                num++;
                            }
                        }
                        finally
                        {
                            IDisposable disposable;
                            if ((disposable = (enumerator as IDisposable)) != null)
                            {
                                disposable.Dispose();
                            }
                        }
                    }
                    else
                    {
                        this._animations = new AnimationClip[0];
                    }
                }
            }
            string text = data.readString("Slot");

            if (text == null)
            {
                this.slot = ESlotType.NONE;
            }
            else
            {
                this.slot = (ESlotType)Enum.Parse(typeof(ESlotType), text, true);
            }
            if (!Dedicator.isDedicated || this.type == EItemType.GUN || this.type == EItemType.MELEE)
            {
                this._item = (GameObject)bundle.load("Item");
                if (this.item == null)
                {
                    throw new NotSupportedException("Missing item gameobject");
                }
                if (this.item.transform.FindChild("Icon") != null && this.item.transform.FindChild("Icon").GetComponent <Camera>() != null)
                {
                    Assets.errors.Add(this.itemName + " icon has a camera attached!");
                }
                if (id < 2000 && (this.type == EItemType.GUN || this.type == EItemType.MELEE) && this.item.transform.FindChild("Stat_Tracker") == null)
                {
                    Assets.errors.Add(this.itemName + " missing stat tracker hook!");
                }
            }
            byte b  = data.readByte("Blueprints");
            byte b2 = data.readByte("Actions");

            this._blueprints = new List <Blueprint>((int)b);
            this._actions    = new List <Action>((int)b2);
            for (byte b3 = 0; b3 < b; b3 += 1)
            {
                if (!data.has("Blueprint_" + b3 + "_Type"))
                {
                    throw new NotSupportedException("Missing blueprint type");
                }
                EBlueprintType newType = (EBlueprintType)Enum.Parse(typeof(EBlueprintType), data.readString("Blueprint_" + b3 + "_Type"), true);
                byte           b4      = data.readByte("Blueprint_" + b3 + "_Supplies");
                if (b4 < 1)
                {
                    b4 = 1;
                }
                BlueprintSupply[] array = new BlueprintSupply[(int)b4];
                byte b5 = 0;
                while ((int)b5 < array.Length)
                {
                    ushort newID = data.readUInt16(string.Concat(new object[]
                    {
                        "Blueprint_",
                        b3,
                        "_Supply_",
                        b5,
                        "_ID"
                    }));
                    bool newCritical = data.has(string.Concat(new object[]
                    {
                        "Blueprint_",
                        b3,
                        "_Supply_",
                        b5,
                        "_Critical"
                    }));
                    byte b6 = data.readByte(string.Concat(new object[]
                    {
                        "Blueprint_",
                        b3,
                        "_Supply_",
                        b5,
                        "_Amount"
                    }));
                    if (b6 < 1)
                    {
                        b6 = 1;
                    }
                    array[(int)b5] = new BlueprintSupply(newID, newCritical, b6);
                    b5            += 1;
                }
                byte b7 = data.readByte("Blueprint_" + b3 + "_Outputs");
                BlueprintOutput[] array2;
                if (b7 > 0)
                {
                    array2 = new BlueprintOutput[(int)b7];
                    byte b8 = 0;
                    while ((int)b8 < array2.Length)
                    {
                        ushort newID2 = data.readUInt16(string.Concat(new object[]
                        {
                            "Blueprint_",
                            b3,
                            "_Output_",
                            b8,
                            "_ID"
                        }));
                        byte b9 = data.readByte(string.Concat(new object[]
                        {
                            "Blueprint_",
                            b3,
                            "_Output_",
                            b8,
                            "_Amount"
                        }));
                        if (b9 < 1)
                        {
                            b9 = 1;
                        }
                        array2[(int)b8] = new BlueprintOutput(newID2, b9);
                        b8 += 1;
                    }
                }
                else
                {
                    array2 = new BlueprintOutput[1];
                    ushort num2 = data.readUInt16("Blueprint_" + b3 + "_Product");
                    if (num2 == 0)
                    {
                        num2 = id;
                    }
                    byte b10 = data.readByte("Blueprint_" + b3 + "_Products");
                    if (b10 < 1)
                    {
                        b10 = 1;
                    }
                    array2[0] = new BlueprintOutput(num2, b10);
                }
                ushort          newTool         = data.readUInt16("Blueprint_" + b3 + "_Tool");
                bool            newToolCritical = data.has("Blueprint_" + b3 + "_Tool_Critical");
                ushort          newBuild        = data.readUInt16("Blueprint_" + b3 + "_Build");
                byte            b11             = data.readByte("Blueprint_" + b3 + "_Level");
                EBlueprintSkill newSkill        = EBlueprintSkill.NONE;
                if (b11 > 0)
                {
                    newSkill = (EBlueprintSkill)Enum.Parse(typeof(EBlueprintSkill), data.readString("Blueprint_" + b3 + "_Skill"), true);
                }
                bool            newTransferState = data.has("Blueprint_" + b3 + "_State_Transfer");
                string          newMap           = data.readString("Blueprint_" + b3 + "_Map");
                INPCCondition[] array3           = new INPCCondition[(int)data.readByte("Blueprint_" + b3 + "_Conditions")];
                NPCTool.readConditions(data, localization, "Blueprint_" + b3 + "_Condition_", array3, string.Concat(new object[]
                {
                    "item ",
                    id,
                    " blueprint ",
                    b3
                }));
                INPCReward[] array4 = new INPCReward[(int)data.readByte("Blueprint_" + b3 + "_Rewards")];
                NPCTool.readRewards(data, localization, "Blueprint_" + b3 + "_Reward_", array4, string.Concat(new object[]
                {
                    "item ",
                    id,
                    " blueprint ",
                    b3
                }));
                this.blueprints.Add(new Blueprint(id, b3, newType, array, array2, newTool, newToolCritical, newBuild, b11, newSkill, newTransferState, newMap, array3, array4));
            }
            for (byte b12 = 0; b12 < b2; b12 += 1)
            {
                if (!data.has("Action_" + b12 + "_Type"))
                {
                    throw new NotSupportedException("Missing action type");
                }
                EActionType newType2 = (EActionType)Enum.Parse(typeof(EActionType), data.readString("Action_" + b12 + "_Type"), true);
                byte        b13      = data.readByte("Action_" + b12 + "_Blueprints");
                if (b13 < 1)
                {
                    b13 = 1;
                }
                ActionBlueprint[] array5 = new ActionBlueprint[(int)b13];
                byte b14 = 0;
                while ((int)b14 < array5.Length)
                {
                    byte newID3 = data.readByte(string.Concat(new object[]
                    {
                        "Action_",
                        b12,
                        "_Blueprint_",
                        b14,
                        "_Index"
                    }));
                    bool newLink = data.has(string.Concat(new object[]
                    {
                        "Action_",
                        b12,
                        "_Blueprint_",
                        b14,
                        "_Link"
                    }));
                    array5[(int)b14] = new ActionBlueprint(newID3, newLink);
                    b14 += 1;
                }
                string newText    = data.readString("Action_" + b12 + "_Text");
                string newTooltip = data.readString("Action_" + b12 + "_Tooltip");
                string newKey     = data.readString("Action_" + b12 + "_Key");
                ushort num3       = data.readUInt16("Action_" + b12 + "_Source");
                if (num3 == 0)
                {
                    num3 = id;
                }
                this.actions.Add(new Action(num3, newType2, array5, newText, newTooltip, newKey));
            }
            if (b2 == 0)
            {
                bool flag = false;
                byte b15  = 0;
                while ((int)b15 < this.blueprints.Count)
                {
                    Blueprint blueprint = this.blueprints[(int)b15];
                    if (blueprint.type == EBlueprintType.REPAIR)
                    {
                        Action item = new Action(id, EActionType.BLUEPRINT, new ActionBlueprint[]
                        {
                            new ActionBlueprint(b15, true)
                        }, null, null, "Repair");
                        this.actions.Insert(0, item);
                    }
                    else if (blueprint.type == EBlueprintType.AMMO)
                    {
                        flag = true;
                    }
                    else if (blueprint.supplies.Length == 1 && blueprint.supplies[0].id == id)
                    {
                        Action item2 = new Action(id, EActionType.BLUEPRINT, new ActionBlueprint[]
                        {
                            new ActionBlueprint(b15, this.type == EItemType.GUN || this.type == EItemType.MELEE)
                        }, null, null, "Salvage");
                        this.actions.Add(item2);
                    }
                    b15 += 1;
                }
                if (flag)
                {
                    List <ActionBlueprint> list = new List <ActionBlueprint>();
                    byte b16 = 0;
                    while ((int)b16 < this.blueprints.Count)
                    {
                        Blueprint blueprint2 = this.blueprints[(int)b16];
                        if (blueprint2.type == EBlueprintType.AMMO)
                        {
                            ActionBlueprint item3 = new ActionBlueprint(b16, true);
                            list.Add(item3);
                        }
                        b16 += 1;
                    }
                    Action item4 = new Action(id, EActionType.BLUEPRINT, list.ToArray(), null, null, "Refill");
                    this.actions.Add(item4);
                }
            }
            this._shouldVerifyHash   = !data.has("Bypass_Hash_Verification");
            this.overrideShowQuality = data.has("Override_Show_Quality");
            if (!Dedicator.isDedicated)
            {
                this._albedoBase   = (Texture2D)bundle.load("Albedo_Base");
                this._metallicBase = (Texture2D)bundle.load("Metallic_Base");
                this._emissionBase = (Texture2D)bundle.load("Emission_Base");
            }
        }
Пример #7
0
        public DialogueAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id)
        {
            if (id < 2000 && !bundle.hasResource && !data.has("Bypass_ID_Limit"))
            {
                throw new NotSupportedException("ID < 2000");
            }
            this.messages = new DialogueMessage[(int)data.readByte("Messages")];
            byte b = 0;

            while ((int)b < this.messages.Length)
            {
                DialoguePage[] array = new DialoguePage[(int)data.readByte("Message_" + b + "_Pages")];
                byte           b2    = 0;
                while ((int)b2 < array.Length)
                {
                    string text = localization.format(string.Concat(new object[]
                    {
                        "Message_",
                        b,
                        "_Page_",
                        b2
                    }));
                    text           = ItemTool.filterRarityRichText(text);
                    array[(int)b2] = new DialoguePage(text);
                    b2            += 1;
                }
                byte[] array2 = new byte[(int)data.readByte("Message_" + b + "_Responses")];
                byte   b3     = 0;
                while ((int)b3 < array2.Length)
                {
                    array2[(int)b3] = data.readByte(string.Concat(new object[]
                    {
                        "Message_",
                        b,
                        "_Response_",
                        b3
                    }));
                    b3 += 1;
                }
                ushort          newPrev = data.readUInt16("Message_" + b + "_Prev");
                INPCCondition[] array3  = new INPCCondition[(int)data.readByte("Message_" + b + "_Conditions")];
                NPCTool.readConditions(data, localization, "Message_" + b + "_Condition_", array3);
                INPCReward[] array4 = new INPCReward[(int)data.readByte("Message_" + b + "_Rewards")];
                NPCTool.readRewards(data, localization, "Message_" + b + "_Reward_", array4);
                this.messages[(int)b] = new DialogueMessage(b, array, array2, newPrev, array3, array4);
                b += 1;
            }
            this.responses = new DialogueResponse[(int)data.readByte("Responses")];
            byte b4 = 0;

            while ((int)b4 < this.responses.Length)
            {
                byte[] array5 = new byte[(int)data.readByte("Response_" + b4 + "_Messages")];
                byte   b5     = 0;
                while ((int)b5 < array5.Length)
                {
                    array5[(int)b5] = data.readByte(string.Concat(new object[]
                    {
                        "Response_",
                        b4,
                        "_Message_",
                        b5
                    }));
                    b5 += 1;
                }
                ushort newDialogue = data.readUInt16("Response_" + b4 + "_Dialogue");
                ushort newQuest    = data.readUInt16("Response_" + b4 + "_Quest");
                ushort newVendor   = data.readUInt16("Response_" + b4 + "_Vendor");
                string text2       = localization.format("Response_" + b4);
                text2 = ItemTool.filterRarityRichText(text2);
                INPCCondition[] array6 = new INPCCondition[(int)data.readByte("Response_" + b4 + "_Conditions")];
                NPCTool.readConditions(data, localization, "Response_" + b4 + "_Condition_", array6);
                INPCReward[] array7 = new INPCReward[(int)data.readByte("Response_" + b4 + "_Rewards")];
                NPCTool.readRewards(data, localization, "Response_" + b4 + "_Reward_", array7);
                this.responses[(int)b4] = new DialogueResponse(b4, array5, newDialogue, newQuest, newVendor, text2, array6, array7);
                b4 += 1;
            }
            bundle.unload();
        }
Пример #8
0
        // Token: 0x06003448 RID: 13384 RVA: 0x00155AC4 File Offset: 0x00153EC4
        public static void readRewards(Data data, Local localization, string prefix, INPCReward[] rewards, string errorMessageSource)
        {
            for (int i = 0; i < rewards.Length; i++)
            {
                if (!data.has(prefix + i + "_Type"))
                {
                    Assets.errors.Add(string.Concat(new object[]
                    {
                        "Missing ",
                        prefix,
                        i,
                        " reward type"
                    }));
                    throw new NotSupportedException(string.Concat(new object[]
                    {
                        "Missing ",
                        prefix,
                        i,
                        " reward type"
                    }));
                }
                ENPCRewardType enpcrewardType = (ENPCRewardType)Enum.Parse(typeof(ENPCRewardType), data.readString(prefix + i + "_Type"), true);
                string         text           = localization.read(prefix + i);
                text = ItemTool.filterRarityRichText(text);
                switch (enpcrewardType)
                {
                case ENPCRewardType.EXPERIENCE:
                    if (!data.has(prefix + i + "_Value"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Experience reward ",
                            prefix,
                            i,
                            " missing _Value in: ",
                            errorMessageSource
                        }));
                    }
                    rewards[i] = new NPCExperienceReward(data.readUInt32(prefix + i + "_Value"), text);
                    break;

                case ENPCRewardType.REPUTATION:
                    if (!data.has(prefix + i + "_Value"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Reputation reward ",
                            prefix,
                            i,
                            " missing _Value in: ",
                            errorMessageSource
                        }));
                    }
                    rewards[i] = new NPCReputationReward(data.readInt32(prefix + i + "_Value"), text);
                    break;

                case ENPCRewardType.FLAG_BOOL:
                    if (!data.has(prefix + i + "_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Bool flag reward ",
                            prefix,
                            i,
                            " missing _ID in: ",
                            errorMessageSource
                        }));
                    }
                    if (!data.has(prefix + i + "_Value"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Bool flag reward ",
                            prefix,
                            i,
                            " missing _Value in: ",
                            errorMessageSource
                        }));
                    }
                    rewards[i] = new NPCBoolFlagReward(data.readUInt16(prefix + i + "_ID"), data.readBoolean(prefix + i + "_Value"), text);
                    break;

                case ENPCRewardType.FLAG_SHORT:
                    if (!data.has(prefix + i + "_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Short flag reward ",
                            prefix,
                            i,
                            " missing _ID in: ",
                            errorMessageSource
                        }));
                    }
                    if (!data.has(prefix + i + "_Value"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Short flag reward ",
                            prefix,
                            i,
                            " missing _Value in: ",
                            errorMessageSource
                        }));
                    }
                    rewards[i] = new NPCShortFlagReward(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), (ENPCModificationType)Enum.Parse(typeof(ENPCModificationType), data.readString(prefix + i + "_Modification"), true), text);
                    break;

                case ENPCRewardType.FLAG_SHORT_RANDOM:
                    if (!data.has(prefix + i + "_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Random short flag reward ",
                            prefix,
                            i,
                            " missing _ID in: ",
                            errorMessageSource
                        }));
                    }
                    if (!data.has(prefix + i + "_Min_Value"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Random short flag reward ",
                            prefix,
                            i,
                            " missing _Min_Value in: ",
                            errorMessageSource
                        }));
                    }
                    if (!data.has(prefix + i + "_Max_Value"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Random short flag reward ",
                            prefix,
                            i,
                            " missing _Max_Value in: ",
                            errorMessageSource
                        }));
                    }
                    rewards[i] = new NPCRandomShortFlagReward(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Min_Value"), data.readInt16(prefix + i + "_Max_Value"), (ENPCModificationType)Enum.Parse(typeof(ENPCModificationType), data.readString(prefix + i + "_Modification"), true), text);
                    break;

                case ENPCRewardType.QUEST:
                    if (!data.has(prefix + i + "_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Quest reward ",
                            prefix,
                            i,
                            " missing _ID in: ",
                            errorMessageSource
                        }));
                    }
                    rewards[i] = new NPCQuestReward(data.readUInt16(prefix + i + "_ID"), text);
                    break;

                case ENPCRewardType.ITEM:
                    if (!data.has(prefix + i + "_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Item reward ",
                            prefix,
                            i,
                            " missing _ID in: ",
                            errorMessageSource
                        }));
                    }
                    if (!data.has(prefix + i + "_Amount"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Item reward ",
                            prefix,
                            i,
                            " missing _Amount in: ",
                            errorMessageSource
                        }));
                    }
                    rewards[i] = new NPCItemReward(data.readUInt16(prefix + i + "_ID"), data.readByte(prefix + i + "_Amount"), data.readUInt16(prefix + i + "_Sight"), data.readUInt16(prefix + i + "_Tactical"), data.readUInt16(prefix + i + "_Grip"), data.readUInt16(prefix + i + "_Barrel"), data.readUInt16(prefix + i + "_Magazine"), data.readByte(prefix + i + "_Ammo"), text);
                    break;

                case ENPCRewardType.ITEM_RANDOM:
                    if (!data.has(prefix + i + "_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Random item reward ",
                            prefix,
                            i,
                            " missing _ID in: ",
                            errorMessageSource
                        }));
                    }
                    if (!data.has(prefix + i + "_Amount"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Random item reward ",
                            prefix,
                            i,
                            " missing _Amount in: ",
                            errorMessageSource
                        }));
                    }
                    rewards[i] = new NPCRandomItemReward(data.readUInt16(prefix + i + "_ID"), data.readByte(prefix + i + "_Amount"), text);
                    break;

                case ENPCRewardType.ACHIEVEMENT:
                    if (!data.has(prefix + i + "_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Achievement reward ",
                            prefix,
                            i,
                            " missing _ID in: ",
                            errorMessageSource
                        }));
                    }
                    rewards[i] = new NPCAchievementReward(data.readString(prefix + i + "_ID"), text);
                    break;

                case ENPCRewardType.VEHICLE:
                    if (!data.has(prefix + i + "_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Vehicle reward ",
                            prefix,
                            i,
                            " missing _ID in: ",
                            errorMessageSource
                        }));
                    }
                    if (!data.has(prefix + i + "_Spawnpoint"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Vehicle reward ",
                            prefix,
                            i,
                            " missing _Spawnpoint in: ",
                            errorMessageSource
                        }));
                    }
                    rewards[i] = new NPCVehicleReward(data.readUInt16(prefix + i + "_ID"), data.readString(prefix + i + "_Spawnpoint"), text);
                    break;

                case ENPCRewardType.TELEPORT:
                    if (!data.has(prefix + i + "_Spawnpoint"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Teleport reward ",
                            prefix,
                            i,
                            " missing _Spawnpoint in: ",
                            errorMessageSource
                        }));
                    }
                    rewards[i] = new NPCTeleportReward(data.readString(prefix + i + "_Spawnpoint"), text);
                    break;

                case ENPCRewardType.EVENT:
                    if (!data.has(prefix + i + "_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Event reward ",
                            prefix,
                            i,
                            " missing _ID in: ",
                            errorMessageSource
                        }));
                    }
                    rewards[i] = new NPCEventReward(data.readString(prefix + i + "_ID"), text);
                    break;

                case ENPCRewardType.FLAG_MATH:
                    if (!data.has(prefix + i + "_A_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Math reward ",
                            prefix,
                            i,
                            " missing _A_ID in: ",
                            errorMessageSource
                        }));
                    }
                    if (!data.has(prefix + i + "_B_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Math reward ",
                            prefix,
                            i,
                            " missing _B_ID in: ",
                            errorMessageSource
                        }));
                    }
                    rewards[i] = new NPCFlagMathReward(data.readUInt16(prefix + i + "_A_ID"), data.readUInt16(prefix + i + "_B_ID"), (ENPCOperationType)Enum.Parse(typeof(ENPCOperationType), data.readString(prefix + i + "_Operation"), true), text);
                    break;
                }
            }
        }
Пример #9
0
        // Token: 0x06003447 RID: 13383 RVA: 0x00154C10 File Offset: 0x00153010
        public static void readConditions(Data data, Local localization, string prefix, INPCCondition[] conditions, string errorMessageSource)
        {
            for (int i = 0; i < conditions.Length; i++)
            {
                if (!data.has(prefix + i + "_Type"))
                {
                    Assets.errors.Add(string.Concat(new object[]
                    {
                        "Missing condition ",
                        prefix,
                        i,
                        " type"
                    }));
                    throw new NotSupportedException(string.Concat(new object[]
                    {
                        "Missing condition ",
                        prefix,
                        i,
                        " type"
                    }));
                }
                ENPCConditionType enpcconditionType = (ENPCConditionType)Enum.Parse(typeof(ENPCConditionType), data.readString(prefix + i + "_Type"), true);
                string            text = localization.read(prefix + i);
                text = ItemTool.filterRarityRichText(text);
                bool          newShouldReset = data.has(prefix + i + "_Reset");
                ENPCLogicType newLogicType   = ENPCLogicType.NONE;
                if (data.has(prefix + i + "_Logic"))
                {
                    newLogicType = (ENPCLogicType)Enum.Parse(typeof(ENPCLogicType), data.readString(prefix + i + "_Logic"), true);
                }
                switch (enpcconditionType)
                {
                case ENPCConditionType.EXPERIENCE:
                    if (!data.has(prefix + i + "_Value"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Experience condition ",
                            prefix,
                            i,
                            " missing _Value in: ",
                            errorMessageSource
                        }));
                    }
                    conditions[i] = new NPCExperienceCondition(data.readUInt32(prefix + i + "_Value"), newLogicType, text, newShouldReset);
                    break;

                case ENPCConditionType.REPUTATION:
                    if (!data.has(prefix + i + "_Value"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Reputation condition ",
                            prefix,
                            i,
                            " missing _Value in: ",
                            errorMessageSource
                        }));
                    }
                    conditions[i] = new NPCReputationCondition(data.readInt32(prefix + i + "_Value"), newLogicType, text);
                    break;

                case ENPCConditionType.FLAG_BOOL:
                    if (!data.has(prefix + i + "_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Bool flag condition ",
                            prefix,
                            i,
                            " missing _ID in: ",
                            errorMessageSource
                        }));
                    }
                    if (!data.has(prefix + i + "_Value"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Bool flag condition ",
                            prefix,
                            i,
                            " missing _Value in: ",
                            errorMessageSource
                        }));
                    }
                    conditions[i] = new NPCBoolFlagCondition(data.readUInt16(prefix + i + "_ID"), data.readBoolean(prefix + i + "_Value"), data.has(prefix + i + "_Allow_Unset"), newLogicType, text, newShouldReset);
                    break;

                case ENPCConditionType.FLAG_SHORT:
                    if (!data.has(prefix + i + "_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Short flag condition ",
                            prefix,
                            i,
                            " missing _ID in: ",
                            errorMessageSource
                        }));
                    }
                    if (!data.has(prefix + i + "_Value"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Short flag condition ",
                            prefix,
                            i,
                            " missing _Value in: ",
                            errorMessageSource
                        }));
                    }
                    conditions[i] = new NPCShortFlagCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), data.has(prefix + i + "_Allow_Unset"), newLogicType, text, newShouldReset);
                    break;

                case ENPCConditionType.QUEST:
                    if (!data.has(prefix + i + "_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Quest condition ",
                            prefix,
                            i,
                            " missing _ID in: ",
                            errorMessageSource
                        }));
                    }
                    if (!data.has(prefix + i + "_Status"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Quest condition ",
                            prefix,
                            i,
                            " missing _Status in: ",
                            errorMessageSource
                        }));
                    }
                    conditions[i] = new NPCQuestCondition(data.readUInt16(prefix + i + "_ID"), (ENPCQuestStatus)Enum.Parse(typeof(ENPCQuestStatus), data.readString(prefix + i + "_Status"), true), data.has(prefix + i + "_Ignore_NPC"), newLogicType, text, newShouldReset);
                    break;

                case ENPCConditionType.SKILLSET:
                    if (!data.has(prefix + i + "_Value"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Skillset condition ",
                            prefix,
                            i,
                            " missing _Value in: ",
                            errorMessageSource
                        }));
                    }
                    conditions[i] = new NPCSkillsetCondition((EPlayerSkillset)Enum.Parse(typeof(EPlayerSkillset), data.readString(prefix + i + "_Value"), true), newLogicType, text);
                    break;

                case ENPCConditionType.ITEM:
                    if (!data.has(prefix + i + "_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Item condition ",
                            prefix,
                            i,
                            " missing _ID in: ",
                            errorMessageSource
                        }));
                    }
                    if (!data.has(prefix + i + "_Amount"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Item condition ",
                            prefix,
                            i,
                            " missing _Amount in: ",
                            errorMessageSource
                        }));
                    }
                    conditions[i] = new NPCItemCondition(data.readUInt16(prefix + i + "_ID"), data.readUInt16(prefix + i + "_Amount"), text, newShouldReset);
                    break;

                case ENPCConditionType.KILLS_ZOMBIE:
                {
                    if (!data.has(prefix + i + "_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                            {
                                "Zombie kills condition ",
                                prefix,
                                i,
                                " missing _ID in: ",
                                errorMessageSource
                            }));
                    }
                    if (!data.has(prefix + i + "_Value"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                            {
                                "Zombie kills condition ",
                                prefix,
                                i,
                                " missing _Value in: ",
                                errorMessageSource
                            }));
                    }
                    EZombieSpeciality newZombie = EZombieSpeciality.NONE;
                    if (data.has(prefix + i + "_Zombie"))
                    {
                        newZombie = (EZombieSpeciality)Enum.Parse(typeof(EZombieSpeciality), data.readString(prefix + i + "_Zombie"), true);
                    }
                    else
                    {
                        Assets.errors.Add(string.Concat(new object[]
                            {
                                "Zombie kills condition ",
                                prefix,
                                i,
                                " missing _Zombie in: ",
                                errorMessageSource
                            }));
                    }
                    conditions[i] = new NPCZombieKillsCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), newZombie, data.has(prefix + i + "_Spawn"), data.readByte(prefix + i + "_Nav"), text, newShouldReset);
                    break;
                }

                case ENPCConditionType.KILLS_HORDE:
                    if (!data.has(prefix + i + "_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Horde kills condition ",
                            prefix,
                            i,
                            " missing _ID in: ",
                            errorMessageSource
                        }));
                    }
                    if (!data.has(prefix + i + "_Value"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Horde kills condition ",
                            prefix,
                            i,
                            " missing _Value in: ",
                            errorMessageSource
                        }));
                    }
                    if (!data.has(prefix + i + "_Nav"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Horde kills condition ",
                            prefix,
                            i,
                            " missing _Nav in: ",
                            errorMessageSource
                        }));
                    }
                    conditions[i] = new NPCHordeKillsCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), data.readByte(prefix + i + "_Nav"), text, newShouldReset);
                    break;

                case ENPCConditionType.KILLS_ANIMAL:
                    if (!data.has(prefix + i + "_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Animal kills condition ",
                            prefix,
                            i,
                            " missing _ID in: ",
                            errorMessageSource
                        }));
                    }
                    if (!data.has(prefix + i + "_Value"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Animal kills condition ",
                            prefix,
                            i,
                            " missing _Value in: ",
                            errorMessageSource
                        }));
                    }
                    if (!data.has(prefix + i + "_Animal"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Animal kills condition ",
                            prefix,
                            i,
                            " missing _Animal in: ",
                            errorMessageSource
                        }));
                    }
                    conditions[i] = new NPCAnimalKillsCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), data.readUInt16(prefix + i + "_Animal"), text, newShouldReset);
                    break;

                case ENPCConditionType.COMPARE_FLAGS:
                    if (!data.has(prefix + i + "_A_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Compare flags condition ",
                            prefix,
                            i,
                            " missing _A_ID in: ",
                            errorMessageSource
                        }));
                    }
                    if (!data.has(prefix + i + "_B_ID"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Compare flags condition ",
                            prefix,
                            i,
                            " missing _B_ID in: ",
                            errorMessageSource
                        }));
                    }
                    conditions[i] = new NPCCompareFlagsCondition(data.readUInt16(prefix + i + "_A_ID"), data.readUInt16(prefix + i + "_B_ID"), data.has(prefix + i + "_Allow_A_Unset"), data.has(prefix + i + "_Allow_B_Unset"), newLogicType, text, newShouldReset);
                    break;

                case ENPCConditionType.TIME_OF_DAY:
                    if (!data.has(prefix + i + "_Second"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Time of day condition ",
                            prefix,
                            i,
                            " missing _Second in: ",
                            errorMessageSource
                        }));
                    }
                    conditions[i] = new NPCTimeOfDayCondition(data.readInt32(prefix + i + "_Second"), newLogicType, text, newShouldReset);
                    break;

                case ENPCConditionType.PLAYER_LIFE_HEALTH:
                    if (!data.has(prefix + i + "_Value"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Player life health condition ",
                            prefix,
                            i,
                            " missing _Value in: ",
                            errorMessageSource
                        }));
                    }
                    conditions[i] = new NPCPlayerLifeHealthCondition(data.readInt32(prefix + i + "_Value"), newLogicType, text);
                    break;

                case ENPCConditionType.PLAYER_LIFE_FOOD:
                    if (!data.has(prefix + i + "_Value"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Player life food condition ",
                            prefix,
                            i,
                            " missing _Value in: ",
                            errorMessageSource
                        }));
                    }
                    conditions[i] = new NPCPlayerLifeFoodCondition(data.readInt32(prefix + i + "_Value"), newLogicType, text);
                    break;

                case ENPCConditionType.PLAYER_LIFE_WATER:
                    if (!data.has(prefix + i + "_Value"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Player life water condition ",
                            prefix,
                            i,
                            " missing _Value in: ",
                            errorMessageSource
                        }));
                    }
                    conditions[i] = new NPCPlayerLifeWaterCondition(data.readInt32(prefix + i + "_Value"), newLogicType, text);
                    break;

                case ENPCConditionType.PLAYER_LIFE_VIRUS:
                    if (!data.has(prefix + i + "_Value"))
                    {
                        Assets.errors.Add(string.Concat(new object[]
                        {
                            "Player life virus condition ",
                            prefix,
                            i,
                            " missing _Value in: ",
                            errorMessageSource
                        }));
                    }
                    conditions[i] = new NPCPlayerLifeVirusCondition(data.readInt32(prefix + i + "_Value"), newLogicType, text);
                    break;
                }
            }
        }
Пример #10
0
        public static void updateScene()
        {
            if (!Dedicator.isDedicated)
            {
                if (LoadingUI.backgroundImage == null)
                {
                    return;
                }
                if (LoadingUI.loadingImage == null)
                {
                    return;
                }
                LoadingUI.updateProgress(0f);
                Local local = Localization.read("/Menu/MenuTips.dat");
                byte  b;
                do
                {
                    b = (byte)Random.Range(1, (int)(LoadingUI.TIP_COUNT + 1));
                }while (b == (byte)LoadingUI.tip);
                LoadingUI.tip = (ELoadingTip)b;
                string text;
                if (OptionsSettings.streamer && Provider.streamerNames != null && Provider.streamerNames.Count > 0 && Provider.streamerNames[0] == "Nelson AI")
                {
                    text = local.format("Streamer");
                }
                else
                {
                    switch (LoadingUI.tip)
                    {
                    case ELoadingTip.HOTKEY:
                        text = local.format("Hotkey");
                        break;

                    case ELoadingTip.EQUIP:
                        text = local.format("Equip", new object[]
                        {
                            MenuConfigurationControlsUI.getKeyCodeText(ControlsSettings.other)
                        });
                        break;

                    case ELoadingTip.DROP:
                        text = local.format("Drop", new object[]
                        {
                            MenuConfigurationControlsUI.getKeyCodeText(ControlsSettings.other)
                        });
                        break;

                    case ELoadingTip.SIRENS:
                        text = local.format("Sirens", new object[]
                        {
                            MenuConfigurationControlsUI.getKeyCodeText(ControlsSettings.other)
                        });
                        break;

                    case ELoadingTip.TRANSFORM:
                        text = local.format("Transform");
                        break;

                    case ELoadingTip.QUALITY:
                        text = local.format("Quality");
                        break;

                    case ELoadingTip.UMBRELLA:
                        text = local.format("Umbrella");
                        break;

                    case ELoadingTip.HEAL:
                        text = local.format("Heal");
                        break;

                    case ELoadingTip.ROTATE:
                        text = local.format("Rotate");
                        break;

                    case ELoadingTip.BASE:
                        text = local.format("Base");
                        break;

                    case ELoadingTip.DEQUIP:
                        text = local.format("Dequip", new object[]
                        {
                            MenuConfigurationControlsUI.getKeyCodeText(ControlsSettings.dequip)
                        });
                        break;

                    case ELoadingTip.NIGHTVISION:
                        text = local.format("Nightvision", new object[]
                        {
                            MenuConfigurationControlsUI.getKeyCodeText(ControlsSettings.vision)
                        });
                        break;

                    case ELoadingTip.TRANSFER:
                        text = local.format("Transfer", new object[]
                        {
                            MenuConfigurationControlsUI.getKeyCodeText(ControlsSettings.other)
                        });
                        break;

                    case ELoadingTip.SURFACE:
                        text = local.format("Surface", new object[]
                        {
                            MenuConfigurationControlsUI.getKeyCodeText(ControlsSettings.jump)
                        });
                        break;

                    case ELoadingTip.ARREST:
                        text = local.format("Arrest", new object[]
                        {
                            MenuConfigurationControlsUI.getKeyCodeText(ControlsSettings.leanLeft),
                            MenuConfigurationControlsUI.getKeyCodeText(ControlsSettings.leanRight)
                        });
                        break;

                    case ELoadingTip.SAFEZONE:
                        text = local.format("Safezone");
                        break;

                    case ELoadingTip.CLAIM:
                        text = local.format("Claim");
                        break;

                    case ELoadingTip.GROUP:
                        text = local.format("Group");
                        break;

                    case ELoadingTip.MAP:
                        text = local.format("Map", new object[]
                        {
                            MenuConfigurationControlsUI.getKeyCodeText(ControlsSettings.map)
                        });
                        break;

                    case ELoadingTip.BEACON:
                        text = local.format("Beacon");
                        break;

                    case ELoadingTip.HORN:
                        text = local.format("Horn", new object[]
                        {
                            MenuConfigurationControlsUI.getKeyCodeText(ControlsSettings.primary)
                        });
                        break;

                    case ELoadingTip.LIGHTS:
                        text = local.format("Lights", new object[]
                        {
                            MenuConfigurationControlsUI.getKeyCodeText(ControlsSettings.secondary)
                        });
                        break;

                    case ELoadingTip.SNAP:
                        text = local.format("Snap", new object[]
                        {
                            MenuConfigurationControlsUI.getKeyCodeText(ControlsSettings.snap)
                        });
                        break;

                    case ELoadingTip.UPGRADE:
                        text = local.format("Upgrade", new object[]
                        {
                            MenuConfigurationControlsUI.getKeyCodeText(ControlsSettings.other)
                        });
                        break;

                    case ELoadingTip.GRAB:
                        text = local.format("Grab", new object[]
                        {
                            MenuConfigurationControlsUI.getKeyCodeText(ControlsSettings.other)
                        });
                        break;

                    case ELoadingTip.SKYCRANE:
                        text = local.format("Skycrane", new object[]
                        {
                            MenuConfigurationControlsUI.getKeyCodeText(ControlsSettings.other)
                        });
                        break;

                    case ELoadingTip.SEAT:
                        text = local.format("Seat");
                        break;

                    case ELoadingTip.RARITY:
                        text = local.format("Rarity");
                        break;

                    case ELoadingTip.ORIENTATION:
                        text = local.format("Orientation", new object[]
                        {
                            MenuConfigurationControlsUI.getKeyCodeText(ControlsSettings.rotate)
                        });
                        break;

                    case ELoadingTip.RED:
                        text = local.format("Red");
                        break;

                    case ELoadingTip.STEADY:
                        text = local.format("Steady", new object[]
                        {
                            MenuConfigurationControlsUI.getKeyCodeText(ControlsSettings.sprint)
                        });
                        break;

                    default:
                        text = "#" + LoadingUI.tip.ToString();
                        break;
                    }
                }
                LoadingUI.tipBox.text = ItemTool.filterRarityRichText(local.format("Tip", new object[]
                {
                    text
                }));
                if (Level.info != null)
                {
                    if (!LoadingUI.pickBackgroundImage(Level.info.path + "/Screenshots") && !LoadingUI.loadBackgroundImage(Level.info.path + "/Level.png"))
                    {
                        LoadingUI.pickBackgroundImage(ReadWrite.PATH + "/Screenshots");
                    }
                    Local local2 = Localization.tryRead(Level.info.path, false);
                    if (local2 != null)
                    {
                        if (Provider.isConnected)
                        {
                            string text2;
                            if (Provider.isServer)
                            {
                                text2 = LoadingUI.localization.format("Offline");
                            }
                            else
                            {
                                if (Provider.currentServerInfo.IsVACSecure)
                                {
                                    text2 = LoadingUI.localization.format("VAC_Secure");
                                }
                                else
                                {
                                    text2 = LoadingUI.localization.format("VAC_Insecure");
                                }
                                if (Provider.currentServerInfo.IsBattlEyeSecure)
                                {
                                    text2 = text2 + " + " + LoadingUI.localization.format("BattlEye_Secure");
                                }
                                else
                                {
                                    text2 = text2 + " + " + LoadingUI.localization.format("BattlEye_Insecure");
                                }
                            }
                            LoadingUI.loadingLabel.text = local2.format("Loading_Server", new object[]
                            {
                                (!OptionsSettings.streamer) ? Provider.currentServerInfo.name : LoadingUI.localization.format("Streamer"),
                                text2
                            });
                            if (Provider.mode == EGameMode.EASY)
                            {
                                LoadingUI.loadingImage.backgroundColor = Palette.COLOR_G;
                                LoadingUI.loadingImage.foregroundColor = Palette.COLOR_G;
                            }
                            else if (Provider.mode == EGameMode.HARD)
                            {
                                LoadingUI.loadingImage.backgroundColor = Palette.COLOR_R;
                                LoadingUI.loadingImage.foregroundColor = Palette.COLOR_R;
                            }
                            else
                            {
                                LoadingUI.loadingImage.backgroundColor = Color.white;
                                LoadingUI.loadingImage.foregroundColor = Color.white;
                            }
                        }
                        else
                        {
                            LoadingUI.loadingLabel.text            = local2.format("Loading_Editor");
                            LoadingUI.loadingImage.backgroundColor = Color.white;
                            LoadingUI.loadingImage.foregroundColor = Color.white;
                        }
                    }
                    else
                    {
                        LoadingUI.loadingLabel.text            = string.Empty;
                        LoadingUI.loadingImage.backgroundColor = Color.white;
                        LoadingUI.loadingImage.foregroundColor = Color.white;
                    }
                    if (Level.info.configData.Creators.Length > 0 || Level.info.configData.Collaborators.Length > 0 || Level.info.configData.Thanks.Length > 0)
                    {
                        int    num   = 0;
                        string text3 = string.Empty;
                        if (Level.info.configData.Creators.Length > 0)
                        {
                            text3 += LoadingUI.localization.format("Creators");
                            num   += 15;
                            for (int i = 0; i < Level.info.configData.Creators.Length; i++)
                            {
                                text3 = text3 + "\n" + Level.info.configData.Creators[i];
                                num  += 15;
                            }
                        }
                        if (Level.info.configData.Collaborators.Length > 0)
                        {
                            if (text3.Length > 0)
                            {
                                text3 += "\n\n";
                                num   += 30;
                            }
                            text3 += LoadingUI.localization.format("Collaborators");
                            num   += 15;
                            for (int j = 0; j < Level.info.configData.Collaborators.Length; j++)
                            {
                                text3 = text3 + "\n" + Level.info.configData.Collaborators[j];
                                num  += 15;
                            }
                        }
                        if (Level.info.configData.Thanks.Length > 0)
                        {
                            if (text3.Length > 0)
                            {
                                text3 += "\n\n";
                                num   += 30;
                            }
                            text3 += LoadingUI.localization.format("Thanks");
                            num   += 15;
                            for (int k = 0; k < Level.info.configData.Thanks.Length; k++)
                            {
                                text3 = text3 + "\n" + Level.info.configData.Thanks[k];
                                num  += 15;
                            }
                        }
                        LoadingUI.creditsBox.positionOffset_Y = -num / 2;
                        LoadingUI.creditsBox.sizeOffset_Y     = num;
                        LoadingUI.creditsBox.text             = text3;
                        LoadingUI.creditsBox.isVisible        = true;
                    }
                    else
                    {
                        LoadingUI.creditsBox.isVisible = false;
                    }
                }
                else
                {
                    LoadingUI.pickBackgroundImage(ReadWrite.PATH + "/Screenshots");
                    LoadingUI.loadingLabel.text            = LoadingUI.localization.format("Loading");
                    LoadingUI.loadingImage.backgroundColor = Color.white;
                    LoadingUI.loadingImage.foregroundColor = Color.white;
                    LoadingUI.creditsBox.isVisible         = false;
                }
                LoadingUI.loadingBox.sizeOffset_X = -20;
                LoadingUI.cancelButton.isVisible  = false;
            }
        }
Пример #11
0
        // Token: 0x0600374F RID: 14159 RVA: 0x001826A8 File Offset: 0x00180AA8
        public MenuSurvivorsClothingUI()
        {
            MenuSurvivorsClothingUI.localization = Localization.read("/Menu/Survivors/MenuSurvivorsClothing.dat");
            if (MenuSurvivorsClothingUI.icons != null)
            {
                MenuSurvivorsClothingUI.icons.unload();
                MenuSurvivorsClothingUI.icons = null;
            }
            MenuSurvivorsClothingUI.icons     = Bundles.getBundle("/Bundles/Textures/Menu/Icons/Survivors/MenuSurvivorsClothing/MenuSurvivorsClothing.unity3d");
            MenuSurvivorsClothingUI.container = new Sleek();
            MenuSurvivorsClothingUI.container.positionOffset_X = 10;
            MenuSurvivorsClothingUI.container.positionOffset_Y = 10;
            MenuSurvivorsClothingUI.container.positionScale_Y  = 1f;
            MenuSurvivorsClothingUI.container.sizeOffset_X     = -20;
            MenuSurvivorsClothingUI.container.sizeOffset_Y     = -20;
            MenuSurvivorsClothingUI.container.sizeScale_X      = 1f;
            MenuSurvivorsClothingUI.container.sizeScale_Y      = 1f;
            MenuUI.container.add(MenuSurvivorsClothingUI.container);
            MenuSurvivorsClothingUI.active     = false;
            MenuSurvivorsClothingUI.page       = 0;
            MenuSurvivorsClothingUI.filterMode = EEconFilterMode.SEARCH;
            MenuSurvivorsClothingUI.inventory  = new Sleek();
            MenuSurvivorsClothingUI.inventory.positionOffset_Y = 40;
            MenuSurvivorsClothingUI.inventory.positionScale_X  = 0.5f;
            MenuSurvivorsClothingUI.inventory.sizeScale_X      = 0.5f;
            MenuSurvivorsClothingUI.inventory.sizeScale_Y      = 1f;
            MenuSurvivorsClothingUI.inventory.sizeOffset_Y     = -80;
            MenuSurvivorsClothingUI.inventory.constraint       = ESleekConstraint.XY;
            MenuSurvivorsClothingUI.container.add(MenuSurvivorsClothingUI.inventory);
            MenuSurvivorsClothingUI.crafting = new Sleek();
            MenuSurvivorsClothingUI.crafting.positionOffset_Y = 40;
            MenuSurvivorsClothingUI.crafting.positionScale_X  = 0.5f;
            MenuSurvivorsClothingUI.crafting.sizeScale_X      = 0.5f;
            MenuSurvivorsClothingUI.crafting.sizeScale_Y      = 1f;
            MenuSurvivorsClothingUI.crafting.sizeOffset_Y     = -80;
            MenuSurvivorsClothingUI.crafting.constraint       = ESleekConstraint.XY;
            MenuSurvivorsClothingUI.container.add(MenuSurvivorsClothingUI.crafting);
            MenuSurvivorsClothingUI.crafting.isVisible = false;
            MenuSurvivorsClothingUI.packageButtons     = new SleekInventory[25];
            for (int i = 0; i < MenuSurvivorsClothingUI.packageButtons.Length; i++)
            {
                SleekInventory sleekInventory = new SleekInventory();
                sleekInventory.positionOffset_X = 5;
                sleekInventory.positionOffset_Y = 5;
                sleekInventory.positionScale_X  = (float)(i % 5) * 0.2f;
                sleekInventory.positionScale_Y  = (float)Mathf.FloorToInt((float)i / 5f) * 0.2f;
                sleekInventory.sizeOffset_X     = -10;
                sleekInventory.sizeOffset_Y     = -10;
                sleekInventory.sizeScale_X      = 0.2f;
                sleekInventory.sizeScale_Y      = 0.2f;
                SleekInventory sleekInventory2 = sleekInventory;
                if (MenuSurvivorsClothingUI.< > f__mg$cache0 == null)
                {
                    MenuSurvivorsClothingUI.< > f__mg$cache0 = new ClickedInventory(MenuSurvivorsClothingUI.onClickedInventory);
                }
                sleekInventory2.onClickedInventory = MenuSurvivorsClothingUI.< > f__mg$cache0;
                MenuSurvivorsClothingUI.inventory.add(sleekInventory);
                MenuSurvivorsClothingUI.packageButtons[i] = sleekInventory;
            }
            MenuSurvivorsClothingUI.searchField = new SleekField();
            MenuSurvivorsClothingUI.searchField.positionOffset_X = 5;
            MenuSurvivorsClothingUI.searchField.positionOffset_Y = -35;
            MenuSurvivorsClothingUI.searchField.sizeOffset_X     = -120;
            MenuSurvivorsClothingUI.searchField.sizeOffset_Y     = 30;
            MenuSurvivorsClothingUI.searchField.sizeScale_X      = 1f;
            MenuSurvivorsClothingUI.searchField.hint             = MenuSurvivorsClothingUI.localization.format("Search_Field_Hint");
            MenuSurvivorsClothingUI.searchField.control          = "Search";
            SleekField sleekField = MenuSurvivorsClothingUI.searchField;
            Delegate   onEntered  = sleekField.onEntered;

            if (MenuSurvivorsClothingUI.< > f__mg$cache1 == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cache1 = new Entered(MenuSurvivorsClothingUI.onEnteredSearchField);
            }
            sleekField.onEntered = (Entered)Delegate.Combine(onEntered, MenuSurvivorsClothingUI.< > f__mg$cache1);
            MenuSurvivorsClothingUI.inventory.add(MenuSurvivorsClothingUI.searchField);
            MenuSurvivorsClothingUI.searchButton = new SleekButton();
            MenuSurvivorsClothingUI.searchButton.positionOffset_X = -105;
            MenuSurvivorsClothingUI.searchButton.positionOffset_Y = -35;
            MenuSurvivorsClothingUI.searchButton.positionScale_X  = 1f;
            MenuSurvivorsClothingUI.searchButton.sizeOffset_X     = 100;
            MenuSurvivorsClothingUI.searchButton.sizeOffset_Y     = 30;
            MenuSurvivorsClothingUI.searchButton.text             = MenuSurvivorsClothingUI.localization.format("Search");
            MenuSurvivorsClothingUI.searchButton.tooltip          = MenuSurvivorsClothingUI.localization.format("Search_Tooltip");
            SleekButton sleekButton = MenuSurvivorsClothingUI.searchButton;

            if (MenuSurvivorsClothingUI.< > f__mg$cache2 == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cache2 = new ClickedButton(MenuSurvivorsClothingUI.onClickedSearchButton);
            }
            sleekButton.onClickedButton = MenuSurvivorsClothingUI.< > f__mg$cache2;
            MenuSurvivorsClothingUI.inventory.add(MenuSurvivorsClothingUI.searchButton);
            MenuSurvivorsClothingUI.filterBox = new SleekBox();
            MenuSurvivorsClothingUI.filterBox.positionOffset_X = 5;
            MenuSurvivorsClothingUI.filterBox.positionOffset_Y = -35;
            MenuSurvivorsClothingUI.filterBox.sizeOffset_X     = -120;
            MenuSurvivorsClothingUI.filterBox.sizeOffset_Y     = 30;
            MenuSurvivorsClothingUI.filterBox.sizeScale_X      = 1f;
            MenuSurvivorsClothingUI.filterBox.isRich           = true;
            MenuSurvivorsClothingUI.inventory.add(MenuSurvivorsClothingUI.filterBox);
            MenuSurvivorsClothingUI.filterBox.isVisible = false;
            MenuSurvivorsClothingUI.cancelFilterButton  = new SleekButton();
            MenuSurvivorsClothingUI.cancelFilterButton.positionOffset_X = -105;
            MenuSurvivorsClothingUI.cancelFilterButton.positionOffset_Y = -35;
            MenuSurvivorsClothingUI.cancelFilterButton.positionScale_X  = 1f;
            MenuSurvivorsClothingUI.cancelFilterButton.sizeOffset_X     = 100;
            MenuSurvivorsClothingUI.cancelFilterButton.sizeOffset_Y     = 30;
            MenuSurvivorsClothingUI.cancelFilterButton.text             = MenuSurvivorsClothingUI.localization.format("Cancel_Filter");
            MenuSurvivorsClothingUI.cancelFilterButton.tooltip          = MenuSurvivorsClothingUI.localization.format("Cancel_Filter_Tooltip");
            SleekButton sleekButton2 = MenuSurvivorsClothingUI.cancelFilterButton;

            if (MenuSurvivorsClothingUI.< > f__mg$cache3 == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cache3 = new ClickedButton(MenuSurvivorsClothingUI.onClickedCancelFilterButton);
            }
            sleekButton2.onClickedButton = MenuSurvivorsClothingUI.< > f__mg$cache3;
            MenuSurvivorsClothingUI.inventory.add(MenuSurvivorsClothingUI.cancelFilterButton);
            MenuSurvivorsClothingUI.cancelFilterButton.isVisible = false;
            MenuSurvivorsClothingUI.pageBox = new SleekBox();
            MenuSurvivorsClothingUI.pageBox.positionOffset_X = -145;
            MenuSurvivorsClothingUI.pageBox.positionOffset_Y = 5;
            MenuSurvivorsClothingUI.pageBox.positionScale_X  = 1f;
            MenuSurvivorsClothingUI.pageBox.positionScale_Y  = 1f;
            MenuSurvivorsClothingUI.pageBox.sizeOffset_X     = 100;
            MenuSurvivorsClothingUI.pageBox.sizeOffset_Y     = 30;
            MenuSurvivorsClothingUI.pageBox.fontSize         = 14;
            MenuSurvivorsClothingUI.inventory.add(MenuSurvivorsClothingUI.pageBox);
            MenuSurvivorsClothingUI.infoBox = new SleekBox();
            MenuSurvivorsClothingUI.infoBox.positionOffset_X = 5;
            MenuSurvivorsClothingUI.infoBox.positionOffset_Y = -25;
            MenuSurvivorsClothingUI.infoBox.positionScale_Y  = 0.5f;
            MenuSurvivorsClothingUI.infoBox.sizeScale_X      = 1f;
            MenuSurvivorsClothingUI.infoBox.sizeOffset_X     = -10;
            MenuSurvivorsClothingUI.infoBox.sizeOffset_Y     = 50;
            MenuSurvivorsClothingUI.infoBox.text             = MenuSurvivorsClothingUI.localization.format("No_Items");
            MenuSurvivorsClothingUI.infoBox.fontSize         = 14;
            MenuSurvivorsClothingUI.inventory.add(MenuSurvivorsClothingUI.infoBox);
            MenuSurvivorsClothingUI.infoBox.isVisible                   = !Provider.provider.economyService.isInventoryAvailable;
            MenuSurvivorsClothingUI.leftButton                          = new SleekButtonIcon((Texture2D)MenuSurvivorsClothingUI.icons.load("Left"));
            MenuSurvivorsClothingUI.leftButton.positionOffset_X         = -185;
            MenuSurvivorsClothingUI.leftButton.positionOffset_Y         = 5;
            MenuSurvivorsClothingUI.leftButton.positionScale_X          = 1f;
            MenuSurvivorsClothingUI.leftButton.positionScale_Y          = 1f;
            MenuSurvivorsClothingUI.leftButton.sizeOffset_X             = 30;
            MenuSurvivorsClothingUI.leftButton.sizeOffset_Y             = 30;
            MenuSurvivorsClothingUI.leftButton.tooltip                  = MenuSurvivorsClothingUI.localization.format("Left_Tooltip");
            MenuSurvivorsClothingUI.leftButton.iconImage.backgroundTint = ESleekTint.FOREGROUND;
            SleekButton sleekButton3 = MenuSurvivorsClothingUI.leftButton;

            if (MenuSurvivorsClothingUI.< > f__mg$cache4 == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cache4 = new ClickedButton(MenuSurvivorsClothingUI.onClickedLeftButton);
            }
            sleekButton3.onClickedButton = MenuSurvivorsClothingUI.< > f__mg$cache4;
            MenuSurvivorsClothingUI.inventory.add(MenuSurvivorsClothingUI.leftButton);
            MenuSurvivorsClothingUI.rightButton = new SleekButtonIcon((Texture2D)MenuSurvivorsClothingUI.icons.load("Right"));
            MenuSurvivorsClothingUI.rightButton.positionOffset_X         = -35;
            MenuSurvivorsClothingUI.rightButton.positionOffset_Y         = 5;
            MenuSurvivorsClothingUI.rightButton.positionScale_X          = 1f;
            MenuSurvivorsClothingUI.rightButton.positionScale_Y          = 1f;
            MenuSurvivorsClothingUI.rightButton.sizeOffset_X             = 30;
            MenuSurvivorsClothingUI.rightButton.sizeOffset_Y             = 30;
            MenuSurvivorsClothingUI.rightButton.tooltip                  = MenuSurvivorsClothingUI.localization.format("Right_Tooltip");
            MenuSurvivorsClothingUI.rightButton.iconImage.backgroundTint = ESleekTint.FOREGROUND;
            SleekButton sleekButton4 = MenuSurvivorsClothingUI.rightButton;

            if (MenuSurvivorsClothingUI.< > f__mg$cache5 == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cache5 = new ClickedButton(MenuSurvivorsClothingUI.onClickedRightButton);
            }
            sleekButton4.onClickedButton = MenuSurvivorsClothingUI.< > f__mg$cache5;
            MenuSurvivorsClothingUI.inventory.add(MenuSurvivorsClothingUI.rightButton);
            MenuSurvivorsClothingUI.refreshButton = new SleekButtonIcon((Texture2D)MenuSurvivorsClothingUI.icons.load("Refresh"));
            MenuSurvivorsClothingUI.refreshButton.positionOffset_X         = 5;
            MenuSurvivorsClothingUI.refreshButton.positionOffset_Y         = 5;
            MenuSurvivorsClothingUI.refreshButton.positionScale_Y          = 1f;
            MenuSurvivorsClothingUI.refreshButton.sizeOffset_X             = 30;
            MenuSurvivorsClothingUI.refreshButton.sizeOffset_Y             = 30;
            MenuSurvivorsClothingUI.refreshButton.tooltip                  = MenuSurvivorsClothingUI.localization.format("Refresh_Tooltip");
            MenuSurvivorsClothingUI.refreshButton.iconImage.backgroundTint = ESleekTint.FOREGROUND;
            SleekButton sleekButton5 = MenuSurvivorsClothingUI.refreshButton;

            if (MenuSurvivorsClothingUI.< > f__mg$cache6 == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cache6 = new ClickedButton(MenuSurvivorsClothingUI.onClickedRefreshButton);
            }
            sleekButton5.onClickedButton = MenuSurvivorsClothingUI.< > f__mg$cache6;
            MenuSurvivorsClothingUI.inventory.add(MenuSurvivorsClothingUI.refreshButton);
            MenuSurvivorsClothingUI.characterSlider = new SleekSlider();
            MenuSurvivorsClothingUI.characterSlider.positionOffset_X = 45;
            MenuSurvivorsClothingUI.characterSlider.positionOffset_Y = 10;
            MenuSurvivorsClothingUI.characterSlider.positionScale_Y  = 1f;
            MenuSurvivorsClothingUI.characterSlider.sizeOffset_X     = -240;
            MenuSurvivorsClothingUI.characterSlider.sizeOffset_Y     = 20;
            MenuSurvivorsClothingUI.characterSlider.sizeScale_X      = 1f;
            MenuSurvivorsClothingUI.characterSlider.orientation      = ESleekOrientation.HORIZONTAL;
            SleekSlider sleekSlider = MenuSurvivorsClothingUI.characterSlider;

            if (MenuSurvivorsClothingUI.< > f__mg$cache7 == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cache7 = new Dragged(MenuSurvivorsClothingUI.onDraggedCharacterSlider);
            }
            sleekSlider.onDragged = MenuSurvivorsClothingUI.< > f__mg$cache7;
            MenuSurvivorsClothingUI.inventory.add(MenuSurvivorsClothingUI.characterSlider);
            MenuSurvivorsClothingUI.availableBox              = new SleekBox();
            MenuSurvivorsClothingUI.availableBox.sizeScale_X  = 1f;
            MenuSurvivorsClothingUI.availableBox.sizeOffset_Y = 30;
            MenuSurvivorsClothingUI.availableBox.isRich       = true;
            MenuSurvivorsClothingUI.crafting.add(MenuSurvivorsClothingUI.availableBox);
            MenuSurvivorsClothingUI.craftingScrollBox = new SleekScrollBox();
            MenuSurvivorsClothingUI.craftingScrollBox.positionOffset_Y = 40;
            MenuSurvivorsClothingUI.craftingScrollBox.sizeScale_X      = 1f;
            MenuSurvivorsClothingUI.craftingScrollBox.sizeScale_Y      = 1f;
            MenuSurvivorsClothingUI.craftingScrollBox.sizeOffset_Y     = -40;
            MenuSurvivorsClothingUI.crafting.add(MenuSurvivorsClothingUI.craftingScrollBox);
            MenuSurvivorsClothingUI.craftingButtons = new SleekButton[MenuSurvivorsClothingUI.ECON_CRAFT_OPTIONS.Length];
            for (int j = 0; j < MenuSurvivorsClothingUI.craftingButtons.Length; j++)
            {
                EconCraftOption econCraftOption = MenuSurvivorsClothingUI.ECON_CRAFT_OPTIONS[j];
                SleekButton     sleekButton6    = new SleekButton();
                sleekButton6.positionOffset_Y = j * 30;
                sleekButton6.sizeScale_X      = 1f;
                sleekButton6.sizeOffset_X     = -30;
                sleekButton6.sizeOffset_Y     = 30;
                sleekButton6.isRich           = true;
                sleekButton6.text             = ItemTool.filterRarityRichText(MenuSurvivorsClothingUI.localization.format("Craft_Entry", new object[]
                {
                    MenuSurvivorsClothingUI.localization.format(econCraftOption.token),
                    econCraftOption.scrapsNeeded
                }));
                SleekButton sleekButton7 = sleekButton6;
                if (MenuSurvivorsClothingUI.< > f__mg$cache8 == null)
                {
                    MenuSurvivorsClothingUI.< > f__mg$cache8 = new ClickedButton(MenuSurvivorsClothingUI.onClickedCraftButton);
                }
                sleekButton7.onClickedButton = MenuSurvivorsClothingUI.< > f__mg$cache8;
                MenuSurvivorsClothingUI.craftingScrollBox.add(sleekButton6);
                MenuSurvivorsClothingUI.craftingButtons[j] = sleekButton6;
            }
            MenuSurvivorsClothingUI.craftingScrollBox.area      = new Rect(0f, 0f, 5f, (float)(MenuSurvivorsClothingUI.ECON_CRAFT_OPTIONS.Length * 30));
            MenuSurvivorsClothingUI.backButton                  = new SleekButtonIcon((Texture2D)MenuDashboardUI.icons.load("Exit"));
            MenuSurvivorsClothingUI.backButton.positionOffset_Y = -50;
            MenuSurvivorsClothingUI.backButton.positionScale_Y  = 1f;
            MenuSurvivorsClothingUI.backButton.sizeOffset_X     = 200;
            MenuSurvivorsClothingUI.backButton.sizeOffset_Y     = 50;
            MenuSurvivorsClothingUI.backButton.text             = MenuDashboardUI.localization.format("BackButtonText");
            MenuSurvivorsClothingUI.backButton.tooltip          = MenuDashboardUI.localization.format("BackButtonTooltip");
            SleekButton sleekButton8 = MenuSurvivorsClothingUI.backButton;

            if (MenuSurvivorsClothingUI.< > f__mg$cache9 == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cache9 = new ClickedButton(MenuSurvivorsClothingUI.onClickedBackButton);
            }
            sleekButton8.onClickedButton = MenuSurvivorsClothingUI.< > f__mg$cache9;
            MenuSurvivorsClothingUI.backButton.fontSize = 14;
            MenuSurvivorsClothingUI.backButton.iconImage.backgroundTint = ESleekTint.FOREGROUND;
            MenuSurvivorsClothingUI.container.add(MenuSurvivorsClothingUI.backButton);
            MenuSurvivorsClothingUI.itemstoreButton = new SleekButton();
            MenuSurvivorsClothingUI.itemstoreButton.positionOffset_Y = -170;
            MenuSurvivorsClothingUI.itemstoreButton.positionScale_Y  = 1f;
            MenuSurvivorsClothingUI.itemstoreButton.sizeOffset_X     = 200;
            MenuSurvivorsClothingUI.itemstoreButton.sizeOffset_Y     = 50;
            MenuSurvivorsClothingUI.itemstoreButton.text             = MenuSurvivorsClothingUI.localization.format("Itemstore");
            MenuSurvivorsClothingUI.itemstoreButton.tooltip          = MenuSurvivorsClothingUI.localization.format("Itemstore_Tooltip");
            SleekButton sleekButton9 = MenuSurvivorsClothingUI.itemstoreButton;

            if (MenuSurvivorsClothingUI.< > f__mg$cacheA == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cacheA = new ClickedButton(MenuSurvivorsClothingUI.onClickedItemstoreButton);
            }
            sleekButton9.onClickedButton = MenuSurvivorsClothingUI.< > f__mg$cacheA;
            MenuSurvivorsClothingUI.itemstoreButton.fontSize = 14;
            MenuSurvivorsClothingUI.container.add(MenuSurvivorsClothingUI.itemstoreButton);
            MenuSurvivorsClothingUI.craftingButton = new SleekButtonIcon((Texture2D)MenuSurvivorsClothingUI.icons.load("Crafting"));
            MenuSurvivorsClothingUI.craftingButton.positionOffset_Y = -110;
            MenuSurvivorsClothingUI.craftingButton.positionScale_Y  = 1f;
            MenuSurvivorsClothingUI.craftingButton.sizeOffset_X     = 200;
            MenuSurvivorsClothingUI.craftingButton.sizeOffset_Y     = 50;
            MenuSurvivorsClothingUI.craftingButton.text             = MenuSurvivorsClothingUI.localization.format("Crafting");
            MenuSurvivorsClothingUI.craftingButton.tooltip          = MenuSurvivorsClothingUI.localization.format("Crafting_Tooltip");
            SleekButton sleekButton10 = MenuSurvivorsClothingUI.craftingButton;

            if (MenuSurvivorsClothingUI.< > f__mg$cacheB == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cacheB = new ClickedButton(MenuSurvivorsClothingUI.onClickedCraftingButton);
            }
            sleekButton10.onClickedButton = MenuSurvivorsClothingUI.< > f__mg$cacheB;
            MenuSurvivorsClothingUI.craftingButton.fontSize = 14;
            MenuSurvivorsClothingUI.craftingButton.iconImage.backgroundTint = ESleekTint.FOREGROUND;
            MenuSurvivorsClothingUI.container.add(MenuSurvivorsClothingUI.craftingButton);
            if (Provider.statusData.Stockpile.Has_New_Items)
            {
                SleekNew sleek = new SleekNew(false);
                MenuSurvivorsClothingUI.itemstoreButton.add(sleek);
            }
            if (Provider.statusData.Stockpile.Featured_Item != 0)
            {
                MenuSurvivorsClothingUI.featuredButton = new SleekButton();
                MenuSurvivorsClothingUI.featuredButton.positionOffset_Y = -230;
                MenuSurvivorsClothingUI.featuredButton.positionScale_Y  = 1f;
                MenuSurvivorsClothingUI.featuredButton.sizeOffset_X     = 200;
                MenuSurvivorsClothingUI.featuredButton.sizeOffset_Y     = 50;
                MenuSurvivorsClothingUI.featuredButton.text             = Provider.provider.economyService.getInventoryName(Provider.statusData.Stockpile.Featured_Item);
                MenuSurvivorsClothingUI.featuredButton.tooltip          = MenuSurvivorsClothingUI.localization.format("Featured_Tooltip");
                SleekButton sleekButton11 = MenuSurvivorsClothingUI.featuredButton;
                if (MenuSurvivorsClothingUI.< > f__mg$cacheC == null)
                {
                    MenuSurvivorsClothingUI.< > f__mg$cacheC = new ClickedButton(MenuSurvivorsClothingUI.onClickedFeaturedButton);
                }
                sleekButton11.onClickedButton = MenuSurvivorsClothingUI.< > f__mg$cacheC;
                MenuSurvivorsClothingUI.featuredButton.foregroundTint  = ESleekTint.NONE;
                MenuSurvivorsClothingUI.featuredButton.foregroundColor = Provider.provider.economyService.getInventoryColor(Provider.statusData.Stockpile.Featured_Item);
                MenuSurvivorsClothingUI.featuredButton.fontSize        = 14;
                MenuSurvivorsClothingUI.container.add(MenuSurvivorsClothingUI.featuredButton);
                SleekNew sleek2 = new SleekNew(false);
                MenuSurvivorsClothingUI.featuredButton.add(sleek2);
            }
            if (!MenuSurvivorsClothingUI.hasLoaded)
            {
                TempSteamworksEconomy economyService = Provider.provider.economyService;
                Delegate onInventoryExchanged        = economyService.onInventoryExchanged;
                if (MenuSurvivorsClothingUI.< > f__mg$cacheD == null)
                {
                    MenuSurvivorsClothingUI.< > f__mg$cacheD = new TempSteamworksEconomy.InventoryExchanged(MenuSurvivorsClothingUI.onInventoryExchanged);
                }
                economyService.onInventoryExchanged = (TempSteamworksEconomy.InventoryExchanged)Delegate.Combine(onInventoryExchanged, MenuSurvivorsClothingUI.< > f__mg$cacheD);
                TempSteamworksEconomy economyService2 = Provider.provider.economyService;
                Delegate onInventoryRefreshed         = economyService2.onInventoryRefreshed;
                if (MenuSurvivorsClothingUI.< > f__mg$cacheE == null)
                {
                    MenuSurvivorsClothingUI.< > f__mg$cacheE = new TempSteamworksEconomy.InventoryRefreshed(MenuSurvivorsClothingUI.onInventoryRefreshed);
                }
                economyService2.onInventoryRefreshed = (TempSteamworksEconomy.InventoryRefreshed)Delegate.Combine(onInventoryRefreshed, MenuSurvivorsClothingUI.< > f__mg$cacheE);
                TempSteamworksEconomy economyService3 = Provider.provider.economyService;
                Delegate onInventoryDropped           = economyService3.onInventoryDropped;
                if (MenuSurvivorsClothingUI.< > f__mg$cacheF == null)
                {
                    MenuSurvivorsClothingUI.< > f__mg$cacheF = new TempSteamworksEconomy.InventoryDropped(MenuSurvivorsClothingUI.onInventoryDropped);
                }
                economyService3.onInventoryDropped = (TempSteamworksEconomy.InventoryDropped)Delegate.Combine(onInventoryDropped, MenuSurvivorsClothingUI.< > f__mg$cacheF);
            }
            Delegate onCharacterUpdated = Characters.onCharacterUpdated;

            if (MenuSurvivorsClothingUI.< > f__mg$cache10 == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cache10 = new CharacterUpdated(MenuSurvivorsClothingUI.onCharacterUpdated);
            }
            Characters.onCharacterUpdated     = (CharacterUpdated)Delegate.Combine(onCharacterUpdated, MenuSurvivorsClothingUI.< > f__mg$cache10);
            MenuSurvivorsClothingUI.hasLoaded = true;
            MenuSurvivorsClothingUI.updateFilter();
            MenuSurvivorsClothingUI.updatePage();
            new MenuSurvivorsClothingItemUI();
            new MenuSurvivorsClothingInspectUI();
            new MenuSurvivorsClothingDeleteUI();
            new MenuSurvivorsClothingBoxUI();
        }
Пример #12
0
        public static void readRewards(Data data, Local localization, string prefix, INPCReward[] rewards)
        {
            for (int i = 0; i < rewards.Length; i++)
            {
                if (!data.has(prefix + i + "_Type"))
                {
                    throw new NotSupportedException("Missing reward type");
                }
                ENPCRewardType enpcrewardType = (ENPCRewardType)Enum.Parse(typeof(ENPCRewardType), data.readString(prefix + i + "_Type"), true);
                string         text           = localization.read(prefix + i);
                text = ItemTool.filterRarityRichText(text);
                switch (enpcrewardType)
                {
                case ENPCRewardType.EXPERIENCE:
                    rewards[i] = new NPCExperienceReward(data.readUInt32(prefix + i + "_Value"), text);
                    break;

                case ENPCRewardType.REPUTATION:
                    rewards[i] = new NPCReputationReward(data.readInt32(prefix + i + "_Value"), text);
                    break;

                case ENPCRewardType.FLAG_BOOL:
                    rewards[i] = new NPCBoolFlagReward(data.readUInt16(prefix + i + "_ID"), data.readBoolean(prefix + i + "_Value"), text);
                    break;

                case ENPCRewardType.FLAG_SHORT:
                    rewards[i] = new NPCShortFlagReward(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), (ENPCModificationType)Enum.Parse(typeof(ENPCModificationType), data.readString(prefix + i + "_Modification"), true), text);
                    break;

                case ENPCRewardType.FLAG_SHORT_RANDOM:
                    rewards[i] = new NPCRandomShortFlagReward(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Min_Value"), data.readInt16(prefix + i + "_Max_Value"), (ENPCModificationType)Enum.Parse(typeof(ENPCModificationType), data.readString(prefix + i + "_Modification"), true), text);
                    break;

                case ENPCRewardType.QUEST:
                    rewards[i] = new NPCQuestReward(data.readUInt16(prefix + i + "_ID"), text);
                    break;

                case ENPCRewardType.ITEM:
                    rewards[i] = new NPCItemReward(data.readUInt16(prefix + i + "_ID"), data.readByte(prefix + i + "_Amount"), data.readUInt16(prefix + i + "_Sight"), data.readUInt16(prefix + i + "_Tactical"), data.readUInt16(prefix + i + "_Grip"), data.readUInt16(prefix + i + "_Barrel"), data.readUInt16(prefix + i + "_Magazine"), data.readByte(prefix + i + "_Ammo"), text);
                    break;

                case ENPCRewardType.ITEM_RANDOM:
                    rewards[i] = new NPCRandomItemReward(data.readUInt16(prefix + i + "_ID"), data.readByte(prefix + i + "_Amount"), text);
                    break;

                case ENPCRewardType.ACHIEVEMENT:
                    rewards[i] = new NPCAchievementReward(data.readString(prefix + i + "_ID"), text);
                    break;

                case ENPCRewardType.VEHICLE:
                    rewards[i] = new NPCVehicleReward(data.readUInt16(prefix + i + "_ID"), data.readString(prefix + i + "_Spawnpoint"), text);
                    break;

                case ENPCRewardType.TELEPORT:
                    rewards[i] = new NPCTeleportReward(data.readString(prefix + i + "_Spawnpoint"), text);
                    break;

                case ENPCRewardType.EVENT:
                    rewards[i] = new NPCEventReward(data.readString(prefix + i + "_ID"), text);
                    break;
                }
            }
        }
Пример #13
0
        public static void readConditions(Data data, Local localization, string prefix, INPCCondition[] conditions)
        {
            for (int i = 0; i < conditions.Length; i++)
            {
                if (!data.has(prefix + i + "_Type"))
                {
                    throw new NotSupportedException("Missing condition type");
                }
                ENPCConditionType enpcconditionType = (ENPCConditionType)Enum.Parse(typeof(ENPCConditionType), data.readString(prefix + i + "_Type"), true);
                string            text = localization.read(prefix + i);
                text = ItemTool.filterRarityRichText(text);
                bool          newShouldReset = data.has(prefix + i + "_Reset");
                ENPCLogicType newLogicType   = ENPCLogicType.NONE;
                if (data.has(prefix + i + "_Logic"))
                {
                    newLogicType = (ENPCLogicType)Enum.Parse(typeof(ENPCLogicType), data.readString(prefix + i + "_Logic"), true);
                }
                switch (enpcconditionType)
                {
                case ENPCConditionType.EXPERIENCE:
                    conditions[i] = new NPCExperienceCondition(data.readUInt32(prefix + i + "_Value"), newLogicType, text, newShouldReset);
                    break;

                case ENPCConditionType.REPUTATION:
                    conditions[i] = new NPCReputationCondition(data.readInt32(prefix + i + "_Value"), newLogicType, text);
                    break;

                case ENPCConditionType.FLAG_BOOL:
                    conditions[i] = new NPCBoolFlagCondition(data.readUInt16(prefix + i + "_ID"), data.readBoolean(prefix + i + "_Value"), data.has(prefix + i + "_Allow_Unset"), newLogicType, text, newShouldReset);
                    break;

                case ENPCConditionType.FLAG_SHORT:
                    conditions[i] = new NPCShortFlagCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), data.has(prefix + i + "_Allow_Unset"), newLogicType, text, newShouldReset);
                    break;

                case ENPCConditionType.QUEST:
                    conditions[i] = new NPCQuestCondition(data.readUInt16(prefix + i + "_ID"), (ENPCQuestStatus)Enum.Parse(typeof(ENPCQuestStatus), data.readString(prefix + i + "_Status"), true), data.has(prefix + i + "_Ignore_NPC"), newLogicType, text, newShouldReset);
                    break;

                case ENPCConditionType.SKILLSET:
                    conditions[i] = new NPCSkillsetCondition((EPlayerSkillset)Enum.Parse(typeof(EPlayerSkillset), data.readString(prefix + i + "_Value"), true), newLogicType, text);
                    break;

                case ENPCConditionType.ITEM:
                    conditions[i] = new NPCItemCondition(data.readUInt16(prefix + i + "_ID"), data.readUInt16(prefix + i + "_Amount"), text, newShouldReset);
                    break;

                case ENPCConditionType.KILLS_ZOMBIE:
                {
                    EZombieSpeciality newZombie = EZombieSpeciality.NONE;
                    if (data.has(prefix + i + "_Zombie"))
                    {
                        newZombie = (EZombieSpeciality)Enum.Parse(typeof(EZombieSpeciality), data.readString(prefix + i + "_Zombie"), true);
                    }
                    conditions[i] = new NPCZombieKillsCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), newZombie, data.has(prefix + i + "_Spawn"), data.readByte(prefix + i + "_Nav"), text, newShouldReset);
                    break;
                }

                case ENPCConditionType.KILLS_HORDE:
                    conditions[i] = new NPCHordeKillsCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), data.readByte(prefix + i + "_Nav"), text, newShouldReset);
                    break;
                }
            }
        }