MiniConsole

Defines the MiniConsole Component.

Summary
MiniConsoleDefines the MiniConsole Component.
Variables
master_listHolds all MiniConsoles for consistent reference.
Functions
new
New MiniConsoleA Mudlet text container allowing that mimicks the main console.
Variables
containerThe MiniConsole’s parent frame.
wrapNumber of characters at which the MiniConsole will wrap.
sizeFont size of the text in MiniConsole.
Functions and Properties
updateAbsolutesSets the actual size and position of the MiniConsole using the parent Frame’s Content.
MiniConsole Properties
DrawDraws the MiniConsole.
Resize
Move
Hide
Show
EchoDisplays text on a MiniConsole.
HEchoDisplays text on a MiniConsole with Hex color formatting.
CEchoDisplays text on a MiniConsole with colour tags.
DEchoDisplays text on a MiniConsole with some crazy-ass formatting.
EchoLinkDisplays a clickable line of text in a MiniConsole.
EchoPopupClickable text that expands out to a menu.
PasteCopies text to the MiniConsole from the clipboard (via copy()).
AppendCopies text to the MiniConsole from a buffer or the clipboard (via copy()).
ClearClears all text from the MiniConsole.

Variables

master_list

local master_list

Holds all MiniConsoles for consistent reference.

Functions

new

local function new (_,
name,
init_x,
init_y,
init_width,
init_height,
word_wrap,
font_size)

Parameters

nameUsed for echoing and other Mudlet referencing.
init_xX coordinate position.
init_yY coordinate position.
init_widthWidth of the MiniConsole.
init_heightHeight of the MiniConsole.
word_wrapSets the MiniConsole’s word wrap in characters.  Default is dynamic or 80 if font_size is dynamic.
font_sizeSets the MiniConsole’s font size.  Default is dynamic or 8 if word_wrap is dynamic.

New MiniConsole

A Mudlet text container allowing that mimicks the main console.

Summary
Variables
containerThe MiniConsole’s parent frame.
wrapNumber of characters at which the MiniConsole will wrap.
sizeFont size of the text in MiniConsole.
Functions and Properties
updateAbsolutesSets the actual size and position of the MiniConsole using the parent Frame’s Content.
MiniConsole Properties
DrawDraws the MiniConsole.
Resize
Move
Hide
Show
EchoDisplays text on a MiniConsole.
HEchoDisplays text on a MiniConsole with Hex color formatting.
CEchoDisplays text on a MiniConsole with colour tags.
DEchoDisplays text on a MiniConsole with some crazy-ass formatting.
EchoLinkDisplays a clickable line of text in a MiniConsole.
EchoPopupClickable text that expands out to a menu.
PasteCopies text to the MiniConsole from the clipboard (via copy()).
AppendCopies text to the MiniConsole from a buffer or the clipboard (via copy()).
ClearClears all text from the MiniConsole.

Variables

container

local container

The MiniConsole’s parent frame.  Usually set automatically when added to a Frame.

wrap

local wrap

Number of characters at which the MiniConsole will wrap.

size

local size

Font size of the text in MiniConsole.

Functions and Properties

updateAbsolutes

local function updateAbsolutes ()

Sets the actual size and position of the MiniConsole using the parent Frame’s Content.

MiniConsole Properties

NameReturns the MiniConsole’s name.
ContainerGets and sets the MiniConsole’s parent Frame.
XGets and sets the MiniConsole’s relative X coordinate.
AbsoluteXReturns the MiniConsole’s actual X coordinate.
YGets and sets the MiniConsole’s relative Y coordinate.
AbsoluteYReturns the MiniConsole’s actual Y coordinate.
WidthGets and sets the MiniConsole’s relative width.
AbsoluteWidthReturns the MiniConsole’s actual width.
HeightGets and sets the MiniConsole’s relative height.
AbsoluteHeightReturns the MiniConsole’s actual height.
WordWrapGets and sets the MiniConsole’s word wrap.  If size is dynamic, size is set to 8.
AbsoluteWrapReturns the actual word wrap of the MiniConsole.
FontSizeGets and sets the MiniConsole’s font size.  If wrap is dynamic, wrap is set to 80.
AbsoluteSizeReturns the actual size of the MiniConsole’s text.

