private void SetupWeapon()
        {
            string prefabPath = MiscData.Config.PrefabPath.WeaponBaseTypeIcon[this.storageItem.GetBaseType()];

            base.view.transform.Find("Info/Info/Title/Equipment/TypeIcon").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(prefabPath);
            base.view.transform.Find("Info/Info/Title/Equipment/Name").GetComponent <Text>().text        = this.storageItem.GetDisplayTitle();
            base.view.transform.Find("Info/Info/Content/Equipment/Cost/Num").GetComponent <Text>().text  = this.storageItem.GetCost().ToString();
            base.view.transform.Find("Info/Info/Content/Equipment/Star/EquipStar").GetComponent <MonoEquipSubStar>().SetupView(this.storageItem.rarity, this.storageItem.GetMaxRarity());
            base.view.transform.Find("Info/Info/Content/Equipment/Star/EquipSubStar").GetComponent <MonoEquipSubStar>().SetupView(this.storageItem.GetSubRarity(), this.storageItem.GetMaxSubRarity() - 1);
            base.view.transform.Find("Info/Info/Content/Equipment/3dModel").GetComponent <MonoWeaponRenderImage>().SetupView(this.storageItem as WeaponDataItem, false, 0);
            this.SetupItemProtectedStatus();
            base.view.transform.Find("Desc/Content/Text").GetComponent <Text>().text = this.storageItem.GetDescription();
            AvatarDataItem item = Singleton <AvatarModule> .Instance.TryGetAvatarByID(this.storageItem.avatarID);

            base.view.transform.Find("Info/Info/Content/Equipment/BtnInEquip").gameObject.SetActive(item != null);
            if (item != null)
            {
                base.view.transform.Find("Info/Info/Content/Equipment/BtnInEquip/EquipChara").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(item.IconPath);
            }
        }
 private void SetupStigmata()
 {
     base.view.transform.Find("PowerUpInfo/Equipment/Title/TypeIcon").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab((this.storageItem as StigmataDataItem).GetSmallIconPath());
     base.view.transform.Find("PowerUpInfo/Equipment/Title/Name").GetComponent <Text>().text        = this.storageItem.GetDisplayTitle();
     base.view.transform.Find("PowerUpInfo/Equipment/Cost/Num").GetComponent <Text>().text          = this.storageItem.GetCost().ToString();
     base.view.transform.Find("PowerUpInfo/Equipment/Star/EquipStar").GetComponent <MonoEquipSubStar>().SetupView(this.storageItem.rarity, this.storageItem.GetMaxRarity());
     base.view.transform.Find("PowerUpInfo/Equipment/Star/EquipSubStar").GetComponent <MonoEquipSubStar>().SetupView(this.storageItem.GetSubRarity(), this.storageItem.GetMaxSubRarity() - 1);
     base.view.transform.Find("Info/Figure").GetComponent <MonoStigmataFigure>().SetupView(this.storageItem as StigmataDataItem);
     this.SetupItemProtectedStatus();
 }
示例#3
0
 public static Sprite GetAvatarCardIcon(int avatarID)
 {
     return(Miscs.GetSpriteByPrefab(AvatarCardMetaDataReader.GetAvatarCardMetaDataByKey(AvatarMetaDataReaderExtend.GetAvatarIDsByKey(avatarID).avatarCardID).iconPath));
 }
        private void SetupStigmata()
        {
            StigmataDataItem storageItem = this.storageItem as StigmataDataItem;

            base.view.transform.Find("Info/Content/Equipment/Title/TypeIcon").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(storageItem.GetSmallIconPath());
            string displayTitle = this.storageItem.GetDisplayTitle();

            if (storageItem.IsAffixIdentify)
            {
                string affixName = storageItem.GetAffixName();
                if (!string.IsNullOrEmpty(affixName))
                {
                    displayTitle = MiscData.AddColor("Blue", affixName) + " " + displayTitle;
                }
            }
            else
            {
                displayTitle = MiscData.AddColor("WarningRed", storageItem.GetAffixName()) + " " + displayTitle;
            }
            base.view.transform.Find("Info/Content/Equipment/Title/Name").GetComponent <Text>().text = displayTitle;
            base.view.transform.Find("Info/Content/Equipment/Cost/Num").GetComponent <Text>().text   = this.storageItem.GetCost().ToString();
            this.SetupItemProtectedStatus();
            base.view.transform.Find("Info/Content/Equipment/Star/EquipStar").GetComponent <MonoEquipSubStar>().SetupView(this.storageItem.rarity, this.storageItem.GetMaxRarity());
            base.view.transform.Find("Info/Content/Equipment/Star/EquipSubStar").GetComponent <MonoEquipSubStar>().SetupView(this.storageItem.GetSubRarity(), this.storageItem.GetMaxSubRarity() - 1);
            base.view.transform.Find("Info/Figure").GetComponent <MonoStigmataFigure>().SetupViewWithIdentifyStatus(storageItem, this.hideActionBtns && !this.unlock);
            if (storageItem.IsAffixIdentify)
            {
                bool flag = (storageItem.CanRefine && (Singleton <TutorialModule> .Instance != null)) && UnlockUIDataReaderExtend.UnlockByTutorial(5);
                base.view.transform.Find("ActionBtns/NewAffixBtn").GetComponent <Button>().interactable = flag;
                bool flag2 = Singleton <StorageModule> .Instance.GetStigmatasCanUseForNewAffix(storageItem).Count > 0;

                base.view.transform.Find("ActionBtns/NewAffixBtn/PopUp").gameObject.SetActive(flag2 && flag);
            }
            else
            {
                base.view.transform.Find("ActionBtns/PowerUpBtn").GetComponent <Button>().interactable  = false;
                base.view.transform.Find("ActionBtns/RarityUpBtn").GetComponent <Button>().interactable = false;
                base.view.transform.Find("ActionBtns/NewAffixBtn").GetComponent <Button>().interactable = false;
                base.view.transform.Find("ActionBtns/NewAffixBtn/PopUp").gameObject.SetActive(false);
            }
            base.view.transform.Find("Info/Figure/InfoMark").gameObject.SetActive(storageItem.IsAffixIdentify && this.unlock);
            base.view.transform.Find("Info/IdentifyBtn").gameObject.SetActive((!this.hideActionBtns || this.showIdentifyBtnOnly) && !storageItem.IsAffixIdentify);
            base.view.transform.Find("Info/IdentifyBtn").GetComponent <DragObject>().Init(this.storageItem);
            base.view.transform.Find("Info/Content/Equipment/Desc").GetComponent <Text>().text = this.storageItem.GetDescription();
            base.view.transform.Find("Info/Content").gameObject.SetActive(true);
            AvatarDataItem item2 = Singleton <AvatarModule> .Instance.TryGetAvatarByID(this.storageItem.avatarID);

            base.view.transform.Find("Info/Content/BtnInEquip").gameObject.SetActive(item2 != null);
            if (item2 != null)
            {
                base.view.transform.Find("Info/Content/BtnInEquip/EquipChara").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(item2.IconPath);
            }
        }
