Chat

Manages a number of MiniConsoles and tabs for a clean interface for text.

Summary
ChatManages a number of MiniConsoles and tabs for a clean interface for text.
Functions
new
New ChatA Compound composed of MiniConsoles and tabs that can be echoed to, displaying one MiniConsole at a time, with tabs to switch between the active MiniConsole.
Variables
backgroundThe background Frame that houses the Chat Compound.
channel_listA string list of channel names.
mini_consolesThe MiniConsoles managed by this Chat Compound.
tab_locationDetermines on which side of the MiniConsoles the tabs will sit.
tabsThe tab Frames managed by this Chat Compound.
tab_containerA Frame that holds the tabs’ Box Compound.
componentsA table of Components that all tabs will share.
active_backgroundThe default background color of the active tab.
inactive_backgroundThe default background color of tabs when they’re not the active tab.
pending_backgroundThe default background color of a tab when there’s a message waiting to be viewed.
current_channelThe channel currently active.
pending_channelsChannels with text to be viewed, waiting to be clicked on.
switch_funcThe name of the global function that will be used to switch MiniConsoles when the tab is clicked.
Properties
Chat Properties
Functions
EchoEchos any kind of text into a specific channel.
AppendAppends text to a channel from the buffer.
PastePastes copy()’d text into a channel.
ClearRemoves all text from a channel.
<name>ChatSwitchA dirty global function used as a callback for tabs.
<name>InitializeChatA global function, registered as an event handler for the VyzorDrawnEvent.
Variables
init_funcThe name of the global initialization function for this Chat Compound.

Functions

new

local function new (_,
name,
init_back,
init_channels,
init_tabloc,
init_size,
init_wrap,
init_font,
init_components)

Parameters

nameName of the Chat Compound.  Used to create unique event handler functions.
init_backThe Background Frame for this Chat Compound.
init_channelsThe names of the channels managed by this Compound.  Passed as a table.
init_tablocOptional.  A TabLocation Enum that determines on which side of the consoles the tabs sit.  Default is top.
init_sizeOptional.  This is the size of the unmanaged portion of the tabs.  Must be between 0.0 and 1.0.  Default is 0.05.
init_wrapOptional.  This is the word wrap of the MiniConsole text.  Default is “dynamic”.
init_fontOptional.  This is the font size of the MiniConsole text.  Default is 10.  Can be “dynamic”
init_componentsOptional.  A table of Components.  These are used to decorate the tabs.

New Chat

A Compound composed of MiniConsoles and tabs that can be echoed to, displaying one MiniConsole at a time, with tabs to switch between the active MiniConsole.

Summary
Variables
backgroundThe background Frame that houses the Chat Compound.
channel_listA string list of channel names.
mini_consolesThe MiniConsoles managed by this Chat Compound.
tab_locationDetermines on which side of the MiniConsoles the tabs will sit.
tabsThe tab Frames managed by this Chat Compound.
tab_containerA Frame that holds the tabs’ Box Compound.
componentsA table of Components that all tabs will share.
active_backgroundThe default background color of the active tab.
inactive_backgroundThe default background color of tabs when they’re not the active tab.
pending_backgroundThe default background color of a tab when there’s a message waiting to be viewed.
current_channelThe channel currently active.
pending_channelsChannels with text to be viewed, waiting to be clicked on.
switch_funcThe name of the global function that will be used to switch MiniConsoles when the tab is clicked.
Properties
Chat Properties
Functions
EchoEchos any kind of text into a specific channel.
AppendAppends text to a channel from the buffer.
PastePastes copy()’d text into a channel.
ClearRemoves all text from a channel.
<name>ChatSwitchA dirty global function used as a callback for tabs.
<name>InitializeChatA global function, registered as an event handler for the VyzorDrawnEvent.
Variables
init_funcThe name of the global initialization function for this Chat Compound.

Variables

background

local background

The background Frame that houses the Chat Compound.

