예제 #1
0
        public void SetFriendGameState(ulong ullUid, uint dwLogicWorldID, COM_ACNT_GAME_STATE State, uint startTime, string nickName = "", bool IgnoreWorld_id = false)
        {
            FriendInGame game = null;

            for (int i = 0; i < this.gameStateList.Count; i++)
            {
                game = this.gameStateList[i];
                bool flag = false;
                if (!IgnoreWorld_id)
                {
                    flag = (game.ullUid == ullUid) && (game.dwLogicWorldID == dwLogicWorldID);
                }
                else
                {
                    flag = game.ullUid == ullUid;
                }
                if (flag)
                {
                    game.State          = State;
                    game.dwLogicWorldID = dwLogicWorldID;
                    game.startTime      = startTime;
                    return;
                }
            }
            this.gameStateList.Add(new FriendInGame(ullUid, dwLogicWorldID, State, startTime, nickName));
        }
예제 #2
0
 public FriendInGame(ulong uid, uint worldID, COM_ACNT_GAME_STATE state, string nickName = "")
 {
     this.ullUid         = uid;
     this.dwLogicWorldID = worldID;
     this.State          = state;
     this.nickName       = nickName;
 }
예제 #3
0
 public void ShowGameState(COM_ACNT_GAME_STATE state, bool bOnline)
 {
     if ((state != COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE) && bOnline)
     {
         this.ShowLastTime(true, "游戏中");
     }
 }
예제 #4
0
 public FriendInGame(ulong uid, uint worldID, COM_ACNT_GAME_STATE state, uint startTime, string nickName = "")
 {
     this.ullUid         = uid;
     this.dwLogicWorldID = worldID;
     this.State          = state;
     this.nickName       = CUIUtility.RemoveEmoji(nickName);
     this.startTime      = startTime;
 }
예제 #5
0
        public bool IsFriendInGamingState(ulong ullUid, uint dwLogicWorldID, COM_ACNT_GAME_STATE State)
        {
            FriendInGame game = null;

            for (int i = 0; i < this.gameStateList.Count; i++)
            {
                game = this.gameStateList[i];
                if ((game.ullUid == ullUid) && (game.dwLogicWorldID == dwLogicWorldID))
                {
                    return(game.State == State);
                }
            }
            return(false);
        }
예제 #6
0
        private static void SetLBSState(GameObject element, ref CSDT_LBS_USER_INFO LBSInfo)
        {
            COMDT_FRIEND_INFO stLbsUserInfo = LBSInfo.stLbsUserInfo;
            GameObject        gameObject    = element.transform.FindChild("HeadBg").gameObject;
            Text       component            = element.transform.FindChild("Online").GetComponent <Text>();
            GameObject obj3  = element.transform.FindChild("InviteButton").gameObject;
            Text       text2 = element.transform.FindChild("PlayerName").GetComponent <Text>();

            SetListElementLadderInfo(element, stLbsUserInfo);
            COM_ACNT_GAME_STATE friendInGamingState = COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE;

            if (stLbsUserInfo.bIsOnline != 1)
            {
                component.text = string.Format(Singleton <CTextManager> .instance.GetText("Common_Offline"), new object[0]);
                text2.color    = CUIUtility.s_Color_Grey;
                CUIUtility.GetComponentInChildren <Image>(gameObject).color = CUIUtility.s_Color_GrayShader;
            }
            else
            {
                friendInGamingState = Singleton <CFriendContoller> .instance.model.GetFriendInGamingState(stLbsUserInfo.stUin.ullUid, stLbsUserInfo.stUin.dwLogicWorldId);

                switch (friendInGamingState)
                {
                case COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE:
                {
                    component.text = Singleton <CInviteSystem> .instance.GetInviteStateStr(stLbsUserInfo.stUin.ullUid);

                    CUIEventScript script = obj3.GetComponent <CUIEventScript>();
                    script.m_onClickEventParams.tag  = (int)Singleton <CInviteSystem> .instance.InviteType;
                    script.m_onClickEventParams.tag2 = (int)stLbsUserInfo.stUin.dwLogicWorldId;
                    script.m_onClickEventParams.tag3 = (int)LBSInfo.dwGameSvrEntity;
                    script.m_onClickEventParams.commonUInt64Param1 = stLbsUserInfo.stUin.ullUid;
                    break;
                }

                case COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_SINGLEGAME:
                case COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_MULTIGAME:
                    component.text = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Gaming"));
                    break;

                case COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_TEAM:
                    component.text = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Teaming"));
                    break;
                }
                text2.color = CUIUtility.s_Color_White;
                CUIUtility.GetComponentInChildren <Image>(gameObject).color = CUIUtility.s_Color_White;
            }
            obj3.CustomSetActive((stLbsUserInfo.bIsOnline == 1) && (friendInGamingState == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE));
        }
예제 #7
0
 public void Reset()
 {
     this.stBriefInfo.Reset();
     this.enPosition    = COM_PLAYER_GUILD_STATE.COM_PLAYER_GUILD_STATE_MEMBER;
     this.dwConstruct   = 0;
     this.TotalContruct = 0;
     this.CurrActive    = 0;
     this.WeekActive    = 0;
     this.DonateCnt     = 0;
     this.DonateNum     = 0;
     this.WeekDividend  = 0;
     this.RankInfo.Reset();
     this.GameState     = COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE;
     this.LastLoginTime = 0;
 }
 public void Reset()
 {
     this.stBriefInfo.Reset();
     this.enPosition  = COM_PLAYER_GUILD_STATE.COM_PLAYER_GUILD_STATE_MEMBER;
     this.dwConstruct = 0u;
     this.RankInfo.Reset();
     this.GameState                              = COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE;
     this.LastLoginTime                          = 0u;
     this.JoinTime                               = 0u;
     this.GuildMatchInfo.bIsLeader               = 0;
     this.GuildMatchInfo.ullTeamLeaderUid        = 0uL;
     this.GuildMatchInfo.dwScore                 = 0u;
     this.isGuildMatchSignedUp                   = false;
     this.isGuildMatchOfflineInvitedByHostPlayer = false;
 }
