- Added full implementation of lua event "modifyChatMessage" in IEvents.

This commit is contained in:
MapleWheels
2026-03-23 07:51:49 -04:00
parent 3dd9cfa741
commit 1e76377b63
3 changed files with 47 additions and 1 deletions
@@ -3973,8 +3973,20 @@ namespace Barotrauma.Networking
var hookChatMsg = ChatMessage.Create(senderName, message, (ChatMessageType)type, senderCharacter, senderClient, changeType);
var should = LuaCsSetup.Instance.Hook.Call<bool?>("modifyChatMessage", hookChatMsg, senderRadio);
bool shouldSkip = false;
LuaCsSetup.Instance.EventService.PublishEvent<IEventModifyChatMessage>(sub =>
{
if (sub.OnModifyMessagePredicate(hookChatMsg, senderRadio) is true)
{
shouldSkip = true;
}
});
if (shouldSkip)
{
return;
}
//check which clients can receive the message and apply distance effects
foreach (Client client in ConnectedClients)
{