Example #1
0
 private void OnBGBtnClick()
 {
     this.Destroy();
     if (this._onDestroy != null)
     {
         this._onDestroy();
     }
     if (this._playerLevelBefore < Singleton <PlayerModule> .Instance.playerData.teamLevel)
     {
         PlayerLevelUpDialogContext dialogContext = new PlayerLevelUpDialogContext();
         dialogContext.SetLevelBeforeNoScoreManager(this._playerLevelBefore);
         Singleton <MainUIManager> .Instance.ShowDialog(dialogContext, UIType.Any);
     }
 }
        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;
        }