예제 #9
0
        public void ShowGameState(CFriendModel.FriendInGame st, bool bOnline)
        {
            COM_ACNT_GAME_STATE cOM_ACNT_GAME_STATE = COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE;

            if (st != null)
            {
                cOM_ACNT_GAME_STATE = st.State;
            }
            if (cOM_ACNT_GAME_STATE != COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE && bOnline)
            {
                this.ShowLastTime(true, "游戏中");
            }
            else if (st != null && cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE && st.IsUseTGA())
            {
                this.ShowLastTime(true, Singleton <CTextManager> .instance.GetText("TGA_Friend_State"));
            }
        }
예제 #10
0
        private static void SetLBSState(GameObject element, ref CSDT_LBS_USER_INFO LBSInfo)
        {
            COMDT_FRIEND_INFO stLbsUserInfo = LBSInfo.stLbsUserInfo;
            GameObject        gameObject    = element.transform.FindChild("HeadBg").gameObject;
            Text       component            = element.transform.FindChild("Online").GetComponent <Text>();
            GameObject gameObject2          = element.transform.FindChild("InviteButton").gameObject;
            Text       component2           = element.transform.FindChild("PlayerName").GetComponent <Text>();

            CInviteView.SetListElementLadderInfo(element, stLbsUserInfo);
            COM_ACNT_GAME_STATE cOM_ACNT_GAME_STATE = 0;

            if (stLbsUserInfo.bIsOnline == 1)
            {
                cOM_ACNT_GAME_STATE = Singleton <CFriendContoller> .get_instance().model.GetFriendInGamingState(stLbsUserInfo.stUin.ullUid, stLbsUserInfo.stUin.dwLogicWorldId);

                if (cOM_ACNT_GAME_STATE == null)
                {
                    component.text = Singleton <CInviteSystem> .get_instance().GetInviteStateStr(stLbsUserInfo.stUin.ullUid, false);

                    CUIEventScript component3 = gameObject2.GetComponent <CUIEventScript>();
                    component3.m_onClickEventParams.tag = Singleton <CInviteSystem> .get_instance().InviteType;

                    component3.m_onClickEventParams.tag2 = (int)stLbsUserInfo.stUin.dwLogicWorldId;
                    component3.m_onClickEventParams.tag3 = (int)LBSInfo.dwGameSvrEntity;
                    component3.m_onClickEventParams.commonUInt64Param1 = stLbsUserInfo.stUin.ullUid;
                }
                else if (cOM_ACNT_GAME_STATE == 1 || cOM_ACNT_GAME_STATE == 2 || cOM_ACNT_GAME_STATE == 4)
                {
                    component.text = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .get_instance().GetText("Common_Gaming"));
                }
                else if (cOM_ACNT_GAME_STATE == 3)
                {
                    component.text = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .get_instance().GetText("Common_Teaming"));
                }
                component2.color = CUIUtility.s_Color_White;
                CUIUtility.GetComponentInChildren <Image>(gameObject).color = CUIUtility.s_Color_White;
            }
            else
            {
                component.text   = string.Format(Singleton <CTextManager> .get_instance().GetText("Common_Offline"), new object[0]);
                component2.color = CUIUtility.s_Color_Grey;
                CUIUtility.GetComponentInChildren <Image>(gameObject).color = CUIUtility.s_Color_GrayShader;
            }
            gameObject2.CustomSetActive(stLbsUserInfo.bIsOnline == 1 && cOM_ACNT_GAME_STATE == 0);
        }
