Exemplo n.º 1
0
    public void On_InBattleMsg_ListElement_Click(CUIEvent uiEvent)
    {
        this.Show(false);
        int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList;

        if ((srcWidgetIndexInBelongedList >= 0) && (srcWidgetIndexInBelongedList < Singleton <InBattleMsgMgr> .instance.inbatEntList.Count))
        {
            TabElement element = Singleton <InBattleMsgMgr> .instance.inbatEntList[srcWidgetIndexInBelongedList];
            if (element != null)
            {
                Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                if (hostPlayer != null)
                {
                    ResInBatMsgCfg cfgData = Singleton <InBattleMsgMgr> .instance.GetCfgData(element.cfgId);

                    DebugHelper.Assert(cfgData != null, "InbattleMsgView cfg_data == null");
                    if (cfgData != null)
                    {
                        SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

                        if (curLvelContext != null)
                        {
                            if (!Singleton <InBattleMsgMgr> .instance.ShouldBeThroughNet(curLvelContext))
                            {
                                if ((element.cfgId >= 1) && (element.cfgId <= 15))
                                {
                                    CPlayerBehaviorStat.Plus((CPlayerBehaviorStat.BehaviorType)element.cfgId);
                                }
                                this.InnerHandle_InBat_PreConfigMsg((COM_INBATTLE_CHAT_TYPE)cfgData.bShowType, hostPlayer.CaptainId, element.cfgId, hostPlayer.PlayerUId);
                            }
                            else
                            {
                                if ((element.cfgId >= 1) && (element.cfgId <= 15))
                                {
                                    CPlayerBehaviorStat.Plus((CPlayerBehaviorStat.BehaviorType)element.cfgId);
                                }
                                InBattleMsgNetCore.SendInBattleMsg_PreConfig(element.cfgId, (COM_INBATTLE_CHAT_TYPE)cfgData.bShowType, hostPlayer.CaptainId);
                            }
                            if (this.m_cdButton != null)
                            {
                                ResInBatChannelCfg dataByKey = GameDataMgr.inBattleChannelDatabin.GetDataByKey((uint)cfgData.bInBatChannelID);
                                if (dataByKey != null)
                                {
                                    this.m_cdButton.StartCooldown(dataByKey.dwCdTime, null);
                                }
                                else
                                {
                                    this.m_cdButton.StartCooldown(0xfa0, null);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
Exemplo n.º 2
0
    public void On_InBattleMsg_ListElement_Click(int index)
    {
        this.Show(false);
        TabElement element = this._get_current_info(this.TabIndex, index);

        if (element != null)
        {
            Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

            if (hostPlayer != null)
            {
                ResInBatMsgCfg cfgData = Singleton <InBattleMsgMgr> .instance.GetCfgData(element.cfgId);

                DebugHelper.Assert(cfgData != null, "InbattleMsgView cfg_data == null");
                if (cfgData != null)
                {
                    SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

                    if (curLvelContext != null)
                    {
                        if (!this.ShouldBeThroughNet(curLvelContext))
                        {
                            Singleton <InBattleMsgMgr> .instance.InnerHandle_InBatMsg((COM_INBATTLE_CHAT_TYPE)cfgData.bShowType, hostPlayer.CaptainId, element.cfgId, hostPlayer.PlayerUId);
                        }
                        else
                        {
                            InBattleMsgNetCore.SendInBattleMsg_PreConfig(element.cfgId, (COM_INBATTLE_CHAT_TYPE)cfgData.bShowType, hostPlayer.CaptainId);
                        }
                        if (Singleton <InBattleMsgMgr> .instance.m_cdButton != null)
                        {
                            ResInBatChannelCfg dataByKey = GameDataMgr.inBattleChannelDatabin.GetDataByKey(cfgData.bInBatChannelID);
                            if (dataByKey != null)
                            {
                                Singleton <InBattleMsgMgr> .instance.m_cdButton.StartCooldown(dataByKey.dwCdTime);
                            }
                            else
                            {
                                Singleton <InBattleMsgMgr> .instance.m_cdButton.StartCooldown(0xfa0);
                            }
                        }
                    }
                }
            }
        }
    }
Exemplo n.º 3
0
    public void Send_Config_Chat(int index)
    {
        if (this.m_cdButton == null || this.m_cdButton.startCooldownTimestamp != 0uL)
        {
            return;
        }
        if (index < 0 || index >= Singleton <InBattleMsgMgr> .get_instance().inbatEntList.get_Count())
        {
            return;
        }
        if (Singleton <InBattleMsgMgr> .get_instance().inbatEntList.get_Count() == 0)
        {
            Singleton <InBattleMsgMgr> .get_instance().BuildInBatEnt();
        }
        TabElement tabElement = Singleton <InBattleMsgMgr> .get_instance().inbatEntList.get_Item(index);

        if (tabElement == null)
        {
            return;
        }
        Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

        if (hostPlayer == null)
        {
            return;
        }
        ResInBatMsgCfg cfgData = Singleton <InBattleMsgMgr> .get_instance().GetCfgData(tabElement.cfgId);

        DebugHelper.Assert(cfgData != null, "InbattleMsgView cfg_data == null");
        if (cfgData == null)
        {
            return;
        }
        SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

        if (curLvelContext == null)
        {
            return;
        }
        if (!Singleton <InBattleMsgMgr> .get_instance().ShouldBeThroughNet(curLvelContext))
        {
            if (tabElement.cfgId >= 1u && tabElement.cfgId <= 15u)
            {
                CPlayerBehaviorStat.Plus((CPlayerBehaviorStat.BehaviorType)tabElement.cfgId);
            }
            this.InnerHandle_InBat_PreConfigMsg(cfgData.bShowType, hostPlayer.CaptainId, tabElement.cfgId, hostPlayer.PlayerUId);
        }
        else
        {
            if (tabElement.cfgId >= 1u && tabElement.cfgId <= 15u)
            {
                CPlayerBehaviorStat.Plus((CPlayerBehaviorStat.BehaviorType)tabElement.cfgId);
            }
            InBattleMsgNetCore.SendInBattleMsg_PreConfig(tabElement.cfgId, cfgData.bShowType, hostPlayer.CaptainId);
        }
        if (this.m_cdButton != null)
        {
            ResInBatChannelCfg dataByKey = GameDataMgr.inBattleChannelDatabin.GetDataByKey((uint)cfgData.bInBatChannelID);
            if (dataByKey != null)
            {
                this.m_cdButton.StartCooldown(dataByKey.dwCdTime, null);
            }
            else
            {
                this.m_cdButton.StartCooldown(4000u, null);
            }
        }
    }