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);
        }
Exemplo n.º 2
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);
        }