Difference between revisions of "Modding:UI"
From DoomRL Wiki
Shark20061 (Talk | contribs) m (Forgot a semicolon. D'oh.) |
Shark20061 (Talk | contribs) m (Another minor fix.) |
||
Line 1: | Line 1: | ||
− | + | The UI table provides access to functions that work with the user interface. | |
== API == | == API == |
Revision as of 04:58, 24 March 2012
The UI table provides access to functions that work with the user interface.
API
UI | ||
---|---|---|
void | ui.msg(string message) | |
void | ui.msg_clear( ) | |
string | ui.msg_history(integer numMessages) | |
void | ui.msg_enter(string message) | |
boolean | ui.msg_confirm(string message, boolean warning) | |
string | ui.msg_choice(string message, table choices) | |
void | ui.blood_slide( ) | |
void | ui.blink(Color color, integer duration) | |
void | ui.set_hint(string hint_text) | |
void | ui.plot_screen(string text) | |
- ui.msg(string message)
- Prints message to the message area at the top of the screen.
- ui.msg_clear( )
- Adds two blank lines to the message area, clearing it out.
- ui.msg_history(integer numMessages) → string
- Returns the last numMessages messages from the message list. If 0 is entered, it will return only the most recent message.
- ui.msg_enter(string message)
- Prints message to the message area at the top of the screen, followed by the text "Press Enter...", and then waits for an Enter press (or click in Graphics mode).
- ui.msg_confirm(string message, boolean warning) → boolean
- Prints message to the message area at the top of the screen, followed by "[y/n]", and waits for the user to hit the y or n key. Returns true if the y key was pressed, otherwise returns false. If warning is true, the confirm response is Shift-Y (similar to quitting and nuking) instead of just y.
- ui.msg_choice(string message, table choices) → string
- Prints message to the message area at the top of the screen, followed by the list of possible choices, then waits for the user to make a selection or cancel. Choices must be a character array (i.e., a table of length 1 strings) which indicates the valid choices. The function returns a string containing the choice selected, or the empty string if they hit ESC instead.
- ui.blood_slide( )
- Creates the blood slide animation. Doesn't work in 0.9.9.6, but will in older versions.
- ui.blink(Color color, integer duration)
- Makes the screen flash color for duration milliseconds.
- ui.set_hint(string message)
- Displays message in the hint area, which is right-aligned and under the message area.
- ui.plot_screen(string text)
- Creates a black screen that writes text one letter at a time, similar to the intro text. Text can be a multi line string, the newlines will be properly displayed.