private void On_InBatShortcut_OK(CUIEvent uievent) { InBattleMsgMgr instance = Singleton <InBattleMsgMgr> .get_instance(); instance.SyncData(instance.menuEntList, instance.lastMenuEntList); InBattleMsgNetCore.SendShortCut_Config(instance.menuEntList); this.EditMode = false; }
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); } } } } } } } }
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); } } } } } } }
private void On_EndEdit(string content) { Singleton <InBattleMsgMgr> .instance.HideView(); if (this.m_inputField != null) { this.m_inputField.set_text(string.Empty); } if (this.intimeMSecond_StartTime != 0uL) { uint num = (uint)(Singleton <FrameSynchr> .GetInstance().LogicFrameTick - this.intimeMSecond_StartTime); if ((ulong)num < (ulong)((long)this.intimeMSecond)) { if (this.intimeSendCount + 1 > this.intimeMaxCount) { if (this.m_inputButton != null) { this.m_inputButton.StartCooldown(this.intime_cd, new Action(this.OnBlockCDEnd)); } InBattleInputChat inputChat = Singleton <InBattleMsgMgr> .instance.m_InputChat; if (inputChat != null) { InBattleInputChat.InBatChatEntity ent = inputChat.ConstructEnt(this.m_inCDTxt, InBattleInputChat.InBatChatEntity.EType.System); inputChat.Add(ent); } this.intimeSendCount = 0; return; } } else { this.intimeSendCount = 0; } } InBattleInputChat inputChat2 = Singleton <InBattleMsgMgr> .instance.m_InputChat; if (inputChat2 == null) { return; } if (string.IsNullOrEmpty(content)) { return; } content = CUIUtility.RemoveEmoji(content); if (this.m_inputText != null) { this.m_inputText.CustomSetActive(false); } SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext(); if (curLvelContext != null && !Singleton <InBattleMsgMgr> .instance.ShouldBeThroughNet(curLvelContext)) { InBattleInputChat inputChat3 = Singleton <InBattleMsgMgr> .instance.m_InputChat; if (inputChat3 != null) { InBattleInputChat.InBatChatEntity ent2 = inputChat3.ConstructEnt(this.m_inWramBattle, InBattleInputChat.InBatChatEntity.EType.System); inputChat3.Add(ent2); } } else if (!string.IsNullOrEmpty(content)) { InBattleMsgNetCore.SendInBattleMsg_InputChat(content, (byte)inputChat2.m_curChatCamp); } if (this.intimeSendCount == 0) { this.intimeMSecond_StartTime = Singleton <FrameSynchr> .GetInstance().LogicFrameTick; } this.intimeSendCount++; }
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); } } }