public static string GetRelationText(COM_INTIMACY_STATE state)
		{
			if (IntimacyRelationViewUT.IsRelaState(state))
			{
				RelationConfig relaTextCfg = Singleton<CFriendContoller>.instance.model.FRData.GetRelaTextCfg(state);
				if (relaTextCfg != null)
				{
					return relaTextCfg.IntimRela_Type;
				}
			}
			return string.Empty;
		}
 public RelationConfig GetRelaTextCfg(COM_INTIMACY_STATE state)
 {
     if (IntimacyRelationViewUT.IsRelaState(state))
     {
         for (int i = 0; i < this.m_RelationConfig.Count; i++)
         {
             RelationConfig relationConfig = this.m_RelationConfig[i];
             if (relationConfig.state == state)
             {
                 return(relationConfig);
             }
         }
     }
     return(null);
 }
		public static string GetRelationInLoadingMenu(byte state, string name)
		{
			if (IntimacyRelationViewUT.IsRelaState(state))
			{
				RelationConfig relaTextCfg = Singleton<CFriendContoller>.instance.model.FRData.GetRelaTextCfg(state);
				if (relaTextCfg != null)
				{
					return Singleton<CTextManager>.instance.GetText(relaTextCfg.IntimacyShowLoad, new string[]
					{
						name
					});
				}
			}
			return string.Empty;
		}
