-
Notifications
You must be signed in to change notification settings - Fork 0
Communicating with UTChat
There are two methods to communicate with UTChat, though only one sound solution for redistributed modules.
UTChat has a couple functions to deal with chat messages, and they are accessible to any module in its scope.
#!lua
function UTChat:PostMessage( UText )
function UTChat:PrintChat( SimpleText )
PrintChat is what packages text sent via event cross-module. It allows for very few properties to be set because it is designed to be compatible with vanilla chat messages. It may be best to call on this function Cross-Module using events rather than supplementing the UTLib module
- See UTChat Cross-Module syntax for information on how to best interface with UTChat this way.
If you are residing in the UTLib folder and demand more functionality, then you can use PostMessage. You can pass any constructed UText object through this.
Protip: PostMessage will process your UText object through all registered Chat Handlers. If you do not wish your message to be processed, then set your object's internal 'nochathandling' to true. 'nochathandling' is only used by UTChat and tells PostMessage if the message it receives should be processed with handlers. It is safe to modify this internal.