
This control defines the main chat window. The recommended location for it is in a desktop panel. Only one instance of
the control can exist, attempts to create more than one will fail.
The chat window contains several chatentry objects representing the entries in the chat buffer. The messages
added to the buffer can either be sent to other clients taking part in the session or used as local notification messages.
See addMessage and deliverMessage for details.
Information about events is passed to and from the script event handlers (described below) in a table. The fields in this table are:
text: The text content of the message
sender: The string identifying the sender of the message
mood: Set only if a mood is specified, containing the contents of the mood string
font: Set only if the message uses a font different from the default setting, containing the font resource name
icon: Set only if the message contains an icon drawn at the beginning of the message, containing the icon resource
name for the desired icon
Definition

<chatwindow name="..."
>
...
</chatwindow>
|
|
Interface

addMessage

function addMessage(
messagedata
)
Add a new entry to the chat window history locally. The message is not delivered to other connected users, and the
onReceiveMessage event is not fired.
Parameters
messagedata (table)
A table containing information about the message. See the
chatwindow description for details.
clear

function clear(
)
Clear the chat history for all connected users. If called as a client, has no effect.
deliverMessage

function deliverMessage(
messagedata
)
Add a new entry to the chat window, delivering it to clients (if acting as the host) or requesting the host to distribute it
to clients (if acting as a client).
This form of the function delivers the message to all connected clients.
Parameters
messagedata (table)
A table containing information about the message. See the
chatwindow description for details.
deliverMessage

function deliverMessage(
messagedata, recipient
)
Add a new entry to the chat window, delivering it to clients (if acting as the host) or requesting the host to distribute it
to clients (if acting as a client).
This form of the function delivers the message to the specified recipient only.
Parameters
messagedata (table)
A table containing information about the message. See the
chatwindow description for details.
recipient (string)
A string containing the user name of the desired recipient
deliverMessage

function deliverMessage(
messagedata, recipients
)
Add a new entry to the chat window, delivering it to clients (if acting as the host) or requesting the host to distribute it
to clients (if acting as a client).
This form of the function delivers the message to all the recipients specified as the second parameter.
Parameters
messagedata (table)
A table containing information about the message. See the
chatwindow description for details.
recipients (table)
An integer indexed table containing strings specifying the user names of the desired recipients
onDiceLanded

event
function onDiceLanded(
draginfo
)
If present, this function is called whenever a die roll has been made and all dice have landed and had the result numbers assigned.
For any custom dice, the custom value calculations have already been performed.
Parameters
draginfo (dragdata)
A
dragdata reference containing information about the drag used to roll the dice.
Return values
(boolean)
If true, the message is not processed any further, omitting it from the chat history.
onReceiveMessage

event
function onReceiveMessage(
messagedata
)
If present, this function is called whenever a message is delivered to the chat window as a result of sending
one over the network (i.e. it is not called when using addMessage).
Parameters
messagedata (table)
A table containing information about the message. See the
chatwindow description for details.
Return values
(boolean)
If true, the message is not processed any further, omitting it from the chat history.
throwDice

function throwDice(
dragtype, dice, modifier, description, [customdata]
)
This function is used to trigger a roll of the dice without direct UI actions. Technically, the roll is performed by creating a dragdata
object and triggering the action of the dice.
Parameters
dragtype (string)
The type used for the
dragdata object. A value of "dice" performs a normal die roll.
dice (table)
An integer indexed list of die types to add to the roll, similar in function to
dragdata.setDieList.
modifier (number)
description (string)
customdata (any) [optional]
A custom value useful for e.g. storing special information about the roll required when the results are displayed (see
dragdata.setCustomData).