public void OnOKButtonCallBack()
        {
            int num;

            if (int.TryParse(base.view.transform.Find("Dialog/Content/SearchID/InputField").GetComponent <InputField>().text, out num))
            {
                if (num == Singleton <PlayerModule> .Instance.playerData.userId)
                {
                    Singleton <MainUIManager> .Instance.ShowDialog(new GeneralHintDialogContext(LocalizationGeneralLogic.GetText("Err_SearchSelf", new object[0]), 2f), UIType.Any);
                }
                else if (Singleton <FriendModule> .Instance.IsMyFriend(num))
                {
                    Singleton <MainUIManager> .Instance.ShowDialog(new GeneralHintDialogContext(LocalizationGeneralLogic.GetText("Err_IsFriend", new object[0]), 2f), UIType.Any);
                }
                else
                {
                    FriendDetailDataItem playerInfo = Singleton <FriendModule> .Instance.TryGetFriendDetailData(num);

                    if (playerInfo == null)
                    {
                        Singleton <NetworkManager> .Instance.RequestFriendDetailInfo(num);
                    }
                    else
                    {
                        Singleton <MainUIManager> .Instance.ShowDialog(new SearchedFriendDetailDialogContext(playerInfo, false), UIType.Any);

                        this.Close();
                    }
                }
            }
            else
            {
                base.view.transform.Find("Dialog/Content/ErrHintText").gameObject.SetActive(true);
            }
        }
 public void SetupView(FriendDetailDataItem userData)
 {
     this._isRemoteAvatar = true;
     this._userData       = userData;
     this._avatarData     = this._userData.leaderAvatar;
     base.transform.Find("Info/ChangeBtn").gameObject.SetActive(false);
     this.SetupWeapon(this._userData.leaderAvatar.GetWeapon());
 }
Example #3
0
 public void SetupView(FriendDetailDataItem userData)
 {
     this._isRemoteAvatar = true;
     this._userData       = userData;
     this._avatarData     = this._userData.leaderAvatar;
     this.SetupSlots();
     this.SetupSetEffect();
 }
Example #4
0
 private bool OnGetPlayerDetailDataRsp(GetPlayerDetailDataRsp rsp)
 {
     if (rsp.get_retcode() == null)
     {
         PlayerDetailData     playerDetailData = rsp.get_detail();
         FriendDetailDataItem item             = new FriendDetailDataItem(playerDetailData);
         this._playerDetialInfoCacheDict[(int)playerDetailData.get_uid()] = new CacheData <FriendDetailDataItem>(item);
     }
     return(false);
 }
Example #5
0
 private bool OnPlayerDetailRsp(GetPlayerDetailDataRsp rsp)
 {
     if ((rsp.get_retcode() == null) && (this._playerUidToShow == rsp.get_detail().get_uid()))
     {
         this._playerUidToShow = -1;
         FriendDetailDataItem detailData = new FriendDetailDataItem(rsp.get_detail());
         return(this.ShowFriendDetailInfo(detailData));
     }
     return(false);
 }
Example #6
0
        public AddFriendDialogContext(FriendDetailDataItem friendDetailData)
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "AddFriendDialogContext",
                viewPrefabPath = "UI/Menus/Dialog/AddFriendDialog"
            };

            base.config            = pattern;
            this._friendDetailData = friendDetailData;
        }
Example #7
0
        private void OnPortraitButtonCallBack()
        {
            FriendDetailDataItem userData = Singleton <FriendModule> .Instance.TryGetFriendDetailData(this._friendDetailData.uid);

            if (userData != null)
            {
                RemoteAvatarDetailPageContext context = new RemoteAvatarDetailPageContext(userData, false, null);
                Singleton <MainUIManager> .Instance.ShowPage(context, UIType.Page);
            }
        }
Example #8
0
        private void CreateAvatarHelper()
        {
            if ((Singleton <LevelScoreManager> .Instance.friendDetailItem != null) && (this._helperAvatarRuntimeID == 0))
            {
                FriendDetailDataItem friendDetailItem = Singleton <LevelScoreManager> .Instance.friendDetailItem;
                AvatarDataItem       leaderAvatar     = friendDetailItem.leaderAvatar;
                bool leaderSkillOn = Singleton <FriendModule> .Instance.IsMyFriend(friendDetailItem.uid);

                Singleton <AvatarManager> .Instance.CreateAvatar(leaderAvatar, false, InLevelData.CREATE_INIT_POS, InLevelData.CREATE_INIT_FORWARD, Singleton <RuntimeIDManager> .Instance.GetNextRuntimeID(3), false, leaderSkillOn, true, true);
            }
        }
