Footnote - this allows footnote references to be generated in displayed text, and the user to retrieve the contents of the footnote on demand.
Create an instance of Footnote for each footnote. For each footnote object, define the "desc" property as a double-quoted string (or method) displaying the footnote's contents.
To display a footnote reference in a passage of text, call <<x.noteRef>>, where x is the footnote object in question. That's all you have to do - we'll automatically assign the footnote a sequential number (so that footnote references are always seen by the player in ascending order, regardless of the order in which the player encounters the sources of the footnotes), and the NOTE command will automatically figure out which footnote object is involved for a given footnote number.
This class also serves as a daemon notification object to receive per-command daemon calls. The first time we show a footnote reference, we'll show an explanation of how footnotes work.
Footnote : object
Superclass Tree (in declaration order)
Summary of Properties
Summary of Methods
Display the contents of the footnote - this will be called when the user asks to show the footnote with the "NOTE n" command. Each instance must provide suitable text here.
static property: we've never shown a footnote reference before
my footnote number - this is assigned the first time I'm referenced; initially we have no number, since we don't want to assign a number until the note is first referenced
Flag: this footnote's full text has been displayed. This refers to the text of the footnote itself, not the reference, so this is only set when the "FOOTNOTE n" command is used to read this footnote.
SettingsItem tracking our current status
Static property: the highest footnote number currently in use. We start this at zero, because zero is never a valid footnote number.
Static property: a vector of all footnotes which have had numbers assigned. We use this to find a footnote object given its note number.
static property: per-command-prompt daemon entrypoint
Display a footnote given its number. If there is no such footnote, we'll display an error message saying so. (This is a class method, so it should be called directly on Footnote, not on instances of Footnote.)
TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3