Ejemplo n.º 1
0
        private void On_IntimacyRela_OK(CUIEvent uievent)
        {
            ulong commonUInt64Param = uievent.m_eventParams.commonUInt64Param1;
            uint  tagUInt           = uievent.m_eventParams.tagUInt;
            COM_INTIMACY_STATE tag  = uievent.m_eventParams.tag;
            int tag2 = uievent.m_eventParams.tag2;

            if (tag == 24 && tag2 != -1)
            {
                CFriendRelationship fRData = Singleton <CFriendContoller> .get_instance().model.FRData;

                CFriendRelationship.FRConfig cFGByIndex = fRData.GetCFGByIndex(tag2);
                if (cFGByIndex.state == 1)
                {
                    if (fRData.FindFrist(1) == null)
                    {
                        FriendRelationNetCore.Send_INTIMACY_RELATION_REQUEST(commonUInt64Param, tagUInt, 1, 1);
                        Singleton <CFriendContoller> .get_instance().model.FRData.ResetChoiseRelaState(commonUInt64Param, tagUInt);
                    }
                    else
                    {
                        Singleton <CUIManager> .get_instance().OpenTips(UT.FRData().IntimRela_Tips_AlreadyHasGay, true, 1.5f, null, new object[0]);
                    }
                }
                if (cFGByIndex.state == 2)
                {
                    if (fRData.FindFrist(2) == null)
                    {
                        FriendRelationNetCore.Send_INTIMACY_RELATION_REQUEST(commonUInt64Param, tagUInt, 2, 1);
                        Singleton <CFriendContoller> .get_instance().model.FRData.ResetChoiseRelaState(commonUInt64Param, tagUInt);
                    }
                    else
                    {
                        Singleton <CUIManager> .get_instance().OpenTips(UT.FRData().IntimRela_Tips_AlreadyHasLover, true, 1.5f, null, new object[0]);
                    }
                }
            }
            else if (tag == 20)
            {
                FriendRelationNetCore.Send_CHG_INTIMACY_CONFIRM(commonUInt64Param, tagUInt, 1, 1);
            }
            else if (tag == 22)
            {
                FriendRelationNetCore.Send_CHG_INTIMACY_CONFIRM(commonUInt64Param, tagUInt, 2, 1);
            }
            else if (tag == 21)
            {
                FriendRelationNetCore.Send_CHG_INTIMACY_CONFIRM(commonUInt64Param, tagUInt, 1, 2);
            }
            else if (tag == 23)
            {
                FriendRelationNetCore.Send_CHG_INTIMACY_CONFIRM(commonUInt64Param, tagUInt, 2, 2);
            }
        }
        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);
            }
        }