console.tfilesource file

TADS 3 Library - console input/output manager

This module defines the low-level functions for handling input and output via the traditional interpreter's user interface, using the local keyboard and console via the "tads-io" function set.

The functions in this module are designed primarily for internal use within the library itself. Games should use the higher level objects and functions defined in input.t and output.t instead of directly calling the functions defined here. The reason for separating these functions is so that we can substitute the Web UI versions for games that wish to use the Web UI insetad of the traditional console UI.

Summary of Classes  

(none)

Summary of Global Objects  

statuslineBanner 

Summary of Global Functions  

aHref  aHrefAlt  aioClearScreen  aioInputDialog  aioInputEvent  aioInputFile  aioInputLineCancel  aioInputLineTimeout  aioMorePrompt  aioSay  aioSetLogFile  checkHtmlMode  initDisplay  initUI  statusHTML  terminateUI 

Global Functions  

aHref (href, txt?, title?, flags, =, 0)console.t[189]

Generate a string to show hyperlinked text. If we're not in HTML mode, we'll simply return the text without the hyperlink; otherwise, we'll return the text with a hyperlink to the given HREF.

If the display text is included, we'll generate the entire link, including the <A HREF> tag, the hyperlinked text contents, and the </A> end tag. If the text is omitted, we'll simply generate the <A HREF> tag itself, leaving it to the caller to display the text and the </A>.

The optional 'flags' is a combination of AHREF_xxx flags indicating any special properties of the hyperlink.

aHrefAlt (href, linkedText, altText, title?)console.t[224]
Generate a string to show hyperlinked text, with alternate text if we're not in HTML mode. If we're in HTML mode, we'll return linkedTxt linked to the given HREF; if we're in plain text mode, we'll return the alternate text as-is.

aioClearScreen ( )console.t[165]
Clear the screen

aioInputDialog (icon, prompt, buttons, defaultButton, cancelButton)console.t[145]
Show an input dialog

aioInputEvent (timeout)console.t[113]
Read an input event

aioInputFile (prompt, dialogType, fileType, flags)console.t[135]
Show a file selector dialog

aioInputLineCancel (reset)console.t[102]
Cancel a suspended input line

aioInputLineTimeout (timeout)console.t[93]
Get a line of input from the keyboard, with timeout

aioMorePrompt ( )console.t[124]
Show a "More" prompt

aioSay (txt)console.t[83]
Write text to the main game window

aioSetLogFile (fname, logType?)console.t[155]
Set/remove the output logging file

checkHtmlMode ( )console.t[61]
Check to see if we're in HTML mode

initDisplay ( )console.t[39]
Initialize the display. The library calls this at the start of the game, and after each RESTART, to set up the layout of the game window.

initUI ( )console.t[31]
Initialize the user interface. The library calls this once at the start of the interpreter session to set up the UI. For the console interpreter, we don't need to do anything here; the interpreter takes care of setting up the display window for us.

statusHTML (stage)console.t[249]
Generate HTML to wrap the left/right portions of the status line. The basic status line has three stages: stage 0 precedes the left portion, stage 1 comes between the left and right portions, and stage 2 follows the right portion. If we're listing exits, we get two more stages: stage 3 precedes the exit listing, stage 4 follows it.

terminateUI ( )console.t[52]
Shut down the user interface. The library calls this once just before the game is about to terminate.

Adv3Lite Library Reference Manual
Generated on 25/04/2024 from adv3Lite version 2.0