public void ShowZhaomuZhe_Item(GameObject com, CFriendRecruit.RecruitData info)
        {
            GameObject bar              = Utility.FindChild(com, "BarBg");
            GameObject bar2             = Utility.FindChild(com, "BarBg2");
            Image      componetInChild  = Utility.GetComponetInChild <Image>(com, "BarBg/Fore");
            Image      componetInChild2 = Utility.GetComponetInChild <Image>(com, "BarBg2/Fore");

            if (this.zhaoMuZheBarWidth1 == 0f && componetInChild != null)
            {
                this.zhaoMuZheBarWidth1 = componetInChild.get_rectTransform().sizeDelta.x;
            }
            if (this.zhaoMuZheBarWidth2 == 0f && componetInChild2 != null)
            {
                this.zhaoMuZheBarWidth2 = componetInChild2.get_rectTransform().sizeDelta.x;
            }
            if (info.userInfo != null)
            {
                com.transform.FindChild("user/hasData").gameObject.CustomSetActive(true);
                com.transform.FindChild("user/null").gameObject.CustomSetActive(false);
                com.transform.FindChild("user/hasData/Level").gameObject.CustomSetActive(true);
                CUIHttpImageScript component = com.transform.FindChild("user/hasData/pnlSnsHead/HttpImage").GetComponent <CUIHttpImageScript>();
                UT.SetHttpImage(component, info.userInfo.szHeadUrl);
                Text component2 = com.transform.FindChild("user/hasData/Level").GetComponent <Text>();
                component2.set_text(string.Format("Lv.{0}", info.userInfo.dwPvpLvl));
                GameObject gameObject = com.transform.FindChild("user/hasData/pnlSnsHead/HttpImage/NobeIcon").gameObject;
                if (gameObject)
                {
                    MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(gameObject.GetComponent <Image>(), (int)info.userInfo.stGameVip.dwCurLevel, false, true, 0uL);
                }
                Text   component3 = com.transform.FindChild("user/hasData/NameGroup/Name").GetComponent <Text>();
                string text       = UT.Bytes2String(info.userInfo.szUserName);
                if (component3 != null)
                {
                    component3.set_text(text);
                }
                GameObject gameObject2 = com.transform.FindChild("user/hasData/NameGroup/Gender").gameObject;
                FriendShower.ShowGender(gameObject2, (COM_SNSGENDER)info.userInfo.bGender);
            }
            else
            {
                com.transform.FindChild("user/hasData").gameObject.CustomSetActive(false);
                com.transform.FindChild("user/null").gameObject.CustomSetActive(true);
            }
            float         num  = 1000f;
            float         num2 = -1f;
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CFriendContoller.FriendFormPath);

            int num3 = Math.Min(this.zhaomuzheRewardCount, info.RewardList.Count);

            for (int i = 0; i < num3; i++)
            {
                Transform transform = com.transform.FindChild(string.Format("reward_{0}", i));
                DebugHelper.Assert(transform != null, "rewardNodeTS not null...");
                if (!(transform == null))
                {
                    CFriendRecruit.RecruitReward recruitReward = info.RewardList[i];
                    ResRecruitmentReward         cfgReward     = Singleton <CFriendContoller> .instance.model.friendRecruit.GetCfgReward(recruitReward.rewardID);

                    if (cfgReward.dwLevel < num)
                    {
                        num = cfgReward.dwLevel;
                    }
                    if (cfgReward.dwLevel > num2)
                    {
                        num2 = cfgReward.dwLevel;
                    }
                    this.Show_Award(transform.gameObject, info.ullUid, info.dwLogicWorldId, COM_RECRUITMENT_TYPE.COM_RECRUITMENT_ACTIVE, recruitReward.rewardID, cfgReward, recruitReward.state, form, true);
                }
            }
            GameObject gameObject3 = Utility.FindChild(com, "cup");

            this.ShowCup(gameObject3, info.IsGetAllReward(), 0);
            if (info.userInfo != null)
            {
                this.SetCombineBar(bar, bar2, this.zhaoMuZheBarWidth1, this.zhaoMuZheBarWidth2, info.userInfo.dwPvpLvl, num, num2);
            }
            else
            {
                this.SetBarSize(componetInChild, 0f, 0f);
                this.SetBarSize(componetInChild2, 0f, 0f);
            }
        }
        public static void On_NTF_CHG_INTIMACY_DENY(CSPkg msg)
        {
            SCPKG_CMD_NTF_CHG_INTIMACY_DENY stNtfChgIntimacyDeny = msg.stPkgData.get_stNtfChgIntimacyDeny();

            if (stNtfChgIntimacyDeny == null)
            {
                return;
            }
            COMDT_FRIEND_INFO gameOrSnsFriend = Singleton <CFriendContoller> .get_instance().model.GetGameOrSnsFriend(stNtfChgIntimacyDeny.stUin.ullUid, stNtfChgIntimacyDeny.stUin.dwLogicWorldId);

            string strContent = string.Empty;

            if (stNtfChgIntimacyDeny.bRelationChgType == 1)
            {
                if (stNtfChgIntimacyDeny.bIntimacyState == 1)
                {
                    if (gameOrSnsFriend != null)
                    {
                        strContent = string.Format(UT.FRData().IntimRela_Tips_DenyYourRequestGay, UT.Bytes2String(gameOrSnsFriend.szUserName));
                    }
                    CFriendRelationship.FRData.Add(stNtfChgIntimacyDeny.stUin.ullUid, stNtfChgIntimacyDeny.stUin.dwLogicWorldId, 24, 0, 0u, false);
                }
                if (stNtfChgIntimacyDeny.bIntimacyState == 2)
                {
                    if (gameOrSnsFriend != null)
                    {
                        strContent = string.Format(UT.FRData().IntimRela_Tips_DenyYourRequestLover, UT.Bytes2String(gameOrSnsFriend.szUserName));
                    }
                    CFriendRelationship.FRData.Add(stNtfChgIntimacyDeny.stUin.ullUid, stNtfChgIntimacyDeny.stUin.dwLogicWorldId, 24, 0, 0u, false);
                }
            }
            if (stNtfChgIntimacyDeny.bRelationChgType == 2)
            {
                if (stNtfChgIntimacyDeny.bIntimacyState == 1)
                {
                    if (gameOrSnsFriend != null)
                    {
                        strContent = string.Format(UT.FRData().IntimRela_Tips_DenyYourDelGay, UT.Bytes2String(gameOrSnsFriend.szUserName));
                    }
                    CFriendRelationship.FRData.Add(stNtfChgIntimacyDeny.stUin.ullUid, stNtfChgIntimacyDeny.stUin.dwLogicWorldId, 1, 0, 0u, false);
                }
                if (stNtfChgIntimacyDeny.bIntimacyState == 2)
                {
                    if (gameOrSnsFriend != null)
                    {
                        strContent = string.Format(UT.FRData().IntimRela_Tips_DenyYourDelLover, UT.Bytes2String(gameOrSnsFriend.szUserName));
                    }
                    CFriendRelationship.FRData.Add(stNtfChgIntimacyDeny.stUin.ullUid, stNtfChgIntimacyDeny.stUin.dwLogicWorldId, 2, 0, 0u, false);
                }
            }
            Singleton <CUIManager> .GetInstance().OpenTips(strContent, false, 1.5f, null, new object[0]);
        }
Exemplo n.º 3
0
        public static string Build_4_EntryString(EChatChannel type, ulong ullUid, uint iLogicWorldID, string rawText)
        {
            string str = string.Empty;

            if (type == EChatChannel.Friend)
            {
                COMDT_FRIEND_INFO gameOrSnsFriend = Singleton <CFriendContoller> .GetInstance().model.GetGameOrSnsFriend(ullUid, iLogicWorldID);

                if (gameOrSnsFriend != null)
                {
                    str = string.Format(CChatController.fmt, UT.Bytes2String(gameOrSnsFriend.szUserName), rawText);
                }
                return(str);
            }
            if (type == EChatChannel.Lobby)
            {
                COMDT_CHAT_PLAYER_INFO comdt_chat_player_info = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (comdt_chat_player_info != null)
                {
                    str = string.Format(CChatController.fmt, UT.Bytes2String(comdt_chat_player_info.szName), rawText);
                }
                return(str);
            }
            if (type == EChatChannel.Guild)
            {
                COMDT_CHAT_PLAYER_INFO comdt_chat_player_info2 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (comdt_chat_player_info2 != null)
                {
                    str = string.Format(CChatController.fmt, UT.Bytes2String(comdt_chat_player_info2.szName), rawText);
                }
                return(str);
            }
            if (type == EChatChannel.Room)
            {
                COMDT_CHAT_PLAYER_INFO comdt_chat_player_info3 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (comdt_chat_player_info3 != null)
                {
                    str = string.Format(CChatController.fmt, UT.Bytes2String(comdt_chat_player_info3.szName), rawText);
                }
                return(str);
            }
            if (type == EChatChannel.Team)
            {
                COMDT_CHAT_PLAYER_INFO comdt_chat_player_info4 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (comdt_chat_player_info4 != null)
                {
                    str = string.Format(CChatController.fmt, UT.Bytes2String(comdt_chat_player_info4.szName), rawText);
                }
                return(str);
            }
            if (type == EChatChannel.Settle)
            {
                COMDT_CHAT_PLAYER_INFO comdt_chat_player_info5 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (comdt_chat_player_info5 != null)
                {
                    str = string.Format(CChatController.fmt, UT.Bytes2String(comdt_chat_player_info5.szName), rawText);
                }
                return(str);
            }
            return("ERROR, in Build_4_EntryString");
        }
        public static void Show_Item_Middle(CUIComponent com, CFR frData)
        {
            IntimacyRelationViewUT.SetButtonParam(com.m_widgets[16], frData);
            IntimacyRelationViewUT.SetButtonParam(com.m_widgets[14], frData);
            IntimacyRelationViewUT.SetButtonParam(com.m_widgets[12], frData);
            IntimacyRelationViewUT.SetButtonParam(com.m_widgets[7], frData);
            int cDDays = frData.CDDays;

            if (cDDays != -1)
            {
                com.m_widgets[5].CustomSetActive(true);
                com.m_widgets[6].CustomSetActive(false);
                IntimacyRelationViewUT.Set_Middle_Text(com, true, string.Format(UT.FRData().IntimRela_CD_CountDown, cDDays));
                return;
            }
            if (frData.state == 24 && cDDays == -1)
            {
                com.m_widgets[5].CustomSetActive(true);
                com.m_widgets[6].CustomSetActive(true);
                com.m_widgets[10].CustomSetActive(false);
                IntimacyRelationViewUT.Set_Drop_Text(com, !frData.bInShowChoiseRelaList, frData);
                IntimacyRelationViewUT.Set_Drop_List(com, frData.bInShowChoiseRelaList);
                IntimacyRelationViewUT.Set_Middle_Text(com, false, string.Empty);
            }
            if (frData.state == 1 || frData.state == 2)
            {
                com.m_widgets[5].CustomSetActive(true);
                com.m_widgets[6].CustomSetActive(false);
                IntimacyRelationViewUT.Set_Middle_Text(com, true, IntimacyRelationViewUT.GetMiddleTextStr(frData.state));
            }
            if (frData.state == 20 || frData.state == 22)
            {
                if (frData.bReciveOthersRequest)
                {
                    com.m_widgets[5].CustomSetActive(true);
                    com.m_widgets[6].CustomSetActive(false);
                    string text = string.Empty;
                    if (frData.state == 20)
                    {
                        text = UT.FRData().IntimRela_Type_Gay;
                    }
                    if (frData.state == 22)
                    {
                        text = UT.FRData().IntimRela_Type_Lover;
                    }
                    string txt = string.Format(UT.FRData().IntimRela_Tips_ReceiveOtherReqRela, UT.Bytes2String(frData.friendInfo.szUserName), text);
                    IntimacyRelationViewUT.Set_Middle_Text(com, true, txt);
                }
                else
                {
                    com.m_widgets[5].CustomSetActive(true);
                    com.m_widgets[6].CustomSetActive(false);
                    IntimacyRelationViewUT.Set_Middle_Text(com, true, UT.FRData().IntimRela_Tips_Wait4TargetRspReqRela);
                }
            }
            if (frData.state == 21 || frData.state == 23)
            {
                if (frData.bReciveOthersRequest)
                {
                    com.m_widgets[5].CustomSetActive(true);
                    com.m_widgets[6].CustomSetActive(false);
                    string text2 = string.Empty;
                    if (frData.state == 21)
                    {
                        text2 = UT.FRData().IntimRela_Type_Gay;
                    }
                    if (frData.state == 23)
                    {
                        text2 = UT.FRData().IntimRela_Type_Lover;
                    }
                    IntimacyRelationViewUT.Set_Middle_Text(com, true, string.Format(UT.FRData().IntimRela_Tips_ReceiveOtherDelRela, UT.Bytes2String(frData.friendInfo.szUserName), text2));
                }
                else
                {
                    com.m_widgets[5].CustomSetActive(true);
                    com.m_widgets[6].CustomSetActive(false);
                    IntimacyRelationViewUT.Set_Middle_Text(com, true, UT.FRData().IntimRela_Tips_Wait4TargetRspDelRela);
                }
            }
        }
