private bool onChatMessageReceived(ChatServiceEvents.ChatMessageReceived evt) { if (dataEntityCollection.TryGetComponent(dataEntityCollection.LocalPlayerHandle, out ChatHistoryData component)) { component.AddMessage(new DChatMessage(evt.SessionId, evt.Message, evt.SizzleClipID)); } FullScreenChatData fullScreenChatData; if (dataEntityCollection.IsLocalPlayer(evt.SessionId)) { fullScreenChatDataList.Add(null); checkListLength(); } else if (tryGetFullScreenChatData(evt.SessionId, out fullScreenChatData)) { fullScreenChatData.MessageCount++; fullScreenChatDataList.Add(fullScreenChatData); checkListLength(); } else if (!Service.Get <ZoneTransitionService>().IsTransitioning) { Log.LogErrorFormatted(this, "Could not find a player with the session id {0}", evt.SessionId); } return(false); }
private bool chatMessageReceived(ChatServiceEvents.ChatMessageReceived evt) { if (dataEntityCollection.LocalPlayerSessionId == evt.SessionId) { int chatAwaitingModerationBlockDataListIndex = getChatAwaitingModerationBlockDataListIndex(evt.SessionId); if (chatAwaitingModerationBlockDataListIndex != -1) { fullScreenChatBlockDataList.RemoveAt(chatAwaitingModerationBlockDataListIndex); layoutElementPool.RemoveElement(chatAwaitingModerationBlockDataListIndex); } } DataEntityHandle handle = findPlayerHandle(evt.SessionId); addChatMessage(evt.SessionId, evt.Message, handle); if (layoutElementPool.ElementScrollRect.verticalNormalizedPosition > 0f) { if (!JumpToNewMessageButton.gameObject.activeSelf) { JumpToNewMessageButton.gameObject.SetActive(value: true); } } else if (JumpToNewMessageButton.gameObject.activeSelf) { JumpToNewMessageButton.gameObject.SetActive(value: false); } EventManager.Instance.PostEvent("SFX/UI/Quest/Text/Open", EventAction.PlaySound); return(false); }
private bool onChatMessageReceived(ChatServiceEvents.ChatMessageReceived evt) { if (evt.SessionId == base.localSessionId || !ignoreRemoteChat) { showChatMessage(evt.SessionId, evt.Message, evt.SizzleClipID); } return(false); }