示例#5
0
        private void SetupGroupList()
        {
            EndlessModule instance               = Singleton <EndlessModule> .Instance;
            int           currentGroupLevel      = instance.currentGroupLevel;
            List <EndlessGroupMetaData> itemList = EndlessGroupMetaDataReader.GetItemList();
            Transform transform = base.view.transform.Find("GroupPanel/GroupListPanel/GroupList");
            int       num2      = (int)instance.endlessData.get_cur_top_group_level();
            bool      flag      = instance.endlessData.get_top_group_player_numSpecified() && instance.endlessData.get_top_group_promote_unlock_player_numSpecified();
            float     num3      = instance.endlessData.get_top_group_player_num();
            float     num4      = instance.endlessData.get_top_group_promote_unlock_player_num();
            bool      flag2     = instance.CanSeeTopGroupInfo();

            for (int i = 0; i < transform.childCount; i++)
            {
                Transform child = transform.GetChild(i);
                if (i >= itemList.Count)
                {
                    child.gameObject.SetActive(false);
                }
                else
                {
                    string str;
                    EndlessGroupMetaData data = itemList[i];
                    bool flag3 = currentGroupLevel == data.groupLevel;
                    child.Find("CurrentGroup").gameObject.SetActive((this._viewStatus != ViewStatus.ShowCurrentGroup) ? (data.groupLevel == itemList.Count) : flag3);
                    if (data.groupLevel > num2)
                    {
                        str = MiscData.Config.EndlessGroupUnopenPrefabPath[data.groupLevel];
                    }
                    else if (data.groupLevel == currentGroupLevel)
                    {
                        str = MiscData.Config.EndlessGroupSelectPrefabPath[data.groupLevel];
                    }
                    else
                    {
                        str = MiscData.Config.EndlessGroupUnselectPrefabPath[data.groupLevel];
                    }
                    child.Find("Image").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(str);
                    if (flag2)
                    {
                        Button component = child.Find("Button").GetComponent <Button>();
                        if (flag3)
                        {
                            component.gameObject.SetActive(true);
                            base.BindViewCallback(component, new UnityAction(this.OnCurrentButtonClick));
                        }
                        else if (data.groupLevel == instance.TopGroupLevel)
                        {
                            child.Find("Button").GetComponent <Button>().gameObject.SetActive(true);
                            child.Find("Particle").GetComponent <ParticleSystem>().gameObject.SetActive(true);
                            base.BindViewCallback(component, new UnityAction(this.OnTopGroupButtonClick));
                        }
                    }
                    else if (data.groupLevel == (num2 + 1))
                    {
                        child.Find("Button").GetComponent <Button>().gameObject.SetActive(true);
                        base.BindViewCallback(child.Find("Button").GetComponent <Button>(), new UnityAction(this.ShowNextGroupHint));
                    }
                    else
                    {
                        child.Find("Button").GetComponent <Button>().gameObject.SetActive(false);
                    }
                    bool flag4 = data.groupLevel == (num2 + 1);
                    child.Find("Slider").gameObject.SetActive(flag4 && flag);
                    child.Find("Slider/Fill").GetComponent <Image>().fillAmount = num3 / num4;
                }
            }
            if (instance.CanRequestTopGroupInfo())
            {
                Singleton <NetworkManager> .Instance.RequestGetEndlessTopGroup();
            }
        }
