Difference between revisions of "Modding:UI"
From DoomRL Wiki
Shark20061 (Talk | contribs) (Creating page with what I have figured out. Warning, information is not guaranteed to be completely correct!) |
Game Hunter (Talk | contribs) m (revised with new templates) |
||
(2 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | + | The UI table provides access to functions that work with the user interface. | |
== API == | == API == | ||
− | {| | + | {{drltable|UI Interface|2|{{Table2Col |
− | + | ||
− | + | ||
|es=background: #333; | |es=background: #333; | ||
|c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px; | |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px; | ||
|c2=padding:0px 2px; | |c2=padding:0px 2px; | ||
− | | | + | |{{modarg|void}} |{{moddef|list|msg|dot||string|message}} |
− | | | + | |{{modarg|void}} |{{moddef|list|msg_clear|dot}} |
− | | | + | |{{modarg|string}} |{{moddef|list|msg_history|dot||integer|numMessages}} |
− | | | + | |{{modarg|void}} |{{moddef|list|msg_enter|dot||string|message}} |
− | | | + | |{{modarg|boolean}}|{{moddef|list|msg_confirm|dot||string|message|boolean|warning}} |
− | | | + | |{{modarg|string}} |{{moddef|list|msg_choice|dot||string|message|table|choices}} |
− | | | + | |{{modarg|void}} |{{moddef|list|blood_slide|dot}} |
− | | | + | |{{modarg|void}} |{{moddef|list|blink|dot||Color|color|integer|duration}} |
− | | | + | |{{modarg|void}} |{{moddef|list|set_hint|dot||string|hint_text}} |
− | | | + | |{{modarg|void}} |{{moddef|list|plot_screen|dot||string|text}} |
|}} | |}} | ||
− | + | }} | |
---- | ---- | ||
− | {{ | + | {{moddef|desc|msg|dot||string|message}} |
− | + | ||
:Prints ''message'' to the message area at the top of the screen. | :Prints ''message'' to the message area at the top of the screen. | ||
---- | ---- | ||
− | {{ | + | {{moddef|desc|msg_clear|dot}} |
− | + | ||
:Adds two blank lines to the message area, clearing it out. | :Adds two blank lines to the message area, clearing it out. | ||
---- | ---- | ||
− | {{ | + | {{moddef|desc|msg_history|dot|string|integer|numMessages}} |
− | + | ||
:Returns the last ''numMessages'' messages from the message list. If 0 is entered, it will return only the most recent message. | :Returns the last ''numMessages'' messages from the message list. If 0 is entered, it will return only the most recent message. | ||
---- | ---- | ||
− | {{ | + | {{moddef|desc|msg_enter|dot||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). | :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). | ||
---- | ---- | ||
− | {{ | + | {{moddef|desc|msg_confirm|dot|boolean|string|message|boolean|warning}} |
− | + | ||
: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. | :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. | ||
---- | ---- | ||
− | {{ | + | {{moddef|desc|msg_choice|dot|string|string|message|table|choices}} |
− | + | ||
: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. | :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. | ||
---- | ---- | ||
− | {{ | + | {{moddef|desc|blood_slide|dot}} |
− | + | ||
:Creates the blood slide animation. Doesn't work in 0.9.9.6, but will in older versions. | :Creates the blood slide animation. Doesn't work in 0.9.9.6, but will in older versions. | ||
---- | ---- | ||
− | {{ | + | {{moddef|desc|blink|dot||Color|color|integer|duration}} |
− | + | ||
:Makes the screen flash ''color'' for ''duration'' milliseconds. | :Makes the screen flash ''color'' for ''duration'' milliseconds. | ||
---- | ---- | ||
− | {{ | + | {{moddef|desc|set_hint|dot||string|hint_text}} |
− | + | ||
:Displays ''message'' in the hint area, which is right-aligned and under the message area. | :Displays ''message'' in the hint area, which is right-aligned and under the message area. | ||
---- | ---- | ||
− | {{ | + | {{moddef|desc|plot_screen|dot||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. | :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. |
Latest revision as of 00:15, 25 March 2012
The UI table provides access to functions that work with the user interface.
API
UI Interface | |
void | msg(string message) |
void | msg_clear() |
string | msg_history(integer numMessages) |
void | msg_enter(string message) |
boolean | msg_confirm(string message, boolean warning) |
string | msg_choice(string message, table choices) |
void | blood_slide() |
void | blink(Color color, integer duration) |
void | set_hint(string hint_text) |
void | plot_screen(string text) |
- msg(string message)
- Prints message to the message area at the top of the screen.
- msg_clear()
- Adds two blank lines to the message area, clearing it out.
- 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.
- 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).
- 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.
- 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.
- blood_slide()
- Creates the blood slide animation. Doesn't work in 0.9.9.6, but will in older versions.
- blink(Color color, integer duration)
- Makes the screen flash color for duration milliseconds.
- set_hint(string hint_text)
- Displays message in the hint area, which is right-aligned and under the message area.
- 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.