// Token: 0x06001403 RID: 5123 RVA: 0x0007FBC0 File Offset: 0x0007DFC0 public static void setupBundle(SkinCreatorOutput bundle, string patternID, out ushort skinID) { skinID = 0; ItemAsset itemAsset = Assets.find(EAssetType.ITEM, bundle.itemID) as ItemAsset; if (itemAsset == null) { return; } string text = string.Concat(new string[] { GameProject.PROJECT_PATH, "\\Builds\\Shared\\Bundles\\Skins\\", itemAsset.name, "/", patternID }); if (!Directory.Exists(text)) { Directory.CreateDirectory(text); } string path = text + "/" + patternID + ".dat"; string text2 = "Type Skin\nID " + skinID + "\n\nSight\nTactical\nGrip\nBarrel\nMagazine"; if (bundle.secondarySkins.Count > 0) { text2 = text2 + "\n\nSecondary_Skins " + bundle.secondarySkins.Count; for (int i = 0; i < bundle.secondarySkins.Count; i++) { SecondarySkinInfo secondarySkinInfo = bundle.secondarySkins[i]; string text3 = text2; text2 = string.Concat(new object[] { text3, "\nSecondary_", i, " ", secondarySkinInfo.itemID }); } } File.WriteAllText(path, text2); }
protected virtual void handleOutputChanged(SkinCreatorOutput output) { this.refreshPreview(); }
protected virtual void input(string skinPath) { using (StreamReader streamReader = new StreamReader(skinPath + "/Skin.kvt")) { IFormattedFileReader formattedFileReader = new KeyValueTableReader(streamReader); SkinCreatorOutput skinCreatorOutput = formattedFileReader.readValue <SkinCreatorOutput>("Data"); ItemAsset itemAsset = Assets.find(EAssetType.ITEM, skinCreatorOutput.itemID) as ItemAsset; string text = "Assets/Game/Sources/Skins"; string destination = "Assets/Resources/Bundles/Skins/" + itemAsset.name + "/" + this.patternID; Material primarySkin = this.importMaterial(skinPath, skinCreatorOutput.primarySkin, string.Concat(new string[] { text, "/", itemAsset.name, "/", this.patternID }), destination, "/Skin_Primary.mat"); Dictionary <ushort, Material> dictionary = new Dictionary <ushort, Material>(); foreach (SecondarySkinInfo secondarySkinInfo in skinCreatorOutput.secondarySkins) { ItemAsset itemAsset2 = Assets.find(EAssetType.ITEM, secondarySkinInfo.itemID) as ItemAsset; if (itemAsset2 != null) { Material material = this.importMaterial(skinPath, secondarySkinInfo, string.Concat(new string[] { text, "/", itemAsset2.name, "/", this.patternID }), destination, "/Skin_Secondary_" + secondarySkinInfo.itemID + ".mat"); if (!(material == null)) { dictionary.Add(secondarySkinInfo.itemID, material); } } } Material tertiarySkin = this.importMaterial(skinPath, skinCreatorOutput.tertiarySkin, text + "/Tertiary/" + this.patternID, destination, "/Skin_Tertiary.mat"); Material attachmentSkin = this.importMaterial(skinPath, skinCreatorOutput.attachmentSkin, text + "/Attachments/" + this.patternID, destination, "/Skin_Attachment.mat"); ushort num; SkinEconBundleWizardWindow.setupBundle(skinCreatorOutput, this.patternID, out num); ESkinAcceptEconType eskinAcceptEconType = this.econType; EconItemDefinition econItemDefinition; if (eskinAcceptEconType != ESkinAcceptEconType.STORE) { if (eskinAcceptEconType != ESkinAcceptEconType.CRATE) { Debug.Log("Failed to handle econ type: " + this.econType); return; } econItemDefinition = new EconCrateItemDefinition { Variants = new EconCrateVariant[] { new EconCrateVariant(0, true, true, 4), new EconCrateVariant(1, false, true, 7), new EconCrateVariant(3, false, true, 7), new EconCrateVariant(4, false, true, 7), new EconCrateVariant(5, false, true, 7), new EconCrateVariant(6, false, true, 7), new EconCrateVariant(7, false, true, 7), new EconCrateVariant(9, false, true, 7), new EconCrateVariant(10, false, true, 7), new EconCrateVariant(11, false, true, 7), new EconCrateVariant(15, false, true, 7), new EconCrateVariant(16, false, true, 7), new EconCrateVariant(18, false, true, 7), new EconCrateVariant(21, false, true, 7), new EconCrateVariant(22, false, true, 7), new EconCrateVariant(23, false, true, 7), new EconCrateVariant(24, false, true, 7) }, IsMarketable = true }; } else { econItemDefinition = new EconStoreItemDefinition { Price = 100, Variants = new EconStoreVariant[] { new EconStoreVariant(8) }, IsCommodity = false, IsPurchasable = true, IsMarketable = false }; } econItemDefinition.SkinName = new EconName(this.econName, this.patternID); econItemDefinition.Description = this.econDesc; econItemDefinition.ItemID = skinCreatorOutput.itemID; econItemDefinition.SkinID = num; econItemDefinition.WorkshopNames = new string[] { SteamFriends.GetFriendPersonaName((CSteamID)this.workshopItemDetails.m_ulSteamIDOwner) }; econItemDefinition.WorkshopIDs = new ulong[] { this.workshopItemDetails.m_nPublishedFileId.m_PublishedFileId }; econItemDefinition.IsWorkshopLinked = true; econItemDefinition.IsLuminescent = skinCreatorOutput.primarySkin.emissionPath.isValid; econItemDefinition.IsDynamic = false; econItemDefinition.IsTradable = true; int num2; SkinEconBundleWizardWindow.setupEcon(econItemDefinition, out num2); this.iconItemID = skinCreatorOutput.itemID; this.iconSkinID = num; this.iconEconID = num2; Assets.add(new SkinAsset(false, primarySkin, dictionary, attachmentSkin, tertiarySkin) { id = num, name = this.patternID }); } }