示例#6
0
        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);
            }
        }
        protected override bool SetupView()
        {
            StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(this._ticketID, 1);

            StorageDataItemBase base3 = Singleton <StorageModule> .Instance.TryGetMaterialDataByID(this._ticketID);

            this._currentTicketNum = (base3 != null) ? base3.number : 0;
            this._ticketPrice      = Singleton <PlayerModule> .Instance.playerData.gachaTicketPriceDict[this._ticketID];
            this._lackTicketNum    = this._wantedNum - this._currentTicketNum;
            this._hcoinEnough      = Singleton <PlayerModule> .Instance.playerData.hcoin >= (this._lackTicketNum * this._ticketPrice);
            string str  = !this._hcoinEnough ? LocalizationGeneralLogic.GetText("Menu_GoToRecharge", new object[0]) : LocalizationGeneralLogic.GetText("Menu_Buy", new object[0]);
            string str2 = !this._hcoinEnough ? LocalizationGeneralLogic.GetText("Menu_GoToRechargeDesc", new object[0]) : LocalizationGeneralLogic.GetText("Menu_Desc_GachaTicketLack", new object[] { dummyStorageDataItem.GetDisplayTitle(), this._lackTicketNum *this._ticketPrice, this._lackTicketNum, dummyStorageDataItem.GetDisplayTitle() });

            base.view.transform.Find("Dialog/Content/DoubleButton/OKBtn/Text").GetComponent <Text>().text = str;
            base.view.transform.Find("Dialog/Content/Desc/DescText").GetComponent <Text>().text           = str2;
            string iconPath = dummyStorageDataItem.GetIconPath();

            base.view.transform.Find("Dialog/Content/TicketIcon/Image").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(iconPath);
            base.view.transform.Find("Dialog/Content/CurretnTickets/Content/TicketLabel").GetComponent <Text>().text = dummyStorageDataItem.GetDisplayTitle();
            base.view.transform.Find("Dialog/Content/CurretnTickets/Content/Num").GetComponent <Text>().text         = this._currentTicketNum.ToString();
            object[] replaceParams = new object[] { dummyStorageDataItem.GetDisplayTitle() };
            base.view.transform.Find("Dialog/Title/Text").GetComponent <Text>().text = LocalizationGeneralLogic.GetText("Menu_Title_GachaTitcketLack", replaceParams);
            return(false);
        }
示例#8
0
        public void SetupView(StorageDataItemBase item, SelectMode selectMode = 0, bool isSelected = false, bool bShowCostOver = false, bool bUsed = false)
        {
            this._item       = item;
            this.selectMode  = selectMode;
            this._isSelected = isSelected;
            base.transform.Find("SelectedMark").gameObject.SetActive(false);
            base.transform.Find("ProtectedMark").gameObject.SetActive(false);
            base.transform.Find("InteractiveMask").gameObject.SetActive(false);
            base.transform.Find("NotEnough").gameObject.SetActive(false);
            base.transform.Find("Star").gameObject.SetActive(false);
            base.transform.Find("StigmataType").gameObject.SetActive(false);
            base.transform.Find("UnidentifyText").gameObject.SetActive(false);
            base.transform.Find("QuestionMark").gameObject.SetActive(false);
            base.transform.Find("MinusBtn").gameObject.SetActive(false);
            if (this._item == null)
            {
                base.transform.Find("ItemIcon").gameObject.SetActive(false);
                base.transform.Find("Text").gameObject.SetActive(false);
            }
            else
            {
                base.transform.Find("ItemIcon").gameObject.SetActive(true);
                base.transform.Find("Text").gameObject.SetActive(true);
                Sprite spriteByPrefab = Miscs.GetSpriteByPrefab(item.GetIconPath());
                base.transform.Find("ItemIcon/Icon").GetComponent <Image>().sprite = spriteByPrefab;
                base.transform.Find("ItemIcon").GetComponent <Image>().color       = Color.white;
                base.transform.Find("ItemIcon").GetComponent <Image>().sprite      = Miscs.GetSpriteByPrefab(MiscData.Config.ItemRarityBGImgPath[item.rarity]);
                if ((this._item is WeaponDataItem) || (this._item is StigmataDataItem))
                {
                    base.transform.Find("Text").GetComponent <Text>().text = "LV." + item.level;
                }
                else if (this._item is MaterialDataItem)
                {
                    string str = "\x00d7" + item.number;
                    if (selectMode == SelectMode.ConsumeMaterial)
                    {
                        StorageDataItemBase base2 = Singleton <StorageModule> .Instance.TryGetMaterialDataByID(this._item.ID);

                        int num = (base2 != null) ? base2.number : 0;
                        if (this._item.number > num)
                        {
                            str = MiscData.AddColor("WarningRed", num + " / ") + MiscData.AddColor("TotalBlack", this._item.number.ToString());
                        }
                        else
                        {
                            str = MiscData.AddColor("TotalBlack", num + " / " + this._item.number);
                        }
                    }
                    base.transform.Find("Text").GetComponent <Text>().text = str;
                }
                else if (this._item is AvatarFragmentDataItem)
                {
                    base.transform.Find("Text").GetComponent <Text>().text = "\x00d7" + item.number;
                }
                else
                {
                    base.transform.Find("Text").gameObject.SetActive(false);
                }
                this.SetupRarityView();
                this.SetupStigmataTypeIcon();
                if (selectMode != SelectMode.None)
                {
                    this.SetupSelectedView(isSelected);
                }
                else
                {
                    base.transform.Find("BG/Unselected").gameObject.SetActive(true);
                    base.transform.Find("BG/Selected").gameObject.SetActive(false);
                }
                if (this.showProtected)
                {
                    this.SetupProtectedView();
                }
                this.SetupBlockSelectView();
                this.SetupCostView(bShowCostOver);
                this.SetupUsedView(bUsed);
                base.transform.Find("ItemIcon/Icon").GetComponent <Image>().material = null;
                base.transform.Find("ItemIcon/Icon").GetComponent <Image>().color    = MiscData.GetColor("TotalWhite");
                if (this._item is StigmataDataItem)
                {
                    this.SetupStigmataAffixView((this._item as StigmataDataItem).IsAffixIdentify);
                }
            }
        }
