// Token: 0x06002845 RID: 10309 RVA: 0x000F3DC0 File Offset: 0x000F21C0 private void spawnItem(byte x, byte y, ushort id, byte amount, byte quality, byte[] state, Vector3 point, uint instanceID) { ItemAsset itemAsset = (ItemAsset)Assets.find(EAssetType.ITEM, id); if (itemAsset != null) { Transform transform = new GameObject().transform; transform.name = id.ToString(); transform.transform.parent = LevelItems.models; transform.transform.position = point; Transform item = ItemTool.getItem(id, 0, quality, state, false, itemAsset, null); item.parent = transform; InteractableItem interactableItem = item.gameObject.AddComponent <InteractableItem>(); interactableItem.item = new Item(id, amount, quality, state); interactableItem.asset = itemAsset; item.position = point + Vector3.up * 0.75f; item.rotation = Quaternion.Euler((float)(-90 + UnityEngine.Random.Range(-15, 15)), (float)UnityEngine.Random.Range(0, 360), (float)UnityEngine.Random.Range(-15, 15)); item.gameObject.AddComponent <Rigidbody>(); item.GetComponent <Rigidbody>().interpolation = RigidbodyInterpolation.Interpolate; item.GetComponent <Rigidbody>().collisionDetectionMode = CollisionDetectionMode.Discrete; item.GetComponent <Rigidbody>().drag = 0.5f; item.GetComponent <Rigidbody>().angularDrag = 0.1f; if (LevelObjects.loads[(int)x, (int)y] != -1) { item.GetComponent <Rigidbody>().useGravity = false; item.GetComponent <Rigidbody>().isKinematic = true; } ItemDrop item2 = new ItemDrop(transform, interactableItem, instanceID); ItemManager.regions[(int)x, (int)y].drops.Add(item2); if (ItemManager.onItemDropAdded != null) { ItemManager.onItemDropAdded(item, interactableItem); } } }
// Token: 0x06001BB8 RID: 7096 RVA: 0x000984B0 File Offset: 0x000968B0 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)); }
// 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); } } }
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); }
// 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); }
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)); }
// Token: 0x06001BCD RID: 7117 RVA: 0x00098A08 File Offset: 0x00096E08 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)); }
// 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; } }
public static Transform getItem(ushort id, ushort skin, byte quality, byte[] state, bool viewmodel, ItemAsset itemAsset) { SkinAsset skinAsset = null; if (skin != 0) { skinAsset = (SkinAsset)Assets.find(EAssetType.SKIN, skin); } return(ItemTool.getItem(id, skin, quality, state, viewmodel, itemAsset, skinAsset)); }
// Token: 0x06003421 RID: 13345 RVA: 0x00153B70 File Offset: 0x00151F70 public static Transform getItem(ushort id, ushort skin, byte quality, byte[] state, bool viewmodel, ItemAsset itemAsset, List <Mesh> outTempMeshes, out Material tempMaterial, GetStatTrackerValueHandler statTrackerCallback) { SkinAsset skinAsset = null; if (skin != 0) { skinAsset = (SkinAsset)Assets.find(EAssetType.SKIN, skin); } return(ItemTool.getItem(id, skin, quality, state, viewmodel, itemAsset, skinAsset, outTempMeshes, out tempMaterial, statTrackerCallback)); }
public override Sleek createUI(Player player) { string text = this.formatReward(player); if (string.IsNullOrEmpty(text)) { return(null); } ItemAsset itemAsset = (ItemAsset)Assets.find(EAssetType.ITEM, this.id); if (itemAsset == null) { return(null); } SleekBox sleekBox = new SleekBox(); if (itemAsset.size_y == 1) { sleekBox.sizeOffset_Y = (int)(itemAsset.size_y * 50 + 10); } else { sleekBox.sizeOffset_Y = (int)(itemAsset.size_y * 25 + 10); } sleekBox.sizeScale_X = 1f; SleekImageTexture sleekImageTexture = new SleekImageTexture(); sleekImageTexture.positionOffset_X = 5; sleekImageTexture.positionOffset_Y = 5; if (itemAsset.size_y == 1) { sleekImageTexture.sizeOffset_X = (int)(itemAsset.size_x * 50); sleekImageTexture.sizeOffset_Y = (int)(itemAsset.size_y * 50); } else { sleekImageTexture.sizeOffset_X = (int)(itemAsset.size_x * 25); sleekImageTexture.sizeOffset_Y = (int)(itemAsset.size_y * 25); } sleekBox.add(sleekImageTexture); ItemTool.getIcon(this.id, 100, itemAsset.getState(false), itemAsset, sleekImageTexture.sizeOffset_X, sleekImageTexture.sizeOffset_Y, new ItemIconReady(sleekImageTexture.updateTexture)); sleekBox.add(new SleekLabel { positionOffset_X = 10 + sleekImageTexture.sizeOffset_X, sizeOffset_X = -15 - sleekImageTexture.sizeOffset_X, sizeScale_X = 1f, sizeScale_Y = 1f, fontAlignment = 3, foregroundTint = ESleekTint.NONE, isRich = true, text = text }); return(sleekBox); }
// 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"); } }
public static void getIcon(ushort id, byte quality, byte[] state, ItemAsset itemAsset, int x, int y, ItemIconReady callback) { ushort num = 0; SkinAsset skinAsset = null; int num2; if (Player.player != null && Player.player.channel.owner.skins.TryGetValue(id, out num2) && num2 != 0) { num = Provider.provider.economyService.getInventorySkinID(num2); skinAsset = (SkinAsset)Assets.find(EAssetType.SKIN, num); } ItemTool.getIcon(id, num, quality, state, itemAsset, skinAsset, x, y, false, callback); }
public static void applyEffect(Transform[] bones, Transform[] systems, ushort mythicID, EEffectType type) { if (mythicID == 0) { return; } if (bones == null || systems == null) { return; } for (int i = 0; i < bones.Length; i++) { systems[i] = ItemTool.applyEffect(bones[i], mythicID, type); } }
// 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(); }
// Token: 0x06003428 RID: 13352 RVA: 0x00154140 File Offset: 0x00152540 public static void getIcon(ushort id, byte quality, byte[] state, ItemAsset itemAsset, int x, int y, ItemIconReady callback) { ushort num = 0; SkinAsset skinAsset = null; string empty = string.Empty; string empty2 = string.Empty; int num2; if (Player.player != null && Player.player.channel.owner.getItemSkinItemDefID(id, out num2) && num2 != 0) { num = Provider.provider.economyService.getInventorySkinID(num2); skinAsset = (SkinAsset)Assets.find(EAssetType.SKIN, num); Player.player.channel.owner.getTagsAndDynamicPropsForItem(num2, out empty, out empty2); } ItemTool.getIcon(id, num, quality, state, itemAsset, skinAsset, empty, empty2, x, y, false, callback); }
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(); }
// Token: 0x06003975 RID: 14709 RVA: 0x001AA7D8 File Offset: 0x001A8BD8 public override void tock(uint clock) { if (!this.isStrengthening) { return; } this.strengthTime += 1u; uint num = (uint)(100 + base.player.skills.skills[2][4].level * 20); this.strengthMultiplier = 1f - Mathf.Abs(Mathf.Sin((this.strengthTime + num / 2u) % num / num * 3.14159274f)); this.strengthMultiplier *= this.strengthMultiplier; if (base.channel.isOwner && this.castStrengthBar != null) { this.castStrengthBar.positionScale_Y = 1f - this.strengthMultiplier; this.castStrengthBar.sizeScale_Y = this.strengthMultiplier; this.castStrengthBar.backgroundColor = ItemTool.getQualityColor(this.strengthMultiplier); } }
public static Transform applyEffect(Transform model, ushort mythicID, EEffectType type) { if (mythicID == 0) { return(null); } if (model == null) { return(null); } Transform transform = model.FindChild("Effect"); Transform effectSystem = ItemTool.getEffectSystem(mythicID, type); if (effectSystem != null) { if (transform != null) { effectSystem.parent = transform; MythicLockee mythicLockee = effectSystem.gameObject.AddComponent <MythicLockee>(); MythicLocker mythicLocker = transform.gameObject.AddComponent <MythicLocker>(); mythicLocker.system = mythicLockee; mythicLockee.locker = mythicLocker; } else { effectSystem.parent = model; MythicLockee mythicLockee2 = effectSystem.gameObject.AddComponent <MythicLockee>(); MythicLocker mythicLocker2 = model.gameObject.AddComponent <MythicLocker>(); mythicLocker2.system = mythicLockee2; mythicLockee2.locker = mythicLocker2; } effectSystem.localPosition = Vector3.zero; effectSystem.localRotation = Quaternion.identity; } return(effectSystem); }
public virtual void refreshDisplay() { if (this.displayModel != null) { Object.Destroy(this.displayModel.gameObject); this.displayModel = null; this.displayAsset = null; } if (this.displayItem == null) { return; } if (this.gunLargeTransform == null || this.gunSmallTransform == null || this.meleeTransform == null || this.itemTransform == null) { return; } this.displayAsset = (ItemAsset)Assets.find(EAssetType.ITEM, this.displayItem.id); if (this.displayAsset == null) { return; } if (this.displaySkin != 0) { if ((SkinAsset)Assets.find(EAssetType.SKIN, this.displaySkin) == null) { return; } this.displayModel = ItemTool.getItem(this.displayItem.id, this.displaySkin, this.displayItem.quality, this.displayItem.state, false); if (this.displayMythic != 0) { ItemTool.applyEffect(this.displayModel, this.displayMythic, EEffectType.THIRD); } } else { this.displayModel = ItemTool.getItem(this.displayItem.id, 0, this.displayItem.quality, this.displayItem.state, false); if (this.displayMythic != 0) { ItemTool.applyEffect(this.displayModel, this.displayMythic, EEffectType.HOOK); } } if (this.displayModel == null) { return; } if (this.displayAsset.type == EItemType.GUN) { if (this.displayAsset.slot == ESlotType.PRIMARY) { this.displayModel.parent = this.gunLargeTransform; } else { this.displayModel.parent = this.gunSmallTransform; } } else if (this.displayAsset.type == EItemType.MELEE) { this.displayModel.parent = this.meleeTransform; } else { this.displayModel.parent = this.itemTransform; } this.displayModel.localPosition = Vector3.zero; this.displayModel.localRotation = this.displayRotation; this.displayModel.localScale = Vector3.one; Object.Destroy(this.displayModel.GetComponent <Collider>()); }
// 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"); } }
// Token: 0x06002168 RID: 8552 RVA: 0x000B5FB4 File Offset: 0x000B43B4 public override void updateState(Asset asset, byte[] state) { base.updateState(asset, state); if (!this.isInit) { this.isInit = true; this._npcAsset = (asset as ObjectNPCAsset); if (!Dedicator.isDedicated) { Transform transform = base.transform.FindChild("Root"); Transform transform2 = transform.FindChild("Skeleton"); this.skull = transform2.FindChild("Spine").FindChild("Skull"); this.anim = transform.GetComponent <Animation>(); this.humanAnim = transform.GetComponent <HumanAnimator>(); transform.localScale = new Vector3((float)((!this.npcAsset.isBackward) ? 1 : -1), 1f, 1f); ItemAsset itemAsset = (ItemAsset)Assets.find(EAssetType.ITEM, this.npcAsset.primary); ItemAsset itemAsset2 = (ItemAsset)Assets.find(EAssetType.ITEM, this.npcAsset.secondary); ItemAsset itemAsset3 = (ItemAsset)Assets.find(EAssetType.ITEM, this.npcAsset.tertiary); ItemAsset itemAsset4 = null; Transform parent = transform2.FindChild("Spine").FindChild("Primary_Melee"); Transform parent2 = transform2.FindChild("Spine").FindChild("Primary_Large_Gun"); Transform parent3 = transform2.FindChild("Spine").FindChild("Primary_Small_Gun"); Transform parent4 = transform2.FindChild("Right_Hip").FindChild("Right_Leg").FindChild("Secondary_Melee"); Transform parent5 = transform2.FindChild("Right_Hip").FindChild("Right_Leg").FindChild("Secondary_Gun"); Transform parent6 = transform2.FindChild("Spine").FindChild("Left_Shoulder").FindChild("Left_Arm").FindChild("Left_Hand").FindChild("Left_Hook"); Transform parent7 = transform2.FindChild("Spine").FindChild("Right_Shoulder").FindChild("Right_Arm").FindChild("Right_Hand").FindChild("Right_Hook"); this.clothes = transform.GetComponent <HumanClothes>(); this.clothes.shirt = this.npcAsset.shirt; this.clothes.pants = this.npcAsset.pants; this.clothes.hat = this.npcAsset.hat; this.clothes.backpack = this.npcAsset.backpack; this.clothes.vest = this.npcAsset.vest; this.clothes.mask = this.npcAsset.mask; this.clothes.glasses = this.npcAsset.glasses; this.clothes.face = this.npcAsset.face; this.clothes.hair = this.npcAsset.hair; this.clothes.beard = this.npcAsset.beard; this.clothes.skin = this.npcAsset.skin; this.clothes.color = this.npcAsset.color; this.clothes.apply(); if (this.npcAsset.primary != 0 && itemAsset != null) { Material material; Transform item = ItemTool.getItem(itemAsset.id, 0, 100, itemAsset.getState(), false, itemAsset, null, out material, null); if (this.npcAsset.equipped == ESlotType.PRIMARY) { if (itemAsset.isBackward) { item.transform.parent = parent6; } else { item.transform.parent = parent7; } itemAsset4 = itemAsset; } else if (itemAsset.type == EItemType.MELEE) { item.transform.parent = parent; } else if (itemAsset.slot == ESlotType.PRIMARY) { item.transform.parent = parent2; } else { item.transform.parent = parent3; } item.localPosition = Vector3.zero; item.localRotation = Quaternion.Euler(0f, 0f, 90f); item.localScale = Vector3.one; UnityEngine.Object.Destroy(item.GetComponent <Collider>()); Layerer.enemy(item); } if (this.npcAsset.secondary != 0 && itemAsset2 != null) { Material material2; Transform item2 = ItemTool.getItem(itemAsset2.id, 0, 100, itemAsset2.getState(), false, itemAsset2, null, out material2, null); if (this.npcAsset.equipped == ESlotType.SECONDARY) { if (itemAsset2.isBackward) { item2.transform.parent = parent6; } else { item2.transform.parent = parent7; } itemAsset4 = itemAsset2; } else if (itemAsset2.type == EItemType.MELEE) { item2.transform.parent = parent4; } else { item2.transform.parent = parent5; } item2.localPosition = Vector3.zero; item2.localRotation = Quaternion.Euler(0f, 0f, 90f); item2.localScale = Vector3.one; UnityEngine.Object.Destroy(item2.GetComponent <Collider>()); Layerer.enemy(item2); } if (this.npcAsset.tertiary != 0 && itemAsset3 != null && this.npcAsset.equipped == ESlotType.TERTIARY) { Material material3; Transform item3 = ItemTool.getItem(itemAsset3.id, 0, 100, itemAsset3.getState(), false, itemAsset3, null, out material3, null); if (itemAsset3.isBackward) { item3.transform.parent = parent6; } else { item3.transform.parent = parent7; } itemAsset4 = itemAsset3; item3.localPosition = Vector3.zero; item3.localRotation = Quaternion.Euler(0f, 0f, 90f); item3.localScale = Vector3.one; UnityEngine.Object.Destroy(item3.GetComponent <Collider>()); Layerer.enemy(item3); } if (itemAsset4 != null) { Transform mix = transform2.FindChild("Spine").FindChild("Left_Shoulder"); Transform mix2 = transform2.FindChild("Spine").FindChild("Right_Shoulder"); int i = 0; while (i < itemAsset4.animations.Length) { AnimationClip animationClip = itemAsset4.animations[i]; if (animationClip.name == "Equip") { this.hasEquip = true; goto IL_683; } if (animationClip.name == "Sprint_Start" || animationClip.name == "Sprint_Stop") { this.hasSafety = true; goto IL_683; } if (animationClip.name == "Inspect") { this.hasInspect = true; goto IL_683; } IL_6E3: i++; continue; IL_683: this.anim.AddClip(animationClip, animationClip.name); this.anim[animationClip.name].AddMixingTransform(mix, true); this.anim[animationClip.name].AddMixingTransform(mix2, true); this.anim[animationClip.name].layer = 1; goto IL_6E3; } } this.anim["Idle_Kick_Left"].AddMixingTransform(transform2.FindChild("Left_Hip"), true); this.anim["Idle_Kick_Left"].layer = 2; this.anim["Idle_Kick_Right"].AddMixingTransform(transform2.FindChild("Right_Hip"), true); this.anim["Idle_Kick_Right"].layer = 2; this.updateAnimation(); } } }
protected override void execute(CSteamID executorID, string parameter) { if (!Provider.isServer) { CommandWindow.LogError(this.localization.format("NotRunningErrorText")); return; } if (!Provider.hasCheats) { CommandWindow.LogError(this.localization.format("CheatsErrorText")); return; } string[] componentsFromSerial = Parser.getComponentsFromSerial(parameter, '/'); if (componentsFromSerial.Length < 1 || componentsFromSerial.Length > 3) { CommandWindow.LogError(this.localization.format("InvalidParameterErrorText")); return; } bool flag = false; SteamPlayer steamPlayer; if (!PlayerTool.tryGetSteamPlayer(componentsFromSerial[0], out steamPlayer)) { steamPlayer = PlayerTool.getSteamPlayer(executorID); if (steamPlayer == null) { CommandWindow.LogError(this.localization.format("NoPlayerErrorText", new object[] { componentsFromSerial[0] })); return; } flag = true; } ushort num; if (!ushort.TryParse(componentsFromSerial[(!flag) ? 1 : 0], out num)) { CommandWindow.LogError(this.localization.format("InvalidItemIDErrorText", new object[] { componentsFromSerial[(!flag) ? 1 : 0] })); return; } byte b = 1; if (flag) { if (componentsFromSerial.Length > 1 && !byte.TryParse(componentsFromSerial[1], out b)) { CommandWindow.LogError(this.localization.format("InvalidNumberErrorText", new object[] { componentsFromSerial[1] })); return; } } else if (componentsFromSerial.Length > 2 && !byte.TryParse(componentsFromSerial[2], out b)) { CommandWindow.LogError(this.localization.format("InvalidNumberErrorText", new object[] { componentsFromSerial[2] })); return; } if (!ItemTool.tryForceGiveItem(steamPlayer.player, num, b)) { CommandWindow.LogError(this.localization.format("NoItemIDErrorText", new object[] { num })); return; } CommandWindow.Log(this.localization.format("GiveText", new object[] { steamPlayer.playerID.playerName, num, b })); }
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(); }
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(); }
// Token: 0x06001C8F RID: 7311 RVA: 0x0009B100 File Offset: 0x00099500 public ResourceAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id) { if (id < 50 && !bundle.hasResource && !data.has("Bypass_ID_Limit")) { throw new NotSupportedException("ID < 50"); } if (Dedicator.isDedicated || GraphicsSettings.treeMode == ETreeGraphicMode.LEGACY) { this.isSpeedTree = false; } else { this.isSpeedTree = data.has("SpeedTree"); } this.defaultLODWeights = data.has("SpeedTree_Default_LOD_Weights"); this._resourceName = localization.format("Name"); if (Dedicator.isDedicated) { this._modelGameObject = (GameObject)bundle.load("Resource_Clip"); if (this.modelGameObject == null) { Assets.errors.Add(this.resourceName + " is missing collision data. Highly recommended to fix."); } this._stumpGameObject = (GameObject)bundle.load("Stump_Clip"); if (this.stumpGameObject == null) { Assets.errors.Add(this.resourceName + " is missing collision data. Highly recommended to fix."); } } else { this._modelGameObject = null; this._stumpGameObject = null; this._skyboxGameObject = null; this._debrisGameObject = null; if (GraphicsSettings.treeMode == ETreeGraphicMode.LEGACY) { this._modelGameObject = (GameObject)bundle.load("Resource_Old"); } if (this._modelGameObject == null) { this._modelGameObject = (GameObject)bundle.load("Resource"); } if (this.defaultLODWeights) { Transform transform = this.modelGameObject.transform.FindChild("Billboard"); if (transform != null) { BillboardRenderer component = transform.GetComponent <BillboardRenderer>(); if (component != null) { component.shadowCastingMode = ShadowCastingMode.Off; } } } if (GraphicsSettings.treeMode == ETreeGraphicMode.LEGACY) { this._stumpGameObject = (GameObject)bundle.load("Stump_Old"); } if (this._stumpGameObject == null) { this._stumpGameObject = (GameObject)bundle.load("Stump"); } if (GraphicsSettings.treeMode == ETreeGraphicMode.LEGACY) { this._skyboxGameObject = (GameObject)bundle.load("Skybox_Old"); } if (this._skyboxGameObject == null) { this._skyboxGameObject = (GameObject)bundle.load("Skybox"); } if (this.defaultLODWeights) { Transform transform2 = this.skyboxGameObject.transform.FindChild("Model_0"); if (transform2 != null) { BillboardRenderer component2 = transform2.GetComponent <BillboardRenderer>(); if (component2 != null) { component2.shadowCastingMode = ShadowCastingMode.Off; } } } if (this.isSpeedTree) { this._debrisGameObject = (GameObject)bundle.load("Debris"); if (this.modelGameObject != null) { LODGroup component3 = this.modelGameObject.GetComponent <LODGroup>(); if (component3 != null) { if (GraphicsSettings.treeMode == ETreeGraphicMode.SPEEDTREE_FADE_SPEEDTREE) { component3.fadeMode = LODFadeMode.SpeedTree; if (this.defaultLODWeights && GraphicsSettings.treeMode != ETreeGraphicMode.LEGACY) { this.applyDefaultLODs(component3, true); } } else { component3.fadeMode = LODFadeMode.None; if (this.defaultLODWeights && GraphicsSettings.treeMode != ETreeGraphicMode.LEGACY) { this.applyDefaultLODs(component3, false); } } } } if (this.debrisGameObject != null) { LODGroup component4 = this.debrisGameObject.GetComponent <LODGroup>(); if (component4 != null) { if (GraphicsSettings.treeMode == ETreeGraphicMode.SPEEDTREE_FADE_SPEEDTREE) { component4.fadeMode = LODFadeMode.SpeedTree; if (this.defaultLODWeights && GraphicsSettings.treeMode != ETreeGraphicMode.LEGACY) { this.applyDefaultLODs(component4, true); } } else { component4.fadeMode = LODFadeMode.None; if (this.defaultLODWeights && GraphicsSettings.treeMode != ETreeGraphicMode.LEGACY) { this.applyDefaultLODs(component4, false); } } } } } if (data.has("Auto_Skybox") && !this.isSpeedTree && this.skyboxGameObject) { Transform transform3 = this.modelGameObject.transform.FindChild("Model_0"); if (transform3) { ResourceAsset.meshes.Clear(); transform3.GetComponentsInChildren <MeshFilter>(true, ResourceAsset.meshes); if (ResourceAsset.meshes.Count > 0) { Bounds bounds = default(Bounds); for (int i = 0; i < ResourceAsset.meshes.Count; i++) { Mesh sharedMesh = ResourceAsset.meshes[i].sharedMesh; if (!(sharedMesh == null)) { Bounds bounds2 = sharedMesh.bounds; bounds.Encapsulate(bounds2.min); bounds.Encapsulate(bounds2.max); } } if (bounds.min.y < 0f) { float num = Mathf.Abs(bounds.min.z); bounds.center += new Vector3(0f, 0f, num / 2f); bounds.size -= new Vector3(0f, 0f, num); } float num2 = Mathf.Max(bounds.size.x, bounds.size.y); float z = bounds.size.z; this.skyboxGameObject.transform.localScale = new Vector3(z, z, z); Transform transform4 = UnityEngine.Object.Instantiate <GameObject>(this.modelGameObject).transform; Transform transform5 = new GameObject().transform; transform5.parent = transform4; transform5.localPosition = new Vector3(0f, z / 2f, -num2 / 2f); transform5.localRotation = Quaternion.identity; Transform transform6 = new GameObject().transform; transform6.parent = transform4; transform6.localPosition = new Vector3(-num2 / 2f, z / 2f, 0f); transform6.localRotation = Quaternion.Euler(0f, 90f, 0f); if (!ResourceAsset.shader) { ResourceAsset.shader = Shader.Find("Custom/Card"); } Texture2D card = ItemTool.getCard(transform4, transform5, transform6, 64, 64, z / 2f, num2); this.skyboxMaterial = new Material(ResourceAsset.shader); this.skyboxMaterial.mainTexture = card; } } } } this.health = data.readUInt16("Health"); this.radius = data.readSingle("Radius"); this.scale = data.readSingle("Scale"); this.explosion = data.readUInt16("Explosion"); this.log = data.readUInt16("Log"); this.stick = data.readUInt16("Stick"); this.rewardID = data.readUInt16("Reward_ID"); this.rewardXP = data.readUInt32("Reward_XP"); if (data.has("Reward_Min")) { this.rewardMin = data.readByte("Reward_Min"); } else { this.rewardMin = 6; } if (data.has("Reward_Max")) { this.rewardMax = data.readByte("Reward_Max"); } else { this.rewardMax = 9; } this.bladeID = data.readByte("BladeID"); this.reset = data.readSingle("Reset"); this.isForage = data.has("Forage"); this.hasDebris = !data.has("No_Debris"); bundle.unload(); }
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)); }
public override Sleek createUI(Player player, Texture2D icon) { string text = this.formatCondition(player); if (string.IsNullOrEmpty(text)) { return(null); } ItemAsset itemAsset = (ItemAsset)Assets.find(EAssetType.ITEM, this.id); if (itemAsset == null) { return(null); } SleekBox sleekBox = new SleekBox(); if (itemAsset.size_y == 1) { sleekBox.sizeOffset_Y = (int)(itemAsset.size_y * 50 + 10); } else { sleekBox.sizeOffset_Y = (int)(itemAsset.size_y * 25 + 10); } sleekBox.sizeScale_X = 1f; if (icon != null) { sleekBox.add(new SleekImageTexture(icon) { positionOffset_X = 5, positionOffset_Y = -10, positionScale_Y = 0.5f, sizeOffset_X = 20, sizeOffset_Y = 20 }); } SleekImageTexture sleekImageTexture = new SleekImageTexture(); if (icon != null) { sleekImageTexture.positionOffset_X = 30; } else { sleekImageTexture.positionOffset_X = 5; } sleekImageTexture.positionOffset_Y = 5; if (itemAsset.size_y == 1) { sleekImageTexture.sizeOffset_X = (int)(itemAsset.size_x * 50); sleekImageTexture.sizeOffset_Y = (int)(itemAsset.size_y * 50); } else { sleekImageTexture.sizeOffset_X = (int)(itemAsset.size_x * 25); sleekImageTexture.sizeOffset_Y = (int)(itemAsset.size_y * 25); } sleekBox.add(sleekImageTexture); ItemTool.getIcon(this.id, 100, itemAsset.getState(false), itemAsset, sleekImageTexture.sizeOffset_X, sleekImageTexture.sizeOffset_Y, new ItemIconReady(sleekImageTexture.updateTexture)); SleekLabel sleekLabel = new SleekLabel(); if (icon != null) { sleekLabel.positionOffset_X = 35 + sleekImageTexture.sizeOffset_X; sleekLabel.sizeOffset_X = -40 - sleekImageTexture.sizeOffset_X; } else { sleekLabel.positionOffset_X = 10 + sleekImageTexture.sizeOffset_X; sleekLabel.sizeOffset_X = -15 - sleekImageTexture.sizeOffset_X; } sleekLabel.sizeScale_X = 1f; sleekLabel.sizeScale_Y = 1f; sleekLabel.fontAlignment = 3; sleekLabel.foregroundTint = ESleekTint.NONE; sleekLabel.isRich = true; sleekLabel.text = text; sleekBox.add(sleekLabel); return(sleekBox); }
public SleekBlueprint(Blueprint newBlueprint) { this._blueprint = newBlueprint; base.init(); this.fontStyle = 1; this.fontAlignment = 4; this.fontSize = SleekRender.FONT_SIZE; this.calculateContent(); SleekLabel sleekLabel = new SleekLabel(); sleekLabel.positionOffset_X = 5; sleekLabel.positionOffset_Y = 5; sleekLabel.sizeOffset_X = -10; sleekLabel.sizeOffset_Y = 30; sleekLabel.sizeScale_X = 1f; sleekLabel.foregroundColor = ((!this.blueprint.hasSupplies || !this.blueprint.hasTool || !this.blueprint.hasItem || !this.blueprint.hasSkills) ? Palette.COLOR_R : Palette.COLOR_G); sleekLabel.foregroundTint = ESleekTint.NONE; sleekLabel.fontSize = 14; base.add(sleekLabel); if (this.blueprint.skill != EBlueprintSkill.NONE) { base.add(new SleekLabel { positionOffset_X = 5, positionOffset_Y = -35, positionScale_Y = 1f, sizeOffset_X = -10, sizeOffset_Y = 30, sizeScale_X = 1f, text = PlayerDashboardCraftingUI.localization.format("Skill_" + (int)this.blueprint.skill, new object[] { PlayerDashboardSkillsUI.localization.format("Level_" + this.blueprint.level) }), foregroundColor = ((!this.blueprint.hasSkills) ? Palette.COLOR_R : Palette.COLOR_G), foregroundTint = ESleekTint.NONE, fontSize = 14 }); } Sleek sleek = new Sleek(); sleek.positionOffset_Y = 40; sleek.positionScale_X = 0.5f; sleek.sizeOffset_Y = -45; sleek.sizeScale_Y = 1f; base.add(sleek); int num = 0; for (int i = 0; i < this.blueprint.supplies.Length; i++) { BlueprintSupply blueprintSupply = this.blueprint.supplies[i]; ItemAsset itemAsset = (ItemAsset)Assets.find(EAssetType.ITEM, blueprintSupply.id); if (itemAsset != null) { SleekLabel sleekLabel2 = sleekLabel; sleekLabel2.text += itemAsset.itemName; SleekImageTexture sleekImageTexture = new SleekImageTexture(); sleekImageTexture.positionOffset_X = num; sleekImageTexture.positionOffset_Y = (int)(-itemAsset.size_y * 25); sleekImageTexture.positionScale_Y = 0.5f; sleekImageTexture.sizeOffset_X = (int)(itemAsset.size_x * 50); sleekImageTexture.sizeOffset_Y = (int)(itemAsset.size_y * 50); sleek.add(sleekImageTexture); ItemTool.getIcon(blueprintSupply.id, 100, itemAsset.getState(false), itemAsset, new ItemIconReady(sleekImageTexture.updateTexture)); SleekLabel sleekLabel3 = new SleekLabel(); sleekLabel3.positionOffset_X = -100; sleekLabel3.positionOffset_Y = -30; sleekLabel3.positionScale_Y = 1f; sleekLabel3.sizeOffset_X = 100; sleekLabel3.sizeOffset_Y = 30; sleekLabel3.sizeScale_X = 1f; sleekLabel3.foregroundTint = ESleekTint.NONE; sleekLabel3.fontAlignment = 5; sleekLabel3.text = blueprintSupply.hasAmount + "/" + blueprintSupply.amount; sleekImageTexture.add(sleekLabel3); SleekLabel sleekLabel4 = sleekLabel; string text = sleekLabel4.text; sleekLabel4.text = string.Concat(new object[] { text, " ", blueprintSupply.hasAmount, "/", blueprintSupply.amount }); if (this.blueprint.type == EBlueprintType.AMMO) { if (blueprintSupply.hasAmount == 0 || blueprintSupply.amount == 0) { sleekLabel3.backgroundColor = Palette.COLOR_R; sleekLabel3.foregroundColor = Palette.COLOR_R; } } else if (blueprintSupply.hasAmount < blueprintSupply.amount) { sleekLabel3.backgroundColor = Palette.COLOR_R; sleekLabel3.foregroundColor = Palette.COLOR_R; } num += (int)(itemAsset.size_x * 50 + 25); if (i < this.blueprint.supplies.Length - 1 || this.blueprint.tool != 0 || this.blueprint.type == EBlueprintType.REPAIR || this.blueprint.type == EBlueprintType.AMMO) { SleekLabel sleekLabel5 = sleekLabel; sleekLabel5.text += " + "; sleek.add(new SleekImageTexture((Texture2D)PlayerDashboardCraftingUI.icons.load("Plus")) { positionOffset_X = num, positionOffset_Y = -20, positionScale_Y = 0.5f, sizeOffset_X = 40, sizeOffset_Y = 40, backgroundTint = ESleekTint.FOREGROUND }); num += 65; } } } if (this.blueprint.tool != 0) { ItemAsset itemAsset2 = (ItemAsset)Assets.find(EAssetType.ITEM, this.blueprint.tool); if (itemAsset2 != null) { SleekLabel sleekLabel6 = sleekLabel; sleekLabel6.text += itemAsset2.itemName; SleekImageTexture sleekImageTexture2 = new SleekImageTexture(); sleekImageTexture2.positionOffset_X = num; sleekImageTexture2.positionOffset_Y = (int)(-itemAsset2.size_y * 25); sleekImageTexture2.positionScale_Y = 0.5f; sleekImageTexture2.sizeOffset_X = (int)(itemAsset2.size_x * 50); sleekImageTexture2.sizeOffset_Y = (int)(itemAsset2.size_y * 50); sleek.add(sleekImageTexture2); ItemTool.getIcon(this.blueprint.tool, 100, itemAsset2.getState(), itemAsset2, new ItemIconReady(sleekImageTexture2.updateTexture)); SleekLabel sleekLabel7 = new SleekLabel(); sleekLabel7.positionOffset_X = -100; sleekLabel7.positionOffset_Y = -30; sleekLabel7.positionScale_Y = 1f; sleekLabel7.sizeOffset_X = 100; sleekLabel7.sizeOffset_Y = 30; sleekLabel7.sizeScale_X = 1f; sleekLabel7.foregroundTint = ESleekTint.NONE; sleekLabel7.fontAlignment = 5; sleekLabel7.text = this.blueprint.tools + "/1"; sleekImageTexture2.add(sleekLabel7); SleekLabel sleekLabel8 = sleekLabel; string text = sleekLabel8.text; sleekLabel8.text = string.Concat(new object[] { text, " ", this.blueprint.tools, "/1" }); if (!this.blueprint.hasTool) { sleekLabel7.backgroundColor = Palette.COLOR_R; sleekLabel7.foregroundColor = Palette.COLOR_R; } num += (int)(itemAsset2.size_x * 50 + 25); if (this.blueprint.type == EBlueprintType.REPAIR || this.blueprint.type == EBlueprintType.AMMO) { SleekLabel sleekLabel9 = sleekLabel; sleekLabel9.text += " + "; sleek.add(new SleekImageTexture((Texture2D)PlayerDashboardCraftingUI.icons.load("Plus")) { positionOffset_X = num, positionOffset_Y = -20, positionScale_Y = 0.5f, sizeOffset_X = 40, sizeOffset_Y = 40, backgroundTint = ESleekTint.FOREGROUND }); num += 65; } } } if (this.blueprint.type == EBlueprintType.REPAIR || this.blueprint.type == EBlueprintType.AMMO) { ItemAsset itemAsset3 = (ItemAsset)Assets.find(EAssetType.ITEM, this.blueprint.outputs[0].id); if (itemAsset3 != null) { SleekLabel sleekLabel10 = sleekLabel; sleekLabel10.text += itemAsset3.itemName; SleekImageTexture sleekImageTexture3 = new SleekImageTexture(); sleekImageTexture3.positionOffset_X = num; sleekImageTexture3.positionOffset_Y = (int)(-itemAsset3.size_y * 25); sleekImageTexture3.positionScale_Y = 0.5f; sleekImageTexture3.sizeOffset_X = (int)(itemAsset3.size_x * 50); sleekImageTexture3.sizeOffset_Y = (int)(itemAsset3.size_y * 50); sleek.add(sleekImageTexture3); ItemTool.getIcon(this.blueprint.outputs[0].id, 100, itemAsset3.getState(), itemAsset3, new ItemIconReady(sleekImageTexture3.updateTexture)); SleekLabel sleekLabel11 = new SleekLabel(); sleekLabel11.positionOffset_X = -100; sleekLabel11.positionOffset_Y = -30; sleekLabel11.positionScale_Y = 1f; sleekLabel11.sizeOffset_X = 100; sleekLabel11.sizeOffset_Y = 30; sleekLabel11.sizeScale_X = 1f; sleekLabel11.foregroundTint = ESleekTint.NONE; sleekLabel11.fontAlignment = 5; if (this.blueprint.type == EBlueprintType.REPAIR) { SleekLabel sleekLabel12 = sleekLabel; string text = sleekLabel12.text; sleekLabel12.text = string.Concat(new object[] { text, " ", this.blueprint.items, "%" }); sleekLabel11.text = this.blueprint.items + "%"; sleekLabel11.backgroundColor = ItemTool.getQualityColor((float)this.blueprint.items / 100f); sleekLabel11.foregroundColor = sleekLabel11.backgroundColor; } else if (this.blueprint.type == EBlueprintType.AMMO) { SleekLabel sleekLabel13 = sleekLabel; string text = sleekLabel13.text; sleekLabel13.text = string.Concat(new object[] { text, " ", this.blueprint.items, "/", this.blueprint.products }); sleekLabel11.text = this.blueprint.items + "/" + itemAsset3.amount; } if (!this.blueprint.hasItem) { sleekLabel11.backgroundColor = Palette.COLOR_R; sleekLabel11.foregroundColor = Palette.COLOR_R; } sleekImageTexture3.add(sleekLabel11); num += (int)(itemAsset3.size_x * 50 + 25); } } SleekLabel sleekLabel14 = sleekLabel; sleekLabel14.text += " = "; sleek.add(new SleekImageTexture((Texture2D)PlayerDashboardCraftingUI.icons.load("Equals")) { positionOffset_X = num, positionOffset_Y = -20, positionScale_Y = 0.5f, sizeOffset_X = 40, sizeOffset_Y = 40, backgroundTint = ESleekTint.FOREGROUND }); num += 65; for (int j = 0; j < this.blueprint.outputs.Length; j++) { BlueprintOutput blueprintOutput = this.blueprint.outputs[j]; ItemAsset itemAsset4 = (ItemAsset)Assets.find(EAssetType.ITEM, blueprintOutput.id); if (itemAsset4 != null) { SleekLabel sleekLabel15 = sleekLabel; sleekLabel15.text += itemAsset4.itemName; SleekImageTexture sleekImageTexture4 = new SleekImageTexture(); sleekImageTexture4.positionOffset_X = num; sleekImageTexture4.positionOffset_Y = (int)(-itemAsset4.size_y * 25); sleekImageTexture4.positionScale_Y = 0.5f; sleekImageTexture4.sizeOffset_X = (int)(itemAsset4.size_x * 50); sleekImageTexture4.sizeOffset_Y = (int)(itemAsset4.size_y * 50); sleek.add(sleekImageTexture4); ItemTool.getIcon(blueprintOutput.id, 100, itemAsset4.getState(), itemAsset4, new ItemIconReady(sleekImageTexture4.updateTexture)); SleekLabel sleekLabel16 = new SleekLabel(); sleekLabel16.positionOffset_X = -100; sleekLabel16.positionOffset_Y = -30; sleekLabel16.positionScale_Y = 1f; sleekLabel16.sizeOffset_X = 100; sleekLabel16.sizeOffset_Y = 30; sleekLabel16.sizeScale_X = 1f; sleekLabel16.foregroundTint = ESleekTint.NONE; sleekLabel16.fontAlignment = 5; if (this.blueprint.type == EBlueprintType.REPAIR) { SleekLabel sleekLabel17 = sleekLabel; sleekLabel17.text += " 100%"; sleekLabel16.text = "100%"; sleekLabel16.backgroundColor = Palette.COLOR_G; sleekLabel16.foregroundColor = Palette.COLOR_G; } else if (this.blueprint.type == EBlueprintType.AMMO) { ItemAsset itemAsset5 = (ItemAsset)Assets.find(EAssetType.ITEM, blueprintOutput.id); if (itemAsset5 != null) { SleekLabel sleekLabel18 = sleekLabel; string text = sleekLabel18.text; sleekLabel18.text = string.Concat(new object[] { text, " ", this.blueprint.products, "/", itemAsset5.amount }); sleekLabel16.text = this.blueprint.products + "/" + itemAsset5.amount; } } else { SleekLabel sleekLabel19 = sleekLabel; sleekLabel19.text = sleekLabel19.text + " x" + blueprintOutput.amount; sleekLabel16.text = "x" + blueprintOutput.amount.ToString(); } sleekImageTexture4.add(sleekLabel16); num += (int)(itemAsset4.size_x * 50); if (j < this.blueprint.outputs.Length - 1) { num += 25; SleekLabel sleekLabel20 = sleekLabel; sleekLabel20.text += " + "; sleek.add(new SleekImageTexture((Texture2D)PlayerDashboardCraftingUI.icons.load("Plus")) { positionOffset_X = num, positionOffset_Y = -20, positionScale_Y = 0.5f, sizeOffset_X = 40, sizeOffset_Y = 40, backgroundTint = ESleekTint.FOREGROUND }); num += 65; } } } sleek.positionOffset_X = -num / 2; sleek.sizeOffset_X = num; base.tooltip = sleekLabel.text; this.foregroundTint = ESleekTint.NONE; base.foregroundColor = sleekLabel.foregroundColor; }
// 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; } } } }