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
        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 #4
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 #5
0
 // Token: 0x06003753 RID: 14163 RVA: 0x001836D8 File Offset: 0x00181AD8
 public static void setFilter(EEconFilterMode newFilterMode, ulong newFilterInstigator)
 {
     MenuSurvivorsClothingUI.setCrafting(false);
     MenuSurvivorsClothingUI.filterMode                   = newFilterMode;
     MenuSurvivorsClothingUI.filterInstigator             = newFilterInstigator;
     MenuSurvivorsClothingUI.searchField.isVisible        = (MenuSurvivorsClothingUI.filterMode == EEconFilterMode.SEARCH);
     MenuSurvivorsClothingUI.searchButton.isVisible       = (MenuSurvivorsClothingUI.filterMode == EEconFilterMode.SEARCH);
     MenuSurvivorsClothingUI.filterBox.isVisible          = (MenuSurvivorsClothingUI.filterMode != EEconFilterMode.SEARCH);
     MenuSurvivorsClothingUI.cancelFilterButton.isVisible = (MenuSurvivorsClothingUI.filterMode != EEconFilterMode.SEARCH);
     if (MenuSurvivorsClothingUI.filterMode == EEconFilterMode.STAT_TRACKER)
     {
         int    inventoryItem  = Provider.provider.economyService.getInventoryItem(MenuSurvivorsClothingUI.filterInstigator);
         string inventoryName  = Provider.provider.economyService.getInventoryName(inventoryItem);
         Color  inventoryColor = Provider.provider.economyService.getInventoryColor(inventoryItem);
         string text           = string.Concat(new string[]
         {
             "<color=",
             Palette.hex(inventoryColor),
             ">",
             inventoryName,
             "</color>"
         });
         MenuSurvivorsClothingUI.filterBox.text = MenuSurvivorsClothingUI.localization.format("Filter_Item_Target", new object[]
         {
             text
         });
     }
     MenuSurvivorsClothingUI.updateFilterAndPage();
 }
 // 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;
     }
 }
Example #7
0
 public static void viewItem(int newItem, ulong newInstance)
 {
     MenuSurvivorsClothingDeleteUI.item             = newItem;
     MenuSurvivorsClothingDeleteUI.instance         = newInstance;
     MenuSurvivorsClothingDeleteUI.intentLabel.text = MenuSurvivorsClothingDeleteUI.localization.format("Intent", new object[]
     {
         string.Concat(new string[]
         {
             "<color=",
             Palette.hex(Provider.provider.economyService.getInventoryColor(MenuSurvivorsClothingDeleteUI.item)),
             ">",
             Provider.provider.economyService.getInventoryName(MenuSurvivorsClothingDeleteUI.item),
             "</color>"
         })
     });
     MenuSurvivorsClothingDeleteUI.confirmField.text = string.Empty;
 }