Draw

function new_console:Draw ()

Draws the MiniConsole.  Should only be called internally.

Resize

function new_console:Resize (new_width,
new_height)

Parameters

new_widthNew relative width of the MiniConsole.
new_heightNew relative height of the MiniConsole.

Move

function new_console:Move (new_x,
new_y)

Parameters

new_xNew relative X coordinate of the MiniConsole.
new_yNew relative Y coordinate of the MiniConsole.

Hide

function new_console:Hide ()

Show

function new_console:Show ()

Echo

function new_console:Echo (text)

Displays text on a MiniConsole.  Starts where the last line left off.

Parameters

textThe text to be displayed.

HEcho

function new_console:HEcho (text)

Displays text on a MiniConsole with Hex color formatting.

Paramaters

textThe text to be displayed.

CEcho

function new_console:CEcho (text)

Displays text on a MiniConsole with colour tags.

Paramaters

textThe text to be displayed.

DEcho

function new_console:DEcho (text,
fore,
back,
insert)

Displays text on a MiniConsole with some crazy-ass formatting.

Paramaters

textThe text to be displayed.
foreThe foreground color of the text.
backThe background color of the text.
insertIf true, uses InsertText() instead of echo().

EchoLink

function new_console:EchoLink (text,
command,
hint,
keep_format,
insert)

Displays a clickable line of text in a MiniConsole.

Parameters

textThe text to be displayed.
commandScript to be executed when clicked.
hintTooltip text.
keep_formatIf true, uses Frame text formatting.
insertIf true, uses InsertText() instead of Echo()

EchoPopup

function new_console:EchoPopup (text,
commands,
hints,
keep_format,
insert)

Clickable text that expands out to a menu.

Parameters

textThe text to be displayed.
commandsA table of scripts to be executed.
hintsA table of tooltips.
keep_formatIf true, uses MiniConsole text formatting.
insertIf true, uses InsertText() insead of Echo().

Paste

function new_console:Paste ()

Copies text to the MiniConsole from the clipboard (via copy()).  Clears the window first.

Append

function new_console:Append ()

Copies text to the MiniConsole from a buffer or the clipboard (via copy()).  Adds the text beginning at a new line.

Clear

function new_console:Clear ()

Clears all text from the MiniConsole.

local master_list
Holds all MiniConsoles for consistent reference.
local function new (_,
name,
init_x,
init_y,
init_width,
init_height,
word_wrap,
font_size)
local container
The MiniConsole’s parent frame.
local wrap
Number of characters at which the MiniConsole will wrap.
local size
Font size of the text in MiniConsole.
local function updateAbsolutes ()
Sets the actual size and position of the MiniConsole using the parent Frame’s Content.
function new_console:Draw ()
Draws the MiniConsole.
function new_console:Resize (new_width,
new_height)
function new_console:Move (new_x,
new_y)
function new_console:Hide ()
function new_console:Show ()
function new_console:Echo (text)
Displays text on a MiniConsole.
function new_console:HEcho (text)
Displays text on a MiniConsole with Hex color formatting.
function new_console:CEcho (text)
Displays text on a MiniConsole with colour tags.
function new_console:DEcho (text,
fore,
back,
insert)
Displays text on a MiniConsole with some crazy-ass formatting.
function new_console:EchoLink (text,
command,
hint,
keep_format,
insert)
Displays a clickable line of text in a MiniConsole.
function new_console:EchoPopup (text,
commands,
hints,
keep_format,
insert)
Clickable text that expands out to a menu.
function new_console:Paste ()
Copies text to the MiniConsole from the clipboard (via copy()).
function new_console:Append ()
Copies text to the MiniConsole from a buffer or the clipboard (via copy()).
function new_console:Clear ()
Clears all text from the MiniConsole.
Close