예제 #11
0
 public void Reset()
 {
     this.stBriefInfo.Reset();
     this.enPosition    = 6;
     this.dwConstruct   = 0u;
     this.TotalContruct = 0u;
     this.CurrActive    = 0u;
     this.WeekActive    = 0u;
     this.DonateCnt     = 0;
     this.DonateNum     = 0u;
     this.WeekDividend  = 0u;
     this.RankInfo.Reset();
     this.GameState                       = 0;
     this.LastLoginTime                   = 0u;
     this.JoinTime                        = 0u;
     this.GuildMatchInfo.bIsLeader        = 0;
     this.GuildMatchInfo.ullTeamLeaderUid = 0uL;
     this.GuildMatchInfo.dwScore          = 0u;
 }
        private static void SetLBSState(GameObject element, ref CSDT_LBS_USER_INFO LBSInfo)
        {
            COMDT_FRIEND_INFO stLbsUserInfo = LBSInfo.stLbsUserInfo;
            GameObject        gameObject    = element.transform.FindChild("HeadBg").gameObject;
            Text       component            = element.transform.FindChild("Online").GetComponent <Text>();
            GameObject gameObject2          = element.transform.FindChild("InviteButton").gameObject;
            Text       component2           = element.transform.FindChild("PlayerName").GetComponent <Text>();
            GameObject obj = Utility.FindChild(element, "HeadBg/AntiDisturbBits");

            obj.CustomSetActive(false);
            bool flag = false;

            CInviteView.SetListElementLadderInfo(element, stLbsUserInfo);
            COM_ACNT_GAME_STATE cOM_ACNT_GAME_STATE = COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE;

            if (stLbsUserInfo.bIsOnline == 1)
            {
                cOM_ACNT_GAME_STATE = COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE;
                CFriendModel.FriendInGame friendInGaming = Singleton <CFriendContoller> .instance.model.GetFriendInGaming(stLbsUserInfo.stUin.ullUid, stLbsUserInfo.stUin.dwLogicWorldId);

                if (friendInGaming != null)
                {
                    cOM_ACNT_GAME_STATE = friendInGaming.State;
                    flag = ((friendInGaming.antiDisturbBits & 1u) == 1u);
                }
                if (cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE)
                {
                    if (flag)
                    {
                        component.set_text(Singleton <CTextManager> .instance.GetText("Common_NotDisturb"));
                        obj.CustomSetActive(true);
                    }
                    else
                    {
                        component.set_text(Singleton <CInviteSystem> .instance.GetInviteStateStr(stLbsUserInfo.stUin.ullUid, false));
                    }
                    CUIEventScript component3 = gameObject2.GetComponent <CUIEventScript>();
                    component3.m_onClickEventParams.tag  = (int)Singleton <CInviteSystem> .instance.InviteType;
                    component3.m_onClickEventParams.tag2 = (int)stLbsUserInfo.stUin.dwLogicWorldId;
                    component3.m_onClickEventParams.tag3 = (int)LBSInfo.dwGameSvrEntity;
                    component3.m_onClickEventParams.commonUInt64Param1 = stLbsUserInfo.stUin.ullUid;
                }
                else if (cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_SINGLEGAME || cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_MULTIGAME || cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_WAITMULTIGAME)
                {
                    component.set_text(string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Gaming")));
                }
                else if (cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_TEAM)
                {
                    component.set_text(string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Teaming")));
                }
                component2.set_color(CUIUtility.s_Color_White);
                CUIUtility.GetComponentInChildren <Image>(gameObject).set_color(CUIUtility.s_Color_White);
            }
            else
            {
                component.set_text(string.Format(Singleton <CTextManager> .instance.GetText("Common_Offline"), new object[0]));
                component2.set_color(CUIUtility.s_Color_Grey);
                CUIUtility.GetComponentInChildren <Image>(gameObject).set_color(CUIUtility.s_Color_GrayShader);
            }
            gameObject2.CustomSetActive(stLbsUserInfo.bIsOnline == 1 && !flag && cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE);
        }
        private static void SetFriendState(GameObject element, ref COMDT_FRIEND_INFO friend)
        {
            if (element == null || friend == null)
            {
                return;
            }
            CFriendModel model       = Singleton <CFriendContoller> .instance.model;
            GameObject   gameObject  = element.transform.FindChild("HeadBg").gameObject;
            GameObject   gameObject2 = element.transform.FindChild("InviteButton").gameObject;
            Text         component   = element.transform.FindChild("Online").GetComponent <Text>();
            Text         component2  = element.transform.FindChild("PlayerName").GetComponent <Text>();
            GameObject   obj         = Utility.FindChild(element, "HeadBg/AntiDisturbBits");

            obj.CustomSetActive(false);
            Text component3 = element.transform.FindChild("Time").GetComponent <Text>();
            bool flag       = false;

            if (component3 != null)
            {
                component3.gameObject.CustomSetActive(false);
            }
            if (component != null)
            {
                component.gameObject.CustomSetActive(true);
            }
            GameObject gameObject3 = Utility.FindChild(element, "ReserveButton");

            gameObject3.CustomSetActive(false);
            GameObject gameObject4 = Utility.FindChild(element, "ReserveText");

            gameObject4.CustomSetActive(false);
            CInviteView.SetListElementLadderInfo(element, friend);
            COM_ACNT_GAME_STATE cOM_ACNT_GAME_STATE = COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE;

            if (friend.bIsOnline == 1)
            {
                CFriendModel.FriendInGame friendInGaming = Singleton <CFriendContoller> .instance.model.GetFriendInGaming(friend.stUin.ullUid, friend.stUin.dwLogicWorldId);

                if (friendInGaming == null)
                {
                    cOM_ACNT_GAME_STATE = COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE;
                }
                else
                {
                    cOM_ACNT_GAME_STATE = friendInGaming.State;
                    flag = ((friendInGaming.antiDisturbBits & 1u) == 1u);
                }
                if (cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE)
                {
                    if (flag)
                    {
                        component.set_text(Singleton <CTextManager> .instance.GetText("Common_NotDisturb"));
                        obj.CustomSetActive(true);
                    }
                    else
                    {
                        component.set_text(Singleton <CInviteSystem> .instance.GetInviteStateStr(friend.stUin.ullUid, false));
                    }
                    if (friendInGaming != null && friendInGaming.IsUseTGA())
                    {
                        component.gameObject.CustomSetActive(true);
                        component.set_text(string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("TGA_Friend_State")));
                    }
                    CUIEventScript component4 = gameObject2.GetComponent <CUIEventScript>();
                    component4.m_onClickEventParams.tag  = (int)Singleton <CInviteSystem> .instance.InviteType;
                    component4.m_onClickEventParams.tag2 = (int)friend.stUin.dwLogicWorldId;
                    component4.m_onClickEventParams.commonUInt64Param1 = friend.stUin.ullUid;
                }
                else if (cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_SINGLEGAME || cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_MULTIGAME || cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_WAITMULTIGAME)
                {
                    if (friendInGaming == null)
                    {
                        component.gameObject.CustomSetActive(true);
                        component.set_text("friendInGame is null");
                        return;
                    }
                    if (friendInGaming.startTime > 0u)
                    {
                        component.gameObject.CustomSetActive(false);
                        component3.gameObject.CustomSetActive(true);
                        component3.set_text(string.Format(Singleton <CTextManager> .instance.GetText("Common_Gaming_Time"), CInviteView.GetStartMinute(friendInGaming.startTime)));
                        Singleton <CInviteSystem> .instance.CheckInviteListGameTimer();

                        if (Singleton <CFriendContoller> .instance.model.friendReserve.BServerEnableReverse)
                        {
                            FriendReserve.Ent          ent = model.friendReserve.Find(friend.stUin.ullUid, friend.stUin.dwLogicWorldId, FriendReserve.ReserveDataType.Send);
                            ushort                     num;
                            CFriendModel.EIntimacyType eIntimacyType;
                            bool flag2;
                            model.GetFriendIntimacy(friend.stUin.ullUid, friend.stUin.dwLogicWorldId, out num, out eIntimacyType, out flag2);
                            if (ent == null)
                            {
                                bool flag3 = (friendInGaming.antiDisturbBits & 1u) > 0u;
                                bool flag4 = (friend.dwRefuseFriendBits & 16u) == 0u;
                                if (flag4 && !flag3 && num >= 100)
                                {
                                    gameObject3.CustomSetActive(true);
                                    gameObject4.CustomSetActive(false);
                                    if (gameObject3 != null)
                                    {
                                        CUIEventScript component5 = gameObject3.GetComponent <CUIEventScript>();
                                        component5.m_onClickEventParams.commonUInt64Param1 = friend.stUin.ullUid;
                                        component5.m_onClickEventParams.tagUInt            = friend.stUin.dwLogicWorldId;
                                        component5.m_onClickEventParams.tagStr             = Utility.UTF8Convert(friend.szUserName);
                                    }
                                }
                            }
                            else
                            {
                                gameObject3.CustomSetActive(false);
                                gameObject4.CustomSetActive(true);
                                if (gameObject4 != null)
                                {
                                    Text component6 = gameObject4.GetComponent <Text>();
                                    if (component6 != null)
                                    {
                                        if (ent != null && ent.result == 2)
                                        {
                                            component6.set_text(model.friendReserve.Reserve_Success);
                                        }
                                        else if (ent != null && ent.result == 1)
                                        {
                                            component6.set_text(model.friendReserve.Reserve_Failed);
                                        }
                                        else
                                        {
                                            component6.set_text(model.friendReserve.Reserve_Wait4Rsp);
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        component.gameObject.CustomSetActive(true);
                        component.set_text(string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Gaming_NoTime")));
                    }
                }
                else if (cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_TEAM)
                {
                    component.set_text(string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Teaming")));
                }
                component2.set_color(CUIUtility.s_Color_White);
                CUIUtility.GetComponentInChildren <Image>(gameObject).set_color(CUIUtility.s_Color_White);
            }
            else
            {
                component.set_text(string.Format(Singleton <CTextManager> .instance.GetText("Common_Offline"), new object[0]));
                component2.set_color(CUIUtility.s_Color_Grey);
                CUIUtility.GetComponentInChildren <Image>(gameObject).set_color(CUIUtility.s_Color_GrayShader);
            }
            gameObject2.CustomSetActive(friend.bIsOnline == 1 && !flag && cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE);
        }
예제 #14
0
    private void OnPlayerInfoSystemRecivedMsg(CSPkg msg)
    {
        if (msg.stPkgData.stGetAcntDetailInfoRsp.iErrCode != 0)
        {
            Singleton <CUIManager> .GetInstance().OpenMessageBox(string.Format("Error Code {0}", msg.stPkgData.stGetAcntDetailInfoRsp.iErrCode), false);

            return;
        }
        this.m_BackPlayeInfoMsg = msg;
        this.m_PlayerProfile.ConvertServerDetailData(msg.stPkgData.stGetAcntDetailInfoRsp.stAcntDetail.stOfSucc);
        CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CMiniPlayerInfoSystem.sPlayerInfoFormPath, false, true);

        if (cUIFormScript == null)
        {
            return;
        }
        if (this.m_bUp)
        {
            cUIFormScript.SetPriority(enFormPriority.Priority5);
        }
        else
        {
            cUIFormScript.RestorePriority();
        }
        GameObject    widget        = cUIFormScript.GetWidget(0);
        RectTransform rectTransform = cUIFormScript.transform.Find("panel") as RectTransform;

        if (rectTransform == null)
        {
            Debug.LogError("mini player info form's panel is null");
            Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Mini_Player_Info_CloseForm);
        }
        CMiniPlayerInfoSystem.OpenSrc openSrc = this.m_OpenSrc;
        if (openSrc != CMiniPlayerInfoSystem.OpenSrc.Rank)
        {
            if (openSrc == CMiniPlayerInfoSystem.OpenSrc.Chat)
            {
                CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CChatController.ChatFormPath);

                if (form == null)
                {
                    Debug.LogError("can't get chat form");
                    Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Mini_Player_Info_CloseForm);

                    return;
                }
                RectTransform rectTransform2 = form.transform.Find("node/null") as RectTransform;
                if (rectTransform2 == null)
                {
                    Debug.LogError("chat form's close btn is null");
                    Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Mini_Player_Info_CloseForm);

                    return;
                }
                widget.CustomSetActive(true);
                Vector3[] array = new Vector3[4];
                rectTransform2.GetWorldCorners(array);
                Vector2   vector      = CUIUtility.WorldToScreenPoint(Singleton <CUIManager> .instance.FormCamera, array[3]);
                Vector2   screenPoint = new Vector2(0f, vector.y);
                Vector3[] array2      = new Vector3[4];
                rectTransform.GetWorldCorners(array2);
                float num = CUIUtility.WorldToScreenPoint(Singleton <CUIManager> .instance.FormCamera, array2[3]).x - CUIUtility.WorldToScreenPoint(Singleton <CUIManager> .instance.FormCamera, array2[0]).x;
                if (vector.x + num + 100f > (float)Screen.width)
                {
                    screenPoint.x = (float)Screen.width - num - 15f;
                }
                else
                {
                    screenPoint = new Vector2(vector.x + 20f, vector.y);
                }
                rectTransform.position = CUIUtility.ScreenToWorldPoint(cUIFormScript.GetCamera(), screenPoint, rectTransform.position.z);
            }
        }
        else
        {
            CUIFormScript form2 = Singleton <CUIManager> .GetInstance().GetForm(RankingSystem.s_rankingForm);

            if (form2 == null)
            {
                Debug.LogError("can't get ranking form");
                Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Mini_Player_Info_CloseForm);

                return;
            }
            RectTransform rectTransform3 = form2.transform.Find("bg") as RectTransform;
            if (rectTransform3 == null)
            {
                Debug.LogError("ranking form's bg is null");
                Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Mini_Player_Info_CloseForm);

                return;
            }
            widget.CustomSetActive(true);
            Vector3[] array3 = new Vector3[4];
            rectTransform3.GetWorldCorners(array3);
            Vector2   vector2      = CUIUtility.WorldToScreenPoint(Singleton <CUIManager> .instance.FormCamera, array3[2]);
            Vector2   screenPoint2 = new Vector2(0f, vector2.y - 100f);
            Vector3[] array4       = new Vector3[4];
            rectTransform.GetWorldCorners(array4);
            float num2 = CUIUtility.WorldToScreenPoint(Singleton <CUIManager> .instance.FormCamera, array4[3]).x - CUIUtility.WorldToScreenPoint(Singleton <CUIManager> .instance.FormCamera, array4[0]).x;
            if (vector2.x + 80f + num2 > (float)Screen.width)
            {
                screenPoint2.x = (float)Screen.width - num2 - 15f;
            }
            else
            {
                screenPoint2.x = vector2.x + 80f;
            }
            rectTransform.position = CUIUtility.ScreenToWorldPoint(cUIFormScript.GetCamera(), screenPoint2, rectTransform.position.z);
        }
        Text componetInChild = Utility.GetComponetInChild <Text>(cUIFormScript.gameObject, "panel/Name/Text");

        if (componetInChild != null)
        {
            componetInChild.set_text(this.m_PlayerProfile.Name());
        }
        COMDT_FRIEND_INFO info = Singleton <CFriendContoller> .instance.model.GetInfo(CFriendModel.FriendType.GameFriend, this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld);

        COMDT_FRIEND_INFO info2 = Singleton <CFriendContoller> .instance.model.GetInfo(CFriendModel.FriendType.SNS, this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld);

        Text componetInChild2 = Utility.GetComponetInChild <Text>(cUIFormScript.gameObject, "panel/Online/Text");

        if (componetInChild2 != null)
        {
            if (this.m_PlayerProfile.IsOnLine())
            {
                COMDT_FRIEND_INFO cOMDT_FRIEND_INFO = (info == null) ? ((info2 == null) ? null : info2) : info;
                if (cOMDT_FRIEND_INFO != null)
                {
                    COM_ACNT_GAME_STATE friendInGamingState = Singleton <CFriendContoller> .instance.model.GetFriendInGamingState(this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld);

                    if (friendInGamingState == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE)
                    {
                        componetInChild2.set_text(string.Format("<color=#00ff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Online")));
                    }
                    else if (friendInGamingState == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_SINGLEGAME || friendInGamingState == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_MULTIGAME)
                    {
                        componetInChild2.set_text(string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Gaming")));
                    }
                    else if (friendInGamingState == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_TEAM)
                    {
                        componetInChild2.set_text(string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Teaming")));
                    }
                }
                else
                {
                    componetInChild2.set_text(string.Format("<color=#00ff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Online")));
                }
            }
            else
            {
                Text   text  = componetInChild2;
                string text2 = Singleton <CTextManager> .GetInstance().GetText("Common_Offline");

                componetInChild2.set_text(text2);
                text.set_text(text2);
            }
        }
        Text componetInChild3 = Utility.GetComponetInChild <Text>(cUIFormScript.gameObject, "panel/DuanWei/Text");

        if (componetInChild3 != null)
        {
            string rankName = CLadderView.GetRankName(this.m_PlayerProfile.GetRankGrade(), (uint)this.m_PlayerProfile.GetRankClass());
            componetInChild3.set_text(string.IsNullOrEmpty(rankName) ? Singleton <CTextManager> .GetInstance().GetText("Common_NoData") : rankName);
        }
        Text componetInChild4 = Utility.GetComponetInChild <Text>(cUIFormScript.gameObject, "panel/Team/Text");
        Text componetInChild5 = Utility.GetComponetInChild <Text>(cUIFormScript.gameObject, "panel/Position/Text");

        if (!CGuildSystem.IsInNormalGuild(this.m_PlayerProfile.GuildState) || string.IsNullOrEmpty(this.m_PlayerProfile.GuildName))
        {
            if (componetInChild4 != null)
            {
                componetInChild4.set_text(Singleton <CTextManager> .GetInstance().GetText("PlayerInfo_Guild"));
            }
            if (componetInChild5 != null)
            {
                componetInChild5.set_text(Singleton <CTextManager> .GetInstance().GetText("PlayerInfo_Guild"));
            }
        }
        else
        {
            if (componetInChild4 != null)
            {
                componetInChild4.set_text(this.m_PlayerProfile.GuildName);
            }
            if (componetInChild5 != null)
            {
                componetInChild5.set_text(CGuildHelper.GetPositionName(this.m_PlayerProfile.GuildState));
            }
        }
        GameObject obj        = Utility.FindChild(cUIFormScript.gameObject, "panel/Btn/AddFriend");
        GameObject obj2       = Utility.FindChild(cUIFormScript.gameObject, "panel/Btn/Profile");
        GameObject obj3       = Utility.FindChild(cUIFormScript.gameObject, "panel/Btn/3v3");
        GameObject obj4       = Utility.FindChild(cUIFormScript.gameObject, "panel/Btn/5v5");
        GameObject gameObject = Utility.FindChild(cUIFormScript.gameObject, "panel/Btn/Block");
        GameObject obj5       = Utility.FindChild(cUIFormScript.gameObject, "panel/Btn/Complaints");

        obj5.CustomSetActive(false);
        obj2.CustomSetActive(true);
        openSrc = this.m_OpenSrc;
        if (openSrc != CMiniPlayerInfoSystem.OpenSrc.Rank)
        {
            if (openSrc == CMiniPlayerInfoSystem.OpenSrc.Chat)
            {
                switch (Singleton <CChatController> .GetInstance().view.CurTab)
                {
                case EChatChannel.Lobby:
                case EChatChannel.GuildMatchTeam:
                    obj3.CustomSetActive(false);
                    obj4.CustomSetActive(false);
                    if (info != null || info2 != null)
                    {
                        obj.CustomSetActive(false);
                    }
                    else
                    {
                        obj.CustomSetActive(true);
                    }
                    gameObject.CustomSetActive(true);
                    obj5.CustomSetActive(false);
                    this.SetBlockButtonBlocked(gameObject, Singleton <CFriendContoller> .instance.model.IsBlack(this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld));
                    break;

                case EChatChannel.Guild:
                    if (info != null || info2 != null)
                    {
                        obj.CustomSetActive(false);
                        obj3.CustomSetActive(true);
                        obj4.CustomSetActive(true);
                    }
                    else
                    {
                        obj.CustomSetActive(true);
                        obj3.CustomSetActive(false);
                        obj4.CustomSetActive(false);
                    }
                    gameObject.CustomSetActive(true);
                    obj5.CustomSetActive(false);
                    this.SetBlockButtonBlocked(gameObject, Singleton <CFriendContoller> .instance.model.IsBlack(this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld));
                    break;

                case EChatChannel.Friend_Chat:
                    obj.CustomSetActive(false);
                    obj3.CustomSetActive(true);
                    obj4.CustomSetActive(true);
                    gameObject.CustomSetActive(true);
                    obj5.CustomSetActive(false);
                    this.SetBlockButtonBlocked(gameObject, Singleton <CFriendContoller> .instance.model.IsBlack(this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld));
                    break;

                case EChatChannel.Settle:
                    obj.CustomSetActive(false);
                    obj3.CustomSetActive(false);
                    obj4.CustomSetActive(false);
                    gameObject.CustomSetActive(true);
                    obj5.CustomSetActive(false);
                    this.SetBlockButtonBlocked(gameObject, Singleton <CFriendContoller> .instance.model.IsBlack(this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld));
                    break;
                }
            }
        }
        else
        {
            if (info != null || info2 != null)
            {
                obj.CustomSetActive(false);
                obj3.CustomSetActive(true);
                obj4.CustomSetActive(true);
            }
            else
            {
                obj.CustomSetActive(true);
                obj3.CustomSetActive(false);
                obj4.CustomSetActive(false);
            }
            gameObject.CustomSetActive(false);
            obj5.CustomSetActive(false);
        }
    }
예제 #15
0
    private void OnPlayerInfoSystemRecivedMsg(CSPkg msg)
    {
        Text text3;

        if (msg.stPkgData.stGetAcntDetailInfoRsp.iErrCode != 0)
        {
            Singleton <CUIManager> .GetInstance().OpenMessageBox(string.Format("Error Code {0}", msg.stPkgData.stGetAcntDetailInfoRsp.iErrCode), false);

            return;
        }
        this.m_BackPlayeInfoMsg = msg;
        this.m_PlayerProfile.ConvertServerDetailData(msg.stPkgData.stGetAcntDetailInfoRsp.stAcntDetail.stOfSucc);
        CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm(sPlayerInfoFormPath, false, true);

        if (script == null)
        {
            return;
        }
        if (this.m_bUp)
        {
            script.SetPriority(enFormPriority.Priority5);
        }
        else
        {
            script.RestorePriority();
        }
        GameObject    widget    = script.GetWidget(0);
        RectTransform transform = script.transform.Find("panel") as RectTransform;

        if (transform == null)
        {
            Debug.LogError("mini player info form's panel is null");
            Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Mini_Player_Info_CloseForm);
        }
        OpenSrc openSrc = this.m_OpenSrc;

        if (openSrc == OpenSrc.Rank)
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(RankingSystem.s_rankingForm);

            if (form == null)
            {
                Debug.LogError("can't get ranking form");
                Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Mini_Player_Info_CloseForm);

                return;
            }
            RectTransform transform3 = form.transform.Find("bg") as RectTransform;
            if (transform3 == null)
            {
                Debug.LogError("ranking form's bg is null");
                Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Mini_Player_Info_CloseForm);

                return;
            }
            widget.CustomSetActive(true);
            Vector3[] fourCornersArray = new Vector3[4];
            transform3.GetWorldCorners(fourCornersArray);
            Vector2 vector3     = CUIUtility.WorldToScreenPoint(Singleton <CUIManager> .instance.FormCamera, fourCornersArray[2]);
            Vector2 screenPoint = new Vector2(0f, vector3.y - 100f);
            if (((vector3.x + 80f) + transform.rect.width) > Screen.width)
            {
                screenPoint.x = (Screen.width - transform.rect.width) - 15f;
            }
            else
            {
                screenPoint.x = vector3.x + 80f;
            }
            transform.position = CUIUtility.ScreenToWorldPoint(script.GetCamera(), screenPoint, transform.position.z);
        }
        else if (openSrc == OpenSrc.Chat)
        {
            CUIFormScript script2 = Singleton <CUIManager> .GetInstance().GetForm(CChatController.ChatFormPath);

            if (script2 == null)
            {
                Debug.LogError("can't get chat form");
                Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Mini_Player_Info_CloseForm);

                return;
            }
            RectTransform transform2 = script2.transform.Find("node/null") as RectTransform;
            if (transform2 == null)
            {
                Debug.LogError("chat form's close btn is null");
                Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Mini_Player_Info_CloseForm);

                return;
            }
            widget.CustomSetActive(true);
            Vector3[] vectorArray = new Vector3[4];
            transform2.GetWorldCorners(vectorArray);
            Vector2 vector  = CUIUtility.WorldToScreenPoint(Singleton <CUIManager> .instance.FormCamera, vectorArray[3]);
            Vector2 vector2 = new Vector2(0f, vector.y);
            if (((vector.x + transform.rect.width) + 100f) > Screen.width)
            {
                vector2.x = (Screen.width - transform.rect.width) - 15f;
            }
            else
            {
                vector2 = new Vector2(vector.x + 20f, vector.y);
            }
            transform.position = CUIUtility.ScreenToWorldPoint(script.GetCamera(), vector2, transform.position.z);
        }
        Text componetInChild = Utility.GetComponetInChild <Text>(script.gameObject, "panel/Name/Text");

        if (componetInChild != null)
        {
            componetInChild.text = this.m_PlayerProfile.Name();
        }
        COMDT_FRIEND_INFO comdt_friend_info = Singleton <CFriendContoller> .instance.model.GetInfo(CFriendModel.FriendType.GameFriend, this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld);

        COMDT_FRIEND_INFO comdt_friend_info2 = Singleton <CFriendContoller> .instance.model.GetInfo(CFriendModel.FriendType.SNS, this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld);

        Text text2 = Utility.GetComponetInChild <Text>(script.gameObject, "panel/Online/Text");

        if (text2 != null)
        {
            if (this.m_PlayerProfile.IsOnLine())
            {
                if (((comdt_friend_info != null) ? comdt_friend_info : ((comdt_friend_info2 != null) ? comdt_friend_info2 : null)) != null)
                {
                    COM_ACNT_GAME_STATE friendInGamingState = Singleton <CFriendContoller> .instance.model.GetFriendInGamingState(this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld);

                    switch (friendInGamingState)
                    {
                    case COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE:
                        text2.text = string.Format("<color=#00ff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Online"));
                        goto Label_0558;

                    case COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_SINGLEGAME:
                    case COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_MULTIGAME:
                        text2.text = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Gaming"));
                        goto Label_0558;
                    }
                    if (friendInGamingState == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_TEAM)
                    {
                        text2.text = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Teaming"));
                    }
                }
                else
                {
                    text2.text = string.Format("<color=#00ff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Online"));
                }
            }
            else
            {
                string text = Singleton <CTextManager> .GetInstance().GetText("Common_Offline");

                text2.text = text;
                text2.text = text;
            }
        }