Example #8
0
 public static void viewItem(int newItem, ushort newQuantity, ulong newInstance)
 {
     MenuSurvivorsClothingItemUI.item     = newItem;
     MenuSurvivorsClothingItemUI.quantity = newQuantity;
     MenuSurvivorsClothingItemUI.instance = newInstance;
     MenuSurvivorsClothingItemUI.packageBox.updateInventory(MenuSurvivorsClothingItemUI.instance, MenuSurvivorsClothingItemUI.item, newQuantity, false, true);
     if (MenuSurvivorsClothingItemUI.packageBox.itemAsset != null)
     {
         if (MenuSurvivorsClothingItemUI.packageBox.itemAsset.type == EItemType.KEY)
         {
             MenuSurvivorsClothingItemUI.useButton.isVisible     = false;
             MenuSurvivorsClothingItemUI.inspectButton.isVisible = false;
         }
         else if (MenuSurvivorsClothingItemUI.packageBox.itemAsset.type == EItemType.BOX)
         {
             MenuSurvivorsClothingItemUI.useButton.isVisible     = true;
             MenuSurvivorsClothingItemUI.inspectButton.isVisible = false;
             MenuSurvivorsClothingItemUI.useButton.text          = MenuSurvivorsClothingItemUI.localization.format("Contents_Text");
             MenuSurvivorsClothingItemUI.useButton.tooltip       = MenuSurvivorsClothingItemUI.localization.format("Contents_Tooltip");
         }
         else
         {
             MenuSurvivorsClothingItemUI.useButton.isVisible     = true;
             MenuSurvivorsClothingItemUI.inspectButton.isVisible = true;
             bool flag;
             if (MenuSurvivorsClothingItemUI.packageBox.itemAsset.proPath == null || MenuSurvivorsClothingItemUI.packageBox.itemAsset.proPath.Length == 0)
             {
                 flag = Characters.isSkinEquipped(MenuSurvivorsClothingItemUI.instance);
             }
             else
             {
                 flag = Characters.isCosmeticEquipped(MenuSurvivorsClothingItemUI.instance);
             }
             MenuSurvivorsClothingItemUI.useButton.text    = MenuSurvivorsClothingItemUI.localization.format((!flag) ? "Equip_Text" : "Dequip_Text");
             MenuSurvivorsClothingItemUI.useButton.tooltip = MenuSurvivorsClothingItemUI.localization.format((!flag) ? "Equip_Tooltip" : "Dequip_Tooltip");
         }
         MenuSurvivorsClothingItemUI.marketButton.isVisible      = Provider.provider.economyService.getInventoryMarketable(MenuSurvivorsClothingItemUI.item);
         MenuSurvivorsClothingItemUI.descriptionBox.sizeOffset_Y = 0;
         if (MenuSurvivorsClothingItemUI.useButton.isVisible || MenuSurvivorsClothingItemUI.inspectButton.isVisible)
         {
             MenuSurvivorsClothingItemUI.descriptionBox.sizeOffset_Y   -= 60;
             MenuSurvivorsClothingItemUI.useButton.positionOffset_Y     = -MenuSurvivorsClothingItemUI.descriptionBox.sizeOffset_Y - 50;
             MenuSurvivorsClothingItemUI.inspectButton.positionOffset_Y = -MenuSurvivorsClothingItemUI.descriptionBox.sizeOffset_Y - 50;
         }
         if (MenuSurvivorsClothingItemUI.marketButton.isVisible || MenuSurvivorsClothingItemUI.deleteButton.isVisible)
         {
             MenuSurvivorsClothingItemUI.descriptionBox.sizeOffset_Y  -= 60;
             MenuSurvivorsClothingItemUI.marketButton.positionOffset_Y = -MenuSurvivorsClothingItemUI.descriptionBox.sizeOffset_Y - 50;
             MenuSurvivorsClothingItemUI.deleteButton.positionOffset_Y = -MenuSurvivorsClothingItemUI.descriptionBox.sizeOffset_Y - 50;
         }
         MenuSurvivorsClothingItemUI.infoLabel.text = string.Concat(new string[]
         {
             "<color=",
             Palette.hex(Provider.provider.economyService.getInventoryColor(MenuSurvivorsClothingItemUI.item)),
             ">",
             Provider.provider.economyService.getInventoryType(MenuSurvivorsClothingItemUI.item),
             "</color>\n\n",
             Provider.provider.economyService.getInventoryDescription(MenuSurvivorsClothingItemUI.item)
         });
     }
     else
     {
         MenuSurvivorsClothingItemUI.useButton.isVisible           = false;
         MenuSurvivorsClothingItemUI.inspectButton.isVisible       = false;
         MenuSurvivorsClothingItemUI.marketButton.isVisible        = false;
         MenuSurvivorsClothingItemUI.deleteButton.isVisible        = true;
         MenuSurvivorsClothingItemUI.descriptionBox.sizeOffset_Y   = -60;
         MenuSurvivorsClothingItemUI.deleteButton.positionOffset_Y = -MenuSurvivorsClothingItemUI.descriptionBox.sizeOffset_Y - 50;
         MenuSurvivorsClothingItemUI.infoLabel.text = MenuSurvivorsClothingItemUI.localization.format("Unknown");
     }
 }