Exemplo n.º 5
0
 public void SetChatTimerEnable(bool b)
 {
     UT.ResetTimer(this.chatTimer, !b);
 }
Exemplo n.º 6
0
 private string QueryBossName()
 {
     DebugHelper.Assert(this.bossActorRoot);
     return(UT.Bytes2String(MonsterDataHelper.GetDataCfgInfoByCurLevelDiff(this.bossActorRoot.handle.TheActorMeta.ConfigId).szName));
 }
Exemplo n.º 7
0
        public void ShowSpeaker(COMDT_CHAT_MSG_HORN data)
        {
            string a = CChatUT.Build_4_Speaker_EntryString(data.stFrom.ullUid, (uint)data.stFrom.iLogicWorldID, UT.Bytes2String(data.szContent));

            this.m_timerSpeaker = Singleton <CTimerManager> .get_instance().AddTimer(1000, 0, new CTimer.OnTimeUpHandler(this.OnTimerSpeaker));

            if (Singleton <CChatController> .get_instance().model.channelMgr.ChatTab == CChatChannelMgr.EChatTab.Normal)
            {
                Singleton <CChatController> .get_instance().model.sysData.Add_NewContent_Entry_Speaker(a);

                Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_ChatEntry_Change");
            }
        }
Exemplo n.º 8
0
 public stBlackName Convert2BlackName(COMDT_CHAT_PLAYER_INFO info, byte bGender, uint dwLastLoginTime)
 {
     return(new stBlackName {
         ullUid = info.ullUid, dwLogicWorldId = (uint)info.iLogicWorldID, name = UT.Bytes2String(info.szName), bIsOnline = 0, bGender = bGender, szHeadUrl = UT.Bytes2String(info.szHeadUrl), dwPvpLvl = info.dwLevel, dwLastLoginTime = dwLastLoginTime
     });
 }
Exemplo n.º 9
0
        public static void Send_Private_Chat(ulong ullUid, uint logicWorldId, string text)
        {
            CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(1300u);

            cSPkg.stPkgData.get_stChatReq().stChatMsg.bType = 2;
            cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.select(2L);
            cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.get_stPrivate().stTo.ullUid = ullUid;
            cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.get_stPrivate().stTo.iLogicWorldID = (int)logicWorldId;
            COMDT_FRIEND_INFO gameOrSnsFriend = Singleton <CFriendContoller> .get_instance().model.GetGameOrSnsFriend(ullUid, logicWorldId);

            if (gameOrSnsFriend != null)
            {
                cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.get_stPrivate().stTo.szName = gameOrSnsFriend.szUserName;
                cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.get_stPrivate().stTo.dwLevel = gameOrSnsFriend.dwLevel;
            }
            cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.get_stPrivate().szContent = UT.String2Bytes(text);
            Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref cSPkg, false);

            Debug.Log(string.Concat(new object[]
            {
                "--- send private chat, id:",
                ullUid,
                ",logicworldid:",
                logicWorldId,
                ",content:",
                text
            }));
        }
Exemplo n.º 10
0
        public static void ShowLBSUserData(CSDT_LBS_USER_INFO info, FriendShower com)
        {
            if (com == null)
            {
                return;
            }
            com.ullUid         = info.stLbsUserInfo.stUin.ullUid;
            com.dwLogicWorldID = info.stLbsUserInfo.stUin.dwLogicWorldId;
            if (info.stLbsUserInfo.szHeadUrl != null)
            {
                string url = UT.Bytes2String(info.stLbsUserInfo.szHeadUrl);
                com.HttpImage.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url));
            }
            if (com.nobeIcon)
            {
                MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(com.nobeIcon.GetComponent <Image>(), (int)info.stLbsUserInfo.stGameVip.dwCurLevel, false, false, info.stLbsUserInfo.ullUserPrivacyBits);
            }
            if (com.HeadIconBack)
            {
                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(com.HeadIconBack.GetComponent <Image>(), (int)info.stLbsUserInfo.stGameVip.dwHeadIconId);

                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBkEffect(com.HeadIconBack.GetComponent <Image>(), (int)info.stLbsUserInfo.stGameVip.dwHeadIconId, com.HttpImage.m_belongedFormScript, 1f, true);
            }
            if (com.QQVipImage)
            {
                MonoSingleton <NobeSys> .GetInstance().SetOtherQQVipHead(com.QQVipImage.GetComponent <Image>(), (int)info.stLbsUserInfo.dwQQVIPMask);
            }
            if (com.mentorLv_node)
            {
                com.mentorLv_node.CustomSetActive(false);
            }
            com.intimacyNode.CustomSetActive(false);
            com.SetFriendItemType(FriendShower.ItemType.LBS, true);
            com.ShowName(UT.Bytes2String(info.stLbsUserInfo.szUserName));
            com.ShowLevel(info.stLbsUserInfo.dwPvpLvl);
            com.ShowLastTime(true, UT.GetTimeString(info.stLbsUserInfo.dwLastLoginTime));
            com.ShowGenderType((COM_SNSGENDER)info.stLbsUserInfo.bGender);
            com.ShowDistance(UT.GetDistance(info.dwDistance));
            com.SetBGray(info.stLbsUserInfo.bIsOnline != 1);
            if (com.platChannelIcon != null)
            {
                com.platChannelIcon.CustomSetActive(false);
            }
            if (com.lbsAddFriendBtn != null)
            {
                CFriendModel model = Singleton <CFriendContoller> .instance.model;
                if (model.IsSnsFriend(com.ullUid, com.dwLogicWorldID) || model.IsGameFriend(com.ullUid, com.dwLogicWorldID))
                {
                    CUICommonSystem.SetButtonEnableWithShader(com.lbsAddFriendBtn, false, true);
                }
                else
                {
                    CUICommonSystem.SetButtonEnableWithShader(com.lbsAddFriendBtn, true, true);
                }
            }
            GameObject gameObject  = com.gameObject.transform.Find("body/LBS/Rank").gameObject;
            GameObject gameObject2 = com.gameObject.transform.Find("body/LBS/HisRank").gameObject;

            UT.ShowRank(com.formScript, gameObject, info.bGradeOfRank, info.stLbsUserInfo.dwRankClass);
            UT.ShowRank(com.formScript, gameObject2, info.bMaxGradeOfRank, info.stLbsUserInfo.dwRankClass);
        }
Exemplo n.º 11
0
 public stBlackName Convert2BlackName(COMDT_FRIEND_INFO info)
 {
     return(new stBlackName {
         ullUid = info.stUin.ullUid, dwLogicWorldId = info.stUin.dwLogicWorldId, name = UT.Bytes2String(info.szUserName), bIsOnline = info.bIsOnline, dwLastLoginTime = info.dwLastLoginTime, bGender = info.bGender, szHeadUrl = UT.Bytes2String(info.szHeadUrl), dwPvpLvl = info.dwPvpLvl
     });
 }
Exemplo n.º 12
0
        public static string Build_4_EntryString(EChatChannel type, ulong ullUid, uint iLogicWorldID, string rawText)
        {
            string result = string.Empty;

            if (type == EChatChannel.Friend)
            {
                COMDT_FRIEND_INFO gameOrSnsFriend = Singleton <CFriendContoller> .GetInstance().model.GetGameOrSnsFriend(ullUid, iLogicWorldID);

                if (gameOrSnsFriend != null)
                {
                    result = string.Format(CChatController.fmt, UT.Bytes2String(gameOrSnsFriend.szUserName), rawText);
                }
            }
            else if (type == EChatChannel.Lobby)
            {
                COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (cOMDT_CHAT_PLAYER_INFO != null)
                {
                    result = string.Format(CChatController.fmt, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO.szName), rawText);
                }
            }
            else if (type == EChatChannel.Guild)
            {
                COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO2 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (cOMDT_CHAT_PLAYER_INFO2 != null)
                {
                    result = string.Format(CChatController.fmt, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO2.szName), rawText);
                }
            }
            else if (type == EChatChannel.GuildMatchTeam)
            {
                COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO3 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (cOMDT_CHAT_PLAYER_INFO3 != null)
                {
                    result = string.Format(CChatController.fmt, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO3.szName), rawText);
                }
            }
            else if (type == EChatChannel.Room)
            {
                COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO4 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (cOMDT_CHAT_PLAYER_INFO4 != null)
                {
                    result = string.Format(CChatController.fmt, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO4.szName), rawText);
                }
            }
            else if (type == EChatChannel.Team)
            {
                COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO5 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (cOMDT_CHAT_PLAYER_INFO5 != null)
                {
                    result = string.Format(CChatController.fmt, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO5.szName), rawText);
                }
            }
            else if (type == EChatChannel.Settle)
            {
                COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO6 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (cOMDT_CHAT_PLAYER_INFO6 != null)
                {
                    result = string.Format(CChatController.fmt, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO6.szName), rawText);
                }
            }
            else
            {
                result = "ERROR, in Build_4_EntryString";
            }
            return(result);
        }