Label_0558:
        text3 = Utility.GetComponetInChild <Text>(script.gameObject, "panel/DuanWei/Text");
        if (text3 != null)
        {
            string rankTitle = CLadderView.GetRankTitle(this.m_PlayerProfile.GetRankGrade(), this.m_PlayerProfile.GetRankClass());
            text3.text = !string.IsNullOrEmpty(rankTitle) ? rankTitle : Singleton <CTextManager> .GetInstance().GetText("Common_NoData");
        }
        Text text4 = Utility.GetComponetInChild <Text>(script.gameObject, "panel/Team/Text");
        Text text5 = Utility.GetComponetInChild <Text>(script.gameObject, "panel/Position/Text");

        if (!CGuildSystem.IsInNormalGuild(this.m_PlayerProfile.GuildState) || string.IsNullOrEmpty(this.m_PlayerProfile.GuildName))
        {
            if (text4 != null)
            {
                text4.text = Singleton <CTextManager> .GetInstance().GetText("PlayerInfo_Guild");
            }
            if (text5 != null)
            {
                text5.text = Singleton <CTextManager> .GetInstance().GetText("PlayerInfo_Guild");
            }
        }
        else
        {
            if (text4 != null)
            {
                text4.text = this.m_PlayerProfile.GuildName;
            }
            if (text5 != null)
            {
                text5.text = CGuildHelper.GetPositionName(this.m_PlayerProfile.GuildState);
            }
        }
        GameObject obj3 = Utility.FindChild(script.gameObject, "panel/Btn/AddFriend");
        GameObject obj4 = Utility.FindChild(script.gameObject, "panel/Btn/Profile");
        GameObject obj5 = Utility.FindChild(script.gameObject, "panel/Btn/3v3");
        GameObject obj6 = Utility.FindChild(script.gameObject, "panel/Btn/5v5");
        GameObject obj7 = Utility.FindChild(script.gameObject, "panel/Btn/Block");

        obj4.CustomSetActive(true);
        switch (this.m_OpenSrc)
        {
        case OpenSrc.Rank:
            if ((comdt_friend_info != null) || (comdt_friend_info2 != null))
            {
                obj3.CustomSetActive(false);
                obj5.CustomSetActive(true);
                obj6.CustomSetActive(true);
            }
            else
            {
                obj3.CustomSetActive(true);
                obj5.CustomSetActive(false);
                obj6.CustomSetActive(false);
            }
            obj7.CustomSetActive(false);
            break;

        case OpenSrc.Chat:
            switch (Singleton <CChatController> .GetInstance().view.CurTab)
            {
            case EChatChannel.Lobby:
                obj5.CustomSetActive(false);
                obj6.CustomSetActive(false);
                if ((comdt_friend_info == null) && (comdt_friend_info2 == null))
                {
                    obj3.CustomSetActive(true);
                }
                else
                {
                    obj3.CustomSetActive(false);
                }
                obj7.CustomSetActive(true);
                this.SetBlockButtonBlocked(obj7, Singleton <CFriendContoller> .instance.model.IsBlack(this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld));
                return;

            case EChatChannel.Friend:
            case EChatChannel.Select_Hero:
            case EChatChannel.Speaker:
                return;

            case EChatChannel.Guild:
                if ((comdt_friend_info == null) && (comdt_friend_info2 == null))
                {
                    obj3.CustomSetActive(true);
                    obj5.CustomSetActive(false);
                    obj6.CustomSetActive(false);
                }
                else
                {
                    obj3.CustomSetActive(false);
                    obj5.CustomSetActive(true);
                    obj6.CustomSetActive(true);
                }
                obj7.CustomSetActive(true);
                this.SetBlockButtonBlocked(obj7, Singleton <CFriendContoller> .instance.model.IsBlack(this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld));
                return;

            case EChatChannel.Friend_Chat:
                obj3.CustomSetActive(false);
                obj5.CustomSetActive(true);
                obj6.CustomSetActive(true);
                obj7.CustomSetActive(true);
                this.SetBlockButtonBlocked(obj7, Singleton <CFriendContoller> .instance.model.IsBlack(this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld));
                return;

            case EChatChannel.Settle:
                obj3.CustomSetActive(false);
                obj5.CustomSetActive(false);
                obj6.CustomSetActive(false);
                obj7.CustomSetActive(true);
                this.SetBlockButtonBlocked(obj7, Singleton <CFriendContoller> .instance.model.IsBlack(this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld));
                return;
            }
            break;
        }
    }