示例#9
0
        protected override bool SetupView()
        {
            this.SetupRarityView();
            base.view.transform.Find("Dialog/Content/Icon/Image").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(this.storageItem.GetImagePath());
            Transform transform = base.view.transform.Find("Dialog/Content/Star/EquipStar");

            if (this.storageItem is AvatarFragmentDataItem)
            {
                transform.gameObject.SetActive(false);
            }
            else
            {
                transform.gameObject.SetActive(true);
                transform.GetComponent <MonoEquipStar>().SetupView(this.storageItem.rarity);
            }
            base.view.transform.Find("Dialog/Content/NameText").GetComponent <Text>().text = this.storageItem.GetDisplayTitle();
            base.view.transform.Find("Dialog/Content/DescText").GetComponent <Text>().text = this.GetAllDesc();
            base.view.transform.Find("Dialog/Content/Num/Text").GetComponent <Text>().text = this.storageItem.number.ToString();
            base.view.transform.Find("Dialog/Content/Num").gameObject.SetActive(!this.hideActionBtns);
            base.view.transform.Find("Dialog/Content/RarityUpBtn").gameObject.SetActive(!this.hideActionBtns && (this.storageItem.GetEvoStorageItem() != null));
            return(false);
        }
示例#10
0
        protected override bool SetupView()
        {
            bool flag = Singleton <FriendModule> .Instance.IsMyFriend(this.playerInfo.uid);

            base.view.transform.Find("Dialog/Content/ActionBtns/AddFriendBtn").gameObject.SetActive(!flag);
            base.view.transform.Find("Dialog/Content/IsFriendMark").gameObject.SetActive(flag);
            base.view.transform.Find("Dialog/Content/ActionBtns/AddFriendBtn").gameObject.SetActive(!Singleton <FriendModule> .Instance.IsMyFriend(this.playerInfo.uid));
            base.view.transform.Find("Dialog/Content/Icon/Image").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(this.playerInfo.leaderAvatar.IconPath);
            base.view.transform.Find("Dialog/Content/NameText").GetComponent <Text>().text      = this.playerInfo.nickName;
            base.view.transform.Find("Dialog/Content/DescText").GetComponent <Text>().text      = this.playerInfo.Desc;
            return(false);
        }
示例#11
0
 public void SetupView(AvatarDataItem avatarData)
 {
     this._avatarData = avatarData;
     base.transform.Find("Info/AttrImage/Image").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(this._avatarData.AttributeIconPath);
     base.transform.Find("Info/NameText").GetComponent <Text>().text           = this._avatarData.FullName;
     base.transform.Find("Info/LvText").GetComponent <Text>().text             = "LV." + this._avatarData.level;
     base.transform.Find("Info/CombatNumText").GetComponent <Text>().text      = Mathf.FloorToInt(this._avatarData.CombatNum).ToString();
     base.transform.Find("Info/Cost/CurrentCost").GetComponent <Text>().text   = this._avatarData.GetCurrentCost().ToString();
     base.transform.Find("Info/Cost/MaxCost").GetComponent <Text>().text       = this._avatarData.MaxCost.ToString();
 }
示例#12
0
        protected override bool SetupView()
        {
            base.view.transform.Find("Btn").gameObject.SetActive(false);
            this._groupBGColor = Miscs.ParseColor(MiscData.Config.EndlessGroupBGColor[(int)this._rewardData.get_group_level()]);
            this.SetupRewardTilte();
            base.view.transform.Find("Dialog/Content/GroupPanel/GroupBGL/GroupIcon").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(MiscData.Config.EndlessGroupSelectPrefabPath[(int)this._rewardData.get_group_level()]);
            Transform transform = base.view.transform.Find("Dialog/Content/GetProps");

            this.InitRewardList();
            for (int i = 1; i <= 3; i++)
            {
                Transform transform2 = transform.Find(i.ToString());
                if (i > this._gotRewardList.Count)
                {
                    transform2.gameObject.SetActive(false);
                }
                else
                {
                    RewardUIData data = this._gotRewardList[i - 1];
                    transform2.Find("Image").GetComponent <Image>().sprite = data.GetIconSprite();
                    transform2.Find("Num").GetComponent <Text>().text      = data.value.ToString();
                }
            }
            Transform transform3 = base.view.transform.Find("Dialog/Content/GroupPanel/Ranking");

            transform3.Find("Up").gameObject.SetActive(false);
            transform3.Find("Flat").gameObject.SetActive(false);
            transform3.Find("Down").gameObject.SetActive(false);
            switch (this._rewardData.get_reward_type())
            {
            case 1:
                transform3.Find("Up").gameObject.SetActive(true);
                break;

            case 2:
                transform3.Find("Flat").gameObject.SetActive(true);
                break;

            case 3:
                transform3.Find("Down").gameObject.SetActive(true);
                break;
            }
            base.view.transform.Find("Dialog/Content/GroupPanel/Label").gameObject.SetActive(false);
            return(false);
        }