示例#4
0
        public static void On_NTF_CHG_INTIMACY_DENY(CSPkg msg)
        {
            SCPKG_CMD_NTF_CHG_INTIMACY_DENY stNtfChgIntimacyDeny = msg.stPkgData.stNtfChgIntimacyDeny;

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

            string text = string.Empty;

            if (stNtfChgIntimacyDeny.bRelationChgType == 1)
            {
                string         text2       = string.Empty;
                RelationConfig relaTextCfg = CFriendRelationship.FRData.GetRelaTextCfg(stNtfChgIntimacyDeny.bIntimacyState);
                if (relaTextCfg != null)
                {
                    text2 = relaTextCfg.IntimRela_Tips_DenyYourRequest;
                }
                if (!string.IsNullOrEmpty(text2) && gameOrSnsFriend != null)
                {
                    text = string.Format(text2, UT.Bytes2String(gameOrSnsFriend.szUserName));
                    CFriendRelationship.FRData.Add(stNtfChgIntimacyDeny.stUin.ullUid, stNtfChgIntimacyDeny.stUin.dwLogicWorldId, COM_INTIMACY_STATE.COM_INTIMACY_STATE_VALUE_FULL, COM_INTIMACY_RELATION_CHG_TYPE.COM_INTIMACY_RELATION_NULL, 0u, false);
                }
            }
            if (stNtfChgIntimacyDeny.bRelationChgType == 2)
            {
                if (!IntimacyRelationViewUT.IsRelaState(stNtfChgIntimacyDeny.bIntimacyState))
                {
                    return;
                }
                RelationConfig relaTextCfg2 = CFriendRelationship.FRData.GetRelaTextCfg(stNtfChgIntimacyDeny.bIntimacyState);
                if (relaTextCfg2 == null)
                {
                    return;
                }
                if (gameOrSnsFriend != null)
                {
                    text = string.Format(relaTextCfg2.IntimRela_Tips_DenyYourDel, UT.Bytes2String(gameOrSnsFriend.szUserName));
                }
                CFriendRelationship.FRData.Add(stNtfChgIntimacyDeny.stUin.ullUid, stNtfChgIntimacyDeny.stUin.dwLogicWorldId, (COM_INTIMACY_STATE)stNtfChgIntimacyDeny.bIntimacyState, COM_INTIMACY_RELATION_CHG_TYPE.COM_INTIMACY_RELATION_NULL, 0u, false);
            }
            if (string.IsNullOrEmpty(text))
            {
                Singleton <CUIManager> .GetInstance().OpenTips(text, false, 1.5f, null, new object[0]);
            }
        }
        private void On_IntimacyRela_OK(CUIEvent uievent)
        {
            ulong commonUInt64Param = uievent.m_eventParams.commonUInt64Param1;
            uint  tagUInt           = uievent.m_eventParams.tagUInt;
            COM_INTIMACY_STATE tag  = (COM_INTIMACY_STATE)uievent.m_eventParams.tag;
            int tag2 = uievent.m_eventParams.tag2;

            if (tag == COM_INTIMACY_STATE.COM_INTIMACY_STATE_VALUE_FULL && tag2 != -1)
            {
                CFriendRelationship          fRData     = Singleton <CFriendContoller> .instance.model.FRData;
                CFriendRelationship.FRConfig cFGByIndex = fRData.GetCFGByIndex(tag2);
                if (cFGByIndex == null)
                {
                    return;
                }
                if (IntimacyRelationViewUT.IsRelaState(cFGByIndex.state))
                {
                    if (fRData.FindFrist(cFGByIndex.state) == null)
                    {
                        FriendRelationNetCore.Send_INTIMACY_RELATION_REQUEST(commonUInt64Param, tagUInt, cFGByIndex.state, COM_INTIMACY_RELATION_CHG_TYPE.COM_INTIMACY_RELATION_ADD);
                        Singleton <CFriendContoller> .instance.model.FRData.ResetChoiseRelaState(commonUInt64Param, tagUInt);
                    }
                    else
                    {
                        RelationConfig relaTextCfg = Singleton <CFriendContoller> .instance.model.FRData.GetRelaTextCfg(cFGByIndex.state);

                        if (relaTextCfg != null)
                        {
                            Singleton <CUIManager> .instance.OpenTips(relaTextCfg.IntimRela_Tips_AlreadyHas, true, 1.5f, null, new object[0]);
                        }
                    }
                }
            }
            else if (IntimacyRelationViewUT.IsRelaStateConfirm(tag))
            {
                FriendRelationNetCore.Send_CHG_INTIMACY_CONFIRM(commonUInt64Param, tagUInt, IntimacyRelationViewUT.GetStateByConfirmState(tag), COM_INTIMACY_RELATION_CHG_TYPE.COM_INTIMACY_RELATION_ADD);
            }
            else if (IntimacyRelationViewUT.IsRelaStateDeny(tag))
            {
                FriendRelationNetCore.Send_CHG_INTIMACY_CONFIRM(commonUInt64Param, tagUInt, IntimacyRelationViewUT.GetStateByDenyState(tag), COM_INTIMACY_RELATION_CHG_TYPE.COM_INTIMACY_RELATION_DEL);
            }
        }
		public static string GetRelaIconByRelaLevel(int relaLevel, COM_INTIMACY_STATE state)
		{
			RelationConfig relaTextCfg = Singleton<CFriendContoller>.instance.model.FRData.GetRelaTextCfg(state);
			if (relaTextCfg == null)
			{
				return string.Empty;
			}
			if (relaLevel == 1 || relaLevel == 2)
			{
				return relaTextCfg.iconLevel_1;
			}
			if (relaLevel == 3)
			{
				return relaTextCfg.iconLevel_2;
			}
			if (relaLevel == 4)
			{
				return relaTextCfg.iconLevel_3;
			}
			return string.Empty;
		}
            public void AddRelaLevelUpMsgBox(string otherName, int newLevel, COM_INTIMACY_STATE state)
            {
                RelationConfig relaTextCfg = Singleton <CFriendContoller> .instance.model.FRData.GetRelaTextCfg(state);

                if (relaTextCfg == null)
                {
                    return;
                }
                string levelDescStr = IntimacyRelationViewUT.GetLevelDescStr(newLevel);
                string text         = Singleton <CTextManager> .instance.GetText("RelaLevelUp_Info");

                string content = string.Format(text, new object[]
                {
                    otherName,
                    relaTextCfg.IntimRela_Type,
                    levelDescStr,
                    levelDescStr,
                    relaTextCfg.IntimRela_Type
                });

                this.contents.Add(new IntimacyRelationView.IntimacyTipsMgr.Ent(content, IntimacyRelationView.IntimacyTipsMgr.EShowType.LevelUpMsgBoxAll, otherName, state));
            }
