Modding:UI

From DoomRL Wiki

Revision as of 04:51, 24 March 2012 by Shark20061 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

These functions provide 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) &rarr 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.
Personal tools