示例#13
0
        private bool PlayEffect()
        {
            string path = string.Empty;
            int    num  = (int)this._rewardData.get_group_level();

            switch (this._rewardData.get_reward_type())
            {
            case 1:
            {
                int count = EndlessGroupMetaDataReader.GetItemList().Count;
                if (this._rewardData.get_group_level() < (count - 1))
                {
                    path = "UI/Menus/Widget/Storage/UpgradingBigSuccess";
                    num++;
                    break;
                }
                path = "UI/Menus/Widget/Storage/UpgradingLargeSuccess";
                num  = count;
                break;
            }

            case 2:
                path = "UI/Menus/Widget/Storage/UpgradingBigSuccess";
                break;

            case 3:
                path = "UI/Menus/Widget/Storage/UpgradingBigSuccess";
                if (num > 1)
                {
                    num--;
                }
                break;
            }
            UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>(path)).transform.SetParent(base.view.transform, false);
            base.view.transform.Find("Dialog/Content/GroupPanel/GroupBGL/GroupIcon").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(MiscData.Config.EndlessGroupSelectPrefabPath[num]);
            base.view.transform.Find("Btn").gameObject.SetActive(true);
            return(false);
        }
示例#14
0
        private void SetupWeapon()
        {
            string prefabPath = MiscData.Config.PrefabPath.WeaponBaseTypeIcon[this.storageItem.GetBaseType()];

            base.view.transform.Find("Info/Info/Title/Equipment/TypeIcon").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(prefabPath);
            base.view.transform.Find("Info/Info/Title/Equipment/Name").GetComponent <Text>().text        = this.storageItem.GetDisplayTitle();
            base.view.transform.Find("Info/Info/Content/Equipment/Cost/Num").GetComponent <Text>().text  = this.storageItem.GetCost().ToString();
            base.view.transform.Find("Info/Info/Content/Equipment/Star/EquipStar").GetComponent <MonoEquipSubStar>().SetupView(this.storageItem.rarity, this.storageItem.GetMaxRarity());
            base.view.transform.Find("Info/Info/Content/Equipment/Star/EquipSubStar").GetComponent <MonoEquipSubStar>().SetupView(this.storageItem.GetSubRarity(), this.storageItem.GetMaxSubRarity() - 1);
            base.view.transform.Find("Info/Info/Content/Equipment/3dModel").GetComponent <MonoWeaponRenderImage>().SetupView(this.storageItem as WeaponDataItem, true, 0);
            this.SetupItemProtectedStatus();
        }
示例#15
0
 private void AddIcon(int skillId)
 {
     base.transform.AddChildFromPrefab(this.iconPrefab, "Icon").Find("Image").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(this._avatarData.GetAvatarSkillBySkillID(skillId).IconPath);
 }
示例#16
0
 private void SetupStigmataTypeIcon()
 {
     base.transform.Find("StigmataType").gameObject.SetActive(this._item is StigmataDataItem);
     if (this._item is StigmataDataItem)
     {
         base.transform.Find("StigmataType/Image").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(MiscData.Config.StigmataTypeIconPath[this._item.GetBaseType()]);
     }
 }
