Exemplo n.º 1
0
        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 InitRewardList()
        {
            RewardData data = this._rewardDataList[0];

            this._missionRewardList.Clear();
            if (data.get_exp() > 0)
            {
                RewardUIData playerExpData = RewardUIData.GetPlayerExpData((int)data.get_exp());
                this._missionRewardList.Add(playerExpData);
            }
            if (data.get_scoin() > 0)
            {
                RewardUIData scoinData = RewardUIData.GetScoinData((int)data.get_scoin());
                this._missionRewardList.Add(scoinData);
            }
            if (data.get_hcoin() > 0)
            {
                RewardUIData hcoinData = RewardUIData.GetHcoinData((int)data.get_hcoin());
                this._missionRewardList.Add(hcoinData);
            }
            if (data.get_stamina() > 0)
            {
                RewardUIData staminaData = RewardUIData.GetStaminaData((int)data.get_stamina());
                this._missionRewardList.Add(staminaData);
            }
            if (data.get_skill_point() > 0)
            {
                RewardUIData skillPointData = RewardUIData.GetSkillPointData((int)data.get_skill_point());
                this._missionRewardList.Add(skillPointData);
            }
            if (data.get_friends_point() > 0)
            {
                RewardUIData friendPointData = RewardUIData.GetFriendPointData((int)data.get_friends_point());
                this._missionRewardList.Add(friendPointData);
            }
            foreach (RewardItemData data8 in data.get_item_list())
            {
                RewardUIData data9 = new RewardUIData(ResourceType.Item, (int)data8.get_num(), RewardUIData.ITEM_ICON_TEXT_ID, string.Empty, (int)data8.get_id(), (int)data8.get_level());
                this._missionRewardList.Add(data9);
                StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem((int)data8.get_id(), (int)data8.get_level());

                if (dummyStorageDataItem is AvatarCardDataItem)
                {
                    this._avatarData = dummyStorageDataItem as AvatarCardDataItem;
                }
            }
            if (this._dropItemList != null)
            {
                foreach (DropItem item in this._dropItemList)
                {
                    RewardUIData data10 = new RewardUIData(ResourceType.Item, (int)item.get_num(), RewardUIData.ITEM_ICON_TEXT_ID, string.Empty, (int)item.get_item_id(), (int)item.get_level());
                    this._missionRewardList.Add(data10);
                }
            }
        }
        public MissionRewardGotDialogContext(List <RewardData> rewardDataList, List <DropItem> dropList = null)
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "MissionRewardGotDialogContext",
                viewPrefabPath = "UI/Menus/Dialog/MissionRewardGotDialog"
            };

            base.config          = pattern;
            this._rewardDataList = rewardDataList;
            this._dropItemList   = dropList;
            this._avatarData     = null;
        }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
        public PlayerLevelUpDialogContext()
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "PlayerLevelUpDialogContext",
                viewPrefabPath = "UI/Menus/Dialog/PlayerLevelUpDialog"
            };

            base.config = pattern;
            if (this._timer != null)
            {
                this._timer.Destroy();
            }
            this._timer = Singleton <MainUIManager> .Instance.SceneCanvas.CreateTimer(2f, 0f);

            this._timer.timeUpCallback = new Action(this.OnBGClick);
            this._timer.StopRun();
            this._avatarData = null;
        }
Exemplo n.º 6
0
        public bool CanSplit()
        {
            AvatarCardDataItem item = this._dropItem as AvatarCardDataItem;

            return((item != null) && item.IsSplite());
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
 public void SetNotifyWhenDestroy(AvatarCardDataItem avatarData)
 {
     this._avatarData = avatarData;
 }