Example #9
0
 private void Update()
 {
     if (MenuUI.window == null)
     {
         return;
     }
     MenuConfigurationControlsUI.bindUpdate();
     if (MenuConfigurationControlsUI.binding == 255)
     {
         if (Input.GetKeyDown(27))
         {
             if (Provider.provider.matchmakingService.isAttemptingServerQuery)
             {
                 Provider.provider.matchmakingService.cancel();
             }
             else if (MenuUI.isAlerting)
             {
                 MenuUI.closeAlert();
                 MenuUI.isAlerting = false;
             }
             else if (MenuPauseUI.active)
             {
                 MenuPauseUI.close();
                 MenuDashboardUI.open();
                 MenuTitleUI.open();
             }
             else if (MenuCreditsUI.active)
             {
                 MenuCreditsUI.close();
                 MenuPauseUI.open();
             }
             else if (MenuTitleUI.active)
             {
                 MenuPauseUI.open();
                 MenuDashboardUI.close();
                 MenuTitleUI.close();
             }
             else if (MenuPlayConfigUI.active)
             {
                 MenuPlayConfigUI.close();
                 MenuPlaySingleplayerUI.open();
             }
             else if (MenuPlayServerInfoUI.active)
             {
                 MenuPlayServerInfoUI.close();
                 MenuPlayServerInfoUI.EServerInfoOpenContext openContext = MenuPlayServerInfoUI.openContext;
                 if (openContext != MenuPlayServerInfoUI.EServerInfoOpenContext.CONNECT)
                 {
                     if (openContext != MenuPlayServerInfoUI.EServerInfoOpenContext.SERVERS)
                     {
                         if (openContext == MenuPlayServerInfoUI.EServerInfoOpenContext.MATCHMAKING)
                         {
                             MenuPlayMatchmakingUI.open();
                         }
                     }
                     else
                     {
                         MenuPlayServersUI.open();
                     }
                 }
                 else
                 {
                     MenuPlayConnectUI.open();
                 }
             }
             else if (MenuPlayConnectUI.active || MenuPlayServersUI.active || MenuPlaySingleplayerUI.active || MenuPlayMatchmakingUI.active || MenuPlayLobbiesUI.active)
             {
                 MenuPlayConnectUI.close();
                 MenuPlayServersUI.close();
                 MenuPlaySingleplayerUI.close();
                 MenuPlayMatchmakingUI.close();
                 MenuPlayLobbiesUI.close();
                 MenuPlayUI.open();
             }
             else if (MenuSurvivorsClothingItemUI.active)
             {
                 MenuSurvivorsClothingItemUI.close();
                 MenuSurvivorsClothingUI.open();
             }
             else if (MenuSurvivorsClothingBoxUI.active)
             {
                 if (!MenuSurvivorsClothingBoxUI.isUnboxing)
                 {
                     MenuSurvivorsClothingBoxUI.close();
                     MenuSurvivorsClothingItemUI.open();
                 }
             }
             else if (MenuSurvivorsClothingInspectUI.active || MenuSurvivorsClothingDeleteUI.active)
             {
                 MenuSurvivorsClothingInspectUI.close();
                 MenuSurvivorsClothingDeleteUI.close();
                 MenuSurvivorsClothingItemUI.open();
             }
             else if (MenuSurvivorsCharacterUI.active || MenuSurvivorsAppearanceUI.active || MenuSurvivorsGroupUI.active || MenuSurvivorsClothingUI.active)
             {
                 MenuSurvivorsCharacterUI.close();
                 MenuSurvivorsAppearanceUI.close();
                 MenuSurvivorsGroupUI.close();
                 MenuSurvivorsClothingUI.close();
                 MenuSurvivorsUI.open();
             }
             else if (MenuConfigurationOptionsUI.active || MenuConfigurationControlsUI.active || MenuConfigurationGraphicsUI.active || MenuConfigurationDisplayUI.active)
             {
                 MenuConfigurationOptionsUI.close();
                 MenuConfigurationControlsUI.close();
                 MenuConfigurationGraphicsUI.close();
                 MenuConfigurationDisplayUI.close();
                 MenuConfigurationUI.open();
             }
             else if (MenuWorkshopSubmitUI.active || MenuWorkshopEditorUI.active || MenuWorkshopErrorUI.active || MenuWorkshopLocalizationUI.active || MenuWorkshopSpawnsUI.active || MenuWorkshopModulesUI.active)
             {
                 MenuWorkshopSubmitUI.close();
                 MenuWorkshopEditorUI.close();
                 MenuWorkshopErrorUI.close();
                 MenuWorkshopLocalizationUI.close();
                 MenuWorkshopSpawnsUI.close();
                 MenuWorkshopModulesUI.close();
                 MenuWorkshopUI.open();
             }
             else
             {
                 MenuPlayUI.close();
                 MenuSurvivorsUI.close();
                 MenuConfigurationUI.close();
                 MenuWorkshopUI.close();
                 MenuDashboardUI.open();
                 MenuTitleUI.open();
             }
         }
         if (MenuUI.window != null)
         {
             if (Input.GetKeyDown(ControlsSettings.screenshot))
             {
                 Provider.takeScreenshot();
             }
             if (Input.GetKeyDown(ControlsSettings.hud))
             {
                 DevkitWindowManager.isActive          = false;
                 MenuUI.window.isEnabled               = !MenuUI.window.isEnabled;
                 MenuUI.window.drawCursorWhileDisabled = false;
             }
             if (Input.GetKeyDown(ControlsSettings.terminal))
             {
                 DevkitWindowManager.isActive          = !DevkitWindowManager.isActive;
                 MenuUI.window.isEnabled               = !DevkitWindowManager.isActive;
                 MenuUI.window.drawCursorWhileDisabled = DevkitWindowManager.isActive;
             }
         }
     }
     if (Input.GetKeyDown(ControlsSettings.refreshAssets))
     {
         Assets.refresh();
     }
     if (Input.GetKeyDown(ControlsSettings.clipboardDebug) && MenuSurvivorsAppearanceUI.active)
     {
         string text = string.Empty;
         text = text + "Face " + Characters.active.face;
         text = text + "\nHair " + Characters.active.hair;
         text = text + "\nBeard " + Characters.active.beard;
         text = text + "\nColor_Skin " + Palette.hex(Characters.active.skin);
         text = text + "\nColor_Hair " + Palette.hex(Characters.active.color);
         if (Characters.active.hand)
         {
             text += "\nBackward";
         }
         GUIUtility.systemCopyBuffer = text;
     }
     if (MenuUI.isAlerting && Time.realtimeSinceStartup - MenuUI.lastAlert > MenuUI.alertTime)
     {
         MenuUI.closeAlert();
         MenuUI.isAlerting = false;
     }
     MenuUI.window.showCursor = true;
     MenuUI.window.updateDebug();
     if (MenuPlayUI.active || MenuPlayConnectUI.active || MenuPlayServersUI.active || MenuPlayServerInfoUI.active || MenuPlaySingleplayerUI.active || MenuPlayMatchmakingUI.active || MenuPlayLobbiesUI.active || MenuPlayConfigUI.active)
     {
         this.target = this.play;
     }
     else if (MenuSurvivorsUI.active || MenuSurvivorsCharacterUI.active || MenuSurvivorsAppearanceUI.active || MenuSurvivorsGroupUI.active || MenuSurvivorsClothingUI.active || MenuSurvivorsClothingItemUI.active || MenuSurvivorsClothingInspectUI.active || MenuSurvivorsClothingDeleteUI.active || MenuSurvivorsClothingBoxUI.active)
     {
         this.target = this.survivors;
     }
     else if (MenuConfigurationUI.active || MenuConfigurationOptionsUI.active || MenuConfigurationControlsUI.active || MenuConfigurationGraphicsUI.active || MenuConfigurationDisplayUI.active)
     {
         this.target = this.configuration;
     }
     else if (MenuWorkshopUI.active || MenuWorkshopSubmitUI.active || MenuWorkshopEditorUI.active || MenuWorkshopErrorUI.active || MenuWorkshopLocalizationUI.active || MenuWorkshopSpawnsUI.active || MenuWorkshopModulesUI.active)
     {
         this.target = this.workshop;
     }
     else
     {
         this.target = this.title;
     }
     if (this.target == this.title)
     {
         if (MenuUI.hasTitled)
         {
             base.transform.position = Vector3.Lerp(base.transform.position, this.target.position, Time.deltaTime * 4f);
             base.transform.rotation = Quaternion.Lerp(base.transform.rotation, this.target.rotation, Time.deltaTime * 4f);
         }
         else
         {
             base.transform.position = Vector3.Lerp(base.transform.position, this.target.position, Time.deltaTime);
             base.transform.rotation = Quaternion.Lerp(base.transform.rotation, this.target.rotation, Time.deltaTime);
         }
     }
     else
     {
         MenuUI.hasTitled        = true;
         base.transform.position = Vector3.Lerp(base.transform.position, this.target.position, Time.deltaTime * 4f);
         base.transform.rotation = Quaternion.Lerp(base.transform.rotation, this.target.rotation, Time.deltaTime * 4f);
     }
 }
