private void OnScrollerChange(List <StorageDataItemBase> list, Transform trans, int index) { StorageDataItemBase item = list[index]; MonoItemIconButton component = trans.GetComponent <MonoItemIconButton>(); component.showProtected = true; component.blockSelect = false; if (this.featureType == FeatureType.SelectForSell) { component.blockSelect = !this.FilterForSell(item); } else if (this.featureType == FeatureType.SelectForPowerUp) { component.blockSelect = !this.FilterForPowerUp(item); } bool flag = ((this.featureType == FeatureType.SelectForSell) && (this._sellPanel != null)) && this._sellPanel.IsItemInSelectedMap(item); bool flag2 = ((this.featureType == FeatureType.SelectForPowerUp) && (this._powerUpPanel != null)) && this._powerUpPanel.IsItemInSelectedMap(item); bool bUsed = AvatarMetaDataReaderExtend.GetAvatarIDsByKey(item.avatarID) != null; component.SetupView(item, MonoItemIconButton.SelectMode.CheckWhenSelect, flag || flag2, false, bUsed); component.SetClickCallback(new MonoItemIconButton.ClickCallBack(this.OnItemButonClick)); if (this.IsTabItemHeap(this._tabManager.GetShowingTabKey()) && flag2) { component.SetMinusBtnCallBack(new Action <StorageDataItemBase>(this.OnItemMinusBtnClick)); component.ShowSelectedNum(this._powerUpPanel.GetItemSelectNum(item)); } }
private int GachaGotItemComparor(StorageDataItemBase left, StorageDataItemBase right) { ItemType itemTypePriority = this.GetItemTypePriority(left); ItemType type2 = this.GetItemTypePriority(right); if (itemTypePriority != type2) { return((int)(itemTypePriority - type2)); } ItemType type3 = itemTypePriority; if (type3 != ItemType.AvatarCard) { if (type3 == ItemType.AvatarFragment) { int num3 = AvatarMetaDataReader.GetAvatarMetaDataByKey(AvatarMetaDataReaderExtend.GetAvatarIDsByKey((left as AvatarFragmentDataItem).ID).avatarID).unlockStar; int num4 = AvatarMetaDataReader.GetAvatarMetaDataByKey(AvatarMetaDataReaderExtend.GetAvatarIDsByKey((right as AvatarFragmentDataItem).ID).avatarID).unlockStar; if (num3 == num4) { return(left.ID - right.ID); } return(num4 - num3); } if (left.rarity == right.rarity) { return(left.ID - right.ID); } return(right.rarity - left.rarity); } int unlockStar = AvatarMetaDataReader.GetAvatarMetaDataByKey(AvatarMetaDataReaderExtend.GetAvatarIDsByKey((left as AvatarCardDataItem).ID).avatarID).unlockStar; int num2 = AvatarMetaDataReader.GetAvatarMetaDataByKey(AvatarMetaDataReaderExtend.GetAvatarIDsByKey((right as AvatarCardDataItem).ID).avatarID).unlockStar; if (unlockStar == num2) { return(left.ID - right.ID); } return(num2 - unlockStar); }
protected override bool SetupView() { base.view.transform.Find("AvatarFigurePanel/Image").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(Singleton <StorageModule> .Instance.GetDummyStorageDataItem(AvatarMetaDataReaderExtend.GetAvatarIDsByKey(this.avatarData.avatarID).avatarCardID, 1).GetImagePath()); this.SetupAvatarProfile(); this.SetupAvatarInfo(); if (base.view.GetComponent <MonoFadeInAnimManager>() != null) { base.view.GetComponent <MonoFadeInAnimManager>().Play("PageFadeIn", false, null); } return(false); }
protected override bool SetupView() { this._animationManager = new SequenceAnimationManager(null, null); base.view.transform.Find("ItemPanel/StigmataIcon").gameObject.SetActive(false); base.view.transform.Find("ItemPanel/3dModel").gameObject.SetActive(false); base.view.transform.Find("ItemPanel/OtherIcon").gameObject.SetActive(false); if (this._storageItem is WeaponDataItem) { base.view.transform.Find("ItemPanel/3dModel").gameObject.SetActive(true); base.view.transform.Find("ItemPanel/3dModel").GetComponent <MonoWeaponRenderImage>().SetupView(this._storageItem as WeaponDataItem, false, 0); this._animationManager.AddAnimation(base.view.transform.Find("ItemPanel/3dModel").GetComponent <MonoAnimationinSequence>(), null); } else if (this._storageItem is StigmataDataItem) { base.view.transform.Find("ItemPanel/StigmataIcon").gameObject.SetActive(true); base.view.transform.Find("ItemPanel/StigmataIcon/Image").GetComponent <MonoStigmataFigure>().SetupView(this._storageItem as StigmataDataItem); this._animationManager.AddAnimation(base.view.transform.Find("ItemPanel/StigmataIcon/Image").GetComponent <MonoAnimationinSequence>(), null); } else { string prefabPath = !(this._storageItem is EndlessToolDataItem) ? this._storageItem.GetImagePath() : (this._storageItem as EndlessToolDataItem).GetIconPath(); base.view.transform.Find("ItemPanel/OtherIcon").gameObject.SetActive(true); base.view.transform.Find("ItemPanel/OtherIcon/Image").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(prefabPath); this._animationManager.AddAnimation(base.view.transform.Find("ItemPanel/OtherIcon/Image").GetComponent <MonoAnimationinSequence>(), null); } base.view.transform.Find("NewAvatarEffect/Green").gameObject.SetActive(false); base.view.transform.Find("NewAvatarEffect/Blue").gameObject.SetActive(false); base.view.transform.Find("NewAvatarEffect/Purple").gameObject.SetActive(false); base.view.transform.Find("NewAvatarEffect/Orange").gameObject.SetActive(false); base.view.transform.Find("NewAvatarEffect/" + MiscData.Config.RarityColor[this._storageItem.rarity]).gameObject.SetActive(true); if (!this._onlyShow) { base.view.transform.Find("ItemPanel/Title/DescPanel/Desc").GetComponent <Text>().text = this._storageItem.GetDisplayTitle(); this._animationManager.AddAnimation(base.view.transform.Find("ItemPanel/Title").GetComponent <MonoAnimationinSequence>(), null); Transform trans = base.view.transform.Find("ItemPanel/Stars"); if ((this._storageItem is AvatarFragmentDataItem) || (this._storageItem is AvatarCardDataItem)) { trans.gameObject.SetActive(false); } else { trans.gameObject.SetActive(true); for (int i = 0; i < trans.childCount; i++) { Transform child = trans.GetChild(i); child.gameObject.SetActive(i < this._storageItem.rarity); if (i < this._storageItem.rarity) { bool flag = this._storageItem is AvatarCardDataItem; child.Find("1").gameObject.SetActive(!flag); child.Find("2").gameObject.SetActive(flag); } } this._animationManager.AddAllChildrenInTransform(trans); } } this._animationManager.StartPlay(0f, false); if (((this._timer != null) && (Singleton <TutorialModule> .Instance != null)) && !Singleton <TutorialModule> .Instance.IsInTutorial) { this._timer.StartRun(false); } AvatarCardDataItem item = this._storageItem as AvatarCardDataItem; if ((item != null) && !item.IsSplite()) { AvatarUnlockDialogContext dialogContext = new AvatarUnlockDialogContext(AvatarMetaDataReaderExtend.GetAvatarIDsByKey(item.ID).avatarID, true); Singleton <MainUIManager> .Instance.ShowDialog(dialogContext, UIType.Any); } this.PostOpenningAudioEvent(); return(false); }
private bool OnGachaRsp(GachaRsp rsp) { if (rsp.get_retcode() == null) { this._gachaGotList.Clear(); this._gachaItemList = rsp.get_item_list(); this._dropItemShowDialogManager = new SequenceDialogManager(new Action(this.ShowGachaResultPage)); this._unLockAvatarDialogManager = new SequenceDialogManager(new Action(this.ClearUnlockAvatarDialogManagerContent)); foreach (GachaItem item in rsp.get_item_list()) { StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem((int)item.get_item_id(), (int)item.get_level()); if (dummyStorageDataItem != null) { dummyStorageDataItem.number = (int)item.get_num(); if (dummyStorageDataItem is AvatarCardDataItem) { if (item.get_split_fragment_numSpecified()) { (dummyStorageDataItem as AvatarCardDataItem).SpliteToFragment((int)item.get_split_fragment_num()); } else { AvatarCardDataItem item2 = dummyStorageDataItem as AvatarCardDataItem; AvatarUnlockDialogContext dialogContext = new AvatarUnlockDialogContext(AvatarMetaDataReaderExtend.GetAvatarIDsByKey(item2.ID).avatarID, true); this._unLockAvatarDialogManager.AddDialog(dialogContext); } } this._gachaGotList.Add(dummyStorageDataItem); List <Tuple <StorageDataItemBase, bool> > itemDataList = new List <Tuple <StorageDataItemBase, bool> > { new Tuple <StorageDataItemBase, bool>(dummyStorageDataItem, item.get_is_rare_drop()) }; if (item.get_gift_item_idSpecified()) { StorageDataItemBase base3 = Singleton <StorageModule> .Instance.GetDummyStorageDataItem((int)item.get_gift_item_id(), (int)item.get_gift_level()); if (base3 != null) { base3.number = (int)item.get_gift_num(); itemDataList.Add(new Tuple <StorageDataItemBase, bool>(base3, false)); this._gachaGotList.Add(base3); } } this._dropItemShowDialogManager.AddDialog(new DropNewItemDialogContextV2(itemDataList)); } } this._waitGachaRsp.End(); } else if (rsp.get_retcode() == 3) { GeneralDialogContext context2 = new GeneralDialogContext { type = GeneralDialogContext.ButtonType.SingleButton, title = LocalizationGeneralLogic.GetText("Menu_Return_GachaTitcketLack", new object[0]), desc = LocalizationGeneralLogic.GetText("Menu_Return_GachaTitcketLack", new object[0]) }; Singleton <MainUIManager> .Instance.ShowDialog(context2, UIType.Any); } this.UpdateView(); return(false); }
private void SetupItemInfo() { base.transform.Find("Item/TitleRare/Green").gameObject.SetActive(false); base.transform.Find("Item/TitleRare/Blue").gameObject.SetActive(false); base.transform.Find("Item/TitleRare/Purple").gameObject.SetActive(false); base.transform.Find("Item/TitleRare/Orange").gameObject.SetActive(false); base.transform.Find("Item/TitleRare/" + MiscData.Config.RarityColor[this._itemData.rarity]).gameObject.SetActive(true); if (this._itemType == DropNewItemType.NormalItem) { base.transform.Find("Item/Title/DescPanel/Desc").GetComponent <Text>().text = this._itemData.GetDisplayTitle(); base.transform.Find("Item/StigmataIcon").gameObject.SetActive(false); base.transform.Find("Item/3dModel").gameObject.SetActive(false); base.transform.Find("Item/OtherIcon").gameObject.SetActive(false); if (this._itemData is WeaponDataItem) { base.transform.Find("Item/3dModel").gameObject.SetActive(true); base.transform.Find("Item/3dModel").GetComponent <MonoWeaponRenderImage>().SetupView(this._itemData as WeaponDataItem, false, 0); } else if (this._itemData is StigmataDataItem) { base.transform.Find("Item/StigmataIcon").gameObject.SetActive(true); base.transform.Find("Item/StigmataIcon/Image").GetComponent <MonoStigmataFigure>().SetupView(this._itemData as StigmataDataItem); } else { string prefabPath = !(this._itemData is EndlessToolDataItem) ? this._itemData.GetImagePath() : (this._itemData as EndlessToolDataItem).GetIconPath(); base.transform.Find("Item/OtherIcon").gameObject.SetActive(true); base.transform.Find("Item/OtherIcon/Image").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(prefabPath); } string text = LocalizationGeneralLogic.GetText("Menu_Material", new object[0]); if (this._itemData is StigmataDataItem) { text = LocalizationGeneralLogic.GetText("Menu_Stigmata", new object[0]); } else if (this._itemData is WeaponDataItem) { text = LocalizationGeneralLogic.GetText("Menu_Weapon", new object[0]); } base.transform.Find("Item/Title/DescPanel/Label").GetComponent <Text>().text = text; Transform transform = base.transform.Find("Item/Stars"); if (this._itemData is AvatarFragmentDataItem) { transform.gameObject.SetActive(false); } else { transform.gameObject.SetActive(true); for (int i = 0; i < transform.childCount; i++) { transform.GetChild(i).gameObject.SetActive(i < this._itemData.rarity); } } Color color = Miscs.ParseColor(MiscData.Config.DropItemBracketColorList[this._itemData.rarity]); base.transform.Find("Item/Title/DescPanel/L").GetComponent <Image>().color = color; base.transform.Find("Item/Title/DescPanel/R").GetComponent <Image>().color = color; } else { base.transform.Find("Item/OtherIcon/Image").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(this._itemData.GetImagePath()); base.transform.Find("Item/Title/DescPanel/Label").GetComponent <Text>().text = LocalizationGeneralLogic.GetText("Menu_AvatarCard", new object[0]); int avatarID = AvatarMetaDataReaderExtend.GetAvatarIDsByKey(this._itemData.ID).avatarID; int star = Singleton <AvatarModule> .Instance.GetDummyAvatarDataItem(avatarID).star; base.transform.Find("Item/Stars/AvatarStar/1").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(MiscData.Config.AvatarStarIcons[star]); base.transform.Find("Item/Title/DescPanel/Desc").GetComponent <Text>().text = Singleton <AvatarModule> .Instance.GetAvatarByID(avatarID).FullName; Color color2 = Miscs.ParseColor(MiscData.Config.DropItemBracketColorList[0]); base.transform.Find("Item/Title/DescPanel/L").GetComponent <Image>().color = color2; base.transform.Find("Item/Title/DescPanel/R").GetComponent <Image>().color = color2; } }
private void SetupUpContent(Transform gridTrans, Text nameText, List <StorageDataItemBase> itemList) { string str = string.Empty; gridTrans.DestroyChildren(); foreach (StorageDataItemBase base2 in itemList) { if (base2 is AvatarCardDataItem) { str = str + Singleton <AvatarModule> .Instance.GetDummyAvatarDataItem(AvatarMetaDataReaderExtend.GetAvatarIDsByKey(base2.ID).avatarID).FullName; str = str + Environment.NewLine; } else if ((base2 is WeaponDataItem) || (base2 is StigmataDataItem)) { str = str + base2.GetDisplayTitle(); str = str + Environment.NewLine; } GameObject obj2 = UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>("UI/Menus/Widget/Map/DropItemButton")); if (obj2 != null) { obj2.transform.SetParent(gridTrans, false); obj2.GetComponent <MonoLevelDropIconButton>().SetupView(base2, new DropItemButtonClickCallBack(this.OnItemClick), true, false, false, false); obj2.GetComponent <CanvasGroup>().alpha = 1f; } } nameText.text = str; }
private void SetupUpAvatarPanel() { Transform transform = base.view.transform.Find("Content/ScrollView/Content/UpAvatarPanel"); transform.gameObject.SetActive(this._displayData.get_up_avatar_list().Count > 0); if (this._displayData.get_up_avatar_list().Count > 0) { this.upAvatarDataList = new List <StorageDataItemBase>(); foreach (uint num in this._displayData.get_up_avatar_list()) { AvatarCardDataItem item = new AvatarCardDataItem(AvatarCardMetaDataReader.GetAvatarCardMetaDataByKey(AvatarMetaDataReaderExtend.GetAvatarIDsByKey((int)num).avatarCardID)); this.upAvatarDataList.Add(item); } this.SetupUpContent(transform.Find("AvatarPanel"), transform.Find("AvatarNamePanel/Text").GetComponent <Text>(), this.upAvatarDataList); } }
private void SetRarity(Transform tran, RewardUIData data) { StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(data.itemID, data.level); if (!(dummyStorageDataItem is AvatarFragmentDataItem)) { if (dummyStorageDataItem is AvatarCardDataItem) { tran.Find("x").gameObject.SetActive(false); tran.Find("Number").gameObject.SetActive(false); Transform transform = tran.Find("AvatarStar"); transform.gameObject.SetActive(true); AvatarDataItem dummyAvatarDataItem = Singleton <AvatarModule> .Instance.GetDummyAvatarDataItem(AvatarMetaDataReaderExtend.GetAvatarIDsByKey(data.itemID).avatarID); transform.GetComponent <MonoAvatarStar>().SetupView(dummyAvatarDataItem.star); } else { Transform transform2 = tran.Find("Star"); transform2.gameObject.SetActive(true); int rarity = dummyStorageDataItem.rarity; if (dummyStorageDataItem is WeaponDataItem) { rarity = (dummyStorageDataItem as WeaponDataItem).GetMaxRarity(); } else if (dummyStorageDataItem is StigmataDataItem) { rarity = (dummyStorageDataItem as StigmataDataItem).GetMaxRarity(); } transform2.GetComponent <MonoItemIconStar>().SetupView(dummyStorageDataItem.rarity, rarity); } } }
public static Sprite GetAvatarCardIcon(int avatarID) { return(Miscs.GetSpriteByPrefab(AvatarCardMetaDataReader.GetAvatarCardMetaDataByKey(AvatarMetaDataReaderExtend.GetAvatarIDsByKey(avatarID).avatarCardID).iconPath)); }
private void SetupRarityView(StorageDataItemBase item) { base.transform.Find("AvatarStar").gameObject.SetActive(false); base.transform.Find("Star").gameObject.SetActive(false); string hexString = MiscData.Config.ItemRarityColorList[item.rarity]; base.transform.Find("ItemIcon").GetComponent <Image>().color = Miscs.ParseColor(hexString); if (item is AvatarCardDataItem) { AvatarDataItem dummyAvatarDataItem = Singleton <AvatarModule> .Instance.GetDummyAvatarDataItem(AvatarMetaDataReaderExtend.GetAvatarIDsByKey(item.ID).avatarID); this.SetupAvatarStar(dummyAvatarDataItem.star); base.transform.Find("AvatarStar").gameObject.SetActive(true); } else if (!(item is AvatarFragmentDataItem)) { base.transform.Find("Star").gameObject.SetActive(true); int rarity = item.rarity; if (item is WeaponDataItem) { rarity = (item as WeaponDataItem).GetMaxRarity(); } else if (item is StigmataDataItem) { rarity = (item as StigmataDataItem).GetMaxRarity(); } base.transform.Find("Star").GetComponent <MonoItemIconStar>().SetupView(item.rarity, rarity); } }
private void SetupDesc(StorageDataItemBase item) { if ((item is WeaponDataItem) || (item is StigmataDataItem)) { base.transform.Find("NumPanel").gameObject.SetActive(false); base.transform.Find("LevelPanel").gameObject.SetActive(true); base.transform.Find("LevelPanel/Num/Num").GetComponent <Text>().text = item.level.ToString(); } else if (item is AvatarCardDataItem) { base.transform.Find("NumPanel").gameObject.SetActive(false); base.transform.Find("LevelPanel").gameObject.SetActive(true); AvatarDataItem dummyAvatarDataItem = Singleton <AvatarModule> .Instance.GetDummyAvatarDataItem(AvatarMetaDataReaderExtend.GetAvatarIDsByKey(item.ID).avatarID); base.transform.Find("LevelPanel/Num/Num").GetComponent <Text>().text = dummyAvatarDataItem.level.ToString(); } else { base.transform.Find("NumPanel").gameObject.SetActive(true); base.transform.Find("LevelPanel").gameObject.SetActive(false); base.transform.Find("NumPanel/Num/Num").GetComponent <Text>().text = item.number.ToString(); } }
public AvatarFragmentDataItem GetAvatarFragmentDataItem() { return(new AvatarFragmentDataItem(AvatarFragmentMetaDataReader.GetAvatarFragmentMetaDataByKey(AvatarMetaDataReaderExtend.GetAvatarIDsByKey(this.avatarID).avatarFragmentID)) { number = this.fragment }); }