Example #9
0
        public SearchedFriendDetailDialogContext(FriendDetailDataItem playerInfo, bool hideActionBtns = false)
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "SearchedFriendDetailDialogContext",
                viewPrefabPath = "UI/Menus/Dialog/SearchedFriendInfoShowDialog",
                ignoreNotify   = true
            };

            base.config         = pattern;
            this.playerInfo     = playerInfo;
            this.hideActionBtns = hideActionBtns;
        }
Example #10
0
 protected override bool SetupView()
 {
     if (Singleton <LevelScoreManager> .Instance == null)
     {
         base.Destroy();
         return(false);
     }
     base.view.transform.Find("BlockPanel").gameObject.SetActive(true);
     this._friendDetailData = Singleton <LevelScoreManager> .Instance.friendDetailItem;
     this.InitAnimationAndDialogManager();
     this.SetupTitle();
     this.OnStageEndRsp(Singleton <LevelScoreManager> .Instance.stageEndRsp);
     this.SetupFriendDialog();
     return(false);
 }
Example #11
0
        public RemoteAvatarDetailPageContext(FriendDetailDataItem userData, bool fromDialog = false, Transform dialogTrans = null)
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "RemoteAvatarDetailPageContext",
                viewPrefabPath = "UI/Menus/Page/AvatarDetailPage"
            };

            base.config                   = pattern;
            base.showSpaceShip            = true;
            this.userData                 = userData;
            this._tabManager              = new TabManager();
            this._tabManager.onSetActive += new TabManager.OnSetActive(this.OnTabSetActive);
            this._fromDialog              = fromDialog;
            this._dialogTrans             = dialogTrans;
        }
Example #12
0
 public void SetupView(FriendDetailDataItem userData, AvatarSkillDataItem selectedSkillData = null)
 {
     this._isRemoteAvatar = true;
     this._userData       = userData;
     this._avatarData     = this._userData.leaderAvatar;
     base.transform.Find("ListPanel/Info/Content/SkillPoint").gameObject.SetActive(false);
     if (selectedSkillData != null)
     {
         this.SetupSelectSkillView(selectedSkillData);
     }
     else
     {
         this.SetupSkillListView();
     }
 }
Example #13
0
        public void SetupView(FriendDetailDataItem userData)
        {
            this._isRemoteAvatar = true;
            this._userData       = userData;
            this._avatarData     = this._userData.leaderAvatar;
            this.SetupAvatarBasicStatus(base.transform.Find("BasicStatus/InfoPanel/BasicStatus"));
            base.transform.Find("BasicStatus/InfoPanel/StarPanel/AvatarStar").GetComponent <MonoAvatarStar>().SetupView(this._avatarData.star);
            base.transform.Find("Star").gameObject.SetActive(false);
            base.transform.Find("Lv").gameObject.SetActive(false);
            base.transform.Find("Introduction").gameObject.SetActive(true);
            base.transform.Find("Introduction/InfoPanel/Desc").GetComponent <Text>().text = this._userData.Desc;
            bool flag = Singleton <FriendModule> .Instance.IsMyFriend(this._userData.uid);

            base.transform.Find("Introduction/AddBtn").gameObject.SetActive(!flag);
            base.transform.Find("Introduction/DeleteBtn").gameObject.SetActive(flag);
        }
Example #14
0
        private void OnDetailBtnClick(FriendBriefDataItem friendBriefData)
        {
            Singleton <FriendModule> .Instance.MarkFriendAsOld(friendBriefData.uid);

            FriendDetailDataItem detailData = Singleton <FriendModule> .Instance.TryGetFriendDetailData(friendBriefData.uid);

            if (detailData == null)
            {
                this._playerUidToShow = friendBriefData.uid;
                Singleton <NetworkManager> .Instance.RequestFriendDetailInfo(friendBriefData.uid);
            }
            else
            {
                this.ShowFriendDetailInfo(detailData);
            }
        }
Example #15
0
        private void HandleBeforeLevelDesignAwake()
        {
            Singleton <LevelScoreManager> .Create();

            FriendDetailDataItem friend = null;

            if (true)
            {
                DevAvatarData  devAvatarData  = this.avatarDevDatas[0];
                AvatarDataItem avatarDataItem = Singleton <AvatarModule> .Instance.GetDummyAvatarDataItem(this.avatarTypeNames[0], devAvatarData.avatarLevel, devAvatarData.avatarStar);

                this.SetUpAvatarDataItem(avatarDataItem, devAvatarData);
                friend = new FriendDetailDataItem(0, "FakeHelper", 1, avatarDataItem, null);
            }
            Singleton <LevelScoreManager> .Instance.SetDevLevelBeginIntent(this.LEVEL_PATH, this.LEVEL_MODE, this.LEVEL_HARDLEVEL, this.LEVEL_DIFFICULTY + 1, friend);

            Singleton <PlayerModule> .Instance.playerData.teamLevel = this.TEAM_LEVEL;
        }
Example #16
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;
        }