示例#17
0
        private void SetupPrice(ShopGoodsMetaData goodsItem)
        {
            List <int> list = (this._ticketID <= 0) ? UIUtil.GetGoodsRealPrice(this._goods) : new List <int> {
                goodsItem.HCoinCost
            };

            if (this._isMultiCurrency)
            {
                if (list.Count > 3)
                {
                    base.transform.GetComponent <LayoutElement>().preferredWidth = 320f;
                }
                else
                {
                    base.transform.GetComponent <LayoutElement>().preferredWidth = 220f;
                }
            }
            Transform transform  = base.transform.Find("BG/Unselected/NowPrize");
            Transform transform2 = base.transform.Find("BG/Selected/NowPrize");
            int       num        = 1;

            if (goodsItem.HCoinCost > 0)
            {
                if (this._isMultiCurrency)
                {
                    transform.Find(string.Format("{0}/Image", num)).GetComponent <Image>().sprite  = Miscs.GetSpriteByPrefab("SpriteOutput/RewardIcons/Hcoin");
                    transform2.Find(string.Format("{0}/Image", num)).GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab("SpriteOutput/RewardIcons/Hcoin");
                    transform.Find(string.Format("{0}/Num", num)).GetComponent <Text>().text       = list[num - 1].ToString();
                    transform2.Find(string.Format("{0}/Num", num)).GetComponent <Text>().text      = list[num - 1].ToString();
                }
                else
                {
                    transform.Find("Image").GetComponent <Image>().sprite  = Miscs.GetSpriteByPrefab("SpriteOutput/RewardIcons/Hcoin");
                    transform2.Find("Image").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab("SpriteOutput/RewardIcons/Hcoin");
                    transform.Find("Num").GetComponent <Text>().text       = list[num - 1].ToString();
                    transform2.Find("Num").GetComponent <Text>().text      = list[num - 1].ToString();
                }
                this.SetupCurrencyColor(list[num - 1] <= Singleton <PlayerModule> .Instance.playerData.hcoin, num);
                num++;
            }
            if (goodsItem.SCoinCost > 0)
            {
                if (this._isMultiCurrency)
                {
                    transform.Find(string.Format("{0}/Image", num)).GetComponent <Image>().sprite  = Miscs.GetSpriteByPrefab("SpriteOutput/RewardIcons/Scoin");
                    transform2.Find(string.Format("{0}/Image", num)).GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab("SpriteOutput/RewardIcons/Scoin");
                    transform.Find(string.Format("{0}/Num", num)).GetComponent <Text>().text       = list[num - 1].ToString();
                    transform2.Find(string.Format("{0}/Num", num)).GetComponent <Text>().text      = list[num - 1].ToString();
                }
                else
                {
                    transform.Find("Image").GetComponent <Image>().sprite  = Miscs.GetSpriteByPrefab("SpriteOutput/RewardIcons/Scoin");
                    transform2.Find("Image").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab("SpriteOutput/RewardIcons/Scoin");
                    transform.Find("Num").GetComponent <Text>().text       = list[num - 1].ToString();
                    transform2.Find("Num").GetComponent <Text>().text      = list[num - 1].ToString();
                }
                this.SetupCurrencyColor(list[num - 1] <= Singleton <PlayerModule> .Instance.playerData.scoin, num);
                num++;
            }
            if (goodsItem.CostItemId > 0)
            {
                StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(goodsItem.CostItemId, 1);

                string currencyIconPath = MiscData.GetCurrencyIconPath(goodsItem.CostItemId);
                if (string.IsNullOrEmpty(currencyIconPath))
                {
                    currencyIconPath = dummyStorageDataItem.GetIconPath();
                }
                if (this._isMultiCurrency)
                {
                    transform.Find(string.Format("{0}/Image", num)).GetComponent <Image>().sprite  = Miscs.GetSpriteByPrefab(currencyIconPath);
                    transform2.Find(string.Format("{0}/Image", num)).GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(currencyIconPath);
                    transform.Find(string.Format("{0}/Num", num)).GetComponent <Text>().text       = list[num - 1].ToString();
                    transform2.Find(string.Format("{0}/Num", num)).GetComponent <Text>().text      = list[num - 1].ToString();
                }
                else
                {
                    transform.Find("Image").GetComponent <Image>().sprite  = Miscs.GetSpriteByPrefab(currencyIconPath);
                    transform2.Find("Image").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(currencyIconPath);
                    transform.Find("Num").GetComponent <Text>().text       = list[num - 1].ToString();
                    transform2.Find("Num").GetComponent <Text>().text      = list[num - 1].ToString();
                }
                int number = 0;
                StorageDataItemBase base3 = Singleton <StorageModule> .Instance.TryGetMaterialDataByID(goodsItem.CostItemId);

                if (base3 != null)
                {
                    number = base3.number;
                }
                this.SetupCurrencyColor(list[num - 1] <= number, num);
                num++;
            }
            if (goodsItem.CostItemId2 > 0)
            {
                StorageDataItemBase base4 = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(goodsItem.CostItemId2, 1);

                string iconPath = MiscData.GetCurrencyIconPath(goodsItem.CostItemId2);
                if (string.IsNullOrEmpty(iconPath))
                {
                    iconPath = base4.GetIconPath();
                }
                if (this._isMultiCurrency)
                {
                    transform.Find(string.Format("{0}/Image", num)).GetComponent <Image>().sprite  = Miscs.GetSpriteByPrefab(iconPath);
                    transform2.Find(string.Format("{0}/Image", num)).GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(iconPath);
                    transform.Find(string.Format("{0}/Num", num)).GetComponent <Text>().text       = list[num - 1].ToString();
                    transform2.Find(string.Format("{0}/Num", num)).GetComponent <Text>().text      = list[num - 1].ToString();
                }
                int num3 = 0;
                StorageDataItemBase base5 = Singleton <StorageModule> .Instance.TryGetMaterialDataByID(goodsItem.CostItemId2);

                if (base5 != null)
                {
                    num3 = base5.number;
                }
                this.SetupCurrencyColor(list[num - 1] <= num3, num);
                num++;
            }
            if (goodsItem.CostItemId3 > 0)
            {
                StorageDataItemBase base6 = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(goodsItem.CostItemId3, 1);

                string str3 = MiscData.GetCurrencyIconPath(goodsItem.CostItemId3);
                if (string.IsNullOrEmpty(str3))
                {
                    str3 = base6.GetIconPath();
                }
                if (this._isMultiCurrency)
                {
                    transform.Find(string.Format("{0}/Image", num)).GetComponent <Image>().sprite  = Miscs.GetSpriteByPrefab(str3);
                    transform2.Find(string.Format("{0}/Image", num)).GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(str3);
                    transform.Find(string.Format("{0}/Num", num)).GetComponent <Text>().text       = list[num - 1].ToString();
                    transform2.Find(string.Format("{0}/Num", num)).GetComponent <Text>().text      = list[num - 1].ToString();
                }
                int num4 = 0;
                StorageDataItemBase base7 = Singleton <StorageModule> .Instance.TryGetMaterialDataByID(goodsItem.CostItemId3);

                if (base7 != null)
                {
                    num4 = base7.number;
                }
                this.SetupCurrencyColor(list[num - 1] <= num4, num);
                num++;
            }
            if (goodsItem.CostItemId4 > 0)
            {
                StorageDataItemBase base8 = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(goodsItem.CostItemId4, 1);

                string str4 = MiscData.GetCurrencyIconPath(goodsItem.CostItemId4);
                if (string.IsNullOrEmpty(str4))
                {
                    str4 = base8.GetIconPath();
                }
                if (this._isMultiCurrency)
                {
                    transform.Find(string.Format("{0}/Image", num)).GetComponent <Image>().sprite  = Miscs.GetSpriteByPrefab(str4);
                    transform2.Find(string.Format("{0}/Image", num)).GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(str4);
                    transform.Find(string.Format("{0}/Num", num)).GetComponent <Text>().text       = list[num - 1].ToString();
                    transform2.Find(string.Format("{0}/Num", num)).GetComponent <Text>().text      = list[num - 1].ToString();
                }
                int num5 = 0;
                StorageDataItemBase base9 = Singleton <StorageModule> .Instance.TryGetMaterialDataByID(goodsItem.CostItemId4);

                if (base9 != null)
                {
                    num5 = base9.number;
                }
                this.SetupCurrencyColor(list[num - 1] <= num5, num);
                num++;
            }
            if (goodsItem.CostItemId5 > 0)
            {
                StorageDataItemBase base10 = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(goodsItem.CostItemId5, 1);

                string str5 = MiscData.GetCurrencyIconPath(goodsItem.CostItemId5);
                if (string.IsNullOrEmpty(str5))
                {
                    str5 = base10.GetIconPath();
                }
                if (this._isMultiCurrency)
                {
                    transform.Find(string.Format("{0}/Image", num)).GetComponent <Image>().sprite  = Miscs.GetSpriteByPrefab(str5);
                    transform2.Find(string.Format("{0}/Image", num)).GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(str5);
                    transform.Find(string.Format("{0}/Num", num)).GetComponent <Text>().text       = list[num - 1].ToString();
                    transform2.Find(string.Format("{0}/Num", num)).GetComponent <Text>().text      = list[num - 1].ToString();
                }
                int num6 = 0;
                StorageDataItemBase base11 = Singleton <StorageModule> .Instance.TryGetMaterialDataByID(goodsItem.CostItemId5);

                if (base11 != null)
                {
                    num6 = base11.number;
                }
                this.SetupCurrencyColor(list[num - 1] <= num6, num);
                num++;
            }
            if (list.Count < transform.childCount)
            {
                for (int i = list.Count; i < transform.childCount; i++)
                {
                    transform.GetChild(i).gameObject.SetActive(false);
                    transform2.GetChild(i).gameObject.SetActive(false);
                }
            }
            if (goodsItem.Discount < 0x2710)
            {
                int num8 = UIUtil.GetGoodsOriginPrice(this._goods)[0];
                base.transform.Find("BG/Unselected/FakePrize").gameObject.SetActive(true);
                base.transform.Find("BG/Selected/FakePrize").gameObject.SetActive(true);
                base.transform.Find("BG/Unselected/FakePrize/Num").GetComponent <Text>().text = num8.ToString();
                base.transform.Find("BG/Selected/FakePrize/Num").GetComponent <Text>().text   = num8.ToString();
            }
            else
            {
                base.transform.Find("BG/Unselected/FakePrize").gameObject.SetActive(false);
                base.transform.Find("BG/Selected/FakePrize").gameObject.SetActive(false);
            }
            if (!this._isMultiCurrency)
            {
                base.transform.Find("BG/Unselected/NowPrize/Image").gameObject.SetActive(true);
                base.transform.Find("BG/Unselected/NowPrize/x").gameObject.SetActive(true);
                base.transform.Find("BG/Unselected/NowPrize/Num").gameObject.SetActive(true);
                base.transform.Find("BG/Selected/NowPrize/Image").gameObject.SetActive(true);
                base.transform.Find("BG/Selected/NowPrize/x").gameObject.SetActive(true);
                base.transform.Find("BG/Selected/NowPrize/Num").gameObject.SetActive(true);
            }
        }
