Example #1
0
        public override string formatReward(Player player)
        {
            if (string.IsNullOrEmpty(this.text))
            {
                this.text = PlayerNPCQuestUI.localization.read("Reward_Item");
            }
            ItemAsset itemAsset = Assets.find(EAssetType.ITEM, this.id) as ItemAsset;
            string    arg;

            if (itemAsset != null)
            {
                arg = string.Concat(new string[]
                {
                    "<color=",
                    Palette.hex(ItemTool.getRarityColorUI(itemAsset.rarity)),
                    ">",
                    itemAsset.itemName,
                    "</color>"
                });
            }
            else
            {
                arg = "?";
            }
            return(string.Format(this.text, this.amount, arg));
        }
Example #2
0
        public override string formatCondition(Player player)
        {
            if (string.IsNullOrEmpty(this.text))
            {
                this.text = PlayerNPCQuestUI.localization.format("Condition_Item");
            }
            ItemAsset itemAsset = Assets.find(EAssetType.ITEM, this.id) as ItemAsset;
            string    arg;

            if (itemAsset != null)
            {
                arg = string.Concat(new string[]
                {
                    "<color=",
                    Palette.hex(ItemTool.getRarityColorUI(itemAsset.rarity)),
                    ">",
                    itemAsset.itemName,
                    "</color>"
                });
            }
            else
            {
                arg = "?";
            }
            NPCItemCondition.search.Clear();
            player.inventory.search(NPCItemCondition.search, this.id, false, true);
            return(string.Format(this.text, NPCItemCondition.search.Count, this.amount, arg));
        }
Example #3
0
        // Token: 0x06001C36 RID: 7222 RVA: 0x00099740 File Offset: 0x00097B40
        public override string formatReward(Player player)
        {
            if (string.IsNullOrEmpty(this.text))
            {
                this.text = PlayerNPCQuestUI.localization.read("Reward_Vehicle");
            }
            VehicleAsset vehicleAsset = Assets.find(EAssetType.VEHICLE, this.id) as VehicleAsset;
            string       arg;

            if (vehicleAsset != null)
            {
                arg = string.Concat(new string[]
                {
                    "<color=",
                    Palette.hex(ItemTool.getRarityColorUI(vehicleAsset.rarity)),
                    ">",
                    vehicleAsset.vehicleName,
                    "</color>"
                });
            }
            else
            {
                arg = "?";
            }
            return(string.Format(this.text, arg));
        }
Example #4
0
        public override string getContext(string desc, byte[] state)
        {
            ushort            id = BitConverter.ToUInt16(state, 8);
            ItemMagazineAsset itemMagazineAsset = (ItemMagazineAsset)Assets.find(EAssetType.ITEM, id);

            if (itemMagazineAsset != null)
            {
                desc += PlayerDashboardInventoryUI.localization.format("Ammo", new object[]
                {
                    string.Concat(new string[]
                    {
                        "<color=",
                        Palette.hex(ItemTool.getRarityColorUI(itemMagazineAsset.rarity)),
                        ">",
                        itemMagazineAsset.itemName,
                        "</color>"
                    }),
                    state[10],
                    itemMagazineAsset.amount
                });
            }
            else
            {
                desc += PlayerDashboardInventoryUI.localization.format("Ammo", new object[]
                {
                    PlayerDashboardInventoryUI.localization.format("None"),
                    0,
                    0
                });
            }
            desc += "\n\n";
            return(desc);
        }
Example #5
0
 // Token: 0x0600210C RID: 8460 RVA: 0x000B47FC File Offset: 0x000B2BFC
 public override bool checkHint(out EPlayerMessage message, out string text, out Color color)
 {
     message = EPlayerMessage.ITEM;
     text    = this.asset.itemName;
     color   = ItemTool.getRarityColorUI(this.asset.rarity);
     return(true);
 }
