Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetChatChannelNames

From RoR Wiki

UI Lua API · Chat functions
Version: WAR 1.4.8

Returns the numbered chat channels the player is in.

channels = GetChatChannelNames()

Arguments

None.

Returns

channels
table – Channel tables keyed by chat log filter id (channel number + 56), so that channels[SystemData.ChatLogFilters.CHANNEL_1] is channel 1. Channels the player is not in have no entry.

Each channel table has these fields:

Key Type Meaning
name wstring Channel name.
number number Channel number.

Details

  • This is not a 1-based array; use pairs or index it with the SystemData.ChatLogFilters.CHANNEL_n values.
  • The list is the client's copy; the function does not contact the server.

Errors

None.

Example

From default/ea_chatwindow/source/chatsettings.lua:

local channels = GetChatChannelNames()
...
for channelIndex, _ in pairs( ChatSettings.ChannelSwitches )
do
    -- If there's a name entry, use that instead of the default
    if( channels[channelIndex] ~= nil )
    then
        ChatSettings.Channels[channelIndex].labelText =
            GetFormatStringFromTable( "ChatStrings", StringTables.Chat.CHAT_CHANNEL_REPLACE_CHANNEL_X, { channels[channelIndex].number, channels[channelIndex].name } )
    ...

See also