示例#8
0
        public static void On_Send_INTIMACY_RELATION_REQUEST(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_INTIMACY_RELATION_REQUEST stIntimacyRelationRequestRsp = msg.stPkgData.stIntimacyRelationRequestRsp;

            if (stIntimacyRelationRequestRsp.dwResult == 0u)
            {
                string             strContent = string.Empty;
                COM_INTIMACY_STATE state      = COM_INTIMACY_STATE.COM_INTIMACY_STATE_NULL;
                if (stIntimacyRelationRequestRsp.bRelationChgType == 1)
                {
                    if (IntimacyRelationViewUT.IsRelaState(stIntimacyRelationRequestRsp.bIntimacyState))
                    {
                        state = IntimacyRelationViewUT.GetConfirmState(stIntimacyRelationRequestRsp.bIntimacyState);
                        RelationConfig relaTextCfg = Singleton <CFriendContoller> .instance.model.FRData.GetRelaTextCfg(stIntimacyRelationRequestRsp.bIntimacyState);

                        strContent = relaTextCfg.IntimRela_Tips_SendRequestSuccess;
                    }
                }
                else if (stIntimacyRelationRequestRsp.bRelationChgType == 2 && IntimacyRelationViewUT.IsRelaState(stIntimacyRelationRequestRsp.bIntimacyState))
                {
                    state = IntimacyRelationViewUT.GetDenyState(stIntimacyRelationRequestRsp.bIntimacyState);
                    RelationConfig relaTextCfg2 = Singleton <CFriendContoller> .instance.model.FRData.GetRelaTextCfg(stIntimacyRelationRequestRsp.bIntimacyState);

                    strContent = relaTextCfg2.IntimRela_Tips_SendDelSuccess;
                }
                Singleton <CUIManager> .GetInstance().OpenTips(strContent, false, 1.5f, null, new object[0]);

                CFriendRelationship.FRData.Add(stIntimacyRelationRequestRsp.stUin.ullUid, stIntimacyRelationRequestRsp.stUin.dwLogicWorldId, state, (COM_INTIMACY_RELATION_CHG_TYPE)stIntimacyRelationRequestRsp.bRelationChgType, 0u, false);
            }
            else
            {
                Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stIntimacyRelationRequestRsp.dwResult), false, 1.5f, null, new object[0]);
            }
        }
        private void InitRelationCfg()
        {
            CTextManager   instance       = Singleton <CTextManager> .instance;
            RelationConfig relationConfig = new RelationConfig();

            relationConfig.state = COM_INTIMACY_STATE.COM_INTIMACY_STATE_GAY;
            relationConfig.IntimRela_Tips_AlreadyHas         = instance.GetText("IntimRela_Tips_AlreadyHasGay");
            relationConfig.IntimRela_Type                    = instance.GetText("IntimRela_Type_Gay");
            relationConfig.IntimRela_Tips_SendRequestSuccess = instance.GetText("IntimRela_Tips_SendRequestGaySuccess");
            relationConfig.IntimRela_Tips_SendDelSuccess     = instance.GetText("IntimRela_Tips_SendDelGaySuccess");
            relationConfig.IntimRela_Tips_DenyYourRequest    = instance.GetText("IntimRela_Tips_DenyYourRequestGay");
            relationConfig.IntimRela_Tips_DenyYourDel        = instance.GetText("IntimRela_Tips_DenyYourDelGay");
            relationConfig.IntimRela_TypeColor               = instance.GetText("IntimRela_TypeColor_Gay");
            relationConfig.IntimRela_TypeColor_Prefix_Normal = instance.GetText("IntimRela_TypeColor_Gay_Prefix_Normal");
            relationConfig.IntimRela_TypeColor_Prefix_Max    = instance.GetText("IntimRela_TypeColor_Gay_Prefix_Max");
            relationConfig.IntimacyShowLoad                  = instance.GetText("IntimacyShowLoadGay");
            relationConfig.iconLevel_1 = "UGUI/Sprite/Dynamic/Friend/FriendNormal";
            relationConfig.iconLevel_2 = "UGUI/Sprite/Dynamic/Friend/FriendHigh";
            relationConfig.iconLevel_3 = "UGUI/Sprite/Dynamic/Friend/FriendMax";
            this.m_RelationConfig.Add(relationConfig);
            relationConfig       = new RelationConfig();
            relationConfig.state = COM_INTIMACY_STATE.COM_INTIMACY_STATE_LOVER;
            relationConfig.IntimRela_Tips_AlreadyHas         = instance.GetText("IntimRela_Tips_AlreadyHasLover");
            relationConfig.IntimRela_Type                    = instance.GetText("IntimRela_Type_Lover");
            relationConfig.IntimRela_Tips_SendRequestSuccess = instance.GetText("IntimRela_Tips_SendRequestLoverSuccess");
            relationConfig.IntimRela_Tips_SendDelSuccess     = instance.GetText("IntimRela_Tips_SendDelLoverSuccess");
            relationConfig.IntimRela_Tips_DenyYourRequest    = instance.GetText("IntimRela_Tips_DenyYourRequestLover");
            relationConfig.IntimRela_Tips_DenyYourDel        = instance.GetText("IntimRela_Tips_DenyYourDelLover");
            relationConfig.IntimRela_TypeColor               = instance.GetText("IntimRela_TypeColor_Lover");
            relationConfig.IntimRela_TypeColor_Prefix_Normal = instance.GetText("IntimRela_TypeColor_Lover_Prefix_Normal");
            relationConfig.IntimRela_TypeColor_Prefix_Max    = instance.GetText("IntimRela_TypeColor_Lover_Prefix_Max");
            relationConfig.IntimacyShowLoad                  = instance.GetText("IntimacyShowLoadLover");
            relationConfig.iconLevel_1 = "UGUI/Sprite/Dynamic/Friend/LoverNormal";
            relationConfig.iconLevel_2 = "UGUI/Sprite/Dynamic/Friend/LoverHigh";
            relationConfig.iconLevel_3 = "UGUI/Sprite/Dynamic/Friend/LoverMax";
            this.m_RelationConfig.Add(relationConfig);
            relationConfig       = new RelationConfig();
            relationConfig.state = COM_INTIMACY_STATE.COM_INTIMACY_STATE_SIDEKICK;
            relationConfig.IntimRela_Tips_AlreadyHas         = instance.GetText("IntimRela_Tips_AlreadyHasSidekick");
            relationConfig.IntimRela_Type                    = instance.GetText("IntimRela_Type_Sidekick");
            relationConfig.IntimRela_Tips_SendRequestSuccess = instance.GetText("IntimRela_Tips_SendRequestSidekickSuccess");
            relationConfig.IntimRela_Tips_SendDelSuccess     = instance.GetText("IntimRela_Tips_SendDelSidekickSuccess");
            relationConfig.IntimRela_Tips_DenyYourRequest    = instance.GetText("IntimRela_Tips_DenyYourRequestSidekick");
            relationConfig.IntimRela_Tips_DenyYourDel        = instance.GetText("IntimRela_Tips_DenyYourDelSidekick");
            relationConfig.IntimRela_TypeColor               = instance.GetText("IntimRela_TypeColor_Sidekick");
            relationConfig.IntimRela_TypeColor_Prefix_Normal = instance.GetText("IntimRela_TypeColor_Sidekick_Prefix_Normal");
            relationConfig.IntimRela_TypeColor_Prefix_Max    = instance.GetText("IntimRela_TypeColor_Sidekick_Prefix_Max");
            relationConfig.IntimacyShowLoad                  = instance.GetText("IntimacyShowLoadSideKick");
            relationConfig.iconLevel_1 = "UGUI/Sprite/Dynamic/Friend/SidekickNormal";
            relationConfig.iconLevel_2 = "UGUI/Sprite/Dynamic/Friend/SidekickHigh";
            relationConfig.iconLevel_3 = "UGUI/Sprite/Dynamic/Friend/SidekickMax";
            this.m_RelationConfig.Add(relationConfig);
            relationConfig       = new RelationConfig();
            relationConfig.state = COM_INTIMACY_STATE.COM_INTIMACY_STATE_BESTIE;
            relationConfig.IntimRela_Tips_AlreadyHas         = instance.GetText("IntimRela_Tips_AlreadyHasBesite");
            relationConfig.IntimRela_Type                    = instance.GetText("IntimRela_Type_Besite");
            relationConfig.IntimRela_Tips_SendRequestSuccess = instance.GetText("IntimRela_Tips_SendRequestBesiteSuccess");
            relationConfig.IntimRela_Tips_SendDelSuccess     = instance.GetText("IntimRela_Tips_SendDelBesiteSuccess");
            relationConfig.IntimRela_Tips_DenyYourRequest    = instance.GetText("IntimRela_Tips_DenyYourRequestBesite");
            relationConfig.IntimRela_Tips_DenyYourDel        = instance.GetText("IntimRela_Tips_DenyYourDelBesite");
            relationConfig.IntimRela_TypeColor               = instance.GetText("IntimRela_TypeColor_Besite");
            relationConfig.IntimRela_TypeColor_Prefix_Normal = instance.GetText("IntimRela_TypeColor_Besite_Prefix_Normal");
            relationConfig.IntimRela_TypeColor_Prefix_Max    = instance.GetText("IntimRela_TypeColor_Besite_Prefix_Max");
            relationConfig.IntimacyShowLoad                  = instance.GetText("IntimacyShowLoadBesite");
            relationConfig.iconLevel_1 = "UGUI/Sprite/Dynamic/Friend/BesideNormal";
            relationConfig.iconLevel_2 = "UGUI/Sprite/Dynamic/Friend/BesideHigh";
            relationConfig.iconLevel_3 = "UGUI/Sprite/Dynamic/Friend/BesideMax";
            this.m_RelationConfig.Add(relationConfig);
        }