Modding:UI

From DoomRL Wiki

Revision as of 00:15, 25 March 2012 by Game Hunter (Talk | contribs)

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

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.
Personal tools