示例#18
0
        private void SetupRewardPanel(StageEndRsp rsp)
        {
            string            str;
            LevelScoreManager instance   = Singleton <LevelScoreManager> .Instance;
            PlayerModule      module     = Singleton <PlayerModule> .Instance;
            Transform         transform  = base.view.transform.Find("RewardPanel/ExpPanel");
            Transform         transform2 = transform.Find("PlayerExp/InfoRowLv");

            transform2.Find("LevelLabel").GetComponent <Text>().text = "LV." + instance.playerLevelBefore;
            transform2.Find("Exp/AddExp").GetComponent <Text>().text = rsp.get_player_exp_reward().ToString();
            transform2.Find("Exp/TiltSlider/").GetComponent <MonoMaskSlider>().UpdateValue((float)instance.playerExpBefore, (float)module.playerData.TeamMaxExp, 0f);
            transform2.Find("Exp/MaxNumText").GetComponent <Text>().text = module.playerData.TeamMaxExp.ToString();
            transform2.Find("Exp/NumText").GetComponent <Text>().text    = module.playerData.teamExp.ToString();
            if (instance.playerLevelBefore < module.playerData.teamLevel)
            {
                this._playerLevelUpDialogContext = new PlayerLevelUpDialogContext();
                this._playerLevelUpAndAvatarNewSkillDialogManager.AddDialog(this._playerLevelUpDialogContext);
            }
            this._leftPanelAnimationManager.AddAnimation(transform.Find("PlayerExp").GetComponent <MonoAnimationinSequence>(), null);
            for (int i = 0; i < 3; i++)
            {
                Transform      child      = transform.Find("AvatarExp/Team").GetChild(i);
                Transform      transform4 = transform.Find("AvatarExp/Exps").GetChild(i);
                AvatarDataItem avatarData = (i >= instance.memberList.Count) ? null : Singleton <AvatarModule> .Instance.GetAvatarByID(instance.memberList[i].avatarID);

                if (avatarData == null)
                {
                    child.gameObject.SetActive(false);
                    transform4.gameObject.SetActive(false);
                    child.Find("BG/BGColor").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab("SpriteOutput/AvatarTachie/BgType4");
                }
                else
                {
                    AvatarDataItem item2 = instance.memberList[i];
                    child.Find("Content").gameObject.SetActive(true);
                    child.Find("BG/BGColor").GetComponent <Image>().sprite     = Miscs.GetSpriteByPrefab(MiscData.Config.AvatarAttributeBGSpriteList[avatarData.Attribute]);
                    child.Find("Content/Avatar").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(avatarData.AvatarTachie);
                    child.Find("Content/LVNum").GetComponent <Text>().text     = item2.level.ToString();
                    child.Find("Content/StarPanel/AvatarStar").GetComponent <MonoAvatarStar>().SetupView(avatarData.star);
                    transform4.Find("AddExp").gameObject.SetActive(false);
                    if (rsp.get_avatar_exp_rewardSpecified())
                    {
                        transform4.Find("AddExp").gameObject.SetActive(true);
                        transform4.Find("AddExp").GetComponent <Text>().text = rsp.get_avatar_exp_reward().ToString();
                    }
                    transform4.Find("TiltSlider").GetComponent <MonoMaskSlider>().UpdateValue((float)avatarData.exp, (float)avatarData.MaxExp, 0f);
                    if ((avatarData.level != item2.level) || (avatarData.star != item2.star))
                    {
                        UIUtil.UpdateAvatarSkillStatusInLocalData(avatarData);
                    }
                    foreach (KeyValuePair <string, bool> pair in Singleton <AvatarModule> .Instance.GetCanUnlockSkillNameList(avatarData.avatarID, item2.level, item2.star, avatarData.level, avatarData.star))
                    {
                        this._playerLevelUpAndAvatarNewSkillDialogManager.AddDialog(new AvatarNewSkillCanUnlockDialogContext(avatarData.FullName, pair.Key, pair.Value));
                    }
                }
            }
            this._leftPanelAnimationManager.AddAnimation(transform.Find("AvatarExp").GetComponent <MonoAnimationinSequence>(), null);
            this._helperInfo = instance.friendDetailItem;
            this.SetTotalDropList(rsp, out this._dropItemList, out this._normalDropItem, out this._fastDropItem, out this._sonicDropItem);
            foreach (DropItem item3 in this._dropItemList)
            {
                if (Singleton <StorageModule> .Instance.IsItemNew((int)item3.get_item_id()))
                {
                    StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem((int)item3.get_item_id(), 1);

                    dummyStorageDataItem.level  = (int)item3.get_level();
                    dummyStorageDataItem.number = (int)item3.get_num();
                    this._dropNewItemDialogManager.AddDialog(new DropNewItemDialogContext(dummyStorageDataItem, true, false));
                }
            }
            Transform transform5 = base.view.transform.Find("RewardPanel/DropPanel");

            this._dropPanelBGAnimationManager.AddAnimation(transform5.GetComponent <MonoAnimationinSequence>(), null);
            transform5.Find("Drops/ScrollView").GetComponent <MonoGridScroller>().Init((trans, index) => this.OnScrollerChange(trans, index), this._dropItemList.Count, null);
            IEnumerator enumerator = transform5.Find("Drops/ScrollView/Content").GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    MonoAnimationinSequence component = ((Transform)enumerator.Current).GetComponent <MonoAnimationinSequence>();
                    if (component != null)
                    {
                        component.animationName = "DropItemScale07";
                    }
                }
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable == null)
                {
                }
                disposable.Dispose();
            }
            this._dropPanelBGAnimationManager.AddAllChildrenInTransform(transform5.Find("Drops/ScrollView/Content"));
            transform5.Find("Reward").gameObject.SetActive(true);
            if (rsp.get_scoin_rewardSpecified())
            {
                str = rsp.get_scoin_reward().ToString();
            }
            else
            {
                str = "0";
            }
            transform5.Find("Reward/Num/Num").GetComponent <Text>().text = str;
        }