Example #6
0
        public SleekVendor(VendorElement newElement)
        {
            this.element = newElement;
            base.init();
            this.fontStyle     = 1;
            this.fontAlignment = 4;
            this.fontSize      = SleekRender.FONT_SIZE;
            this.calculateContent();
            ItemAsset itemAsset = (ItemAsset)Assets.find(EAssetType.ITEM, this.element.id);

            if (itemAsset == null)
            {
                return;
            }
            SleekImageTexture sleekImageTexture = new SleekImageTexture();

            sleekImageTexture.positionOffset_X = 5;
            sleekImageTexture.positionOffset_Y = 5;
            if (itemAsset.size_y == 1)
            {
                sleekImageTexture.sizeOffset_X = (int)(itemAsset.size_x * 100);
                sleekImageTexture.sizeOffset_Y = (int)(itemAsset.size_y * 100);
            }
            else
            {
                sleekImageTexture.sizeOffset_X = (int)(itemAsset.size_x * 50);
                sleekImageTexture.sizeOffset_Y = (int)(itemAsset.size_y * 50);
            }
            base.add(sleekImageTexture);
            ItemTool.getIcon(this.element.id, 100, itemAsset.getState(false), itemAsset, sleekImageTexture.sizeOffset_X, sleekImageTexture.sizeOffset_Y, new ItemIconReady(sleekImageTexture.updateTexture));
            base.sizeOffset_Y = sleekImageTexture.sizeOffset_Y + 10;
            base.add(new SleekLabel
            {
                positionOffset_X = sleekImageTexture.sizeOffset_X + 10,
                positionOffset_Y = 5,
                sizeOffset_X     = -sleekImageTexture.sizeOffset_X - 15,
                sizeOffset_Y     = 30,
                sizeScale_X      = 1f,
                text             = itemAsset.itemName,
                fontSize         = 14,
                fontAlignment    = 0,
                foregroundTint   = ESleekTint.NONE,
                foregroundColor  = ItemTool.getRarityColorUI(itemAsset.rarity)
            });
            base.add(new SleekLabel
            {
                positionOffset_X = sleekImageTexture.sizeOffset_X + 10,
                positionOffset_Y = 25,
                sizeOffset_X     = -sleekImageTexture.sizeOffset_X - 15,
                sizeOffset_Y     = -30,
                sizeScale_X      = 1f,
                sizeScale_Y      = 1f,
                fontAlignment    = 0,
                foregroundTint   = ESleekTint.NONE,
                isRich           = true,
                text             = itemAsset.itemDescription
            });
            SleekLabel sleekLabel = new SleekLabel();

            sleekLabel.positionOffset_X = sleekImageTexture.sizeOffset_X + 10;
            sleekLabel.positionOffset_Y = -35;
            sleekLabel.positionScale_Y  = 1f;
            sleekLabel.sizeOffset_X     = -sleekImageTexture.sizeOffset_X - 15;
            sleekLabel.sizeOffset_Y     = 30;
            sleekLabel.sizeScale_X      = 1f;
            sleekLabel.fontAlignment    = 8;
            sleekLabel.foregroundTint   = ESleekTint.NONE;
            sleekLabel.foregroundColor  = Palette.COLOR_Y;
            base.add(sleekLabel);
            if (this.element is VendorBuying)
            {
                sleekLabel.text = PlayerNPCVendorUI.localization.format("Price", new object[]
                {
                    this.element.cost
                });
            }
            else
            {
                sleekLabel.text = PlayerNPCVendorUI.localization.format("Cost", new object[]
                {
                    this.element.cost
                });
            }
            this.amountLabel = new SleekLabel();
            this.amountLabel.positionOffset_X = sleekImageTexture.sizeOffset_X + 10;
            this.amountLabel.positionOffset_Y = -35;
            this.amountLabel.positionScale_Y  = 1f;
            this.amountLabel.sizeOffset_X     = -sleekImageTexture.sizeOffset_X - 15;
            this.amountLabel.sizeOffset_Y     = 30;
            this.amountLabel.sizeScale_X      = 1f;
            this.amountLabel.fontAlignment    = 6;
            this.amountLabel.foregroundTint   = ESleekTint.NONE;
            base.add(this.amountLabel);
            this.updateAmount();
        }
        private static void refresh()
        {
            MenuWorkshopSpawnsUI.rawField.isVisible  = false;
            MenuWorkshopSpawnsUI.rootsBox.isVisible  = true;
            MenuWorkshopSpawnsUI.tablesBox.isVisible = true;
            MenuWorkshopSpawnsUI.rootsBox.remove();
            MenuWorkshopSpawnsUI.tablesBox.remove();
            MenuWorkshopSpawnsUI.asset = (SpawnAsset)Assets.find(EAssetType.SPAWN, MenuWorkshopSpawnsUI.viewIDField.state);
            switch (MenuWorkshopSpawnsUI.typeButton.state)
            {
            case 0:
                MenuWorkshopSpawnsUI.type = EAssetType.ITEM;
                break;

            case 1:
                MenuWorkshopSpawnsUI.type = EAssetType.VEHICLE;
                break;

            case 2:
                MenuWorkshopSpawnsUI.type = EAssetType.ANIMAL;
                break;

            default:
                MenuWorkshopSpawnsUI.type = EAssetType.NONE;
                return;
            }
            int num = 120;

            MenuWorkshopSpawnsUI.rootsBox.positionOffset_Y = num;
            num += 40;
            if (MenuWorkshopSpawnsUI.asset != null)
            {
                MenuWorkshopSpawnsUI.rootsBox.text = MenuWorkshopSpawnsUI.localization.format("Roots_Box", new object[]
                {
                    MenuWorkshopSpawnsUI.viewIDField.state + " " + MenuWorkshopSpawnsUI.asset.name
                });
                for (int i = 0; i < MenuWorkshopSpawnsUI.asset.roots.Count; i++)
                {
                    SpawnTable spawnTable = MenuWorkshopSpawnsUI.asset.roots[i];
                    if (spawnTable.spawnID != 0)
                    {
                        SleekButton sleekButton = new SleekButton();
                        sleekButton.positionOffset_Y = 40 + i * 40;
                        sleekButton.sizeOffset_X     = -260;
                        sleekButton.sizeScale_X      = 1f;
                        sleekButton.sizeOffset_Y     = 30;
                        SleekButton sleekButton2 = sleekButton;
                        if (MenuWorkshopSpawnsUI.< > f__mg$cache0 == null)
                        {
                            MenuWorkshopSpawnsUI.< > f__mg$cache0 = new ClickedButton(MenuWorkshopSpawnsUI.onClickedRootButton);
                        }
                        sleekButton2.onClickedButton = MenuWorkshopSpawnsUI.< > f__mg$cache0;
                        MenuWorkshopSpawnsUI.rootsBox.add(sleekButton);
                        num += 40;
                        SpawnAsset spawnAsset = (SpawnAsset)Assets.find(EAssetType.SPAWN, spawnTable.spawnID);
                        if (spawnAsset != null)
                        {
                            sleekButton.text = spawnTable.spawnID + " " + spawnAsset.name;
                        }
                        else
                        {
                            sleekButton.text = spawnTable.spawnID + " ?";
                        }
                        SleekInt32Field sleekInt32Field = new SleekInt32Field();
                        sleekInt32Field.positionOffset_X = 10;
                        sleekInt32Field.positionScale_X  = 1f;
                        sleekInt32Field.sizeOffset_X     = 55;
                        sleekInt32Field.sizeOffset_Y     = 30;
                        sleekInt32Field.state            = spawnTable.weight;
                        sleekInt32Field.tooltip          = MenuWorkshopSpawnsUI.localization.format("Weight_Tooltip");
                        SleekInt32Field sleekInt32Field2 = sleekInt32Field;
                        Delegate        onTypedInt       = sleekInt32Field2.onTypedInt;
                        if (MenuWorkshopSpawnsUI.< > f__mg$cache1 == null)
                        {
                            MenuWorkshopSpawnsUI.< > f__mg$cache1 = new TypedInt32(MenuWorkshopSpawnsUI.onTypedRootWeightField);
                        }
                        sleekInt32Field2.onTypedInt = (TypedInt32)Delegate.Combine(onTypedInt, MenuWorkshopSpawnsUI.< > f__mg$cache1);
                        sleekButton.add(sleekInt32Field);
                        sleekButton.add(new SleekBox
                        {
                            positionOffset_X = 75,
                            positionScale_X  = 1f,
                            sizeOffset_X     = 55,
                            sizeOffset_Y     = 30,
                            text             = (Math.Round((double)(spawnTable.chance * 1000f)) / 10.0).ToString() + "%",
                            tooltip          = MenuWorkshopSpawnsUI.localization.format("Chance_Tooltip")
                        });
                        SleekButtonIcon sleekButtonIcon = new SleekButtonIcon((Texture2D)MenuWorkshopEditorUI.icons.load("Remove"));
                        sleekButtonIcon.positionOffset_X = 140;
                        sleekButtonIcon.positionScale_X  = 1f;
                        sleekButtonIcon.sizeOffset_X     = 120;
                        sleekButtonIcon.sizeOffset_Y     = 30;
                        sleekButtonIcon.text             = MenuWorkshopSpawnsUI.localization.format("Remove_Root_Button");
                        sleekButtonIcon.tooltip          = MenuWorkshopSpawnsUI.localization.format("Remove_Root_Button_Tooltip");
                        SleekButton sleekButton3 = sleekButtonIcon;
                        if (MenuWorkshopSpawnsUI.< > f__mg$cache2 == null)
                        {
                            MenuWorkshopSpawnsUI.< > f__mg$cache2 = new ClickedButton(MenuWorkshopSpawnsUI.onClickedRemoveRootButton);
                        }
                        sleekButton3.onClickedButton = MenuWorkshopSpawnsUI.< > f__mg$cache2;
                        sleekButton.add(sleekButtonIcon);
                    }
                }
                MenuWorkshopSpawnsUI.addRootIDField.positionOffset_Y     = num;
                MenuWorkshopSpawnsUI.addRootSpawnButton.positionOffset_Y = num;
                num += 40;
                MenuWorkshopSpawnsUI.addRootIDField.isVisible     = true;
                MenuWorkshopSpawnsUI.addRootSpawnButton.isVisible = true;
            }
            else
            {
                MenuWorkshopSpawnsUI.rootsBox.text = MenuWorkshopSpawnsUI.localization.format("Roots_Box", new object[]
                {
                    MenuWorkshopSpawnsUI.viewIDField.state + " ?"
                });
                MenuWorkshopSpawnsUI.addRootIDField.isVisible     = false;
                MenuWorkshopSpawnsUI.addRootSpawnButton.isVisible = false;
            }
            num += 40;
            MenuWorkshopSpawnsUI.tablesBox.positionOffset_Y = num;
            num += 40;
            if (MenuWorkshopSpawnsUI.asset != null)
            {
                MenuWorkshopSpawnsUI.tablesBox.text = MenuWorkshopSpawnsUI.localization.format("Tables_Box", new object[]
                {
                    MenuWorkshopSpawnsUI.viewIDField.state + " " + MenuWorkshopSpawnsUI.asset.name
                });
                for (int j = 0; j < MenuWorkshopSpawnsUI.asset.tables.Count; j++)
                {
                    SpawnTable spawnTable2 = MenuWorkshopSpawnsUI.asset.tables[j];
                    Sleek      sleek       = null;
                    if (spawnTable2.spawnID != 0)
                    {
                        SleekButton sleekButton4 = new SleekButton();
                        sleekButton4.positionOffset_Y = 40 + j * 40;
                        sleekButton4.sizeOffset_X     = -260;
                        sleekButton4.sizeScale_X      = 1f;
                        sleekButton4.sizeOffset_Y     = 30;
                        SleekButton sleekButton5 = sleekButton4;
                        if (MenuWorkshopSpawnsUI.< > f__mg$cache3 == null)
                        {
                            MenuWorkshopSpawnsUI.< > f__mg$cache3 = new ClickedButton(MenuWorkshopSpawnsUI.onClickedTableButton);
                        }
                        sleekButton5.onClickedButton = MenuWorkshopSpawnsUI.< > f__mg$cache3;
                        MenuWorkshopSpawnsUI.tablesBox.add(sleekButton4);
                        sleek = sleekButton4;
                        num  += 40;
                        SpawnAsset spawnAsset2 = (SpawnAsset)Assets.find(EAssetType.SPAWN, spawnTable2.spawnID);
                        if (spawnAsset2 != null)
                        {
                            sleekButton4.text = spawnTable2.spawnID + " " + spawnAsset2.name;
                        }
                        else
                        {
                            sleekButton4.text = spawnTable2.spawnID + " ?";
                        }
                    }
                    else if (spawnTable2.assetID != 0)
                    {
                        SleekBox sleekBox = new SleekBox();
                        sleekBox.positionOffset_Y = 40 + j * 40;
                        sleekBox.sizeOffset_X     = -260;
                        sleekBox.sizeScale_X      = 1f;
                        sleekBox.sizeOffset_Y     = 30;
                        MenuWorkshopSpawnsUI.tablesBox.add(sleekBox);
                        sleek = sleekBox;
                        num  += 40;
                        Asset asset = Assets.find(MenuWorkshopSpawnsUI.type, spawnTable2.assetID);
                        if (asset != null)
                        {
                            sleekBox.text = spawnTable2.assetID + " " + asset.name;
                            if (MenuWorkshopSpawnsUI.type == EAssetType.ITEM)
                            {
                                ItemAsset itemAsset = asset as ItemAsset;
                                if (MenuWorkshopSpawnsUI.asset != null)
                                {
                                    sleekBox.foregroundTint  = ESleekTint.NONE;
                                    sleekBox.foregroundColor = ItemTool.getRarityColorUI(itemAsset.rarity);
                                }
                            }
                            else if (MenuWorkshopSpawnsUI.type == EAssetType.VEHICLE)
                            {
                                VehicleAsset vehicleAsset = asset as VehicleAsset;
                                if (MenuWorkshopSpawnsUI.asset != null)
                                {
                                    sleekBox.foregroundTint  = ESleekTint.NONE;
                                    sleekBox.foregroundColor = ItemTool.getRarityColorUI(vehicleAsset.rarity);
                                }
                            }
                        }
                        else
                        {
                            sleekBox.text = spawnTable2.assetID + " ?";
                        }
                    }
                    if (sleek != null)
                    {
                        SleekInt32Field sleekInt32Field3 = new SleekInt32Field();
                        sleekInt32Field3.positionOffset_X = 10;
                        sleekInt32Field3.positionScale_X  = 1f;
                        sleekInt32Field3.sizeOffset_X     = 55;
                        sleekInt32Field3.sizeOffset_Y     = 30;
                        sleekInt32Field3.state            = spawnTable2.weight;
                        sleekInt32Field3.tooltip          = MenuWorkshopSpawnsUI.localization.format("Weight_Tooltip");
                        SleekInt32Field sleekInt32Field4 = sleekInt32Field3;
                        Delegate        onTypedInt2      = sleekInt32Field4.onTypedInt;
                        if (MenuWorkshopSpawnsUI.< > f__mg$cache4 == null)
                        {
                            MenuWorkshopSpawnsUI.< > f__mg$cache4 = new TypedInt32(MenuWorkshopSpawnsUI.onTypedTableWeightField);
                        }
                        sleekInt32Field4.onTypedInt = (TypedInt32)Delegate.Combine(onTypedInt2, MenuWorkshopSpawnsUI.< > f__mg$cache4);
                        sleek.add(sleekInt32Field3);
                        float num2 = spawnTable2.chance;
                        if (j > 0)
                        {
                            num2 -= MenuWorkshopSpawnsUI.asset.tables[j - 1].chance;
                        }
                        sleek.add(new SleekBox
                        {
                            positionOffset_X = 75,
                            positionScale_X  = 1f,
                            sizeOffset_X     = 55,
                            sizeOffset_Y     = 30,
                            text             = (Math.Round((double)(num2 * 1000f)) / 10.0).ToString() + "%",
                            tooltip          = MenuWorkshopSpawnsUI.localization.format("Chance_Tooltip")
                        });
                        SleekButtonIcon sleekButtonIcon2 = new SleekButtonIcon((Texture2D)MenuWorkshopEditorUI.icons.load("Remove"));
                        sleekButtonIcon2.positionOffset_X = 140;
                        sleekButtonIcon2.positionScale_X  = 1f;
                        sleekButtonIcon2.sizeOffset_X     = 120;
                        sleekButtonIcon2.sizeOffset_Y     = 30;
                        sleekButtonIcon2.text             = MenuWorkshopSpawnsUI.localization.format("Remove_Table_Button");
                        sleekButtonIcon2.tooltip          = MenuWorkshopSpawnsUI.localization.format("Remove_Table_Button_Tooltip");
                        SleekButton sleekButton6 = sleekButtonIcon2;
                        if (MenuWorkshopSpawnsUI.< > f__mg$cache5 == null)
                        {
                            MenuWorkshopSpawnsUI.< > f__mg$cache5 = new ClickedButton(MenuWorkshopSpawnsUI.onClickedRemoveTableButton);
                        }
                        sleekButton6.onClickedButton = MenuWorkshopSpawnsUI.< > f__mg$cache5;
                        sleek.add(sleekButtonIcon2);
                    }
                }
                MenuWorkshopSpawnsUI.addTableIDField.positionOffset_Y     = num;
                MenuWorkshopSpawnsUI.addTableAssetButton.positionOffset_Y = num;
                MenuWorkshopSpawnsUI.addTableSpawnButton.positionOffset_Y = num;
                num += 40;
                MenuWorkshopSpawnsUI.addTableIDField.isVisible     = true;
                MenuWorkshopSpawnsUI.addTableAssetButton.isVisible = true;
                MenuWorkshopSpawnsUI.addTableSpawnButton.isVisible = true;
            }
            else
            {
                MenuWorkshopSpawnsUI.tablesBox.text = MenuWorkshopSpawnsUI.localization.format("Tables_Box", new object[]
                {
                    MenuWorkshopSpawnsUI.viewIDField.state + " ?"
                });
                MenuWorkshopSpawnsUI.addTableIDField.isVisible     = false;
                MenuWorkshopSpawnsUI.addTableAssetButton.isVisible = false;
                MenuWorkshopSpawnsUI.addTableSpawnButton.isVisible = false;
            }
            if (MenuWorkshopSpawnsUI.asset != null)
            {
                MenuWorkshopSpawnsUI.applyWeightsButton.positionOffset_Y = num;
                num += 40;
                MenuWorkshopSpawnsUI.applyWeightsButton.isVisible = true;
            }
            else
            {
                MenuWorkshopSpawnsUI.applyWeightsButton.isVisible = false;
            }
            MenuWorkshopSpawnsUI.spawnsBox.area = new Rect(0f, 0f, 5f, (float)(num - 10));
        }
        // Token: 0x060032BA RID: 12986 RVA: 0x0014923C File Offset: 0x0014763C
        public void updateItem(ItemJar newJar)
        {
            this._jar = newJar;
            ItemAsset itemAsset = (ItemAsset)Assets.find(EAssetType.ITEM, this.jar.item.id);

            if (itemAsset != null)
            {
                if (!this.isTemporary)
                {
                    this.button.tooltip = itemAsset.itemName;
                }
                if (this.jar.rot % 2 == 0)
                {
                    base.sizeOffset_X          = (int)(itemAsset.size_x * 50);
                    base.sizeOffset_Y          = (int)(itemAsset.size_y * 50);
                    this.icon.positionOffset_X = 0;
                    this.icon.positionOffset_Y = 0;
                }
                else
                {
                    base.sizeOffset_X = (int)(itemAsset.size_y * 50);
                    base.sizeOffset_Y = (int)(itemAsset.size_x * 50);
                    int num = Mathf.Abs((int)(itemAsset.size_y - itemAsset.size_x));
                    if (itemAsset.size_x > itemAsset.size_y)
                    {
                        this.icon.positionOffset_X = -num * 25;
                        this.icon.positionOffset_Y = num * 25;
                    }
                    else
                    {
                        this.icon.positionOffset_X = num * 25;
                        this.icon.positionOffset_Y = -num * 25;
                    }
                }
                this.icon.angle        = (float)(this.jar.rot * 90);
                this.icon.sizeOffset_X = (int)(itemAsset.size_x * 50);
                this.icon.sizeOffset_Y = (int)(itemAsset.size_y * 50);
                this.icon.isVisible    = false;
                ItemTool.getIcon(this.jar.item.id, this.jar.item.quality, this.jar.item.state, itemAsset, new ItemIconReady(this.onItemIconReady));
                if (itemAsset.size_x == 1 || itemAsset.size_y == 1)
                {
                    this.amountLabel.positionOffset_X = 0;
                    this.amountLabel.positionOffset_Y = -30;
                    this.amountLabel.sizeOffset_X     = 0;
                    this.amountLabel.fontSize         = 10;
                    this.hotkeyLabel.fontSize         = 10;
                }
                else
                {
                    this.amountLabel.positionOffset_X = 5;
                    this.amountLabel.positionOffset_Y = -35;
                    this.amountLabel.sizeOffset_X     = -10;
                    this.amountLabel.fontSize         = 12;
                    this.hotkeyLabel.fontSize         = 12;
                }
                this.button.backgroundColor = ItemTool.getRarityColorUI(itemAsset.rarity);
                this.button.foregroundColor = this.button.backgroundColor;
                if (itemAsset.showQuality)
                {
                    if (itemAsset.size_x == 1 || itemAsset.size_y == 1)
                    {
                        this.qualityImage.positionOffset_X = -15;
                        this.qualityImage.positionOffset_Y = -15;
                        this.qualityImage.sizeOffset_X     = 10;
                        this.qualityImage.sizeOffset_Y     = 10;
                        this.qualityImage.texture          = (Texture2D)PlayerDashboardInventoryUI.icons.load("Quality_1");
                    }
                    else
                    {
                        this.qualityImage.positionOffset_X = -30;
                        this.qualityImage.positionOffset_Y = -30;
                        this.qualityImage.sizeOffset_X     = 20;
                        this.qualityImage.sizeOffset_Y     = 20;
                        this.qualityImage.texture          = (Texture2D)PlayerDashboardInventoryUI.icons.load("Quality_0");
                    }
                    this.qualityImage.backgroundColor = ItemTool.getQualityColor((float)this.jar.item.quality / 100f);
                    this.qualityImage.foregroundColor = this.qualityImage.backgroundColor;
                    this.amountLabel.text             = this.jar.item.quality + "%";
                    this.amountLabel.backgroundColor  = this.qualityImage.backgroundColor;
                    this.amountLabel.foregroundColor  = this.qualityImage.backgroundColor;
                    this.qualityImage.isVisible       = true;
                    this.amountLabel.isVisible        = true;
                }
                else
                {
                    this.qualityImage.isVisible = false;
                    if (itemAsset.amount > 1)
                    {
                        this.amountLabel.text            = "x" + this.jar.item.amount;
                        this.amountLabel.backgroundColor = Color.white;
                        this.amountLabel.foregroundColor = Color.white;
                        this.amountLabel.isVisible       = true;
                    }
                    else
                    {
                        this.amountLabel.isVisible = false;
                    }
                }
            }
        }
        // Token: 0x0600372B RID: 14123 RVA: 0x0017F678 File Offset: 0x0017DA78
        public MenuSurvivorsClothingBoxUI()
        {
            MenuSurvivorsClothingBoxUI.localization = Localization.read("/Menu/Survivors/MenuSurvivorsClothingBox.dat");
            if (MenuSurvivorsClothingBoxUI.icons != null)
            {
                MenuSurvivorsClothingBoxUI.icons.unload();
            }
            MenuSurvivorsClothingBoxUI.icons     = Bundles.getBundle("/Bundles/Textures/Menu/Icons/Survivors/MenuSurvivorsClothingBox/MenuSurvivorsClothingBox.unity3d");
            MenuSurvivorsClothingBoxUI.container = new Sleek();
            MenuSurvivorsClothingBoxUI.container.positionOffset_X = 10;
            MenuSurvivorsClothingBoxUI.container.positionOffset_Y = 10;
            MenuSurvivorsClothingBoxUI.container.positionScale_Y  = 1f;
            MenuSurvivorsClothingBoxUI.container.sizeOffset_X     = -20;
            MenuSurvivorsClothingBoxUI.container.sizeOffset_Y     = -20;
            MenuSurvivorsClothingBoxUI.container.sizeScale_X      = 1f;
            MenuSurvivorsClothingBoxUI.container.sizeScale_Y      = 1f;
            MenuUI.container.add(MenuSurvivorsClothingBoxUI.container);
            MenuSurvivorsClothingBoxUI.active    = false;
            MenuSurvivorsClothingBoxUI.inventory = new Sleek();
            MenuSurvivorsClothingBoxUI.inventory.positionScale_X  = 0.5f;
            MenuSurvivorsClothingBoxUI.inventory.positionOffset_Y = 10;
            MenuSurvivorsClothingBoxUI.inventory.sizeScale_X      = 0.5f;
            MenuSurvivorsClothingBoxUI.inventory.sizeScale_Y      = 1f;
            MenuSurvivorsClothingBoxUI.inventory.sizeOffset_Y     = -20;
            MenuSurvivorsClothingBoxUI.inventory.constraint       = ESleekConstraint.XY;
            MenuSurvivorsClothingBoxUI.container.add(MenuSurvivorsClothingBoxUI.inventory);
            MenuSurvivorsClothingBoxUI.finalBox = new SleekBox();
            MenuSurvivorsClothingBoxUI.finalBox.positionOffset_X = -10;
            MenuSurvivorsClothingBoxUI.finalBox.positionOffset_Y = -10;
            MenuSurvivorsClothingBoxUI.finalBox.sizeOffset_X     = 20;
            MenuSurvivorsClothingBoxUI.finalBox.sizeOffset_Y     = 20;
            MenuSurvivorsClothingBoxUI.inventory.add(MenuSurvivorsClothingBoxUI.finalBox);
            MenuSurvivorsClothingBoxUI.boxButton = new SleekInventory();
            MenuSurvivorsClothingBoxUI.boxButton.positionOffset_Y = -30;
            MenuSurvivorsClothingBoxUI.boxButton.positionScale_X  = 0.3f;
            MenuSurvivorsClothingBoxUI.boxButton.positionScale_Y  = 0.3f;
            MenuSurvivorsClothingBoxUI.boxButton.sizeScale_X      = 0.4f;
            MenuSurvivorsClothingBoxUI.boxButton.sizeScale_Y      = 0.4f;
            MenuSurvivorsClothingBoxUI.inventory.add(MenuSurvivorsClothingBoxUI.boxButton);
            MenuSurvivorsClothingBoxUI.keyButton = new SleekButtonIcon(null, 40);
            MenuSurvivorsClothingBoxUI.keyButton.positionOffset_Y = -20;
            MenuSurvivorsClothingBoxUI.keyButton.positionScale_X  = 0.3f;
            MenuSurvivorsClothingBoxUI.keyButton.positionScale_Y  = 0.7f;
            MenuSurvivorsClothingBoxUI.keyButton.sizeOffset_X     = -5;
            MenuSurvivorsClothingBoxUI.keyButton.sizeOffset_Y     = 50;
            MenuSurvivorsClothingBoxUI.keyButton.sizeScale_X      = 0.2f;
            MenuSurvivorsClothingBoxUI.keyButton.text             = MenuSurvivorsClothingBoxUI.localization.format("Key_Text");
            MenuSurvivorsClothingBoxUI.keyButton.tooltip          = MenuSurvivorsClothingBoxUI.localization.format("Key_Tooltip");
            SleekButton sleekButton = MenuSurvivorsClothingBoxUI.keyButton;

            if (MenuSurvivorsClothingBoxUI.< > f__mg$cache0 == null)
            {
                MenuSurvivorsClothingBoxUI.< > f__mg$cache0 = new ClickedButton(MenuSurvivorsClothingBoxUI.onClickedKeyButton);
            }
            sleekButton.onClickedButton = MenuSurvivorsClothingBoxUI.< > f__mg$cache0;
            MenuSurvivorsClothingBoxUI.keyButton.fontSize = 14;
            MenuSurvivorsClothingBoxUI.inventory.add(MenuSurvivorsClothingBoxUI.keyButton);
            MenuSurvivorsClothingBoxUI.keyButton.isVisible          = false;
            MenuSurvivorsClothingBoxUI.unboxButton                  = new SleekButtonIcon(null);
            MenuSurvivorsClothingBoxUI.unboxButton.positionOffset_X = 5;
            MenuSurvivorsClothingBoxUI.unboxButton.positionOffset_Y = -20;
            MenuSurvivorsClothingBoxUI.unboxButton.positionScale_X  = 0.5f;
            MenuSurvivorsClothingBoxUI.unboxButton.positionScale_Y  = 0.7f;
            MenuSurvivorsClothingBoxUI.unboxButton.sizeOffset_X     = -5;
            MenuSurvivorsClothingBoxUI.unboxButton.sizeOffset_Y     = 50;
            MenuSurvivorsClothingBoxUI.unboxButton.sizeScale_X      = 0.2f;
            MenuSurvivorsClothingBoxUI.unboxButton.text             = MenuSurvivorsClothingBoxUI.localization.format("Unbox_Text");
            MenuSurvivorsClothingBoxUI.unboxButton.tooltip          = MenuSurvivorsClothingBoxUI.localization.format("Unbox_Tooltip");
            SleekButton sleekButton2 = MenuSurvivorsClothingBoxUI.unboxButton;

            if (MenuSurvivorsClothingBoxUI.< > f__mg$cache1 == null)
            {
                MenuSurvivorsClothingBoxUI.< > f__mg$cache1 = new ClickedButton(MenuSurvivorsClothingBoxUI.onClickedUnboxButton);
            }
            sleekButton2.onClickedButton = MenuSurvivorsClothingBoxUI.< > f__mg$cache1;
            MenuSurvivorsClothingBoxUI.unboxButton.fontSize = 14;
            MenuSurvivorsClothingBoxUI.inventory.add(MenuSurvivorsClothingBoxUI.unboxButton);
            MenuSurvivorsClothingBoxUI.unboxButton.isVisible      = false;
            MenuSurvivorsClothingBoxUI.rareLabel                  = new SleekLabel();
            MenuSurvivorsClothingBoxUI.rareLabel.positionOffset_X = 50;
            MenuSurvivorsClothingBoxUI.rareLabel.positionOffset_Y = 50;
            MenuSurvivorsClothingBoxUI.rareLabel.sizeOffset_X     = 200;
            MenuSurvivorsClothingBoxUI.rareLabel.sizeOffset_Y     = 30;
            MenuSurvivorsClothingBoxUI.rareLabel.text             = MenuSurvivorsClothingBoxUI.localization.format("Rarity_Rare", new object[]
            {
                "75.0"
            });
            MenuSurvivorsClothingBoxUI.rareLabel.foregroundTint  = ESleekTint.NONE;
            MenuSurvivorsClothingBoxUI.rareLabel.foregroundColor = ItemTool.getRarityColorUI(EItemRarity.RARE);
            MenuSurvivorsClothingBoxUI.rareLabel.fontAlignment   = TextAnchor.MiddleLeft;
            MenuSurvivorsClothingBoxUI.container.add(MenuSurvivorsClothingBoxUI.rareLabel);
            MenuSurvivorsClothingBoxUI.epicLabel = new SleekLabel();
            MenuSurvivorsClothingBoxUI.epicLabel.positionOffset_X = 50;
            MenuSurvivorsClothingBoxUI.epicLabel.positionOffset_Y = 70;
            MenuSurvivorsClothingBoxUI.epicLabel.sizeOffset_X     = 200;
            MenuSurvivorsClothingBoxUI.epicLabel.sizeOffset_Y     = 30;
            MenuSurvivorsClothingBoxUI.epicLabel.text             = MenuSurvivorsClothingBoxUI.localization.format("Rarity_Epic", new object[]
            {
                "20.0"
            });
            MenuSurvivorsClothingBoxUI.epicLabel.foregroundTint  = ESleekTint.NONE;
            MenuSurvivorsClothingBoxUI.epicLabel.foregroundColor = ItemTool.getRarityColorUI(EItemRarity.EPIC);
            MenuSurvivorsClothingBoxUI.epicLabel.fontAlignment   = TextAnchor.MiddleLeft;
            MenuSurvivorsClothingBoxUI.container.add(MenuSurvivorsClothingBoxUI.epicLabel);
            MenuSurvivorsClothingBoxUI.legendaryLabel = new SleekLabel();
            MenuSurvivorsClothingBoxUI.legendaryLabel.positionOffset_X = 50;
            MenuSurvivorsClothingBoxUI.legendaryLabel.positionOffset_Y = 90;
            MenuSurvivorsClothingBoxUI.legendaryLabel.sizeOffset_X     = 200;
            MenuSurvivorsClothingBoxUI.legendaryLabel.sizeOffset_Y     = 30;
            MenuSurvivorsClothingBoxUI.legendaryLabel.text             = MenuSurvivorsClothingBoxUI.localization.format("Rarity_Legendary", new object[]
            {
                "5.0"
            });
            MenuSurvivorsClothingBoxUI.legendaryLabel.foregroundTint  = ESleekTint.NONE;
            MenuSurvivorsClothingBoxUI.legendaryLabel.foregroundColor = ItemTool.getRarityColorUI(EItemRarity.LEGENDARY);
            MenuSurvivorsClothingBoxUI.legendaryLabel.fontAlignment   = TextAnchor.MiddleLeft;
            MenuSurvivorsClothingBoxUI.container.add(MenuSurvivorsClothingBoxUI.legendaryLabel);
            MenuSurvivorsClothingBoxUI.mythicalLabel = new SleekLabel();
            MenuSurvivorsClothingBoxUI.mythicalLabel.positionOffset_X = 50;
            MenuSurvivorsClothingBoxUI.mythicalLabel.positionOffset_Y = 110;
            MenuSurvivorsClothingBoxUI.mythicalLabel.sizeOffset_X     = 200;
            MenuSurvivorsClothingBoxUI.mythicalLabel.sizeOffset_Y     = 30;
            MenuSurvivorsClothingBoxUI.mythicalLabel.text             = MenuSurvivorsClothingBoxUI.localization.format("Rarity_Mythical", new object[]
            {
                "3.0"
            });
            MenuSurvivorsClothingBoxUI.mythicalLabel.foregroundTint  = ESleekTint.NONE;
            MenuSurvivorsClothingBoxUI.mythicalLabel.foregroundColor = ItemTool.getRarityColorUI(EItemRarity.MYTHICAL);
            MenuSurvivorsClothingBoxUI.mythicalLabel.fontAlignment   = TextAnchor.MiddleLeft;
            MenuSurvivorsClothingBoxUI.container.add(MenuSurvivorsClothingBoxUI.mythicalLabel);
            if (!MenuSurvivorsClothingBoxUI.hasLoaded)
            {
                TempSteamworksEconomy economyService = Provider.provider.economyService;
                Delegate onInventoryExchanged        = economyService.onInventoryExchanged;
                if (MenuSurvivorsClothingBoxUI.< > f__mg$cache2 == null)
                {
                    MenuSurvivorsClothingBoxUI.< > f__mg$cache2 = new TempSteamworksEconomy.InventoryExchanged(MenuSurvivorsClothingBoxUI.onInventoryExchanged);
                }
                economyService.onInventoryExchanged = (TempSteamworksEconomy.InventoryExchanged)Delegate.Combine(onInventoryExchanged, MenuSurvivorsClothingBoxUI.< > f__mg$cache2);
            }
            MenuSurvivorsClothingBoxUI.hasLoaded  = true;
            MenuSurvivorsClothingBoxUI.backButton = new SleekButtonIcon((Texture2D)MenuDashboardUI.icons.load("Exit"));
            MenuSurvivorsClothingBoxUI.backButton.positionOffset_Y = -50;
            MenuSurvivorsClothingBoxUI.backButton.positionScale_Y  = 1f;
            MenuSurvivorsClothingBoxUI.backButton.sizeOffset_X     = 200;
            MenuSurvivorsClothingBoxUI.backButton.sizeOffset_Y     = 50;
            MenuSurvivorsClothingBoxUI.backButton.text             = MenuDashboardUI.localization.format("BackButtonText");
            MenuSurvivorsClothingBoxUI.backButton.tooltip          = MenuDashboardUI.localization.format("BackButtonTooltip");
            SleekButton sleekButton3 = MenuSurvivorsClothingBoxUI.backButton;

            if (MenuSurvivorsClothingBoxUI.< > f__mg$cache3 == null)
            {
                MenuSurvivorsClothingBoxUI.< > f__mg$cache3 = new ClickedButton(MenuSurvivorsClothingBoxUI.onClickedBackButton);
            }
            sleekButton3.onClickedButton = MenuSurvivorsClothingBoxUI.< > f__mg$cache3;
            MenuSurvivorsClothingBoxUI.backButton.fontSize = 14;
            MenuSurvivorsClothingBoxUI.backButton.iconImage.backgroundTint = ESleekTint.FOREGROUND;
            MenuSurvivorsClothingBoxUI.container.add(MenuSurvivorsClothingBoxUI.backButton);
        }