private void On_IntimacyRela_PrevState(CUIEvent uievent)
        {
            ulong commonUInt64Param = uievent.m_eventParams.commonUInt64Param1;
            uint  tagUInt           = uievent.m_eventParams.tagUInt;
            CFR   cfr = Singleton <CFriendContoller> .instance.model.FRData.GetCfr(commonUInt64Param, tagUInt);

            if (IntimacyRelationViewUT.IsRelaStateConfirm(cfr.state) && !cfr.bReciveOthersRequest)
            {
                cfr.state = COM_INTIMACY_STATE.COM_INTIMACY_STATE_VALUE_FULL;
            }
            if (IntimacyRelationViewUT.IsRelaStateDeny(cfr.state) && !cfr.bReciveOthersRequest)
            {
                cfr.state = IntimacyRelationViewUT.GetStateByDenyState(cfr.state);
            }
            Singleton <EventRouter> .GetInstance().BroadCastEvent("FRDataChange");
        }
        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);
            }
        }
        private void On_IntimacyRela_Cancle(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;

            Singleton <CFriendContoller> .instance.model.FRData.ResetChoiseRelaState(commonUInt64Param, tagUInt);

            if (IntimacyRelationViewUT.IsRelaStateConfirm(tag))
            {
                COM_INTIMACY_STATE stateByConfirmState = IntimacyRelationViewUT.GetStateByConfirmState(tag);
                FriendRelationNetCore.Send_CHG_INTIMACY_DENY(commonUInt64Param, tagUInt, stateByConfirmState, COM_INTIMACY_RELATION_CHG_TYPE.COM_INTIMACY_RELATION_ADD);
                CFriendRelationship.FRData.Add(commonUInt64Param, tagUInt, COM_INTIMACY_STATE.COM_INTIMACY_STATE_VALUE_FULL, COM_INTIMACY_RELATION_CHG_TYPE.COM_INTIMACY_RELATION_NULL, 0u, false);
            }
            if (IntimacyRelationViewUT.IsRelaStateDeny(tag))
            {
                COM_INTIMACY_STATE stateByDenyState = IntimacyRelationViewUT.GetStateByDenyState(tag);
                FriendRelationNetCore.Send_CHG_INTIMACY_DENY(commonUInt64Param, tagUInt, stateByDenyState, COM_INTIMACY_RELATION_CHG_TYPE.COM_INTIMACY_RELATION_DEL);
                CFriendRelationship.FRData.Add(commonUInt64Param, tagUInt, stateByDenyState, COM_INTIMACY_RELATION_CHG_TYPE.COM_INTIMACY_RELATION_NULL, 0u, false);
            }
        }
		public static bool IsRelaStateConfirm(COM_INTIMACY_STATE state)
		{
			return IntimacyRelationViewUT.IsRelaStateConfirm((byte)state);
		}
		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, false);
				return;
			}
			if (frData.state == COM_INTIMACY_STATE.COM_INTIMACY_STATE_VALUE_FULL && 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, false);
			}
			if (IntimacyRelationViewUT.IsRelaState(frData.state))
			{
				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>.instance.model.FRData.GetFirstChoiseState();
				if (firstChoiseState == frData.state)
				{
					IntimacyRelationViewUT.Set_Bottom_Text(com, true, UT.FRData().IntimRela_AleadyFristChoise, true);
				}
				else
				{
					IntimacyRelationViewUT.Set_Bottom_Text(com, false, string.Empty, false);
					IntimacyRelationViewUT.Set_1_Button(com, true, UT.FRData().IntimRela_DoFristChoise);
				}
			}
			if (IntimacyRelationViewUT.IsRelaStateConfirm(frData.state))
			{
				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, false);
					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, false);
					IntimacyRelationViewUT.Set_ReSelect_Button(com, true, UT.FRData().IntimRela_ReselectRelation);
					IntimacyRelationViewUT.Set_DoSelect_Button(com, false, string.Empty);
				}
			}
			if (IntimacyRelationViewUT.IsRelaStateDeny(frData.state))
			{
				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, false);
					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, false);
					IntimacyRelationViewUT.Set_ReSelect_Button(com, true, UT.FRData().IntimRela_ReDelRelation);
					IntimacyRelationViewUT.Set_DoSelect_Button(com, false, string.Empty);
				}
			}
		}
		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);
				}
			}
		}