示例#19
0
        private bool SetupEliteIcon(MonsterActor monsterActor)
        {
            Transform trans = base.transform.Find("EliteIcons");

            trans.DestroyChildren();
            bool flag = false;

            if (monsterActor.uniqueMonsterID > 0)
            {
                return(false);
            }
            foreach (ActorAbility ability in monsterActor.abilityPlugin.GetAppliedAbilities())
            {
                if ((ability != null) && (ability.config != null))
                {
                    string abilityName = ability.config.AbilityName;
                    if (MiscData.Config.EliteAbilityIcon.ContainsKey(abilityName))
                    {
                        string str2   = MiscData.Config.EliteAbilityIcon[abilityName].ToString();
                        string textID = MiscData.Config.EliteAbilityText[abilityName].ToString();
                        if (!string.IsNullOrEmpty(str2))
                        {
                            GameObject obj2 = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>("UI/Menus/Widget/InLevel/EliteIcon", BundleType.RESOURCE_FILE));
                            obj2.transform.SetParent(trans, false);
                            obj2.transform.Find("Image").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(str2);
                            obj2.transform.Find("Text").GetComponent <Text>().text     = LocalizationGeneralLogic.GetText(textID, new object[0]);
                            flag = true;
                        }
                    }
                }
            }
            trans.gameObject.SetActive(flag);
            return(flag);
        }