private void UpdateSelectedItem(StorageDataItemBase selectedItem) { this._selectedItem = (selectedItem == null) ? (this._showItemList[0] as MaterialDataItem) : (selectedItem as MaterialDataItem); this._num_materials = 1; base.view.transform.Find("Dialog/Content/Materials").GetComponent <MonoGridScroller>().RefreshCurrent(); this.UpdateInfo(); }
private void OnItemClick(StorageDataItemBase item, bool selected) { if (!selected) { Singleton <NotifyManager> .Instance.FireNotify(new Notify(NotifyTypes.SelectItemIconChange, item)); } }
private bool Filter(StorageDataItemBase item) { bool flag = false; bool flag2 = false; switch (this.slot) { case 1: flag = item.GetType() == typeof(WeaponDataItem); flag2 = item.GetBaseType() == this.avatarData.WeaponBaseTypeList[0]; break; case 2: flag = item.GetType() == typeof(StigmataDataItem); flag2 = item.GetBaseType() == 1; break; case 3: flag = item.GetType() == typeof(StigmataDataItem); flag2 = item.GetBaseType() == 2; break; case 4: flag = item.GetType() == typeof(StigmataDataItem); flag2 = item.GetBaseType() == 3; break; } return(flag && flag2); }
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 bool IsCostOver(StorageDataItemBase from, StorageDataItemBase to, AvatarDataItem avatarData) { int num = (from != null) ? from.GetCost() : 0; int num2 = (to != null) ? to.GetCost() : 0; return(((avatarData.GetCurrentCost() - num) + num2) > avatarData.MaxCost); }
private void OnScrollChange(Transform trans, int index) { StorageDataItemBase itemData = this._itemList[index]; trans.GetComponent <MonoLevelDropIconButton>().SetupView(itemData, new DropItemButtonClickCallBack(this.OnDropItemBtnClick), true, true, false, false); trans.GetComponent <MonoAnimationinSequence>().animationName = "DropItemScale10"; }
public void RefreshOnItemButonClick(StorageDataItemBase item) { KeyValuePair <System.Type, int> keyByItem = this.GetKeyByItem(item); if (this._selectedItemMap.ContainsKey(keyByItem)) { if (this._isMulti) { this._modifyingItem = this._selectedItemMap[keyByItem]; this.OnIncreaseBtnClick(); } else { this._selectedItemList.Remove(this._selectedItemMap[keyByItem]); this._selectedItemMap.Remove(keyByItem); } } else if (this._selectedItemMap.Count < 6) { StorageDataItemBase base2 = item.Clone(); base2.number = 1; this._selectedItemList.Add(base2); this._selectedItemMap.Add(keyByItem, base2); if (this._isMulti) { this._modifyingItem = base2; } } this.UpdateDataView(); }
private void OnItemMinusBtnClick(StorageDataItemBase dataItem) { if (this._powerUpPanel != null) { this._powerUpPanel.OnDecreaseBtnClick(dataItem); } }
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)); } }
public static Sprite GetResourceSprite(ResourceType resourceType, StorageDataItemBase itemData = null) { switch (resourceType) { case ResourceType.Hcoin: return(Miscs.GetSpriteByPrefab("SpriteOutput/GeneralIcon/IconHC")); case ResourceType.Scoin: return(Miscs.GetSpriteByPrefab("SpriteOutput/GeneralIcon/IconSC")); case ResourceType.PlayerExp: return(Miscs.GetSpriteByPrefab("SpriteOutput/GeneralIcon/IconEXP")); case ResourceType.Stamina: return(Miscs.GetSpriteByPrefab("SpriteOutput/GeneralIcon/IconST")); case ResourceType.SkillPoint: return(Miscs.GetSpriteByPrefab("SpriteOutput/GeneralIcon/IconSP")); case ResourceType.FriendPoint: return(Miscs.GetSpriteByPrefab("SpriteOutput/GeneralIcon/IconFP")); } if (itemData == null) { return(null); } return(Miscs.GetSpriteByPrefab(itemData.GetIconPath())); }
public static string GetResourceIconPath(ResourceType resourceType, int itemID = 0) { switch (resourceType) { case ResourceType.Hcoin: return("SpriteOutput/GeneralIcon/IconHC"); case ResourceType.Scoin: return("SpriteOutput/GeneralIcon/IconSC"); case ResourceType.PlayerExp: return("SpriteOutput/GeneralIcon/IconEXP"); case ResourceType.Stamina: return("SpriteOutput/GeneralIcon/IconST"); case ResourceType.SkillPoint: return("SpriteOutput/GeneralIcon/IconSP"); case ResourceType.FriendPoint: return("SpriteOutput/GeneralIcon/IconFP"); } if (itemID != 0) { StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(itemID, 1); if (dummyStorageDataItem != null) { return(dummyStorageDataItem.GetIconPath()); } } return(null); }
public static bool GetEquipmentSlot(StorageDataItemBase storageData, out EquipmentSlot slot) { if (storageData is WeaponDataItem) { slot = 1; return(true); } if (storageData is StigmataDataItem) { switch ((storageData as StigmataDataItem).GetBaseType()) { case 1: slot = 2; return(true); case 2: slot = 3; return(true); case 3: slot = 4; return(true); } slot = 1; return(false); } slot = 1; return(false); }
private void OnScrollChange(Transform trans, int index) { RewardUIData data = this._mailData.attachment.itemList[index]; Image component = trans.Find("ItemIcon").GetComponent <Image>(); Image image2 = trans.Find("ItemIcon/Icon").GetComponent <Image>(); component.gameObject.SetActive(true); trans.Find("SelectedMark").gameObject.SetActive(false); trans.Find("ProtectedMark").gameObject.SetActive(false); trans.Find("InteractiveMask").gameObject.SetActive(false); trans.Find("NotEnough").gameObject.SetActive(false); trans.Find("Star").gameObject.SetActive(false); trans.Find("StigmataType").gameObject.SetActive(false); trans.Find("UnidentifyText").gameObject.SetActive(false); trans.Find("QuestionMark").gameObject.SetActive(false); trans.Find("ItemIcon").GetComponent <Image>().color = Color.white; trans.Find("ItemIcon").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(MiscData.Config.ItemRarityBGImgPath[0]); if (data.rewardType == ResourceType.Item) { StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(data.itemID, data.level); dummyStorageDataItem.number = data.value; MonoItemIconButton button = trans.GetComponent <MonoItemIconButton>(); button.SetupView(dummyStorageDataItem, MonoItemIconButton.SelectMode.None, false, false, false); button.SetClickCallback(new MonoItemIconButton.ClickCallBack(this.OnItemClick)); } else { image2.sprite = data.GetIconSprite(); trans.Find("Text").GetComponent <Text>().text = "\x00d7" + data.value; } }
public AvatarDataItem Clone() { AvatarDataItem item = new AvatarDataItem(this.avatarID, this.level, this.star) { UnLocked = this.UnLocked, Initialized = this.Initialized, exp = this.exp, fragment = this.fragment }; foreach (EquipmentSlot slot in EQUIP_SLOTS) { StorageDataItemBase base2 = (this.equipsMap[slot] != null) ? this.equipsMap[slot].Clone() : null; item.equipsMap[slot] = base2; } foreach (AvatarSkillDataItem item2 in this.skillDataList) { AvatarSkillDataItem avatarSkillBySkillID = item.GetAvatarSkillBySkillID(item2.skillID); avatarSkillBySkillID.UnLocked = item2.UnLocked; foreach (AvatarSubSkillDataItem item4 in item2.avatarSubSkillList) { avatarSkillBySkillID.GetAvatarSubSkillBySubSkillId(item4.subSkillID).level = item4.level; } } return(item); }
public override void CreateDropGoods(Vector3 initPos, Vector3 initDir, bool actDropAnim = true) { for (int i = 0; i < this.dropNum; i++) { StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(this.metaId, 1); if (dummyStorageDataItem is WeaponDataItem) { Singleton <DynamicObjectManager> .Instance.CreateEquipItem(0x21800001, this.metaId, initPos, initDir, actDropAnim, this.level); } else if (dummyStorageDataItem is StigmataDataItem) { Singleton <DynamicObjectManager> .Instance.CreateStigmataItem(0x21800001, this.metaId, initPos, initDir, actDropAnim, this.level); } else if (dummyStorageDataItem is MaterialDataItem) { Singleton <DynamicObjectManager> .Instance.CreateMaterialItem(0x21800001, this.metaId, initPos, initDir, actDropAnim, this.level); } else if (dummyStorageDataItem is AvatarFragmentDataItem) { Singleton <DynamicObjectManager> .Instance.CreateAvatarFragmentItem(0x21800001, this.metaId, initPos, initDir, actDropAnim, this.level); } } Singleton <LevelScoreManager> .Instance.AddDropItem(this.metaId, this.level, this.dropNum); }
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 void SetupView(StorageDataItemBase item, AvatarDataItem ownerData = null) { this._item = item; this._ownerData = ownerData; this.SetupStatus(); this.SetupGrid(); }
private void OnScrollerChange(Transform trans, int index) { MonoLevelDropIconButtonBox component = trans.GetComponent <MonoLevelDropIconButtonBox>(); MonoLevelDropIconButton button = trans.Find("Item").GetComponent <MonoLevelDropIconButton>(); Vector2 cellSize = this._dropScroller.grid.GetComponent <GridLayoutGroup>().cellSize; trans.SetLocalScaleX(cellSize.x / button.width); trans.SetLocalScaleY(cellSize.y / button.height); DropItem item = this._dropItemList[index]; StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem((int)item.get_item_id(), 1); dummyStorageDataItem.level = (int)item.get_level(); dummyStorageDataItem.number = (int)item.get_num(); button.SetupView(dummyStorageDataItem, new DropItemButtonClickCallBack(this.OnDropItemBtnClick), true, true, false, false); if (item == this._normalDropItem) { component.SetupTypeView(MonoLevelDropIconButtonBox.Type.NormalFinishChallengeReward, this._dropPanelBGAniamtionEnd); } else if (item == this._fastDropItem) { component.SetupTypeView(MonoLevelDropIconButtonBox.Type.FastFinishChallengeReward, this._dropPanelBGAniamtionEnd); } else if (item == this._sonicDropItem) { component.SetupTypeView(MonoLevelDropIconButtonBox.Type.SonicFinishChallengeReward, this._dropPanelBGAniamtionEnd); } else { component.SetupTypeView(MonoLevelDropIconButtonBox.Type.DefaultDrop, this._dropPanelBGAniamtionEnd); } }
public void SetupView(StorageDataItemBase data, Transform parentTrans, StorageItemAction action, int loadPosition, System.Type type, bool interactable = true) { this._originColor = base.transform.GetComponent <Image>().color; this._data = data; this._storageItemProcess = action; this._type = type; this._loadPosition = loadPosition; base.transform.SetParent(parentTrans, false); if (this._data == null) { this.RealClearContent(); } else { base.transform.Find("Image").gameObject.SetActive(true); GameObject obj2 = Miscs.LoadResource <GameObject>(data.GetIconPath(), BundleType.RESOURCE_FILE); base.transform.Find("Image").GetComponent <Image>().sprite = obj2.GetComponent <SpriteRenderer>().sprite; if (this._data is MaterialDataItem) { base.transform.Find("LevelAndCost").gameObject.SetActive(false); base.transform.Find("Number").gameObject.SetActive(true); base.transform.Find("Number/Number").GetComponent <Text>().text = this._data.number.ToString(); } else { base.transform.Find("LevelAndCost").gameObject.SetActive(true); base.transform.Find("Number").gameObject.SetActive(false); base.transform.Find("LevelAndCost/LevelNumber").GetComponent <Text>().text = this._data.level.ToString(); base.transform.Find("LevelAndCost/CostNumber").GetComponent <Text>().text = this._data.GetCost().ToString(); } base.transform.GetComponent <Button>().interactable = interactable; this._setupAlready = true; } }
private void SetupLine(Transform line, RewardUIData data, StorageDataItemBase item = null) { line.gameObject.SetActive(true); line.Find("Image").GetComponent <Image>().sprite = data.GetIconSprite(); line.Find("Desc").GetComponent <Text>().text = this.GetDesc(data.valueLabelTextID, data.itemID); line.Find("Number").GetComponent <Text>().text = string.Format("\x00d7{0}", data.value); }
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); } }
public void SetupView(Goods goods, bool isSelected, int ticketID, bool isMultiCurrency = false) { ShopGoodsMetaData shopGoodsMetaDataByKey; this._goods = goods; this._ticketID = ticketID; this._isMultiCurrency = isMultiCurrency; this.SetItemDefaultColor(); base.transform.Find("BG/Selected").gameObject.SetActive(isSelected); base.transform.Find("BG/Unselected").gameObject.SetActive(!isSelected); if (this._ticketID > 0) { int hCoinCost = Singleton <PlayerModule> .Instance.playerData.gachaTicketPriceDict[this._ticketID]; shopGoodsMetaDataByKey = new ShopGoodsMetaData(this._ticketID, this._ticketID, 1, 1, hCoinCost, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x7fffffff, 1, 0x2710, false); if (Singleton <PlayerModule> .Instance.playerData.gachaTicketPriceDict.ContainsKey(this._ticketID / 10)) { hCoinCost = Singleton <PlayerModule> .Instance.playerData.gachaTicketPriceDict[this._ticketID / 10]; shopGoodsMetaDataByKey = new ShopGoodsMetaData(this._ticketID, this._ticketID / 10, 1, 10, hCoinCost * 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x7fffffff, 1, 0x2710, false); } } else { shopGoodsMetaDataByKey = ShopGoodsMetaDataReader.GetShopGoodsMetaDataByKey((int)goods.get_goods_id()); } StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(shopGoodsMetaDataByKey.ItemID, shopGoodsMetaDataByKey.ItemLevel); dummyStorageDataItem.number = shopGoodsMetaDataByKey.ItemNum; this.SetupSaleLabel(shopGoodsMetaDataByKey); base.transform.Find("FragmentIcon").gameObject.SetActive(dummyStorageDataItem is AvatarFragmentDataItem); Sprite spriteByPrefab = Miscs.GetSpriteByPrefab(dummyStorageDataItem.GetIconPath()); base.transform.Find("ItemIcon/Icon").GetComponent <Image>().sprite = spriteByPrefab; base.transform.Find("ItemIcon/FrameBg").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(MiscData.Config.ItemRarityBGImgPath[dummyStorageDataItem.rarity]); base.transform.Find("ItemIcon/FrameLight").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(MiscData.Config.ItemRarityLightImgPath[dummyStorageDataItem.rarity]); base.transform.Find("ItemIcon/FrameBg").gameObject.SetActive(true); base.transform.Find("ItemIcon/FrameLight").gameObject.SetActive(true); this.SetupDesc(dummyStorageDataItem); this.SetupRarityView(dummyStorageDataItem); this.SetupStigmataTypeIcon(dummyStorageDataItem); this.SetupPrice(shopGoodsMetaDataByKey); if (goods.get_buy_times() >= shopGoodsMetaDataByKey.MaxBuyTimes) { this.SetItemGrey(); } else { base.transform.Find("BG/Unselected/NowPrize").gameObject.SetActive(true); base.transform.Find("BG/Unselected/Empty").gameObject.SetActive(false); Color color = base.transform.Find("BG/Unselected/Image").GetComponent <Image>().color; color.a = 1f; base.transform.Find("BG/Unselected/Image").GetComponent <Image>().color = color; base.transform.Find("BG/Selected/NowPrize").gameObject.SetActive(true); base.transform.Find("BG/Selected/Empty").gameObject.SetActive(false); color = base.transform.Find("BG/Unselected/Image").GetComponent <Image>().color; color.a = 1f; base.transform.Find("BG/Unselected/Image").GetComponent <Image>().color = color; base.transform.Find("ItemIcon/SellOut").gameObject.SetActive(false); } }
private void SetupStigmataTypeIcon(StorageDataItemBase item) { base.transform.Find("StigmataType").gameObject.SetActive(item is StigmataDataItem); if (item is StigmataDataItem) { base.transform.Find("StigmataType/Image").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(MiscData.Config.StigmataTypeIconPath[item.GetBaseType()]); } }
public void ClearContent() { if (this._data != null) { this.RealClearContent(); this._data = null; } }
public NeedItemData(int itemMetaID, int itemNum) { this.itemMetaID = itemMetaID; this.itemNum = itemNum; this.itemData = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(itemMetaID, 1); this.itemData.number = itemNum; }
public void SetupView(AvatarDataItem avatarData, StorageDataItemBase itemBefore, StorageDataItemBase itemAfter, Action <Transform, float, float> setupAttr) { this._avatarData = avatarData; this._itemBefore = itemBefore; this._itemAfter = itemAfter; this._setupAttr = setupAttr; this.SetupStatus(); }
public static int CompareToCostDesc(StorageDataItemBase lobj, StorageDataItemBase robj) { if (lobj.GetCost() != robj.GetCost()) { return(robj.GetCost() - lobj.GetCost()); } return(CompareToRarityDesc(lobj, robj)); }
public static int CompareToBaseTypeAsc(StorageDataItemBase lobj, StorageDataItemBase robj) { if (lobj.GetBaseType() != robj.GetBaseType()) { return(lobj.GetBaseType() - robj.GetBaseType()); } return(CompareToRarityDesc(lobj, robj)); }
public void UpdateInfo(int newCost, int maxCost, AvatarDataItem avatarData, StorageDataItemBase selectItem) { Text component = base.transform.Find("Info/Cost/CurrentCost").GetComponent <Text>(); component.text = newCost.ToString(); component.color = (newCost <= maxCost) ? Color.white : Color.red; base.transform.Find("Info/CombatNumText").GetComponent <Text>().text = Mathf.FloorToInt(avatarData.GetAvatarCombatUsingNewEquip(selectItem)).ToString(); }
private void SetupManualRefreshInfo() { base.transform.Find("RefreshTab").gameObject.SetActive((this._shopType == UIShopType.SHOP_NORMAL) || (this._shopType == UIShopType.SHOP_ACTIVITY)); if ((this._shopType != UIShopType.SHOP_GACHATICKET) && (this._shopType != UIShopType.SHOP_ENDLESS)) { if (this._shopType == UIShopType.SHOP_ACTIVITY) { base.transform.Find("RefreshTab").gameObject.SetActive(this._storeDataItem.isOpen); if (!this._storeDataItem.isOpen) { return; } } base.transform.Find("RefreshTab/RefreshTime/Num").GetComponent <Text>().text = (this._storeDataItem.maxManualRefreshTimes - this._storeDataItem.manualRefreshTimes).ToString(); base.transform.Find("RefreshTab/MetalNum/Num").GetComponent <Text>().text = this._storeDataItem.nextRefreshCost.ToString(); base.transform.Find("RefreshTab/MetalNum/Num").GetComponent <Text>().color = MiscData.GetColor("TotalWhite"); base.transform.Find("RefreshTab/MetalNum/x").GetComponent <Text>().color = MiscData.GetColor("TotalWhite"); if (this._storeDataItem.refreshItemID == 0) { base.transform.Find("RefreshTab/MetalNum/ImgMetal").GetComponent <Image>().sprite = UIUtil.GetResourceSprite(ResourceType.Hcoin, null); if (Singleton <PlayerModule> .Instance.playerData.hcoin < this._storeDataItem.nextRefreshCost) { base.transform.Find("RefreshTab/MetalNum/Num").GetComponent <Text>().color = MiscData.GetColor("WarningRed"); base.transform.Find("RefreshTab/MetalNum/x").GetComponent <Text>().color = MiscData.GetColor("WarningRed"); } } else { string iconPath = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(this._storeDataItem.refreshItemID, 1).GetIconPath(); if (MiscData.GetCurrencyIconPath(this._storeDataItem.refreshItemID) != null) { iconPath = MiscData.GetCurrencyIconPath(this._storeDataItem.refreshItemID); } base.transform.Find("RefreshTab/MetalNum/ImgMetal").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(iconPath); int number = 0; StorageDataItemBase base3 = Singleton <StorageModule> .Instance.TryGetMaterialDataByID(this._storeDataItem.refreshItemID); if (base3 != null) { number = base3.number; } if (number < this._storeDataItem.nextRefreshCost) { base.transform.Find("RefreshTab/MetalNum/Num").GetComponent <Text>().color = MiscData.GetColor("WarningRed"); base.transform.Find("RefreshTab/MetalNum/x").GetComponent <Text>().color = MiscData.GetColor("WarningRed"); } } if (this._storeDataItem.manualRefreshTimes >= this._storeDataItem.maxManualRefreshTimes) { base.transform.Find("RefreshTab/RefreshBtn").GetComponent <Button>().interactable = false; } else { base.transform.Find("RefreshTab/RefreshBtn").GetComponent <Button>().interactable = true; } } }