//----------Outfits---------// public void ShowOutfits(GComponent lastPopup, CharGame charGame, SerializablePropertys propertys) { ItemChar itemChar = charGame.DataChar; var pm_choise = new QuickControlList(); for (int i = 0; i < itemChar.ItemByType.Length; i++) { ItemChar.Items items = itemChar.ItemByType[i]; if (items.ItemList != null && items.ItemList.Length > 0) { Item.EItemType eItemType = (Item.EItemType)i; pm_choise.AddBt(Item.StrEItemType[i], (EventContext context) => { this._showOutfits2(charGame, pm_choise.contentPane, eItemType, items, propertys); }); } } pm_choise.AddBt("Cancel", (EventContext context) => { pm_choise.Dispose(); }); pm_choise.SetParent(InputFieldHelper.Instance.PopUp); lastPopup.visible = false; pm_choise.SetOnDispose(() => { lastPopup.visible = true; }); }
private void _refreshListOutfits(ItemChar.Items items) { var l = items.ItemList; for (int i = 0; i < l.Length; i++) { Item item = l[i]; PropertyChar property = GetOutfit(item); _setCellOutfits(i, property); } }
private void _showOutfits4(CharGame charGame, ItemChar.Items items, Item item, PropertyChar property) { var tryItem = AutoTileMap_Editor.Instance.ItemCharData.FetchItemByGlobalSlug(item.SlugGlobal); if (tryItem == null) { InputFieldHelper.Instance.ShowNoti("Item not found in database"); return; } controlPropertys.ResetSelectItem(); controlPropertys.LoadModelItem(tryItem.ItemPrefab); if (tryItem.SlugChar != charGame.SlugChar) { controlPropertys.SetItemDes("Your character can't use this item."); return; } if (property == null) { controlPropertys.SetItemName(item.Slug); controlPropertys.SetItemDes("You don't own this item."); return; } else { controlPropertys.SetItemName(property.NameUI); } if (property.EquipSlot == -1) { controlPropertys.AddAction("Equip", () => { this.Equip(charGame, property); this._showOutfits4(charGame, items, item, property); this._refreshListOutfits(items); }); } else { controlPropertys.SetItemDes("Item is equipped"); controlPropertys.AddAction("Unequip", () => { this.UnEquip(charGame, property); this._showOutfits4(charGame, items, item, property); this._refreshListOutfits(items); }); } }
private void _showOutfits3(CharGame charGame, ItemChar.Items items, SerializablePropertys propertys) { var l = items.ItemList; for (int i = 0; i < l.Length; i++) { Item item = l[i]; PropertyChar propertyOwn = GetOutfit(item); var bt = controlPropertys.AddItem(item.Slug, () => { _showOutfits4(charGame, items, item, propertyOwn); }); _setCellOutfits(i, propertyOwn); } }
private void _showOutfits2(CharGame charGame, GComponent lastPopup, Item.EItemType eItemType, ItemChar.Items items, SerializablePropertys propertys) { _controlPropertys_Init(); lastPopup.visible = false; controlPropertys._btClose.onClick.Clear(); controlPropertys._btClose.onClick.Add(() => { _controlPropertys_Dispose(); lastPopup.visible = true; }); controlPropertys.SetTitle(Item.StrEItemType[(int)eItemType]); controlPropertys.ResetListItem(); controlPropertys.ResetSelectItem(); _showOutfits3(charGame, items, propertys); _refreshListOutfits(items); controlPropertys.ShowOn(InputFieldHelper.Instance.PopUp); }