예제 #16
0
        private static void SetFriendState(GameObject element, ref COMDT_FRIEND_INFO friend)
        {
            GameObject gameObject  = element.transform.FindChild("HeadBg").gameObject;
            Text       component   = element.transform.FindChild("Online").GetComponent <Text>();
            GameObject gameObject2 = element.transform.FindChild("InviteButton").gameObject;
            Text       component2  = element.transform.FindChild("PlayerName").GetComponent <Text>();
            Text       component3  = element.transform.FindChild("Time").GetComponent <Text>();

            if (component3 != null)
            {
                component3.gameObject.CustomSetActive(false);
            }
            if (component != null)
            {
                component.gameObject.CustomSetActive(true);
            }
            CInviteView.SetListElementLadderInfo(element, friend);
            COM_ACNT_GAME_STATE cOM_ACNT_GAME_STATE = 0;

            if (friend.bIsOnline == 1)
            {
                CFriendModel.FriendInGame friendInGaming = Singleton <CFriendContoller> .get_instance().model.GetFriendInGaming(friend.stUin.ullUid, friend.stUin.dwLogicWorldId);

                if (friendInGaming == null)
                {
                    cOM_ACNT_GAME_STATE = 0;
                }
                else
                {
                    cOM_ACNT_GAME_STATE = friendInGaming.State;
                }
                if (cOM_ACNT_GAME_STATE == null)
                {
                    component.text = Singleton <CInviteSystem> .get_instance().GetInviteStateStr(friend.stUin.ullUid, false);

                    CUIEventScript component4 = gameObject2.GetComponent <CUIEventScript>();
                    component4.m_onClickEventParams.tag = Singleton <CInviteSystem> .get_instance().InviteType;

                    component4.m_onClickEventParams.tag2 = (int)friend.stUin.dwLogicWorldId;
                    component4.m_onClickEventParams.commonUInt64Param1 = friend.stUin.ullUid;
                }
                else if (cOM_ACNT_GAME_STATE == 1 || cOM_ACNT_GAME_STATE == 2 || cOM_ACNT_GAME_STATE == 4)
                {
                    if (friendInGaming == null)
                    {
                        component.gameObject.CustomSetActive(true);
                        component.text = "friendInGame is null";
                        return;
                    }
                    if (friendInGaming.startTime > 0u)
                    {
                        component.gameObject.CustomSetActive(false);
                        component3.gameObject.CustomSetActive(true);
                        component3.text = string.Format(Singleton <CTextManager> .get_instance().GetText("Common_Gaming_Time"), CInviteView.GetStartMinute(friendInGaming.startTime));
                        Singleton <CInviteSystem> .get_instance().CheckInviteListGameTimer();
                    }
                    else
                    {
                        component.gameObject.CustomSetActive(true);
                        component.text = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .get_instance().GetText("Common_Gaming_NoTime"));
                    }
                }
                else if (cOM_ACNT_GAME_STATE == 3)
                {
                    component.text = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .get_instance().GetText("Common_Teaming"));
                }
                component2.color = CUIUtility.s_Color_White;
                CUIUtility.GetComponentInChildren <Image>(gameObject).color = CUIUtility.s_Color_White;
            }
            else
            {
                component.text   = string.Format(Singleton <CTextManager> .get_instance().GetText("Common_Offline"), new object[0]);
                component2.color = CUIUtility.s_Color_Grey;
                CUIUtility.GetComponentInChildren <Image>(gameObject).color = CUIUtility.s_Color_GrayShader;
            }
            gameObject2.CustomSetActive(friend.bIsOnline == 1 && cOM_ACNT_GAME_STATE == 0);
        }