channel_list

A string list of channel names.  There will be one tab and MiniConsole per name.

mini_consoles

The MiniConsoles managed by this Chat Compound.

tab_location

local tab_location

Determines on which side of the MiniConsoles the tabs will sit.

tabs

The tab Frames managed by this Chat Compound.

tab_container

local tab_container

A Frame that holds the tabs’ Box Compound.

components

A table of Components that all tabs will share.

active_background

local active_background

The default background color of the active tab.  If a Background component exists in the components passed, it will override this.

inactive_background

local inactive_background

The default background color of tabs when they’re not the active tab.

pending_background

local pending_background

The default background color of a tab when there’s a message waiting to be viewed.

current_channel

local current_channel

The channel currently active.

pending_channels

Channels with text to be viewed, waiting to be clicked on.

switch_func

local switch_func

The name of the global function that will be used to switch MiniConsoles when the tab is clicked.

Properties

Chat Properties

NameReturns the Chat Compound’s name.
BackgroundReturns the background Frame of the Chat Compound.
ContainerGets and sets the Chat Compound’s parent Frame.
ChannelsReturns a copied list of the channels this Compound covers.
TabSizeGets and sets the size of the un-managed dimension of the tabs.
FontSizeGets and sets the size of the font in the MiniConsoles.
WordWrapGets and sets the word wrap of the MiniConsoles.
TabLocationGets and sets the location of the tabs surrouding the MiniConsoles.
ComponentsReturns a copied list of the Compound’s Tab’s Components.
ActiveBackgroundGets and sets the Background Component of the tab currently active.
InactiveBackgroundGets and sets the Background Component of the tabs that are currently inactive.
PendingBackgroundGets and sets the Background Component of any tabs with text waiting to be read.
CurrentChannelReturns the current channel of the Chat Compound.
MiniConsolesReturns a copied list of the MiniConsoles in the Compound.
TabsReturns a copied list of the Tabs in the Compound.

Functions

Echo

function new_chat:Echo (channel,
text)

Echos any kind of text into a specific channel.

Parameters

channelThe channel into which to echo.
textThe text to be echoed.

Append

function new_chat:Append (channel)

Appends text to a channel from the buffer.

Parameters

channelThe into which the text should be appended.

Paste

function new_chat:Paste (channel)

Pastes copy()’d text into a channel.

Parameters

channelThe channel into which the text should be pasted.

Clear

function new_chat:Clear (channel)

Removes all text from a channel.

Parameters

channelThe channel to be cleared.

<name>ChatSwitch

A dirty global function used as a callback for tabs.  Vyzor creates one of these functions for each Chat Compound.

Parameters

channelThe channel to be switched to.

<name>InitializeChat

A global function, registered as an event handler for the VyzorDrawnEvent.  Makes sure the proper consoles are visible.

Vyzor creates one of these for each Chat Compound.

Variables

init_func

local init_func

The name of the global initialization function for this Chat Compound.

local function new (_,
name,
init_back,
init_channels,
init_tabloc,
init_size,
init_wrap,
init_font,
init_components)
local background
The background Frame that houses the Chat Compound.
local tab_location
Determines on which side of the MiniConsoles the tabs will sit.
local tab_container
A Frame that holds the tabs’ Box Compound.
local active_background
The default background color of the active tab.
local inactive_background
The default background color of tabs when they’re not the active tab.
local pending_background
The default background color of a tab when there’s a message waiting to be viewed.
local current_channel
The channel currently active.
local switch_func
The name of the global function that will be used to switch MiniConsoles when the tab is clicked.
function new_chat:Echo (channel,
text)
Echos any kind of text into a specific channel.
function new_chat:Append (channel)
Appends text to a channel from the buffer.
function new_chat:Paste (channel)
Pastes copy()’d text into a channel.
function new_chat:Clear (channel)
Removes all text from a channel.
local init_func
The name of the global initialization function for this Chat Compound.
Close