Exemplo n.º 13
0
        public static void GetUser(EChaterType type, ulong ulluid, uint logicworld_id, out string name, out string openId, out string level, out string head_url, out COMDT_GAME_VIP_CLIENT stGameVip)
        {
            name      = "error";
            openId    = "error";
            level     = "-1";
            head_url  = string.Empty;
            stGameVip = null;
            if (type == EChaterType.Self)
            {
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

                if (masterRoleInfo != null)
                {
                    name      = masterRoleInfo.Name;
                    level     = masterRoleInfo.PvpLevel.ToString();
                    stGameVip = masterRoleInfo.GetNobeInfo().stGameVipClient;
                    head_url  = masterRoleInfo.HeadUrl.Substring(0, masterRoleInfo.HeadUrl.LastIndexOf("/"));
                }
            }
            else if (type == EChaterType.Friend)
            {
                COMDT_FRIEND_INFO gameOrSnsFriend = Singleton <CFriendContoller> .GetInstance().model.GetGameOrSnsFriend(ulluid, logicworld_id);

                if (gameOrSnsFriend != null)
                {
                    name   = UT.Bytes2String(gameOrSnsFriend.szUserName);
                    openId = UT.Bytes2String(gameOrSnsFriend.szOpenId);
                    int dwPvpLvl = (int)gameOrSnsFriend.dwPvpLvl;
                    level     = dwPvpLvl.ToString();
                    head_url  = UT.Bytes2String(gameOrSnsFriend.szHeadUrl);
                    stGameVip = gameOrSnsFriend.stGameVip;
                }
            }
            else if (type == EChaterType.Strenger)
            {
                COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ulluid, logicworld_id);

                if (cOMDT_CHAT_PLAYER_INFO != null)
                {
                    name   = UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO.szName);
                    openId = UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO.szOpenID);
                    int dwLevel = (int)cOMDT_CHAT_PLAYER_INFO.dwLevel;
                    level     = dwLevel.ToString();
                    head_url  = UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO.szHeadUrl);
                    stGameVip = cOMDT_CHAT_PLAYER_INFO.stVip;
                }
            }
            else if (type == EChaterType.Speaker || type == EChaterType.LoudSpeaker)
            {
                COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO2 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ulluid, logicworld_id);

                if (cOMDT_CHAT_PLAYER_INFO2 != null)
                {
                    name   = UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO2.szName);
                    openId = UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO2.szOpenID);
                    int dwLevel2 = (int)cOMDT_CHAT_PLAYER_INFO2.dwLevel;
                    level     = dwLevel2.ToString();
                    head_url  = UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO2.szHeadUrl);
                    stGameVip = cOMDT_CHAT_PLAYER_INFO2.stVip;
                }
            }
        }
		public static void Show_Item_Middle(CUIComponent com, CFR frData, CUIFormScript uiFrom)
		{
			IntimacyRelationViewUT.SetButtonParam(com.m_widgets[16], frData);
			IntimacyRelationViewUT.SetButtonParam(com.m_widgets[14], frData);
			IntimacyRelationViewUT.SetButtonParam(com.m_widgets[12], frData);
			IntimacyRelationViewUT.SetButtonParam(com.m_widgets[7], frData);
			int cDDays = frData.CDDays;
			GameObject obj = Utility.FindChild(com.gameObject, "mengban");
			obj.CustomSetActive(cDDays != -1);
			if (cDDays != -1)
			{
				com.m_widgets[5].CustomSetActive(true);
				com.m_widgets[6].CustomSetActive(false);
				IntimacyRelationViewUT.Set_Middle_Text(com, true, string.Format(UT.FRData().IntimRela_CD_CountDown, cDDays), false);
				return;
			}
			if (frData.state == COM_INTIMACY_STATE.COM_INTIMACY_STATE_VALUE_FULL && cDDays == -1)
			{
				com.m_widgets[5].CustomSetActive(true);
				com.m_widgets[6].CustomSetActive(true);
				com.m_widgets[10].CustomSetActive(false);
				IntimacyRelationViewUT.Set_Drop_Text(com, !frData.bInShowChoiseRelaList, frData);
				IntimacyRelationViewUT.Set_Drop_List(com, frData.bInShowChoiseRelaList);
				IntimacyRelationViewUT.Set_Middle_Text(com, false, string.Empty, false);
			}
			if (IntimacyRelationViewUT.IsRelaState(frData.state))
			{
				com.m_widgets[5].CustomSetActive(true);
				com.m_widgets[6].CustomSetActive(false);
				IntimacyRelationViewUT.Set_Middle_Text(com, true, IntimacyRelationViewUT.GetMiddleTextStr(frData.state), true);
				ushort num;
				CFriendModel.EIntimacyType eIntimacyType;
				bool flag;
				Singleton<CFriendContoller>.instance.model.GetFriendIntimacy(frData.ulluid, frData.worldID, out num, out eIntimacyType, out flag);
				if (num > 0)
				{
					int relaLevel = IntimacyRelationViewUT.CalcRelaLevel((int)num);
					string relaIconByRelaLevel = IntimacyRelationViewUT.GetRelaIconByRelaLevel(relaLevel, frData.state);
					if (!string.IsNullOrEmpty(relaIconByRelaLevel))
					{
						GameObject p = com.m_widgets[10];
						GameObject gameObject = Utility.FindChild(p, "Icon");
						if (gameObject != null)
						{
							Image component = gameObject.GetComponent<Image>();
							if (component != null)
							{
								component.gameObject.CustomSetActive(true);
								component.SetSprite(relaIconByRelaLevel, uiFrom, true, false, false, false);
								component.SetNativeSize();
							}
						}
					}
				}
			}
			if (IntimacyRelationViewUT.IsRelaStateConfirm(frData.state))
			{
				if (frData.bReciveOthersRequest)
				{
					com.m_widgets[5].CustomSetActive(true);
					com.m_widgets[6].CustomSetActive(false);
					COM_INTIMACY_STATE stateByConfirmState = IntimacyRelationViewUT.GetStateByConfirmState(frData.state);
					string relationText = IntimacyRelationViewUT.GetRelationText(stateByConfirmState);
					string txt = string.Format(UT.FRData().IntimRela_Tips_ReceiveOtherReqRela, UT.Bytes2String(frData.friendInfo.szUserName), relationText);
					IntimacyRelationViewUT.Set_Middle_Text(com, true, txt, false);
				}
				else
				{
					com.m_widgets[5].CustomSetActive(true);
					com.m_widgets[6].CustomSetActive(false);
					IntimacyRelationViewUT.Set_Middle_Text(com, true, UT.FRData().IntimRela_Tips_Wait4TargetRspReqRela, false);
				}
			}
			if (IntimacyRelationViewUT.IsRelaStateDeny(frData.state))
			{
				if (frData.bReciveOthersRequest)
				{
					com.m_widgets[5].CustomSetActive(true);
					com.m_widgets[6].CustomSetActive(false);
					COM_INTIMACY_STATE stateByDenyState = IntimacyRelationViewUT.GetStateByDenyState(frData.state);
					string relationText2 = IntimacyRelationViewUT.GetRelationText(stateByDenyState);
					string txt2 = string.Format(UT.FRData().IntimRela_Tips_ReceiveOtherDelRela, UT.Bytes2String(frData.friendInfo.szUserName), relationText2);
					IntimacyRelationViewUT.Set_Middle_Text(com, true, txt2, false);
				}
				else
				{
					com.m_widgets[5].CustomSetActive(true);
					com.m_widgets[6].CustomSetActive(false);
					IntimacyRelationViewUT.Set_Middle_Text(com, true, UT.FRData().IntimRela_Tips_Wait4TargetRspDelRela, false);
				}
			}
		}
        public void Open()
        {
            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.IntimacyRela_Menu_Close, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRela_Menu_Close));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.IntimacyRela_Show_Drop_List, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRela_Show_Drop_List));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.IntimacyRela_Drop_ListElement_Click, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRela_Drop_ListElement_Click));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.IntimacyRela_Drop_ListElement_Enable, new CUIEventManager.OnUIEventHandler(this.On_Drop_ListElement_Enable));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.IntimacyRela_OK, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRela_OK));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.IntimacyRela_Cancle, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRela_Cancle));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.IntimacyRela_Item_Enable, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRelation_Item_Enable));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.IntimacyRela_FristChoise, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRela_FristChoise));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.IntimacyRela_Delete_Relation, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRela_Delete_Relation));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.IntimacyRela_PrevState, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRela_PrevState));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.IntimacyRela_Delete_Relation_OK, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRela_Delete_Relation_OK));

            Singleton <EventRouter> .GetInstance().AddEventHandler("FRDataChange", new Action(this.On_FRDataChange));

            this.form = Singleton <CUIManager> .GetInstance().OpenForm(CFriendContoller.IntimacyRelaFormPath, false, true);

            this.listScript = this.form.transform.FindChild("GameObject/list").GetComponent <CUIListScript>();
            this.form.transform.FindChild("GameObject/info/txt").GetComponent <Text>().set_text(UT.FRData().IntimRela_EmptyDataText);
            this.Refresh();
        }
Exemplo n.º 16
0
        public static void Send_Lobby_Chat(string text)
        {
            CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(1300u);

            cSPkg.stPkgData.get_stChatReq().stChatMsg.bType = 1;
            cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.select(1L);
            cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.get_stLogicWord().szContent = UT.String2Bytes(text);
            Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref cSPkg, false);

            Singleton <CChatController> .GetInstance().model.channelMgr.GetChannel(EChatChannel.Lobby).Start_InputCD();
        }
Exemplo n.º 17
0
        public void OpenForm(CUIEvent uiEvent)
        {
            this.friendform = Singleton <CUIManager> .GetInstance().OpenForm(CFriendContoller.FriendFormPath, false, true);

            GameObject gameObject = this.friendform.gameObject;

            this.friendListNode = gameObject.transform.Find("node/Image/FriendList").gameObject;
            this.friendListNode.CustomSetActive(true);
            this.friendListCom          = this.friendListNode.GetComponent <CUIListScript>();
            this.addFriendBtnGameObject = Utility.FindChild(gameObject, "node/Buttons/Add");
            this.info_node = gameObject.transform.Find("node/Image/info_node").gameObject;
            this.info_node.CustomSetActive(false);
            this.ifnoText      = Utility.GetComponetInChild <Text>(gameObject, "node/Image/info_node/Text");
            this.ifnoText.text = Singleton <CTextManager> .instance.GetText("Friend_NoFriend_Tip");

            string text = Singleton <CTextManager> .instance.GetText("FriendAdd_Tab_QQ");

            if (Singleton <ApolloHelper> .GetInstance().CurPlatform == ApolloPlatform.Wechat)
            {
                text = Singleton <CTextManager> .instance.GetText("FriendAdd_Tab_Weixin");
            }
            this.tablistScript = gameObject.transform.Find("TopCommon/Panel_Menu/List").gameObject.GetComponent <CUIListScript>();
            string[] strArray  = new string[] { text, UT.GetText("Friend_Title_List"), UT.GetText("Friend_Title_Requests") };
            string[] strArray2 = new string[] { UT.GetText("Friend_Title_List"), UT.GetText("Friend_Title_Requests") };
            string[] strArray3 = !CSysDynamicBlock.bSocialBlocked ? strArray : strArray2;
            Tab      tab       = !CSysDynamicBlock.bSocialBlocked ? Tab.Friend_SNS : Tab.Friend;

            this.tablistScript.SetElementAmount(strArray3.Length);
            for (int i = 0; i < this.tablistScript.m_elementAmount; i++)
            {
                this.tablistScript.GetElemenet(i).gameObject.transform.Find("Text").GetComponent <Text>().text = strArray3[i];
            }
            this.btnText        = Utility.GetComponetInChild <Text>(gameObject, "node/Buttons/Invite/Text");
            this.sns_invite_btn = gameObject.transform.Find("node/Buttons/Invite").gameObject;
            string str2 = Singleton <CTextManager> .instance.GetText("FriendAdd_Invite_Btn_QQ");

            if (Singleton <ApolloHelper> .GetInstance().CurPlatform == ApolloPlatform.Wechat)
            {
                str2 = Singleton <CTextManager> .instance.GetText("FriendAdd_Invite_Btn_Weixin");
            }
            this.btnText.text = str2;
            this.sns_invite_btn.CustomSetActive(false);
            this.tablistScript.m_alwaysDispatchSelectedChangeEvent = true;
            this.tablistScript.SelectElement((int)tab, true);
            this.tablistScript.m_alwaysDispatchSelectedChangeEvent = false;
            this._tab = Tab.None;
            this.Refresh_Tab();
            this.CurTab = tab;
            bool bActive = false;
            long curTime = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().getCurrentTimeSinceLogin();

            if (MonoSingleton <BannerImageSys> .GetInstance().QQBOXInfo.isTimeValid(curTime))
            {
                bActive = true;
            }
            GameObject obj4 = Utility.FindChild(gameObject, "node/Buttons/QQBoxBtn");

            if (obj4 != null)
            {
                if ((ApolloConfig.platform == ApolloPlatform.QQ) || (ApolloConfig.platform == ApolloPlatform.WTLogin))
                {
                    obj4.CustomSetActive(bActive);
                }
                else
                {
                    obj4.CustomSetActive(false);
                }
                if (CSysDynamicBlock.bLobbyEntryBlocked && (obj4 != null))
                {
                    obj4.CustomSetActive(false);
                }
            }
        }
Exemplo n.º 18
0
        public static void Send_Room_Chat(string text)
        {
            CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(1300u);

            cSPkg.stPkgData.get_stChatReq().stChatMsg.bType = 3;
            cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.select(3L);
            cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.get_stRoom().szContent = UT.String2Bytes(text);
            Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref cSPkg, false);
        }
Exemplo n.º 19
0
        private void PlayKillNotify(ref KillInfo killInfo)
        {
            string killerImgSrc = killInfo.KillerImgSrc;
            string victimImgSrc = killInfo.VictimImgSrc;

            string[]           assistImgSrc       = killInfo.assistImgSrc;
            KillDetailInfoType killDetailInfoType = killInfo.MsgType;
            bool         bSrcAllies = killInfo.bSrcAllies;
            bool         bPlayerSelf_KillOrKilled = killInfo.bPlayerSelf_KillOrKilled;
            ActorTypeDef actorType = killInfo.actorType;
            string       spt       = bSrcAllies ? KillNotify.blue_assist_frame_icon : KillNotify.red_assist_frame_icon;

            this.Show();
            UT.ResetTimer(this.hideTimer, false);
            string soundEvent = KillNotifyUT.GetSoundEvent(killDetailInfoType, bSrcAllies, bPlayerSelf_KillOrKilled, actorType);

            if (!string.IsNullOrEmpty(soundEvent))
            {
                Singleton <CSoundManager> .GetInstance().PlayBattleSound2D(soundEvent);
            }
            string animation = KillNotifyUT.GetAnimation(killDetailInfoType, bSrcAllies);

            if (!string.IsNullOrEmpty(animation) && this.animatorScript != null)
            {
                this.animatorScript.PlayAnimator(animation);
            }
            KillNotifyUT.SetImageSprite(this.KillerImg, killerImgSrc);
            if (string.IsNullOrEmpty(killerImgSrc) || killInfo.bSuicide)
            {
                this.SetKillerShow(false);
            }
            else
            {
                this.SetKillerShow(true);
            }
            bool flag = killDetailInfoType == KillDetailInfoType.Info_Type_DestroyTower || killDetailInfoType == KillDetailInfoType.Info_Type_DestroyBase || killDetailInfoType == KillDetailInfoType.Info_Type_AllDead || killDetailInfoType == KillDetailInfoType.Info_Type_RunningMan || killDetailInfoType == KillDetailInfoType.Info_Type_Reconnect || killDetailInfoType == KillDetailInfoType.Info_Type_Disconnect || killDetailInfoType == KillDetailInfoType.Info_Type_Kill_3V3_Dragon || killDetailInfoType == KillDetailInfoType.Info_Type_Game_Start_Wel || killDetailInfoType == KillDetailInfoType.Info_Type_Soldier_Activate_Countdown3 || killDetailInfoType == KillDetailInfoType.Info_Type_Soldier_Activate_Countdown5 || killDetailInfoType == KillDetailInfoType.Info_Type_Soldier_Activate || killDetailInfoType == KillDetailInfoType.Info_Type_Kill_5V5_SmallDragon || killDetailInfoType == KillDetailInfoType.Info_Type_Kill_5V5_BigDragon || killDetailInfoType == KillDetailInfoType.Info_Type_5V5SmallDragon_Suicide;

            this.SetVictimShow(!flag);
            KillNotifyUT.SetImageSprite(this.VictimImg, victimImgSrc);
            int num = 0;

            if (assistImgSrc != null && killDetailInfoType != KillDetailInfoType.Info_Type_AllDead)
            {
                for (int i = 0; i < 4; i++)
                {
                    if (!string.IsNullOrEmpty(assistImgSrc[i]))
                    {
                        if (this.assistHeads[i].gameObject != null)
                        {
                            this.assistHeads[i].gameObject.CustomSetActive(true);
                        }
                        KillNotifyUT.SetImageSprite(this.assistHeads[i], assistImgSrc[i]);
                        KillNotifyUT.SetImageSprite(this.assistHeadFrames[i], spt);
                        num++;
                    }
                    else if (this.assistHeads[i].gameObject != null)
                    {
                        this.assistHeads[i].gameObject.CustomSetActive(false);
                    }
                }
            }
            this.assistList.CustomSetActive(num > 0);
            this.IsPlaying = true;
            bool flag2 = false;

            if (Singleton <GamePlayerCenter> .instance.GetHostPlayer() != null && Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain&& Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain.handle.ObjID == killInfo.killerObjID)
            {
                flag2 = true;
            }
            if ((killDetailInfoType == KillDetailInfoType.Info_Type_Odyssey || killDetailInfoType == KillDetailInfoType.Info_Type_QuataryKill || killDetailInfoType == KillDetailInfoType.Info_Type_PentaKill || killDetailInfoType == KillDetailInfoType.Info_Type_TripleKill) && flag2)
            {
                if (killDetailInfoType == KillDetailInfoType.Info_Type_Odyssey)
                {
                    killDetailInfoType = KillDetailInfoType.Info_Type_Legendary;
                }
                MonoSingleton <TGPSDKSys> .GetInstance().SendGameEvent2(killDetailInfoType);
            }
        }