예제 #17
0
        private static void SetFriendState(GameObject element, ref COMDT_FRIEND_INFO friend)
        {
            GameObject gameObject = element.transform.FindChild("HeadBg").gameObject;
            Text       component  = element.transform.FindChild("Online").GetComponent <Text>();
            GameObject obj3       = element.transform.FindChild("InviteButton").gameObject;
            Text       text2      = element.transform.FindChild("PlayerName").GetComponent <Text>();
            Text       text3      = element.transform.FindChild("Time").GetComponent <Text>();

            if (text3 != null)
            {
                text3.gameObject.CustomSetActive(false);
            }
            if (component != null)
            {
                component.gameObject.CustomSetActive(true);
            }
            SetListElementLadderInfo(element, friend);
            COM_ACNT_GAME_STATE state = COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE;

            if (friend.bIsOnline == 1)
            {
                CFriendModel.FriendInGame friendInGaming = Singleton <CFriendContoller> .instance.model.GetFriendInGaming(friend.stUin.ullUid, friend.stUin.dwLogicWorldId);

                if (friendInGaming == null)
                {
                    state = COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE;
                }
                else
                {
                    state = friendInGaming.State;
                }
                if (state == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE)
                {
                    component.text = Singleton <CInviteSystem> .instance.GetInviteStateStr(friend.stUin.ullUid);

                    CUIEventScript script = obj3.GetComponent <CUIEventScript>();
                    script.m_onClickEventParams.tag  = (int)Singleton <CInviteSystem> .instance.InviteType;
                    script.m_onClickEventParams.tag2 = (int)friend.stUin.dwLogicWorldId;
                    script.m_onClickEventParams.commonUInt64Param1 = friend.stUin.ullUid;
                }
                else if ((state == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_SINGLEGAME) || (state == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_MULTIGAME))
                {
                    if (friendInGaming == null)
                    {
                        component.gameObject.CustomSetActive(true);
                        component.text = "friendInGame is null";
                        return;
                    }
                    if (friendInGaming.startTime > 0)
                    {
                        component.gameObject.CustomSetActive(false);
                        text3.gameObject.CustomSetActive(true);
                        text3.text = string.Format(Singleton <CTextManager> .instance.GetText("Common_Gaming_Time"), GetStartMinute(friendInGaming.startTime));
                        Singleton <CInviteSystem> .instance.CheckInviteListGameTimer();
                    }
                    else
                    {
                        component.gameObject.CustomSetActive(true);
                        component.text = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Gaming_NoTime"));
                    }
                }
                else if (state == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_TEAM)
                {
                    component.text = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Teaming"));
                }
                text2.color = CUIUtility.s_Color_White;
                CUIUtility.GetComponentInChildren <Image>(gameObject).color = CUIUtility.s_Color_White;
            }
            else
            {
                component.text = string.Format(Singleton <CTextManager> .instance.GetText("Common_Offline"), new object[0]);
                text2.color    = CUIUtility.s_Color_Grey;
                CUIUtility.GetComponentInChildren <Image>(gameObject).color = CUIUtility.s_Color_GrayShader;
            }
            obj3.CustomSetActive((friend.bIsOnline == 1) && (state == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE));
        }