Example #10
0
        // Token: 0x060036F8 RID: 14072 RVA: 0x0017C770 File Offset: 0x0017AB70
        private static void updateSelection()
        {
            if (PlaySettings.singleplayerMap == null || PlaySettings.singleplayerMap.Length == 0)
            {
                return;
            }
            LevelInfo level = Level.getLevel(PlaySettings.singleplayerMap);

            if (level == null)
            {
                return;
            }
            Local local = Localization.tryRead(level.path, false);

            if (local != null)
            {
                MenuPlaySingleplayerUI.descriptionBox.text = local.format("Description");
            }
            if (local != null && local.has("Name"))
            {
                MenuPlaySingleplayerUI.selectedBox.text = local.format("Name");
            }
            else
            {
                MenuPlaySingleplayerUI.selectedBox.text = PlaySettings.singleplayerMap;
            }
            if (MenuPlaySingleplayerUI.previewImage.texture != null && MenuPlaySingleplayerUI.previewImage.shouldDestroyTexture)
            {
                UnityEngine.Object.Destroy(MenuPlaySingleplayerUI.previewImage.texture);
                MenuPlaySingleplayerUI.previewImage.texture = null;
            }
            string path = level.path + "/Preview.png";

            if (!ReadWrite.fileExists(path, false, false))
            {
                path = level.path + "/Level.png";
            }
            if (ReadWrite.fileExists(path, false, false))
            {
                byte[]    data      = ReadWrite.readBytes(path, false, false);
                Texture2D texture2D = new Texture2D(320, 180, TextureFormat.ARGB32, false, true);
                texture2D.name       = "Preview_" + PlaySettings.singleplayerMap + "_Selected_Icon";
                texture2D.filterMode = FilterMode.Trilinear;
                texture2D.hideFlags  = HideFlags.HideAndDontSave;
                texture2D.LoadImage(data);
                MenuPlaySingleplayerUI.previewImage.texture = texture2D;
            }
            int num = MenuPlaySingleplayerUI.creditsBox.positionOffset_Y;

            if (level.configData.Creators.Length > 0 || level.configData.Collaborators.Length > 0 || level.configData.Thanks.Length > 0)
            {
                int    num2 = 0;
                string text = string.Empty;
                if (level.configData.Creators.Length > 0)
                {
                    text += MenuPlaySingleplayerUI.localization.format("Creators");
                    num2 += 15;
                    for (int i = 0; i < level.configData.Creators.Length; i++)
                    {
                        text  = text + "\n" + level.configData.Creators[i];
                        num2 += 15;
                    }
                }
                if (level.configData.Collaborators.Length > 0)
                {
                    if (text.Length > 0)
                    {
                        text += "\n\n";
                        num2 += 30;
                    }
                    text += MenuPlaySingleplayerUI.localization.format("Collaborators");
                    num2 += 15;
                    for (int j = 0; j < level.configData.Collaborators.Length; j++)
                    {
                        text  = text + "\n" + level.configData.Collaborators[j];
                        num2 += 15;
                    }
                }
                if (level.configData.Thanks.Length > 0)
                {
                    if (text.Length > 0)
                    {
                        text += "\n\n";
                        num2 += 30;
                    }
                    text += MenuPlaySingleplayerUI.localization.format("Thanks");
                    num2 += 15;
                    for (int k = 0; k < level.configData.Thanks.Length; k++)
                    {
                        text  = text + "\n" + level.configData.Thanks[k];
                        num2 += 15;
                    }
                }
                num2 = Mathf.Max(num2, 40);
                MenuPlaySingleplayerUI.creditsBox.sizeOffset_Y = num2;
                MenuPlaySingleplayerUI.creditsBox.text         = text;
                MenuPlaySingleplayerUI.creditsBox.isVisible    = true;
                num += num2 + 10;
            }
            else
            {
                MenuPlaySingleplayerUI.creditsBox.isVisible = false;
            }
            if (level.configData.Item != 0)
            {
                MenuPlaySingleplayerUI.itemButton.positionOffset_Y = num;
                MenuPlaySingleplayerUI.itemButton.text             = MenuPlaySingleplayerUI.localization.format("Credits_Text", new object[]
                {
                    MenuPlaySingleplayerUI.selectedBox.text,
                    string.Concat(new string[]
                    {
                        "<color=",
                        Palette.hex(Provider.provider.economyService.getInventoryColor(level.configData.Item)),
                        ">",
                        Provider.provider.economyService.getInventoryName(level.configData.Item),
                        "</color>"
                    })
                });
                MenuPlaySingleplayerUI.itemButton.tooltip   = MenuPlaySingleplayerUI.localization.format("Credits_Tooltip");
                MenuPlaySingleplayerUI.itemButton.isVisible = true;
                num += MenuPlaySingleplayerUI.itemButton.sizeOffset_Y + 10;
            }
            else
            {
                MenuPlaySingleplayerUI.itemButton.isVisible = false;
            }
            if (!string.IsNullOrEmpty(level.configData.Feedback))
            {
                MenuPlaySingleplayerUI.feedbackButton.positionOffset_Y = num;
                MenuPlaySingleplayerUI.feedbackButton.isVisible        = true;
                num += MenuPlaySingleplayerUI.feedbackButton.sizeOffset_Y + 10;
            }
            else
            {
                MenuPlaySingleplayerUI.feedbackButton.isVisible = false;
            }
            if (level.configData.Category == ESingleplayerMapCategory.CURATED && level.configData.CuratedMapMode == ECuratedMapMode.TIMED)
            {
                MenuPlaySingleplayerUI.timedBox.positionOffset_Y = num;
                MenuPlaySingleplayerUI.timedBox.text             = MenuPlaySingleplayerUI.localization.format("Timed_Text", new object[]
                {
                    MenuPlaySingleplayerUI.localization.format("Curated_Map_Timestamp", new object[]
                    {
                        level.configData.getCuratedMapTimestamp().ToString(MenuPlaySingleplayerUI.localization.format("Curated_Map_Timestamp_Format"))
                    })
                });
                MenuPlaySingleplayerUI.timedBox.isVisible = true;
                num += MenuPlaySingleplayerUI.timedBox.sizeOffset_Y + 10;
            }
            else
            {
                MenuPlaySingleplayerUI.timedBox.isVisible = false;
            }
        }
        private static void updateSelection()
        {
            if (PlaySettings.singleplayerMap == null || PlaySettings.singleplayerMap.Length == 0)
            {
                return;
            }
            LevelInfo level = Level.getLevel(PlaySettings.singleplayerMap);

            if (level == null)
            {
                return;
            }
            Local local = Localization.tryRead(level.path, false);

            if (local != null)
            {
                MenuPlaySingleplayerUI.descriptionBox.text = local.format("Description");
            }
            if (local != null && local.has("Name"))
            {
                MenuPlaySingleplayerUI.selectedBox.text = local.format("Name");
            }
            else
            {
                MenuPlaySingleplayerUI.selectedBox.text = PlaySettings.singleplayerMap;
            }
            if (MenuPlaySingleplayerUI.previewImage.texture != null && MenuPlaySingleplayerUI.previewImage.shouldDestroyTexture)
            {
                Object.Destroy(MenuPlaySingleplayerUI.previewImage.texture);
                MenuPlaySingleplayerUI.previewImage.texture = null;
            }
            string path = level.path + "/Preview.png";

            if (!ReadWrite.fileExists(path, false, false))
            {
                path = level.path + "/Level.png";
            }
            if (ReadWrite.fileExists(path, false, false))
            {
                byte[]    array     = ReadWrite.readBytes(path, false, false);
                Texture2D texture2D = new Texture2D(320, 180, 5, false, true);
                texture2D.name       = "Preview_" + PlaySettings.singleplayerMap + "_Selected_Icon";
                texture2D.filterMode = 2;
                texture2D.hideFlags  = 61;
                texture2D.LoadImage(array);
                MenuPlaySingleplayerUI.previewImage.texture = texture2D;
            }
            if (level.configData.Creators.Length > 0 || level.configData.Collaborators.Length > 0 || level.configData.Thanks.Length > 0)
            {
                int    num  = 0;
                string text = string.Empty;
                if (level.configData.Creators.Length > 0)
                {
                    text += MenuPlaySingleplayerUI.localization.format("Creators");
                    num  += 15;
                    for (int i = 0; i < level.configData.Creators.Length; i++)
                    {
                        text = text + "\n" + level.configData.Creators[i];
                        num += 15;
                    }
                }
                if (level.configData.Collaborators.Length > 0)
                {
                    if (text.Length > 0)
                    {
                        text += "\n\n";
                        num  += 30;
                    }
                    text += MenuPlaySingleplayerUI.localization.format("Collaborators");
                    num  += 15;
                    for (int j = 0; j < level.configData.Collaborators.Length; j++)
                    {
                        text = text + "\n" + level.configData.Collaborators[j];
                        num += 15;
                    }
                }
                if (level.configData.Thanks.Length > 0)
                {
                    if (text.Length > 0)
                    {
                        text += "\n\n";
                        num  += 30;
                    }
                    text += MenuPlaySingleplayerUI.localization.format("Thanks");
                    num  += 15;
                    for (int k = 0; k < level.configData.Thanks.Length; k++)
                    {
                        text = text + "\n" + level.configData.Thanks[k];
                        num += 15;
                    }
                }
                MenuPlaySingleplayerUI.creditsBox.sizeOffset_Y = num;
                MenuPlaySingleplayerUI.creditsBox.text         = text;
                MenuPlaySingleplayerUI.creditsBox.isVisible    = true;
            }
            else
            {
                MenuPlaySingleplayerUI.creditsBox.isVisible = false;
            }
            if (level.configData.Item != 0)
            {
                MenuPlaySingleplayerUI.itemButton.positionOffset_Y = MenuPlaySingleplayerUI.creditsBox.positionOffset_Y;
                if (MenuPlaySingleplayerUI.creditsBox.isVisible)
                {
                    MenuPlaySingleplayerUI.itemButton.positionOffset_Y += MenuPlaySingleplayerUI.creditsBox.sizeOffset_Y + 10;
                }
                MenuPlaySingleplayerUI.itemButton.text = MenuPlaySingleplayerUI.localization.format("Credits_Text", new object[]
                {
                    MenuPlaySingleplayerUI.selectedBox.text,
                    string.Concat(new string[]
                    {
                        "<color=",
                        Palette.hex(Provider.provider.economyService.getInventoryColor(level.configData.Item)),
                        ">",
                        Provider.provider.economyService.getInventoryName(level.configData.Item),
                        "</color>"
                    })
                });
                MenuPlaySingleplayerUI.itemButton.tooltip   = MenuPlaySingleplayerUI.localization.format("Credits_Tooltip");
                MenuPlaySingleplayerUI.itemButton.isVisible = true;
            }
            else
            {
                MenuPlaySingleplayerUI.itemButton.isVisible = false;
            }
            if (!string.IsNullOrEmpty(level.configData.Feedback))
            {
                MenuPlaySingleplayerUI.feedbackButton.positionOffset_Y = MenuPlaySingleplayerUI.creditsBox.positionOffset_Y;
                if (MenuPlaySingleplayerUI.creditsBox.isVisible)
                {
                    MenuPlaySingleplayerUI.feedbackButton.positionOffset_Y += MenuPlaySingleplayerUI.creditsBox.sizeOffset_Y + 10;
                }
                if (MenuPlaySingleplayerUI.itemButton.isVisible)
                {
                    MenuPlaySingleplayerUI.feedbackButton.positionOffset_Y += MenuPlaySingleplayerUI.itemButton.sizeOffset_Y + 10;
                }
                MenuPlaySingleplayerUI.feedbackButton.isVisible = true;
            }
            else
            {
                MenuPlaySingleplayerUI.feedbackButton.isVisible = false;
            }
        }
 // Token: 0x06003739 RID: 14137 RVA: 0x00180E98 File Offset: 0x0017F298
 public static void viewItem(int newItem, ulong newInstance, EDeleteMode newMode, ulong newInstigator)
 {
     MenuSurvivorsClothingDeleteUI.item              = newItem;
     MenuSurvivorsClothingDeleteUI.instance          = newInstance;
     MenuSurvivorsClothingDeleteUI.mode              = newMode;
     MenuSurvivorsClothingDeleteUI.instigator        = newInstigator;
     MenuSurvivorsClothingDeleteUI.yesButton.tooltip = MenuSurvivorsClothingDeleteUI.localization.format((MenuSurvivorsClothingDeleteUI.mode != EDeleteMode.SALVAGE) ? ((MenuSurvivorsClothingDeleteUI.mode != EDeleteMode.TAG_TOOL) ? "Yes_Delete_Tooltip" : "Yes_Tag_Tool_Tooltip") : "Yes_Salvage_Tooltip");
     if (MenuSurvivorsClothingDeleteUI.mode == EDeleteMode.TAG_TOOL)
     {
         int inventoryItem = Provider.provider.economyService.getInventoryItem(MenuSurvivorsClothingDeleteUI.instigator);
         MenuSurvivorsClothingDeleteUI.intentLabel.text = MenuSurvivorsClothingDeleteUI.localization.format("Intent_Tag_Tool", new object[]
         {
             string.Concat(new string[]
             {
                 "<color=",
                 Palette.hex(Provider.provider.economyService.getInventoryColor(inventoryItem)),
                 ">",
                 Provider.provider.economyService.getInventoryName(inventoryItem),
                 "</color>"
             }),
             string.Concat(new string[]
             {
                 "<color=",
                 Palette.hex(Provider.provider.economyService.getInventoryColor(MenuSurvivorsClothingDeleteUI.item)),
                 ">",
                 Provider.provider.economyService.getInventoryName(MenuSurvivorsClothingDeleteUI.item),
                 "</color>"
             })
         });
     }
     else
     {
         MenuSurvivorsClothingDeleteUI.intentLabel.text = MenuSurvivorsClothingDeleteUI.localization.format((MenuSurvivorsClothingDeleteUI.mode != EDeleteMode.SALVAGE) ? "Intent_Delete" : "Intent_Salvage", new object[]
         {
             string.Concat(new string[]
             {
                 "<color=",
                 Palette.hex(Provider.provider.economyService.getInventoryColor(MenuSurvivorsClothingDeleteUI.item)),
                 ">",
                 Provider.provider.economyService.getInventoryName(MenuSurvivorsClothingDeleteUI.item),
                 "</color>"
             })
         });
     }
     MenuSurvivorsClothingDeleteUI.confirmLabel.text = MenuSurvivorsClothingDeleteUI.localization.format("Confirm", new object[]
     {
         MenuSurvivorsClothingDeleteUI.localization.format((MenuSurvivorsClothingDeleteUI.mode != EDeleteMode.SALVAGE) ? "Delete" : "Salvage")
     });
     MenuSurvivorsClothingDeleteUI.confirmLabel.isVisible = (MenuSurvivorsClothingDeleteUI.mode != EDeleteMode.TAG_TOOL);
     MenuSurvivorsClothingDeleteUI.confirmField.hint      = MenuSurvivorsClothingDeleteUI.localization.format((MenuSurvivorsClothingDeleteUI.mode != EDeleteMode.SALVAGE) ? "Delete" : "Salvage");
     MenuSurvivorsClothingDeleteUI.confirmField.text      = string.Empty;
     MenuSurvivorsClothingDeleteUI.confirmField.isVisible = (MenuSurvivorsClothingDeleteUI.mode != EDeleteMode.TAG_TOOL);
     if (MenuSurvivorsClothingDeleteUI.mode == EDeleteMode.TAG_TOOL)
     {
         MenuSurvivorsClothingDeleteUI.yesButton.positionOffset_X = -65;
         MenuSurvivorsClothingDeleteUI.yesButton.positionScale_X  = 0.5f;
         MenuSurvivorsClothingDeleteUI.noButton.positionOffset_X  = 5;
         MenuSurvivorsClothingDeleteUI.noButton.positionScale_X   = 0.5f;
     }
     else
     {
         MenuSurvivorsClothingDeleteUI.yesButton.positionOffset_X = -135;
         MenuSurvivorsClothingDeleteUI.yesButton.positionScale_X  = 1f;
         MenuSurvivorsClothingDeleteUI.noButton.positionOffset_X  = -65;
         MenuSurvivorsClothingDeleteUI.noButton.positionScale_X   = 1f;
     }
 }