/// <summary> /// Create new items in the scrollview. /// </summary> private void FillScrollView() { if (obj != selectWindow.selectedObject) { // Refill the scroll view if the selected object // if it isn't the same as the previous one. ClearScrollView(); // Fill the scrollview with items. for (int i = 0; i < selectedObject.skins.mySkins.Length; i++) { GameObject newItem = Instantiate(item, content.transform); SkinItem skin = newItem.GetComponent <SkinItem>(); items.Add(skin); skin.SetImage(selectedObject.skins.mySkins[i].icon); skin.id = i; if (selectedObject.skins.mySkins[i].isSelected) { currentSelected = i; SelectSkin(skin); } UpdateVisuals(skin); } } else { // Else update all the items. for (int i = 0; i < items.Count; i++) { UpdateVisuals(items[i]); } } }
/// <summary> /// Select a new item and apply the new skin. /// </summary> /// <param name="s"></param> private void SelectSkin(SkinItem s) { ObjectSkin selected = selectedObject.skins.mySkins[s.id]; // Check if item is bound to a price if (selected.locked.price > 0) { if (selected.locked.price > GameManager.Instance.storeMoney) { return; } s.DisableMoney(); OnItemBought(-selectedObject.skins.mySkins[s.id].locked.price); selected.locked.price = 0; } // Disable previous visuals for selected. items[currentSelected].SetSelected(false); // Disable selected value in object skin list. selectedObject.skins.mySkins[currentSelected].isSelected = false; // Enable new visuals for selected. currentSelected = s.id; s.SetSelected(true); // Enable selected value in object skin list. selectedObject.skins.mySkins[s.id].isSelected = true; // Remove previous skin and create new skin. Destroy(selectedObject.modelParent.transform.GetChild(0).gameObject); Instantiate(selected.skin, selectedObject.modelParent.transform); }
public static SkinItem CeateNew(int _index, int _id, GameObject gameParent) { Object prefab = null; if (prefab == null) { prefab = exResources.GetResource(ResourceType.GUI, "SpiritAnimal/ChangeList"); } if (prefab == null) { GameSys.LogError("找不到ChangeList预制"); return(null); } GameObject obj = Instantiate(prefab) as GameObject; prefab = null; obj.transform.parent = gameParent.transform; obj.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f); SkinItem itemUI = obj.GetComponent <SkinItem>(); if (itemUI == null) { GameSys.LogError("预制上找不到组件:<SkinItem>"); return(null); } return(itemUI); }
public void UseCurrentlySelectedSkin() { if (currentItem != null) { SkinItem skinItem = (SkinItem)currentItem; GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerSkin>().ChangeSkinTexture(skinItem.texture); } }
public void ChangeMapping(SkinItem item) { if (model != null) { model.GetComponent <SpriteRenderer>().sprite = item.image; model.transform.localScale = new Vector3(150 / item.image.rect.width, 250 / item.image.rect.height, 1); //Debug.Log(item.image.rect.width); } }
public override String ToString() { String s = "[Wearables] =>"; s += " Body Item: " + BodyItem.ToString() + ";"; s += " Skin Item: " + SkinItem.ToString() + ";"; s += " Shirt Item: " + ShirtItem.ToString() + ";"; s += " Pants Item: " + PantsItem.ToString() + ";"; return(s); }
public void Reload() { if (skinBagObject == null) { return; } SkinItem skinItem = (SkinItem)skinBagObject.GetComponent <SkinBag>().currentItem; Graphics.Blit(skinItem.texture, _renderTex); currentSkinItem = skinItem; currentTex = skinItem.texture; }
/// <summary> /// Update the locked visuals on the item. /// </summary> /// <param name="s"></param> private void UpdateVisuals(SkinItem s) { ObjectSkinLock locked = selectedObject.skins.mySkins[s.id].locked; if (locked.levelRequirement > GameManager.Instance.storeLevel) { s.SetLevelLock(locked.levelRequirement); } else if (locked.price != 0) { s.SetMoneyLock(locked.price); } }
public void NextSkin() { if (listSkin.Count > 0) { currentIndex++; if (currentIndex >= listSkin.Count) { currentIndex = 0; } CurrentSkin = listSkin[currentIndex]; } }
public IXml FromXml(XmlElement xe) { Name = xe.GetAttribute("name"); Description = xe.GetAttribute("description"); Created = Convert.ToDateTime(xe.GetAttribute("created")); Ver = xe.GetAttribute("ver"); foreach (XmlElement node in xe.SelectNodes("Item")) { SkinItem item = new SkinItem(); item.FromXml(node); items.Add(item); } return(this); }
private void SkinPreviewList_PreviewKeyUp(object sender, KeyEventArgs e) { if (e.Key != Key.Enter) { return; } ListViewItem lbi = (SkinPreviewList.ItemContainerGenerator.ContainerFromIndex(SkinPreviewList.SelectedIndex)) as ListViewItem; ContentPresenter cp = WPFExtensions.FindVisualChild <ContentPresenter>(lbi); DataTemplate dt = lbi.ContentTemplate; SkinItem item = (dt.FindName("ItemControl", cp)) as SkinItem; if (item != null && SkinPreviewList.IsKeyboardFocusWithin) { item.OpenContextMenu(); } }
// this is used for OGS1 public virtual Hashtable ToHashTable() { Hashtable h = new Hashtable(); h["owner"] = Owner.ToString(); h["serial"] = Serial.ToString(); h["visual_params"] = VisualParams; h["texture"] = Texture.GetBytes(); h["avatar_height"] = AvatarHeight.ToString(); h["body_item"] = BodyItem.ToString(); h["body_asset"] = BodyAsset.ToString(); h["skin_item"] = SkinItem.ToString(); h["skin_asset"] = SkinAsset.ToString(); h["hair_item"] = HairItem.ToString(); h["hair_asset"] = HairAsset.ToString(); h["eyes_item"] = EyesItem.ToString(); h["eyes_asset"] = EyesAsset.ToString(); h["shirt_item"] = ShirtItem.ToString(); h["shirt_asset"] = ShirtAsset.ToString(); h["pants_item"] = PantsItem.ToString(); h["pants_asset"] = PantsAsset.ToString(); h["shoes_item"] = ShoesItem.ToString(); h["shoes_asset"] = ShoesAsset.ToString(); h["socks_item"] = SocksItem.ToString(); h["socks_asset"] = SocksAsset.ToString(); h["jacket_item"] = JacketItem.ToString(); h["jacket_asset"] = JacketAsset.ToString(); h["gloves_item"] = GlovesItem.ToString(); h["gloves_asset"] = GlovesAsset.ToString(); h["undershirt_item"] = UnderShirtItem.ToString(); h["undershirt_asset"] = UnderShirtAsset.ToString(); h["underpants_item"] = UnderPantsItem.ToString(); h["underpants_asset"] = UnderPantsAsset.ToString(); h["skirt_item"] = SkirtItem.ToString(); h["skirt_asset"] = SkirtAsset.ToString(); string attachments = GetAttachmentsString(); if (attachments != String.Empty) { h["attachments"] = attachments; } return(h); }
private void SetupRealtimeSkinPreview(SkinItem skin, int uiIndex) { if (!skin.animatedPreview) { return; } AnimatedSkinPreview previewInst = Instantiate(skinPreviewPrefab); previewInst.transform.position = new Vector3(uiIndex * 3f, -40f, 0f); previewInst.Init(skin.skinProperties); skinUiList[uiIndex].itemIconSprite.enabled = false; skinUiList[uiIndex].realtimePreviewTexture.cachedGameObject.SetActive(true); skinUiList[uiIndex].realtimePreviewTexture.mainTexture = previewInst.previewTexture; skinPreviewInstances[uiIndex] = previewInst; }
public WindowInventory(string name, string id, string money) { InitializeComponent(); Username.Content = name; Mon.Content = money; Id = int.Parse(id); string connString = ConfigurationManager.ConnectionStrings["DbConnection"].ConnectionString; try { using (SQLiteConnection conn = new SQLiteConnection(connString)) { conn.Open(); ImageBrush image = new ImageBrush(); string command = "SELECT * FROM Skins WHERE user_id = @Id"; using (SQLiteCommand cmd = new SQLiteCommand(command, conn)) { cmd.Parameters.AddWithValue("@Id", Id); using (SQLiteDataReader reader = cmd.ExecuteReader()) { List <SkinItem> skins = new List <SkinItem>(); while (reader.Read()) { SkinItem skin = new SkinItem(); skin.Id = int.Parse(reader["Id"].ToString()); skin.Name = reader["Name"].ToString(); skin.Image = new BitmapImage(new Uri("../../" + reader["ImgName"].ToString(), UriKind.Relative)); skin.Price = double.Parse(reader["Price"].ToString()); skins.Add(skin); //cmd.ExecuteNonQuery(); } listViewCS.ItemsSource = skins; } } } } catch (SQLiteException ex) { MessageBox.Show(ex.Message); } }
private void ButtonCs_Click(object sender, RoutedEventArgs e) { borderSkinsDota.Visibility = System.Windows.Visibility.Hidden; borderSkins.Visibility = System.Windows.Visibility.Hidden; borderSkinsDotaAdd.Visibility = System.Windows.Visibility.Hidden; border.Visibility = System.Windows.Visibility.Hidden; string connString = ConfigurationManager.ConnectionStrings["Connection"].ConnectionString; try { using (SQLiteConnection conn = new SQLiteConnection(connString)) { conn.Open(); ImageBrush image = new ImageBrush(); string command = "SELECT * FROM SkinsCS"; using (SQLiteCommand cmd = new SQLiteCommand(command, conn)) { using (SQLiteDataReader reader = cmd.ExecuteReader()) { List <SkinItem> skins = new List <SkinItem>(); while (reader.Read()) { SkinItem skin = new SkinItem(); skin.Id = int.Parse(reader["Id"].ToString()); skin.Name = reader["Name"].ToString(); skin.Image = new BitmapImage(new Uri("../../" + reader["ImgName"].ToString(), UriKind.Relative)); skin.Price = double.Parse(reader["Price"].ToString()); skins.Add(skin); } listViewCS.ItemsSource = skins; } } } } catch (SQLiteException ex) { MessageBox.Show(ex.Message); } borderSkinsCSAdd.Visibility = System.Windows.Visibility.Visible; borderSkinsCS.Visibility = System.Windows.Visibility.Visible; }
private void StackPanel_GotFocus_1(object sender, RoutedEventArgs e) { int id_skin = listViewDota.SelectedIndex + 1; double num; string connString = ConfigurationManager.ConnectionStrings["BConnection"].ConnectionString; try { using (SQLiteConnection conn = new SQLiteConnection(connString)) { conn.Open(); ImageBrush image = new ImageBrush(); string command = "SELECT * FROM SkinsDota"; using (SQLiteCommand cmd = new SQLiteCommand(command, conn)) { using (SQLiteDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { if (reader["Id"].ToString() == id_skin.ToString()) { SkinItem skin = new SkinItem(); num = Math.Round(double.Parse(reader["Price"].ToString())); skin.Id = id_skin; skin.Name = reader["Name"].ToString(); skin.Image = new BitmapImage(new Uri("../../" + reader["ImgName"].ToString(), UriKind.Relative)); skin.Path = reader["ImgName"].ToString(); skin.Price = int.Parse(num.ToString()); skins2.Add(skin); } listViewDotaAdd.ItemsSource = skins2; listViewDotaAdd.Items.Refresh(); } } } } } catch (SQLiteException ex) { MessageBox.Show(ex.Message); } }
public Trade(object name, object money, int Id) { InitializeComponent(); Mon.Content = money; Username.Content = name; add(Id); string connString = ConfigurationManager.ConnectionStrings["Connection"].ConnectionString; try { using (SQLiteConnection conn = new SQLiteConnection(connString)) { conn.Open(); ImageBrush image = new ImageBrush(); string command = "SELECT * FROM SkinsCS"; using (SQLiteCommand cmd = new SQLiteCommand(command, conn)) { using (SQLiteDataReader reader = cmd.ExecuteReader()) { List <SkinItem> skins = new List <SkinItem>(); while (reader.Read()) { SkinItem skin = new SkinItem(); skin.Id = int.Parse(reader["Id"].ToString()); skin.Name = reader["Name"].ToString(); skin.Image = new BitmapImage(new Uri("../../" + reader["ImgName"].ToString(), UriKind.Relative)); skin.Price = double.Parse(reader["Price"].ToString()); skins.Add(skin); } listViewCS.ItemsSource = skins; listViewCS.Items.Refresh(); } } } } catch (SQLiteException ex) { MessageBox.Show(ex.Message); } }
public override void Select(Item item, ItemBox itemBox) { base.Select(item, itemBox); detailName.text = item.itemName; detailDescription.text = item.description; currentItem = item; currentItemBox = itemBox; SkinItem skinItem = (SkinItem)currentItem; skinPreviewPlayer.GetComponent <PlayerSkin>().ChangeSkinTexture(skinItem.texture); if (!skinItem.customized) { deleteButton.enabled = false; deleteButton.interactable = false; } else { deleteButton.enabled = true; deleteButton.interactable = true; } }
public void GetSkinItemData() { List <Dictionary <string, object> > item = CSVReader.Read("item"); for (int i = 0; i < item.Count; i++) { string type = item[i]["type"].ToString(); if (type == "skin") { string name = item[i]["name"].ToString(); string info = item[i]["info"].ToString(); int boong = int.Parse(item[i]["boong"].ToString()); int skin_powder = int.Parse(item[i]["skin_powder"].ToString()); string path = item[i]["path"].ToString(); SkinItem skinItem = Instantiate(skinItemPrefab); skinItem.Initialize(name, info, boong, skin_powder, path); skinItems.Add(skinItem); } } }
//每页展示四个 void ShowSkin() { foreach (SkinItem skin in skinItemList.Values) { skin.gameObject.SetActive(false); } for (int i = 0, max = mountSkinList.Count; i < max; i++) { int id = mountSkinList[i].mountId; if (!skinItemList.ContainsKey(id)) { if (parent != null) { SkinItem item = SkinItem.CeateNew(i, id, parent); if (item != null) { item.gameObject.SetActive(true); item.transform.localPosition = new Vector3((-236 + (i / 9) * 428.6f) + (i % 3) * 139, 117 - ((i - (i / 9) * 9) / 3) * 125); item.MountRefDate = ConfigMng.Instance.GetMountRef(id); skinItemList[id] = item; UIEventListener.Get(item.gameObject).onClick -= OnChangeSkin; UIEventListener.Get(item.gameObject).onClick += OnChangeSkin; UIEventListener.Get(item.gameObject).parameter = id; } } } else { SkinItem skin = skinItemList[id] as SkinItem; skin.gameObject.SetActive(true); skin.transform.localPosition = new Vector3((-236 + (i / 9) * 428.6f) + (i % 3) * 139, 117 - ((i - (i / 9) * 9) / 3) * 125); skin.MountRefDate = ConfigMng.Instance.GetMountRef(id); skinItemList[id] = skin; UIEventListener.Get(skin.gameObject).onClick -= OnChangeSkin; UIEventListener.Get(skin.gameObject).onClick += OnChangeSkin; UIEventListener.Get(skin.gameObject).parameter = id; } } ShowPageBtn(); }
private void Update() { // Achievement popups queued when theres no dialog displaying. if (unlockedPopupsQueue.Count > 0) { if (!DialogBoxUI.instance.isDisplaying) { DialogBoxUI.instance.Display("CONGRATULATIONS", unlockedPopupsQueue.Dequeue(), null); } } // Toggle rendering of animated previews depending whether the UI is visible or not. for (int i = 0; i < skinUiList.Length; i++) { SkinItem targetSkin = GetSkin(i); if (targetSkin.animatedPreview) { skinPreviewInstances[i].previewCamera.enabled = skinUiList[i].backgroundSprite.isVisible; } } }
public void Parse(Dictionary <ushort, List <ulong> > track, Dictionary <ulong, Record> map, CASCHandler handler, bool quiet, OverToolFlags flags) { string output = flags.Positionals[2]; List <string> heroes = new List <string>(); if (flags.Positionals.Length > 3) { heroes.AddRange(flags.Positionals[3].ToLowerInvariant().Split(new char[] { '+' }, StringSplitOptions.RemoveEmptyEntries)); } bool heroAllWildcard = heroes.Count == 0 || heroes.Contains("*"); List <ulong> masters = track[0x75]; foreach (ulong masterKey in masters) { if (!map.ContainsKey(masterKey)) { continue; } STUD masterStud = new STUD(Util.OpenFile(map[masterKey], handler)); if (masterStud.Instances == null || masterStud.Instances[0] == null) { continue; } HeroMaster master = (HeroMaster)masterStud.Instances[0]; if (master == null) { continue; } string heroName = Util.GetString(master.Header.name.key, map, handler); if (heroName == null) { continue; } if (!heroes.Contains(heroName.ToLowerInvariant())) { if (!heroAllWildcard) { continue; } } HashSet <ulong> items = new HashSet <ulong>(); InventoryMaster inventory = Extract.OpenInventoryMaster(master, map, handler); if (inventory == null) { continue; } foreach (OWRecord record in inventory.Achievables) { items.Add(record); } for (int i = 0; i < inventory.DefaultGroups.Length; ++i) { for (int j = 0; j < inventory.Defaults[i].Length; ++j) { items.Add(inventory.Defaults[i][j]); } } for (int i = 0; i < inventory.ItemGroups.Length; ++i) { for (int j = 0; j < inventory.Items[i].Length; ++j) { items.Add(inventory.Items[i][j]); } } HashSet <ulong> done = new HashSet <ulong>(); string path = string.Format("{0}{1}{2}{1}{3}{1}", output, Path.DirectorySeparatorChar, Util.Strip(Util.SanitizePath(heroName)), "Sound Dump Full"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } bool haveBase = false; foreach (ulong itemKey in items) { if (!map.ContainsKey(itemKey)) { continue; } using (Stream itemStream = Util.OpenFile(map[itemKey], handler)) { STUD itemStud = new STUD(itemStream); if (itemStud.Instances == null) { continue; } SkinItem item = itemStud.Instances[0] as SkinItem; if (item == null) { continue; } Dictionary <ulong, List <ulong> > sound = new Dictionary <ulong, List <ulong> >(); if (!haveBase) { sound.Clear(); Console.Out.WriteLine("Processing base sounds for hero {0}", heroName); Skin.ExtractData(item, master, false, new HashSet <ulong>(), new Dictionary <ulong, ulong>(), new HashSet <ulong>(), new Dictionary <ulong, List <ImageLayer> >(), new Dictionary <ulong, ulong>(), sound, new List <ulong>(), -1, map, handler); Sound.FindSounds(master, track, map, handler, null, masterKey, sound); DumpVoice.Save($"{path}_Base{Path.DirectorySeparatorChar}", sound, map, handler, quiet, null, done); haveBase = true; } sound.Clear(); string itemName = Util.GetString(item.Header.name, map, handler); if (string.IsNullOrWhiteSpace(itemName)) { itemName = $"Item-{itemKey:X16}"; } Console.Out.WriteLine("Processing new sounds for skin {0}", itemName); Dictionary <ulong, ulong> replace = new Dictionary <ulong, ulong>(); Skin.ExtractData(item, master, true, new HashSet <ulong>(), new Dictionary <ulong, ulong>(), new HashSet <ulong>(), new Dictionary <ulong, List <ImageLayer> >(), replace, sound, new List <ulong>(), -1, map, handler); Sound.FindSounds(master, track, map, handler, replace, masterKey, sound); DumpVoice.Save($"{path}{Util.Strip(Util.SanitizePath(itemName))}{Path.DirectorySeparatorChar}", sound, map, handler, quiet, replace, done); } } } }
public void Parse(Dictionary <ushort, List <ulong> > track, Dictionary <ulong, Record> map, CASCHandler handler, bool quiet, OverToolFlags flags) { string output = flags.Positionals[2]; HashSet <string> heroes = new HashSet <string>(); HashSet <string> heroBlank = new HashSet <string>(); Dictionary <string, HashSet <string> > heroSkin = new Dictionary <string, HashSet <string> >(); bool heroAllWildcard = false; if (flags.Positionals.Length > 3 && flags.Positionals[1] != "*") { foreach (string name in flags.Positionals[3].ToLowerInvariant().Split(new char[] { '+' }, StringSplitOptions.RemoveEmptyEntries)) { string[] data = name.Split(new char[] { '=' }, StringSplitOptions.RemoveEmptyEntries); string realname = data[0]; heroes.Add(realname); data = data.Skip(1).ToArray(); if (data.Length == 0) { heroBlank.Add(realname); continue; } heroSkin[realname] = new HashSet <string>(); foreach (string skin in data) { heroSkin[realname].Add(skin); } } } else { heroAllWildcard = true; } List <ulong> masters = track[0x75]; foreach (ulong masterKey in masters) { if (!map.ContainsKey(masterKey)) { continue; } STUD masterStud = new STUD(Util.OpenFile(map[masterKey], handler)); if (masterStud.Instances == null) { continue; } HeroMaster master = (HeroMaster)masterStud.Instances[0]; if (master == null) { continue; } if (master.Header.itemMaster.key == 0) { continue; } string heroName = Util.GetString(master.Header.name.key, map, handler); if (heroName == null) { continue; } if (heroAllWildcard) { heroes.Add(heroName.ToLowerInvariant()); heroBlank.Add(heroName.ToLowerInvariant()); } if (!heroes.Contains(heroName.ToLowerInvariant())) { continue; } InventoryMaster inventory = OpenInventoryMaster(master, map, handler); if (inventory == null) { continue; } Dictionary <OWRecord, string> items = new Dictionary <OWRecord, string>(); foreach (OWRecord record in inventory.Achievables) { items[record] = "ACHIEVEMENT"; } for (int i = 0; i < inventory.DefaultGroups.Length; ++i) { string name = $"STANDARD_{ItemEvents.GetInstance().GetEvent(inventory.DefaultGroups[i].@event)}"; for (int j = 0; j < inventory.Defaults[i].Length; ++j) { items[inventory.Defaults[i][j]] = name; } } for (int i = 0; i < inventory.ItemGroups.Length; ++i) { string name = ItemEvents.GetInstance().GetEvent(inventory.ItemGroups[i].@event); for (int j = 0; j < inventory.Items[i].Length; ++j) { items[inventory.Items[i][j]] = name; } } Dictionary <string, WeaponSkinItem> weaponskins = new Dictionary <string, WeaponSkinItem>(); Console.Out.WriteLine("Finding weapon skins for {0}", heroName); foreach (KeyValuePair <OWRecord, string> recordname in items) { OWRecord record = recordname.Key; string itemGroup = recordname.Value; if (!map.ContainsKey(record.key)) { continue; } STUD stud = new STUD(Util.OpenFile(map[record.key], handler)); if (stud.Instances == null) { continue; } IInventorySTUDInstance instance = (IInventorySTUDInstance)stud.Instances[0]; WeaponSkinItem weapon = instance as WeaponSkinItem; if (weapon == null) { continue; } if (weapon.Data.index == 0) { continue; } string name = Util.GetString(instance.Header.name.key, map, handler); if (name == null) { name = $"Untitled-{GUID.LongKey(instance.Header.name.key):X12}"; continue; } weaponskins[name] = weapon; Console.Out.WriteLine("Found data for weapon skin {0}", name); } foreach (KeyValuePair <OWRecord, string> recordname in items) { OWRecord record = recordname.Key; string itemGroup = recordname.Value; if (!map.ContainsKey(record.key)) { continue; } STUD stud = new STUD(Util.OpenFile(map[record.key], handler)); if (stud.Instances == null) { continue; } IInventorySTUDInstance instance = (IInventorySTUDInstance)stud.Instances[0]; SkinItem skin = instance as SkinItem; if (skin == null) { continue; } string name = Util.GetString(instance.Header.name.key, map, handler); if (name == null) { name = $"Untitled-{GUID.LongKey(instance.Header.name.key):X12}"; continue; } if (heroBlank.Contains(heroName.ToLowerInvariant()) || heroSkin[heroName.ToLowerInvariant()].Contains(name.ToLowerInvariant())) { Console.Out.WriteLine("Saving textures for skin {0}", name); foreach (KeyValuePair <string, WeaponSkinItem> pair in weaponskins) { string output_real = string.Format("{0}{1}{4}{1}Weapon Skin{1}{2}{1}{3}{1}", output, System.IO.Path.DirectorySeparatorChar, Util.SanitizePath(pair.Key), Util.SanitizePath(name), Util.SanitizePath(heroName)); Dictionary <ulong, ulong> replace = new Dictionary <ulong, ulong>(); ExtractLogic.Skin.FindReplacements(skin.Data.skin.key, (int)pair.Value.Data.index, replace, new HashSet <ulong>(), map, handler, master, skin, true); Dictionary <ulong, ulong> replace_blank = new Dictionary <ulong, ulong>(); ExtractLogic.Skin.FindReplacements(skin.Data.skin.key, -1, replace_blank, new HashSet <ulong>(), map, handler, master, skin, false); if (replace.Values.Count == 0) { continue; } Dictionary <ulong, List <ImageLayer> > layers = new Dictionary <ulong, List <ImageLayer> >(); Dictionary <ulong, List <ImageLayer> > layers_orig = new Dictionary <ulong, List <ImageLayer> >(); foreach (KeyValuePair <ulong, ulong> texture_pair in replace) { ushort type = GUID.Type(texture_pair.Key); switch (type) { case 0x1A: ExtractLogic.Skin.FindTextures(texture_pair.Value, layers, replace, new HashSet <ulong>(), map, handler); if (replace_blank.ContainsKey(texture_pair.Key)) { ExtractLogic.Skin.FindTextures(replace_blank[texture_pair.Key], layers_orig, replace_blank, new HashSet <ulong>(), map, handler); } else { ExtractLogic.Skin.FindTextures(texture_pair.Key, layers_orig, replace_blank, new HashSet <ulong>(), map, handler); } break; } } Dictionary <ulong, HashSet <ulong> > origTextures = new Dictionary <ulong, HashSet <ulong> >(); foreach (KeyValuePair <ulong, List <ImageLayer> > kv in layers_orig) { ulong materialId = kv.Key; List <ImageLayer> sublayers = kv.Value; HashSet <ulong> materialParsed = new HashSet <ulong>(); if (!origTextures.ContainsKey(materialId)) { origTextures[materialId] = new HashSet <ulong>(); } foreach (ImageLayer layer in sublayers) { origTextures[materialId].Add(layer.key); } } foreach (KeyValuePair <ulong, List <ImageLayer> > kv in layers) { ulong materialId = kv.Key; List <ImageLayer> sublayers = kv.Value; HashSet <ulong> materialParsed = new HashSet <ulong>(); foreach (ImageLayer layer in sublayers) { if (!materialParsed.Add(layer.key)) { continue; } if (origTextures.ContainsKey(materialId) && origTextures[materialId].Contains(layer.key)) { continue; } ExtractLogic.Skin.SaveTexture(layer.key, materialId, map, handler, output_real, quiet, ""); } } } } } } }