Exemplo n.º 20
0
        public void RefreshAwakeTaskForm()
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(s_heroAwakeTaskFormPath);

            if (form != null)
            {
                Image      component  = form.transform.Find("Panel/PanelLeft/HeroCell/Hero").GetComponent <Image>();
                Text       text       = form.transform.Find("Panel/PanelLeft/lblTitle").GetComponent <Text>();
                Transform  transform  = form.transform.Find("Panel/PanelLeft/lblState");
                Text       text2      = form.transform.Find("Panel/PanelLeft/lblContent").GetComponent <Text>();
                Button     btn        = form.transform.Find("Panel/PanelLeft/btnReciveTask").GetComponent <Button>();
                Transform  transform2 = form.transform.Find("Panel/PanelLeft/panelType1");
                Text       text3      = transform2.Find("lblTaskDesc").GetComponent <Text>();
                Transform  transform3 = transform2.Find("itemInfo/itemCell");
                Text       text4      = transform2.Find("itemInfo/lblName").GetComponent <Text>();
                Text       text5      = transform2.Find("itemInfo/lblProce").GetComponent <Text>();
                Button     button2    = transform2.Find("itemInfo/btnReciveTask").GetComponent <Button>();
                Button     button3    = transform2.Find("getInfo/btnReciveTask").GetComponent <Button>();
                Transform  transform4 = form.transform.Find("Panel/PanelLeft/panelType2");
                Text       text6      = transform4.Find("taskInfo/lblTaskDesc").GetComponent <Text>();
                Text       text7      = transform4.Find("taskInfo/lblProce").GetComponent <Text>();
                GameObject prefab     = CUIUtility.GetSpritePrefeb(CUIUtility.s_Sprite_Dynamic_BustHero_Dir + StringHelper.UTF8BytesToString(ref this.m_heroInfo.cfgInfo.szImagePath), true, true);
                component.SetSprite(prefab);
                ResHeroWakeInfo dataByKey = GameDataMgr.heroAwakDatabin.GetDataByKey(GameDataMgr.GetDoubleKey(this.m_heroInfo.cfgInfo.dwCfgID, this.m_heroInfo.m_awakeStepID));
                if (dataByKey != null)
                {
                    text.text  = StringHelper.UTF8BytesToString(ref dataByKey.szWakeTitle);
                    text2.text = StringHelper.UTF8BytesToString(ref dataByKey.szWakeDesc);
                    CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                    if (masterRoleInfo != null)
                    {
                        if (dataByKey.bOptType == 1)
                        {
                            transform2.gameObject.CustomSetActive(true);
                            transform4.gameObject.CustomSetActive(false);
                            CUseable        itemUseable       = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, (uint)dataByKey.OptParam[1], 0);
                            int             useableStackCount = masterRoleInfo.GetUseableContainer(enCONTAINER_TYPE.ITEM).GetUseableStackCount(itemUseable.m_type, itemUseable.m_baseID);
                            stUIEventParams eventParams       = new stUIEventParams {
                                iconUseable = itemUseable
                            };
                            itemUseable.m_stackCount = dataByKey.OptParam[2];
                            string[] args = new string[] { itemUseable.m_stackCount.ToString(), itemUseable.m_name };
                            text3.text = Singleton <CTextManager> .instance.GetText("HeroAwake_Tips4", args);

                            text4.text = itemUseable.m_name;
                            CUICommonSystem.SetItemCell(form, transform3.gameObject, itemUseable, true, false);
                            if (useableStackCount >= itemUseable.m_stackCount)
                            {
                                button2.gameObject.CustomSetActive(false);
                                transform.gameObject.CustomSetActive(true);
                                CUICommonSystem.SetButtonEnable(btn, true, true, true);
                                text5.text = string.Format("{0}/{1}", useableStackCount, itemUseable.m_stackCount);
                            }
                            else
                            {
                                button2.gameObject.CustomSetActive(true);
                                transform.gameObject.CustomSetActive(false);
                                CUICommonSystem.SetButtonEnable(btn, false, false, true);
                                text5.text = string.Format("<color=red>{0}</color>/{1}", useableStackCount, itemUseable.m_stackCount);
                                CUIEventScript script2 = button2.GetComponent <CUIEventScript>();
                                if (script2 != null)
                                {
                                    script2.SetUIEvent(enUIEventType.Click, enUIEventID.HeroInfo_Material_Direct_Buy, eventParams);
                                }
                            }
                            CUIEventScript script3 = button3.GetComponent <CUIEventScript>();
                            if (script3 != null)
                            {
                                script3.SetUIEvent(enUIEventType.Click, enUIEventID.Tips_ItemSourceInfoOpen, eventParams);
                            }
                        }
                        else
                        {
                            transform2.gameObject.CustomSetActive(false);
                            transform4.gameObject.CustomSetActive(true);
                            int   num2 = dataByKey.OptParam[0];
                            CTask task = Singleton <CTaskSys> .instance.model.GetTask((uint)num2);

                            if (task == null)
                            {
                                task = TaskUT.Create_Task((uint)num2);
                                if (task == null)
                                {
                                    return;
                                }
                                task.SetState(CTask.State.None);
                            }
                            if (task != null)
                            {
                                text6.text = UT.Bytes2String(task.m_resTask.szTaskDesc);
                                string str = "    ";
                                for (int i = 0; i < task.m_prerequisiteInfo.Length; i++)
                                {
                                    if (task.m_prerequisiteInfo[i].m_valueTarget > 0)
                                    {
                                        string str2;
                                        if (!this.m_heroInfo.m_isStepFinish)
                                        {
                                            str2 = str;
                                            object[] objArray1 = new object[] { str2, task.m_prerequisiteInfo[i].m_value, "/", task.m_prerequisiteInfo[i].m_valueTarget, " " };
                                            str = string.Concat(objArray1);
                                        }
                                        else
                                        {
                                            str2 = str;
                                            object[] objArray2 = new object[] { str2, task.m_prerequisiteInfo[i].m_valueTarget, "/", task.m_prerequisiteInfo[i].m_valueTarget, " " };
                                            str = string.Concat(objArray2);
                                        }
                                        break;
                                    }
                                }
                                text7.text = str;
                            }
                            if (this.m_heroInfo.m_isStepFinish || (task.m_taskState == 3))
                            {
                                transform.gameObject.CustomSetActive(true);
                                CUICommonSystem.SetButtonEnable(btn, true, true, true);
                            }
                            else
                            {
                                transform.gameObject.CustomSetActive(false);
                                CUICommonSystem.SetButtonEnable(btn, false, false, true);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 21
0
        public static void Show_Item_Bottom(CUIComponent com, CFR frData)
        {
            IntimacyRelationViewUT.SetButtonParam(com.m_widgets[12], frData);
            IntimacyRelationViewUT.SetButtonParam(com.m_widgets[14], frData);
            IntimacyRelationViewUT.SetButtonParam(com.m_widgets[16], frData);
            IntimacyRelationViewUT.SetButtonParam(com.m_widgets[20], frData);
            IntimacyRelationViewUT.SetButtonParam(com.m_widgets[22], frData);
            int cDDays = frData.CDDays;

            if (cDDays != -1)
            {
                com.m_widgets[11].CustomSetActive(true);
                IntimacyRelationViewUT.Set_2_Button(com, false, false, string.Empty, string.Empty);
                IntimacyRelationViewUT.Set_1_Button(com, false, string.Empty);
                IntimacyRelationViewUT.Set_ReSelect_Button(com, false, string.Empty);
                IntimacyRelationViewUT.Set_DoSelect_Button(com, false, string.Empty);
                IntimacyRelationViewUT.Set_Bottom_Text(com, true, UT.FRData().IntimRela_Tips_RelaHasDel);
                return;
            }
            if (frData.state == 24 && cDDays == -1)
            {
                com.m_widgets[11].CustomSetActive(true);
                string intimRela_Tips_OK     = UT.FRData().IntimRela_Tips_OK;
                string intimRela_Tips_Cancle = UT.FRData().IntimRela_Tips_Cancle;
                IntimacyRelationViewUT.Set_DoSelect_Button(com, frData.choiseRelation != -1, intimRela_Tips_OK);
                IntimacyRelationViewUT.Set_2_Button(com, false, false, intimRela_Tips_Cancle, intimRela_Tips_OK);
                IntimacyRelationViewUT.Set_1_Button(com, false, string.Empty);
                IntimacyRelationViewUT.Set_ReSelect_Button(com, false, string.Empty);
                IntimacyRelationViewUT.Set_Bottom_Text(com, false, string.Empty);
            }
            if (frData.state == 1 || frData.state == 2)
            {
                com.m_widgets[11].CustomSetActive(true);
                IntimacyRelationViewUT.Set_2_Button(com, false, false, string.Empty, string.Empty);
                IntimacyRelationViewUT.Set_1_Button(com, false, string.Empty);
                IntimacyRelationViewUT.Set_ReSelect_Button(com, false, string.Empty);
                IntimacyRelationViewUT.Set_DoSelect_Button(com, false, string.Empty);
                COM_INTIMACY_STATE firstChoiseState = Singleton <CFriendContoller> .get_instance().model.FRData.GetFirstChoiseState();

                if (firstChoiseState == frData.state)
                {
                    IntimacyRelationViewUT.Set_Bottom_Text(com, true, UT.FRData().IntimRela_AleadyFristChoise);
                }
                else
                {
                    IntimacyRelationViewUT.Set_Bottom_Text(com, false, string.Empty);
                    IntimacyRelationViewUT.Set_1_Button(com, true, UT.FRData().IntimRela_DoFristChoise);
                }
            }
            if (frData.state == 20 || frData.state == 22)
            {
                if (frData.bReciveOthersRequest)
                {
                    com.m_widgets[11].CustomSetActive(true);
                    IntimacyRelationViewUT.Set_2_Button(com, true, true, UT.FRData().IntimRela_Tips_Cancle, UT.FRData().IntimRela_Tips_OK);
                    IntimacyRelationViewUT.Set_1_Button(com, false, string.Empty);
                    IntimacyRelationViewUT.Set_Bottom_Text(com, false, string.Empty);
                    IntimacyRelationViewUT.Set_ReSelect_Button(com, false, string.Empty);
                    IntimacyRelationViewUT.Set_DoSelect_Button(com, false, string.Empty);
                }
                else
                {
                    com.m_widgets[11].CustomSetActive(true);
                    IntimacyRelationViewUT.Set_2_Button(com, false, false, string.Empty, string.Empty);
                    IntimacyRelationViewUT.Set_1_Button(com, false, string.Empty);
                    IntimacyRelationViewUT.Set_Bottom_Text(com, false, UT.FRData().IntimRela_Tips_Wait4TargetRspReqRela);
                    IntimacyRelationViewUT.Set_ReSelect_Button(com, true, UT.FRData().IntimRela_ReselectRelation);
                    IntimacyRelationViewUT.Set_DoSelect_Button(com, false, string.Empty);
                }
            }
            if (frData.state == 21 || frData.state == 23)
            {
                if (frData.bReciveOthersRequest)
                {
                    com.m_widgets[11].CustomSetActive(true);
                    IntimacyRelationViewUT.Set_2_Button(com, true, true, UT.FRData().IntimRela_Tips_Cancle, UT.FRData().IntimRela_Tips_OK);
                    IntimacyRelationViewUT.Set_1_Button(com, false, string.Empty);
                    IntimacyRelationViewUT.Set_Bottom_Text(com, false, string.Empty);
                    IntimacyRelationViewUT.Set_ReSelect_Button(com, false, string.Empty);
                    IntimacyRelationViewUT.Set_DoSelect_Button(com, false, string.Empty);
                }
                else
                {
                    com.m_widgets[11].CustomSetActive(true);
                    IntimacyRelationViewUT.Set_2_Button(com, false, false, string.Empty, string.Empty);
                    IntimacyRelationViewUT.Set_1_Button(com, false, string.Empty);
                    IntimacyRelationViewUT.Set_Bottom_Text(com, false, UT.FRData().IntimRela_Tips_Wait4TargetRspDelRela);
                    IntimacyRelationViewUT.Set_ReSelect_Button(com, true, UT.FRData().IntimRela_ReDelRelation);
                    IntimacyRelationViewUT.Set_DoSelect_Button(com, false, string.Empty);
                }
            }
        }
Exemplo n.º 22
0
        public static string ErrorCode_String(uint dwResult)
        {
            switch (dwResult)
            {
            case 171u:
                return(UT.GetText("CS_ERR_FRIEND_IN_BLACK"));

            case 172u:
            case 173u:
            case 176u:
            case 177u:
            case 178u:
            case 179u:
            case 182u:
            case 183u:
            case 184u:
            case 185u:
            case 186u:
IL_76:
                switch (dwResult)
                {
                case 144u:
                    return(UT.GetText("Friend_CS_ERR_FRIEND_RECALL_REPEATED"));

                case 145u:
                    return(UT.GetText("Friend_CS_ERR_FRIEND_EXCEED"));

                case 146u:
                    return(UT.GetText("Friend_CS_ERR_FRIEND_RECALL_TIME_LIMIT"));

                case 147u:
                case 148u:
                case 149u:
                case 150u:
                case 153u:
                case 155u:
                case 156u:
                case 157u:
                case 158u:
                case 159u:
IL_D2:
                    switch (dwResult)
                    {
                    case 101u:
                        return(UT.GetText("Friend_CS_ERR_FRIEND_TCAPLUS_ERR"));

                    case 102u:
                        return(UT.GetText("Friend_CS_ERR_FRIEND_RECORD_NOT_EXSIST"));

                    case 103u:
                        return(UT.GetText("Friend_CS_ERR_FRIEND_NUM_EXCEED"));

                    case 104u:
                        return(UT.GetText("Friend_CS_ERR_PEER_FRIEND_NUM_EXCEED"));

                    case 105u:
                        return(UT.GetText("Friend_CS_ERR_FRIEND_DONATE_AP_EXCEED"));

                    case 106u:
                        return(UT.GetText("Friend_CS_ERR_FRIEND_RECV_AP_EXCEED"));

                    case 107u:
                        return(UT.GetText("Friend_CS_ERR_FRIEND_ADD_FRIEND_DENY"));

                    case 108u:
                        return(UT.GetText("Friend_CS_ERR_FRIEND_ADD_FRIEND_SELF"));

                    case 109u:
                        return(UT.GetText("Friend_CS_ERR_FRIEND_ADD_FRIEND_EXSIST"));

                    case 110u:
                        return(UT.GetText("Friend_CS_ERR_FRIEND_REQ_REPEATED"));

                    case 111u:
                        return(UT.GetText("Friend_CS_ERR_FRIEND_NOT_EXSIST"));

                    case 112u:
                        return(UT.GetText("Friend_CS_ERR_FRIEND_SEND_MAIL"));

                    case 113u:
                        return(UT.GetText("Friend_CS_ERR_FRIEND_DONATE_REPEATED"));

                    case 114u:
                        return(UT.GetText("Friend_CS_ERR_FRIEND_AP_FULL"));

                    case 115u:
IL_11F:
                        switch (dwResult)
                        {
                        case 37u:
                            return(UT.GetText("CS_ERR_RECRUITER_LEVELLIMIT"));

                        case 38u:
                        case 39u:
                        case 40u:
                        case 41u:
IL_15C:
                            switch (dwResult)
                            {
                            case 2u:
                                return(UT.GetText("Friend_CS_ERR_STARTSINGLEGAME_FAIL"));

                            case 4u:
                                return(UT.GetText("Friend_CS_ERR_FINSINGLEGAME_FAIL"));

                            case 5u:
                                return(UT.GetText("Friend_CS_ERR_QUITMULTGAME_FAIL"));

                            case 6u:
                                return(UT.GetText("Friend_CS_ERR_REGISTER_NAME_DUP_FAIL"));

                            case 7u:
                                return(UT.GetText("Friend_CS_ERR_SHOULD_REFRESH_TASK"));

                            case 8u:
                                return(UT.GetText("Friend_CS_ERR_COMMIT_ERR"));
                            }
                            return(string.Format(UT.GetText("Friend_CS_ERR_FRIEND_DEFAULT"), dwResult));

                        case 42u:
                            return(UT.GetText("CS_ERR_RECRUIT_INVITECODE"));

                        case 43u:
                            return(UT.GetText("CS_ERR_RECRUIT_LEVELLIMIT"));

                        case 44u:
                            return(UT.GetText("CS_ERR_RECRUIT_NOTONEPLAT"));

                        case 45u:
                            return(UT.GetText("CS_ERR_PASSIVE_RECRUIT_NUMLIMIT"));

                        case 46u:
                            return(UT.GetText("CS_ERR_ACTIVE_RECRUIT_NUMLIMIT"));

                        case 47u:
                            return(UT.GetText("CS_ERR_RECRUIT_OTHER"));

                        case 48u:
                            return(UT.GetText("CS_ERR_RECRUIT_SELF"));

                        case 49u:
                            return(UT.GetText("CS_ERR_RECRUIT_CLOSING"));
                        }
                        goto IL_15C;

                    case 116u:
                        return(UT.GetText("Friend_CS_ERR_FRIEND_ADD_FRIEND_ZONE"));

                    case 117u:
                        return(UT.GetText("Friend_CS_ERR_FRIEND_OTHER"));
                    }
                    goto IL_11F;

                case 151u:
                    return(UT.GetText("CS_ERR_REFUSE_RECALL_REPEATED"));

                case 152u:
                    return(UT.GetText("CS_ERR_REFUSE_ADDFRIEND"));

                case 154u:
                    return(UT.GetText("CS_ERR_VERIFICATION_ILLEGAL"));

                case 160u:
                    return(UT.GetText("CS_ERR_DEFRIEND_REPEATED"));

                case 161u:
                    return(UT.GetText("CS_ERR_BLACKLIST_NOT_EXSIST"));

                case 162u:
                    return(UT.GetText("CS_ERR_BLACKLIST_EXCEED"));

                case 163u:
                    return(UT.GetText("CS_ERR_FRIEND_INVALID_PLAT"));
                }
                goto IL_D2;

            case 174u:
                return(UT.GetText("CS_ERR_LBS_LIMIT"));

            case 175u:
                return(UT.GetText("CS_ERR_LBSSERECH_TIMELIMIT"));

            case 180u:
                return(UT.GetText("CS_ERR_FRIEND_ADD_LOCK"));

            case 181u:
                return(UT.GetText("CS_ERR_FRIEND_ADD_TOO_OFTEN"));

            case 187u:
                return(UT.GetText("CS_ERR_INTIMACY_REQUEST_SELF"));

            case 188u:
                return(UT.GetText("CS_ERR_INTIMACY_REQUEST_TIME_LIMIT"));

            case 189u:
                return(UT.GetText("CS_ERR_INTIMACY_VALUE_NOTENOUGH"));

            case 190u:
                return(UT.GetText("CS_ERR_INTIMACY_REQUEST_REPEATED"));

            case 191u:
                return(UT.GetText("CS_ERR_INTIMACY_RELATION_NUM_EXCEED"));

            case 192u:
                return(UT.GetText("CS_ERR_PEER_INTIMACY_RELATION_NUM_EXCEED"));

            case 193u:
                return(UT.GetText("CS_ERR_INTIMACY_RELATION_EXSIST"));

            case 194u:
                return(UT.GetText("CS_ERR_INTIMACY_RELATION_NOTEXIST"));

            case 195u:
                return(UT.GetText("CS_ERR_INTIMACY_RELATION_OTHER"));

            case 196u:
                return(UT.GetText("CS_ERR_INTIMACY_RELATION_OFTEN"));
            }
            goto IL_76;
        }
Exemplo n.º 23
0
        private void On_Chat_GetMsg_NTF(CSPkg msg)
        {
            SCPKG_CMD_CHAT_NTF stChatNtf = msg.stPkgData.stChatNtf;

            if (stChatNtf.dwTimeStamp != 0)
            {
                Singleton <CChatController> .GetInstance().model.SetTimeStamp(EChatChannel.Lobby, stChatNtf.dwTimeStamp);
            }
            Singleton <CChatController> .GetInstance().model.SetRestFreeCnt(EChatChannel.Lobby, stChatNtf.dwRestChatFreeCnt);

            int num = Mathf.Min(stChatNtf.astChatMsg.Length, stChatNtf.bMsgCnt);

            if (num == 0)
            {
                this.cur_chatTimer_totalTime += step_time;
                if (this.cur_chatTimer_totalTime >= max_ChatTime)
                {
                    this.cur_chatTimer_totalTime = max_ChatTime;
                }
                Singleton <CTimerManager> .instance.ResetTimerTotalTime(this.chatTimer, this.cur_chatTimer_totalTime * 0x3e8);
            }
            else
            {
                this.cur_chatTimer_totalTime = init_chatTime;
                Singleton <CTimerManager> .instance.ResetTimerTotalTime(this.chatTimer, this.cur_chatTimer_totalTime * 0x3e8);

                bool flag  = false;
                bool flag2 = false;
                bool flag3 = false;
                bool flag4 = false;
                bool flag5 = false;
                for (int i = num - 1; i >= 0; i--)
                {
                    COMDT_CHAT_MSG comdt_chat_msg = stChatNtf.astChatMsg[i];
                    if (CChatUT.Convert_ChatMsgType_Channel(comdt_chat_msg.bType) == EChatChannel.Friend)
                    {
                        COMDT_CHAT_PLAYER_INFO stFrom  = comdt_chat_msg.stContent.stPrivate.stFrom;
                        CChatEntity            chatEnt = null;
                        if (stFrom.ullUid == Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID)
                        {
                            string content = UT.Bytes2String(comdt_chat_msg.stContent.stPrivate.szContent);
                            chatEnt = CChatUT.Build_4_Self(content);
                            this.model.channelMgr.Add_CurChatFriend(chatEnt);
                            string a = string.Format(fmt, Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().Name, content);
                            this.model.sysData.Add_NewContent_Entry(a, EChatChannel.Friend);
                            Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_FriendChatData_Change");

                            Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_ChatEntry_Change");

                            flag = true;
                        }
                        else
                        {
                            string rawText = UT.Bytes2String(comdt_chat_msg.stContent.stPrivate.szContent);
                            chatEnt = CChatUT.Build_4_Friend(comdt_chat_msg.stContent.stPrivate);
                            this.model.channelMgr.Add_ChatEntity(chatEnt, EChatChannel.Friend, stFrom.ullUid, (uint)stFrom.iLogicWorldID);
                            string str4 = CChatUT.Build_4_EntryString(EChatChannel.Friend, stFrom.ullUid, (uint)stFrom.iLogicWorldID, rawText);
                            this.model.sysData.Add_NewContent_Entry(str4, EChatChannel.Friend);
                            this.model.sysData.LastChannel = EChatChannel.Friend;
                            flag = true;
                        }
                    }
                    else if (CChatUT.Convert_ChatMsgType_Channel(comdt_chat_msg.bType) == EChatChannel.Lobby)
                    {
                        if (this.view != null)
                        {
                            this.view.bRefreshNew = !this.view.IsCheckHistory();
                        }
                        COMDT_CHAT_PLAYER_INFO comdt_chat_player_info2 = comdt_chat_msg.stContent.stLogicWord.stFrom;
                        this.model.Add_Palyer_Info(comdt_chat_msg.stContent.stLogicWord.stFrom);
                        CChatEntity entity2 = CChatUT.Build_4_Lobby(comdt_chat_msg.stContent.stLogicWord);
                        if (comdt_chat_player_info2.ullUid == Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID)
                        {
                            entity2.type = EChaterType.Self;
                        }
                        this.model.channelMgr.Add_ChatEntity(entity2, EChatChannel.Lobby, 0L, 0);
                        string str5 = UT.Bytes2String(comdt_chat_msg.stContent.stLogicWord.szContent);
                        string str6 = CChatUT.Build_4_EntryString(EChatChannel.Lobby, comdt_chat_player_info2.ullUid, (uint)comdt_chat_player_info2.iLogicWorldID, str5);
                        this.model.sysData.Add_NewContent_Entry(str6, EChatChannel.Lobby);
                        this.model.sysData.LastChannel = EChatChannel.Lobby;
                        flag2 = true;
                    }
                    else if (CChatUT.Convert_ChatMsgType_Channel(comdt_chat_msg.bType) == EChatChannel.Guild)
                    {
                        COMDT_CHAT_PLAYER_INFO comdt_chat_player_info3 = comdt_chat_msg.stContent.stGuild.stFrom;
                        this.model.Add_Palyer_Info(comdt_chat_msg.stContent.stGuild.stFrom);
                        CChatEntity entity3 = CChatUT.Build_4_Guild(comdt_chat_msg.stContent.stGuild);
                        if (comdt_chat_player_info3.ullUid == Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID)
                        {
                            entity3.type = EChaterType.Self;
                        }
                        this.model.channelMgr.Add_ChatEntity(entity3, EChatChannel.Guild, 0L, 0);
                        string str7 = UT.Bytes2String(comdt_chat_msg.stContent.stGuild.szContent);
                        string str8 = CChatUT.Build_4_EntryString(EChatChannel.Guild, comdt_chat_player_info3.ullUid, (uint)comdt_chat_player_info3.iLogicWorldID, str7);
                        this.model.sysData.Add_NewContent_Entry(str8, EChatChannel.Guild);
                        this.model.sysData.LastChannel = EChatChannel.Guild;
                        flag4 = true;
                    }
                    else if (CChatUT.Convert_ChatMsgType_Channel(comdt_chat_msg.bType) == EChatChannel.Room)
                    {
                        COMDT_CHAT_PLAYER_INFO info = comdt_chat_msg.stContent.stRoom.stFrom;
                        this.model.Add_Palyer_Info(info);
                        CChatEntity entity4 = CChatUT.Build_4_Room(comdt_chat_msg.stContent.stRoom);
                        if (info.ullUid == Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID)
                        {
                            entity4.type = EChaterType.Self;
                        }
                        this.model.channelMgr.Add_ChatEntity(entity4, EChatChannel.Room, 0L, 0);
                        string str9  = UT.Bytes2String(comdt_chat_msg.stContent.stRoom.szContent);
                        string str10 = CChatUT.Build_4_EntryString(EChatChannel.Room, info.ullUid, (uint)info.iLogicWorldID, str9);
                        this.model.sysData.Add_NewContent_Entry(str10, EChatChannel.Room);
                        flag3 = true;
                        Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_RoomChatData_Change");
                    }
                    else if (CChatUT.Convert_ChatMsgType_Channel(comdt_chat_msg.bType) == EChatChannel.Select_Hero)
                    {
                        COMDT_CHAT_PLAYER_INFO comdt_chat_player_info5 = comdt_chat_msg.stContent.stBattle.stFrom;
                        this.model.Add_Palyer_Info(comdt_chat_msg.stContent.stBattle.stFrom);
                        CChatEntity entity5 = CChatUT.Build_4_SelectHero(comdt_chat_msg.stContent.stBattle);
                        this.model.channelMgr.Add_ChatEntity(entity5, EChatChannel.Select_Hero, 0L, 0);
                        Singleton <EventRouter> .instance.BroadCastEvent("Chat_HeorSelectChatData_Change");
                    }
                    else if (CChatUT.Convert_ChatMsgType_Channel(comdt_chat_msg.bType) == EChatChannel.Team)
                    {
                        COMDT_CHAT_PLAYER_INFO comdt_chat_player_info6 = comdt_chat_msg.stContent.stTeam.stFrom;
                        this.model.Add_Palyer_Info(comdt_chat_msg.stContent.stTeam.stFrom);
                        CChatEntity entity6 = CChatUT.Build_4_Team(comdt_chat_msg.stContent.stTeam);
                        if (comdt_chat_player_info6.ullUid == Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID)
                        {
                            entity6.type = EChaterType.Self;
                        }
                        this.model.channelMgr.Add_ChatEntity(entity6, EChatChannel.Team, 0L, 0);
                        string str11 = UT.Bytes2String(comdt_chat_msg.stContent.stTeam.szContent);
                        string str12 = CChatUT.Build_4_EntryString(EChatChannel.Team, comdt_chat_player_info6.ullUid, (uint)comdt_chat_player_info6.iLogicWorldID, str11);
                        this.model.sysData.Add_NewContent_Entry(str12, EChatChannel.Team);
                        this.model.sysData.LastChannel = EChatChannel.Team;
                        flag5 = true;
                        Singleton <EventRouter> .instance.BroadCastEvent("Chat_TeamChat_Change");
                    }
                    else if (comdt_chat_msg.bType == 7)
                    {
                        Singleton <InBattleMsgMgr> .instance.Handle_InBattleMsg_Ntf(comdt_chat_msg.stContent.stInBattle);
                    }
                }
                if (flag2)
                {
                    Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_LobbyChatData_Change");
                }
                if (flag)
                {
                    Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_FriendChatData_Change");
                }
                if (flag4)
                {
                    Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_GuildChatData_Change");
                }
                if (((flag2 || flag) || flag4) && (this.model.channelMgr.ChatTab == CChatChannelMgr.EChatTab.Normal))
                {
                    Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_ChatEntry_Change");
                }
                if (flag3 && (this.model.channelMgr.ChatTab == CChatChannelMgr.EChatTab.Room))
                {
                    Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_ChatEntry_Change");
                }
                if (((flag2 || flag) || flag5) && (this.model.channelMgr.ChatTab == CChatChannelMgr.EChatTab.Team))
                {
                    Singleton <EventRouter> .GetInstance().BroadCastEvent("Chat_ChatEntry_Change");
                }
            }
        }
Exemplo n.º 24
0
        public static void ShowFriendData(COMDT_FRIEND_INFO info, FriendShower com, FriendShower.ItemType type, bool bShowNickName, CFriendModel.FriendType friendType)
        {
            if (info == null)
            {
                return;
            }
            com.ullUid         = info.stUin.ullUid;
            com.dwLogicWorldID = info.stUin.dwLogicWorldId;
            UT.SetHttpImage(com.HttpImage, info.szHeadUrl);
            if (com.nobeIcon)
            {
                MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(com.nobeIcon.GetComponent <Image>(), (int)info.stGameVip.dwCurLevel, false);
            }
            if (com.HeadIconBack)
            {
                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(com.HeadIconBack.GetComponent <Image>(), (int)info.stGameVip.dwHeadIconId);
            }
            if (com.QQVipImage)
            {
                MonoSingleton <NobeSys> .GetInstance().SetOtherQQVipHead(com.QQVipImage.GetComponent <Image>(), (int)info.dwQQVIPMask);
            }
            if ((type == FriendShower.ItemType.Normal && friendType == CFriendModel.FriendType.GameFriend) || type == FriendShower.ItemType.Mentor || type == FriendShower.ItemType.Apprentice)
            {
                CFriendModel model = Singleton <CFriendContoller> .get_instance().model;

                ushort num;
                CFriendModel.EIntimacyType type2;
                bool bFreeze;
                if (model.GetFriendIntimacy(info.stUin.ullUid, info.stUin.dwLogicWorldId, out num, out type2, out bFreeze))
                {
                    if (num == 0)
                    {
                        com.intimacyNode.CustomSetActive(false);
                    }
                    else
                    {
                        com.intimacyNode.CustomSetActive(true);
                        CFR cfr = model.FRData.GetCfr(info.stUin.ullUid, info.stUin.dwLogicWorldId);
                        if (cfr != null)
                        {
                            com.ShowIntimacyNum((int)num, type2, bFreeze, cfr.state);
                        }
                        else
                        {
                            com.ShowIntimacyNum((int)num, type2, bFreeze, 0);
                        }
                    }
                }
                else
                {
                    com.intimacyNode.CustomSetActive(false);
                }
            }
            else
            {
                com.intimacyNode.CustomSetActive(false);
            }
            com.SetFriendItemType(type, !bShowNickName);
            bool flag = type == FriendShower.ItemType.Normal || type == FriendShower.ItemType.Mentor || type == FriendShower.ItemType.Apprentice || type == FriendShower.ItemType.AddMentor || type == FriendShower.ItemType.AddApprentice || type == FriendShower.ItemType.MentorRequest;

            com.SetBGray(flag && info.bIsOnline != 1);
            com.ShowLevel(info.dwPvpLvl);
            com.ShowVipLevel(info.dwVipLvl);
            com.ShowLastTime(info.bIsOnline != 1, UT.GetTimeString(info.dwLastLoginTime));
            switch (type)
            {
            case FriendShower.ItemType.Request:
            {
                string friendVerifyContent = Singleton <CFriendContoller> .get_instance().model.GetFriendVerifyContent(info.stUin.ullUid, info.stUin.dwLogicWorldId, CFriendModel.enVerifyDataSet.Friend);

                com.ShowVerify(friendVerifyContent);
                break;
            }

            case FriendShower.ItemType.MentorRequest:
            {
                string friendVerifyContent2 = Singleton <CFriendContoller> .get_instance().model.GetFriendVerifyContent(info.stUin.ullUid, info.stUin.dwLogicWorldId, CFriendModel.enVerifyDataSet.Mentor);

                com.ShowVerify(friendVerifyContent2);
                break;
            }
            }
            CFriendModel.FriendInGame friendInGaming = Singleton <CFriendContoller> .get_instance().model.GetFriendInGaming(info.stUin.ullUid, info.stUin.dwLogicWorldId);

            string text;

            if (friendInGaming == null)
            {
                text = UT.Bytes2String(info.szUserName);
                com.ShowGameState(0, info.bIsOnline == 1);
            }
            else
            {
                if (!string.IsNullOrEmpty(friendInGaming.NickName) && bShowNickName)
                {
                    text = string.Format("{0}({1})", UT.Bytes2String(info.szUserName), friendInGaming.NickName);
                }
                else
                {
                    text = UT.Bytes2String(info.szUserName);
                }
                com.ShowGameState(friendInGaming.State, info.bIsOnline == 1);
            }
            switch (type)
            {
            case FriendShower.ItemType.Request:
            {
                string friendSourceDesc = UT.GetFriendSourceDesc(info.stUin.ullUid, Singleton <CFriendContoller> .get_instance().model.GetFriendVerifySource(info.stUin.ullUid, info.stUin.dwLogicWorldId, CFriendModel.enVerifyDataSet.Friend));
                if (!string.IsNullOrEmpty(friendSourceDesc))
                {
                    text = text + " " + friendSourceDesc;
                }
                break;
            }

            case FriendShower.ItemType.MentorRequest:
            {
                COMDT_FRIEND_SOURCE friendVerifySource = Singleton <CFriendContoller> .get_instance().model.GetFriendVerifySource(info.stUin.ullUid, info.stUin.dwLogicWorldId, CFriendModel.enVerifyDataSet.Mentor);

                if (friendVerifySource != null)
                {
                    string friendSourceDesc2 = UT.GetFriendSourceDesc(info.stUin.ullUid, friendVerifySource);
                    if (!string.IsNullOrEmpty(friendSourceDesc2))
                    {
                        text = text + " " + friendSourceDesc2;
                    }
                }
                break;
            }
            }
            com.ShowName(text);
            if (Singleton <CGuildSystem> .GetInstance().CanInvite(info))
            {
                if (Singleton <CGuildSystem> .GetInstance().HasInvited(info.stUin.ullUid))
                {
                    com.ShowinviteGuild(true, false);
                }
                else
                {
                    com.ShowinviteGuild(true, true);
                }
            }
            else if (Singleton <CGuildSystem> .GetInstance().CanRecommend(info))
            {
                if (Singleton <CGuildSystem> .GetInstance().HasRecommended(info.stUin.ullUid))
                {
                    com.ShowRecommendGuild(true, false);
                }
                else
                {
                    com.ShowRecommendGuild(true, true);
                }
            }
            else
            {
                com.ShowinviteGuild(false, false);
            }
            bool bEnable = Singleton <CFriendContoller> .get_instance().model.HeartData.BCanSendHeart(info.stUin);

            com.ShowSendButton(bEnable);
            if (CSysDynamicBlock.bSocialBlocked)
            {
                com.HideSendButton();
            }
            if (com.m_mentorTitleObj != null && com.m_mentorTitleObj.transform.parent != null)
            {
                com.m_mentorTitleObj.transform.parent.gameObject.CustomSetActive(false);
            }
            if (UT.NeedShowGenderGradeByMentor(type, friendType))
            {
                com.ShowMentorSearchInfo(info, friendType, type);
                com.HideSendButton();
            }
            else if (friendType == CFriendModel.FriendType.Mentor || friendType == CFriendModel.FriendType.Apprentice)
            {
                com.ShowInviteButton(false, false);
            }
            else if (CSysDynamicBlock.bSocialBlocked)
            {
                com.ShowInviteButton(false, false);
            }
            else if (friendType == CFriendModel.FriendType.GameFriend)
            {
                com.ShowInviteButton(false, false);
            }
            else if (friendType == CFriendModel.FriendType.SNS)
            {
                bool isShow = CFriendReCallData.BLose(info.stUin, 2);
                bool flag2  = Singleton <CFriendContoller> .get_instance().model.SnsReCallData.BInCd(info.stUin, 2);

                bool flag3 = CFriendModel.IsOnSnsSwitch(info.dwRefuseFriendBits, 0);
                com.ShowInviteButton(isShow, !flag2 && !flag3);
            }
            if (Singleton <COBSystem> .get_instance().IsInOBFriendList(info.stUin.ullUid))
            {
                com.ShowOBButton(true);
            }
            else
            {
                com.ShowOBButton(false);
            }
            com.ShowGenderType(info.bGender);
            com.ShowPlatChannelIcon(info);
            com.ShowSendGiftBtn(true);
            if (friendType == CFriendModel.FriendType.Mentor || friendType == CFriendModel.FriendType.Apprentice)
            {
                enMentorRelationType enMentorRelationType = (enMentorRelationType)(info.bStudentType >> 4);
                int num2 = (int)(info.bStudentType & 15);
                switch (enMentorRelationType)
                {
                case enMentorRelationType.mentor:
                    if (com.mentor_relationship != null)
                    {
                        com.mentor_relationship.CustomSetActive(friendType == CFriendModel.FriendType.Mentor);
                        com.mentor_relationship.transform.Find("MentorRelationText").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mentor_mentor");
                    }
                    break;

                case enMentorRelationType.schoolmate:
                    if (com.mentor_relationship != null)
                    {
                        com.mentor_relationship.CustomSetActive(friendType == CFriendModel.FriendType.Mentor);
                        com.mentor_relationship.transform.Find("MentorRelationText").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mentor_schoolmate");
                    }
                    if (com.normal_node != null)
                    {
                        com.normal_node.CustomSetActive(true);
                    }
                    for (int i = 0; i < com.normal_node.transform.childCount; i++)
                    {
                        Transform child = com.normal_node.transform.GetChild(i);
                        if (child != null)
                        {
                            child.gameObject.CustomSetActive(false);
                        }
                    }
                    break;
                }
                int num3 = num2;
                if (num3 != 1)
                {
                    if (num3 == 2)
                    {
                        if (com.mentor_graduation != null)
                        {
                            com.mentor_graduation.CustomSetActive(friendType == CFriendModel.FriendType.Apprentice || enMentorRelationType == enMentorRelationType.schoolmate);
                            com.mentor_graduation.transform.Find("MentorStatusText").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mentor_Graduated");

                            if (com.normal_node != null)
                            {
                                com.normal_node.CustomSetActive(true);
                            }
                            for (int j = 0; j < com.normal_node.transform.childCount; j++)
                            {
                                Transform child2 = com.normal_node.transform.GetChild(j);
                                if (child2 != null)
                                {
                                    child2.gameObject.CustomSetActive(false);
                                }
                            }
                            if (com.del_node != null)
                            {
                                com.del_node.CustomSetActive(enMentorRelationType == enMentorRelationType.apprentice);
                            }
                        }
                    }
                }
                else if (com.mentor_graduation != null)
                {
                    com.mentor_graduation.CustomSetActive(friendType == CFriendModel.FriendType.Apprentice || enMentorRelationType == enMentorRelationType.schoolmate);
                    com.mentor_graduation.transform.Find("MentorStatusText").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mentor_InStudy");
                }
                CFriendModel model2 = Singleton <CFriendContoller> .get_instance().model;

                UT.SetAddNodeActive(com.add_node, friendType, model2.IsSnsFriend(com.ullUid, com.dwLogicWorldID) || model2.IsGameFriend(com.ullUid, com.dwLogicWorldID));
            }
        }
Exemplo n.º 25
0
        public void ShowNormal(SCPKG_INVITE_JOIN_GAME_REQ info)
        {
            string          text            = CUIUtility.RemoveEmoji(StringHelper.UTF8BytesToString(ref info.stInviterInfo.szName));
            stUIEventParams stUIEventParams = default(stUIEventParams);

            stUIEventParams.tag = (int)info.bIndex;
            int num = 15;

            int.TryParse(Singleton <CTextManager> .instance.GetText("MessageBox_Close_Time"), ref num);
            this.form = Singleton <CUIManager> .GetInstance().OpenForm(string.Format("{0}{1}", "UGUI/Form/Common/", "Form_BeInvited.prefab"), false, true);

            GameObject gameObject = this.form.transform.Find("Panel/Panel/normal").gameObject;

            if (gameObject != null)
            {
                gameObject.CustomSetActive(true);
            }
            GameObject gameObject2 = this.form.transform.Find("Panel/Panel/refuse").gameObject;

            if (gameObject2 != null)
            {
                gameObject2.CustomSetActive(false);
            }
            this.listNode     = this.form.transform.Find("Panel/Panel/refuse/reasonPanel/DropList").gameObject;
            this.listScript   = this.listNode.transform.Find("List").GetComponent <CUIListScript>();
            this.m_inputFiled = this.form.transform.Find("Panel/Panel/refuse/reasonPanel/InputField").GetComponent <InputField>();
            this.m_sendBtn    = this.form.transform.Find("Panel/Panel/refuse/btnGroup/Button_Send").gameObject;
            this.form.transform.Find("Panel/Panel/refuse/MatchInfo").GetComponent <Text>().set_text(Singleton <CTextManager> .instance.GetText("Invite_Refuse_Title"));
            if (this.form != null)
            {
                string text2 = null;
                string text3 = null;
                if (info.bInviteType == 1)
                {
                    ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(info.stInviteDetail.stRoomDetail.bMapType, info.stInviteDetail.stRoomDetail.dwMapId);
                    stUIEventParams.heroId      = (uint)info.stInviteDetail.stRoomDetail.bMapType;
                    stUIEventParams.weakGuideId = info.stInviteDetail.stRoomDetail.dwMapId;
                    if (pvpMapCommonInfo != null)
                    {
                        text2 = Singleton <CTextManager> .instance.GetText("Invite_Map_Desc", new string[]
                        {
                            ((int)(pvpMapCommonInfo.bMaxAcntNum / 2)).ToString(),
                            ((int)(pvpMapCommonInfo.bMaxAcntNum / 2)).ToString(),
                            Utility.UTF8Convert(pvpMapCommonInfo.szName)
                        });
                    }
                    text3 = Singleton <CTextManager> .GetInstance().GetText("Invite_Match_Type_4");
                }
                else if (info.bInviteType == 2)
                {
                    ResDT_LevelCommonInfo pvpMapCommonInfo2 = CLevelCfgLogicManager.GetPvpMapCommonInfo(info.stInviteDetail.stTeamDetail.bMapType, info.stInviteDetail.stTeamDetail.dwMapId);
                    stUIEventParams.heroId      = (uint)info.stInviteDetail.stTeamDetail.bMapType;
                    stUIEventParams.weakGuideId = info.stInviteDetail.stTeamDetail.dwMapId;
                    if (pvpMapCommonInfo2 != null)
                    {
                        text2 = Singleton <CTextManager> .instance.GetText("Invite_Map_Desc", new string[]
                        {
                            ((int)(pvpMapCommonInfo2.bMaxAcntNum / 2)).ToString(),
                            ((int)(pvpMapCommonInfo2.bMaxAcntNum / 2)).ToString(),
                            Utility.UTF8Convert(pvpMapCommonInfo2.szName)
                        });
                    }
                    if (info.stInviteDetail.stTeamDetail.bMapType == 3)
                    {
                        text3 = Singleton <CTextManager> .GetInstance().GetText("Invite_Match_Type_1");
                    }
                    else
                    {
                        text3 = Singleton <CTextManager> .GetInstance().GetText((info.stInviteDetail.stTeamDetail.bPkAI == 1) ? "Invite_Match_Type_2" : "Invite_Match_Type_3");
                    }
                }
                string text4 = Singleton <CTextManager> .instance.GetText("Be_Invited_Tips", new string[]
                {
                    text3,
                    text2
                });

                this.form.m_formWidgets[8].GetComponent <Text>().set_text(text4);
                uint   dwRelationMask = info.stInviterInfo.dwRelationMask;
                string text5;
                if ((dwRelationMask & 1u) > 0u)
                {
                    text5 = Singleton <CTextManager> .instance.GetText("Invite_Src_Type_1");

                    stUIEventParams.tag2 = 0;
                }
                else if ((dwRelationMask & 2u) > 0u)
                {
                    text5 = Singleton <CTextManager> .instance.GetText("Invite_Src_Type_4");

                    stUIEventParams.tag2 = 1;
                }
                else if ((dwRelationMask & 4u) > 0u)
                {
                    text5 = Singleton <CTextManager> .instance.GetText("Invite_Src_Type_5");

                    stUIEventParams.tag2 = 2;
                    CSDT_LBS_USER_INFO lBSUserInfo = Singleton <CFriendContoller> .instance.model.GetLBSUserInfo(info.stInviterInfo.ullUid, info.stInviterInfo.dwLogicWorldID, CFriendModel.LBSGenderType.Both);

                    if (lBSUserInfo != null)
                    {
                        stUIEventParams.tagUInt = lBSUserInfo.dwGameSvrEntity;
                    }
                }
                else
                {
                    text5 = Singleton <CTextManager> .instance.GetText("Invite_Src_Type_1");

                    stUIEventParams.tag2 = 3;
                }
                string text6 = string.Format(Singleton <CTextManager> .instance.GetText("Be_Invited_FromType"), text5);
                this.form.m_formWidgets[6].GetComponent <Text>().set_text(text6);
                stUIEventParams.tagStr             = string.Format("<color=#FFFFFF>{0}</color> {1} {2}", text, text4, text6);
                stUIEventParams.commonUInt64Param1 = info.stInviterInfo.ullUid;
                stUIEventParams.taskId             = info.stInviterInfo.dwLogicWorldID;
                stUIEventParams.tag3 = (int)info.bInviteType;
                if (num != 0)
                {
                    Transform transform = this.form.transform.Find("closeTimer");
                    if (transform != null)
                    {
                        this.timerScript = transform.GetComponent <CUITimerScript>();
                        if (this.timerScript != null)
                        {
                            this.timerScript.enabled = true;
                            this.timerScript.SetTotalTime((float)num);
                            this.timerScript.StartTimer();
                            this.timerScript.m_eventIDs[1]    = enUIEventID.Invite_TimeOut;
                            this.timerScript.m_eventParams[1] = stUIEventParams;
                        }
                    }
                }
                this.form.m_formWidgets[0].GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Invite_RefuseReason_Send, stUIEventParams);
                this.form.m_formWidgets[1].GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Invite_AcceptInvite, stUIEventParams);
                this.form.m_formWidgets[5].GetComponent <Text>().set_text(text);
                COM_SNSGENDER bGender   = (COM_SNSGENDER)info.stInviterInfo.bGender;
                Image         component = this.form.m_formWidgets[4].GetComponent <Image>();
                component.gameObject.CustomSetActive(bGender != COM_SNSGENDER.COM_SNSGENDER_NONE);
                if (bGender == COM_SNSGENDER.COM_SNSGENDER_MALE)
                {
                    CUIUtility.SetImageSprite(component, string.Format("{0}icon/Ico_boy.prefab", "UGUI/Sprite/Dynamic/"), null, true, false, false, false);
                }
                else if (bGender == COM_SNSGENDER.COM_SNSGENDER_FEMALE)
                {
                    CUIUtility.SetImageSprite(component, string.Format("{0}icon/Ico_girl.prefab", "UGUI/Sprite/Dynamic/"), null, true, false, false, false);
                }
                GameObject widget = this.form.GetWidget(9);
                UT.SetMentorLv(widget, (int)info.stInviterInfo.dwMasterLevel);
                CUIHttpImageScript component2 = this.form.m_formWidgets[3].GetComponent <CUIHttpImageScript>();
                component2.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(StringHelper.UTF8BytesToString(ref info.stInviterInfo.szHeadUrl)));
                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(this.form.m_formWidgets[2].GetComponent <Image>(), (int)info.stInviterInfo.dwHeadImgId);

                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBkEffect(this.form.m_formWidgets[2].GetComponent <Image>(), (int)info.stInviterInfo.dwHeadImgId, this.form, 1f, false);

                this.form.m_formWidgets[7].CustomSetActive(info.stInviterInfo.bGradeOfRank > 0);
                if (info.stInviterInfo.bGradeOfRank > 0)
                {
                    CLadderView.ShowRankDetail(this.form.m_formWidgets[7], info.stInviterInfo.bShowGradeOfRank, 0u, 1u, false, true, false, true, true);
                }
            }
        }
Exemplo n.º 26
0
        public void SetFriendItemType(FriendShower.ItemType type, bool bShowDelete = true)
        {
            this.Showuid(this.ullUid, this.dwLogicWorldID);
            if (this.inviteGuildButton != null)
            {
                this.inviteGuildButton.gameObject.CustomSetActive(false);
            }
            this.add_node.CustomSetActive(false);
            this.normal_node.CustomSetActive(false);
            this.request_node.CustomSetActive(false);
            this.black_node.CustomSetActive(false);
            this.addApprentice_node.CustomSetActive(false);
            this.addMentor_node.CustomSetActive(false);
            this.lbs_node.CustomSetActive(false);
            this.mentorInfo_node.CustomSetActive(false);
            switch (type)
            {
            case FriendShower.ItemType.Add:
                UT.SetAddNodeActive(this.add_node, CFriendModel.FriendType.Recommend, false);
                break;

            case FriendShower.ItemType.Normal:
            case FriendShower.ItemType.Mentor:
            case FriendShower.ItemType.Apprentice:
                this.normal_node.CustomSetActive(true);
                if (this.del_node != null)
                {
                    this.del_node.CustomSetActive(bShowDelete || type != FriendShower.ItemType.Normal);
                }
                break;

            case FriendShower.ItemType.Request:
            case FriendShower.ItemType.MentorRequest:
                this.request_node.CustomSetActive(true);
                break;

            case FriendShower.ItemType.BlackList:
                this.black_node.CustomSetActive(true);
                break;

            case FriendShower.ItemType.LBS:
                if (this.lbs_node != null)
                {
                    this.lbs_node.CustomSetActive(true);
                }
                break;

            case FriendShower.ItemType.AddMentor:
                this.mentorInfo_node.CustomSetActive(true);
                this.addMentor_node.CustomSetActive(true);
                break;

            case FriendShower.ItemType.AddApprentice:
                this.addApprentice_node.CustomSetActive(true);
                break;
            }
            if (this.del_node != null)
            {
                CUIEventScript component = this.del_node.GetComponent <CUIEventScript>();
                CUIEvent       uIEvent   = Singleton <CUIEventManager> .GetInstance().GetUIEvent();

                uIEvent.m_eventID         = enUIEventID.Friend_DelFriend;
                uIEvent.m_eventParams.tag = (int)type;
                component.SetUIEvent(enUIEventType.Click, uIEvent.m_eventID, uIEvent.m_eventParams);
            }
            if (this.Giftutton != null)
            {
                CUIEventScript component2 = this.Giftutton.GetComponent <CUIEventScript>();
                CUIEvent       uIEvent2   = Singleton <CUIEventManager> .GetInstance().GetUIEvent();

                uIEvent2.m_eventID         = enUIEventID.Friend_Gift;
                uIEvent2.m_eventParams.tag = (int)type;
                component2.SetUIEvent(enUIEventType.Click, uIEvent2.m_eventID, uIEvent2.m_eventParams);
            }
            if (this.ChatButton != null)
            {
                CUIEventScript component3 = this.ChatButton.GetComponent <CUIEventScript>();
                CUIEvent       uIEvent3   = Singleton <CUIEventManager> .GetInstance().GetUIEvent();

                uIEvent3.m_eventID         = enUIEventID.Friend_Chat_Button;
                uIEvent3.m_eventParams.tag = (int)type;
                component3.SetUIEvent(enUIEventType.Click, uIEvent3.m_eventID, uIEvent3.m_eventParams);
            }
            if (this.VerifyText != null)
            {
                this.VerifyText.transform.parent.gameObject.CustomSetActive(type == FriendShower.ItemType.Request || type == FriendShower.ItemType.MentorRequest);
            }
            if (this.lbsBodyNode != null)
            {
                this.lbsBodyNode.gameObject.CustomSetActive(type == FriendShower.ItemType.LBS);
            }
        }
Exemplo n.º 27
0
 public void SetBGray(bool bGray)
 {
     UT.SetImage(this.headIcon, bGray);
 }
Exemplo n.º 28
0
        public void ShowIntimacyNum(int value, CFriendModel.EIntimacyType type, bool bFreeze, COM_INTIMACY_STATE state)
        {
            GameObject gameObject = this.full.transform.parent.FindChild("rela").gameObject;

            if (state == 1 || state == 2 || state == 21 || state == 23)
            {
                this.intimacyNum.gameObject.CustomSetActive(false);
                this.freeze.CustomSetActive(false);
                this.full.CustomSetActive(false);
                this.high.CustomSetActive(false);
                this.mid.CustomSetActive(false);
                this.low.CustomSetActive(false);
                gameObject.CustomSetActive(true);
                if (state == 1 || state == 21)
                {
                    Utility.FindChild(gameObject, "jiyou").gameObject.CustomSetActive(true);
                    Utility.FindChild(gameObject, "lianren").gameObject.CustomSetActive(false);
                    Text componetInChild = Utility.GetComponetInChild <Text>(gameObject, "txt");
                    if (componetInChild != null)
                    {
                        componetInChild.gameObject.CustomSetActive(true);
                        componetInChild.text = UT.FRData().IntimRela_TypeColor_Gay;
                    }
                }
                else if (state == 2 || state == 23)
                {
                    Utility.FindChild(gameObject, "jiyou").gameObject.CustomSetActive(false);
                    Utility.FindChild(gameObject, "lianren").gameObject.CustomSetActive(true);
                    Text componetInChild2 = Utility.GetComponetInChild <Text>(gameObject, "txt");
                    if (componetInChild2 != null)
                    {
                        componetInChild2.gameObject.CustomSetActive(true);
                        componetInChild2.text = UT.FRData().IntimRela_TypeColor_Lover;
                    }
                }
                return;
            }
            gameObject.CustomSetActive(false);
            if (this.intimacyNum != null)
            {
                this.intimacyNum.gameObject.CustomSetActive(true);
                if ((long)value >= (long)((ulong)Singleton <CFriendContoller> .get_instance().model.GetMaxIntimacyNum()))
                {
                    this.intimacyNum.text = "Max";
                }
                else
                {
                    this.intimacyNum.text = value.ToString();
                }
            }
            if (bFreeze)
            {
                this.freeze.CustomSetActive(true);
                this.intimacyNum.color = CUIUtility.Intimacy_Freeze;
            }
            else
            {
                if (this.freeze != null)
                {
                    this.freeze.CustomSetActive(false);
                }
                if (type == CFriendModel.EIntimacyType.Low)
                {
                    if (this.full != null)
                    {
                        this.full.CustomSetActive(false);
                    }
                    if (this.high != null)
                    {
                        this.high.CustomSetActive(false);
                    }
                    if (this.mid != null)
                    {
                        this.mid.CustomSetActive(false);
                    }
                    if (this.low != null)
                    {
                        this.low.CustomSetActive(true);
                    }
                    this.intimacyNum.color = CUIUtility.Intimacy_Low;
                }
                else if (type == CFriendModel.EIntimacyType.Middle)
                {
                    if (this.full != null)
                    {
                        this.full.CustomSetActive(false);
                    }
                    if (this.high != null)
                    {
                        this.high.CustomSetActive(false);
                    }
                    if (this.mid != null)
                    {
                        this.mid.CustomSetActive(true);
                    }
                    if (this.low != null)
                    {
                        this.low.CustomSetActive(false);
                    }
                    this.intimacyNum.color = CUIUtility.Intimacy_Mid;
                }
                else if (type == CFriendModel.EIntimacyType.High)
                {
                    if (this.full != null)
                    {
                        this.full.CustomSetActive(false);
                    }
                    if (this.high != null)
                    {
                        this.high.CustomSetActive(true);
                    }
                    if (this.mid != null)
                    {
                        this.mid.CustomSetActive(false);
                    }
                    if (this.low != null)
                    {
                        this.low.CustomSetActive(false);
                    }
                    this.intimacyNum.color = CUIUtility.Intimacy_High;
                }
                else if (type == CFriendModel.EIntimacyType.full)
                {
                    if (this.full != null)
                    {
                        this.full.CustomSetActive(true);
                    }
                    if (this.high != null)
                    {
                        this.high.CustomSetActive(false);
                    }
                    if (this.mid != null)
                    {
                        this.mid.CustomSetActive(false);
                    }
                    if (this.low != null)
                    {
                        this.low.CustomSetActive(false);
                    }
                    this.intimacyNum.color = CUIUtility.Intimacy_Full;
                }
            }
        }
Exemplo n.º 29
0
        public static void Send_SelectHero_Chat(string text)
        {
            CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(1300u);

            cSPkg.stPkgData.stChatReq.stChatMsg.bType = 5;
            cSPkg.stPkgData.stChatReq.stChatMsg.stContent.select(5L);
            cSPkg.stPkgData.stChatReq.stChatMsg.stContent.stBattle.bChatType = 2;
            cSPkg.stPkgData.stChatReq.stChatMsg.stContent.stBattle.stChatInfo.select(2L);
            cSPkg.stPkgData.stChatReq.stChatMsg.stContent.stBattle.stChatInfo.stContentStr.szContent = UT.String2Bytes(text);
            Singleton <NetworkModule> .GetInstance().SendGameMsg(ref cSPkg, 0u);
        }
        private void Show_BeiZhouMoZhe_Reward()
        {
            if (this.zhaomu_content == null || this.beizhaomu_content == null)
            {
                return;
            }
            this.zhaomu_content.CustomSetActive(false);
            this.beizhaomu_content.CustomSetActive(true);
            CFriendRecruit friendRecruit = Singleton <CFriendContoller> .instance.model.friendRecruit;
            Text           component     = this.beizhaomu_content.transform.FindChild("info/text").GetComponent <Text>();
            Text           component2    = this.beizhaomu_content.transform.FindChild("info/benift/exp/icon/txt").GetComponent <Text>();
            Text           component3    = this.beizhaomu_content.transform.FindChild("info/benift/gold/icon/txt").GetComponent <Text>();

            if (component2 != null)
            {
                component2.set_text(string.Format("+{0}%", friendRecruit.GetBeiZhaoMuZhe_RewardExp()));
            }
            if (component3 != null)
            {
                component3.set_text(string.Format("+{0}%", friendRecruit.GetBeiZhaoMuZhe_RewardGold()));
            }
            GameObject gameObject = this.beizhaomu_content.transform.FindChild("info/user").gameObject;

            gameObject.CustomSetActive(true);
            GameObject gameObject2 = gameObject.transform.FindChild("default").gameObject;

            gameObject2.GetComponent <Text>().set_text(Singleton <CTextManager> .instance.GetText("Friend_Rec_Bei_User_DefalutTxt"));
            this.beizhaomu_content.transform.FindChild("info/reward/title/Text").GetComponent <Text>().set_text(Singleton <CTextManager> .instance.GetText("Friend_Rec_Bei_RewardTip"));
            GameObject gameObject3 = gameObject.transform.FindChild("NameGroup").gameObject;

            CFriendRecruit.RecruitData beiZhaoMuZhe = friendRecruit.GetBeiZhaoMuZhe();
            Text component4 = gameObject.transform.FindChild("Level").GetComponent <Text>();

            if (beiZhaoMuZhe.userInfo == null)
            {
                component.set_text(Singleton <CTextManager> .instance.GetText("Friend_Rec_Bei_Role_NoData"));
                gameObject2.CustomSetActive(true);
                gameObject3.CustomSetActive(false);
                component4.gameObject.CustomSetActive(false);
            }
            else
            {
                component.set_text(Singleton <CTextManager> .instance.GetText("Friend_Rec_Bei_Role_HasData"));
                gameObject2.CustomSetActive(false);
                gameObject3.CustomSetActive(true);
                component4.gameObject.CustomSetActive(true);
                CUIHttpImageScript component5 = gameObject.transform.FindChild("pnlSnsHead/HttpImage").GetComponent <CUIHttpImageScript>();
                UT.SetHttpImage(component5, beiZhaoMuZhe.userInfo.szHeadUrl);
                component4.set_text(string.Format("Lv.{0}", beiZhaoMuZhe.userInfo.dwPvpLvl));
                GameObject gameObject4 = gameObject.transform.FindChild("pnlSnsHead/HttpImage/NobeIcon").gameObject;
                if (gameObject4)
                {
                    MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(gameObject4.GetComponent <Image>(), (int)beiZhaoMuZhe.userInfo.stGameVip.dwCurLevel, false, true, 0uL);
                }
                Text   component6 = gameObject.transform.FindChild("NameGroup/Name").GetComponent <Text>();
                string text       = UT.Bytes2String(beiZhaoMuZhe.userInfo.szUserName);
                if (component6 != null)
                {
                    component6.set_text(text);
                }
                GameObject gameObject5 = gameObject.transform.FindChild("NameGroup/Gender").gameObject;
                FriendShower.ShowGender(gameObject5, (COM_SNSGENDER)beiZhaoMuZhe.userInfo.bGender);
            }
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CFriendContoller.FriendFormPath);

            GameObject gameObject6 = this.beizhaomu_content.transform.FindChild("info/reward").gameObject;

            CFriendRecruit.RecruitData beiZhaoMuZhe2 = friendRecruit.GetBeiZhaoMuZhe();
            ulong ullUid         = beiZhaoMuZhe2.ullUid;
            uint  dwLogicWorldId = beiZhaoMuZhe2.dwLogicWorldId;
            int   num            = Math.Min(4, beiZhaoMuZhe2.RewardList.Count);
            float num2           = 1000f;
            float num3           = -1f;

            for (int i = 0; i < num; i++)
            {
                CFriendRecruit.RecruitReward recruitReward = beiZhaoMuZhe2.RewardList[i];
                GameObject           gameObject7           = gameObject6.transform.FindChild(string.Format("reward_{0}", i)).gameObject;
                ResRecruitmentReward cfgReward             = Singleton <CFriendContoller> .instance.model.friendRecruit.GetCfgReward(recruitReward.rewardID);

                if (cfgReward.dwLevel < num2 && cfgReward.dwLevel != 1u)
                {
                    num2 = cfgReward.dwLevel;
                }
                if (cfgReward.dwLevel > num3)
                {
                    num3 = cfgReward.dwLevel;
                }
                this.Show_Award(gameObject7, ullUid, dwLogicWorldId, COM_RECRUITMENT_TYPE.COM_RECRUITMENT_PASSIVE, recruitReward.rewardID, cfgReward, recruitReward.state, form, true);
            }
            GameObject gameObject8      = Utility.FindChild(this.beizhaomu_content, "info/reward/BarBg");
            GameObject gameObject9      = Utility.FindChild(this.beizhaomu_content, "info/reward/BarBg2");
            Image      componetInChild  = Utility.GetComponetInChild <Image>(gameObject8, "Fore");
            Image      componetInChild2 = Utility.GetComponetInChild <Image>(gameObject9, "Fore");

            if (this.beiZhaoMuZheBarWidth1 == 0f && componetInChild != null)
            {
                this.beiZhaoMuZheBarWidth1 = componetInChild.get_rectTransform().sizeDelta.x;
            }
            if (this.beiZhaoMuZheBarWidth2 == 0f && componetInChild2 != null)
            {
                this.beiZhaoMuZheBarWidth2 = componetInChild2.get_rectTransform().sizeDelta.x;
            }
            if (beiZhaoMuZhe.userInfo != null)
            {
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

                this.SetCombineBar(gameObject8, gameObject9, this.beiZhaoMuZheBarWidth1, this.beiZhaoMuZheBarWidth2, masterRoleInfo.PvpLevel, num2, num3);
            }
            else
            {
                this.SetBarSize(componetInChild, 0f, 0f);
                this.SetBarSize(componetInChild2, 0f, 0f);
            }
        }