UIAdviser Class
The (ideally) helpful advisor who pops up from the bottom dialog during a game.
Method Index
- addBevelPanel(x, y, w, h, colour, highlight_colour, shadow_colour, disabled_colour) (inherited from Window)
- addColourPanel(x, y, w, h, r, g, b) (inherited from Window)
- addKeyHandler(key, handler, ...) (inherited from Window)
- addPanel(sprite_index, x, y, w, h) (inherited from Window)
- addWindow(window) (inherited from Window)
- afterLoad(old, new) (overrides Window:afterLoad)
- beginDrag(x, y) (inherited from Window)
- bringToTop() (inherited from Window)
- close() (inherited from Window)
- draw(canvas, x, y) (overrides Window:draw)
- getSavedWindowPositionName() (inherited from Window)
- getTooltipAt(x, y) (inherited from Window)
- getTooltipForElement(elem, x, y) (inherited from Window)
- getWindow(window_class) (inherited from Window)
- getWindows(window_class) (inherited from Window)
- hide()
- hitTest(x, y) (inherited from Window)
- hitTestPanel(x, y, panel) (inherited from Window)
- idle()
- makeButtonOnPanel(panel, x, y, w, h, sprite, on_click, on_click_self, on_rightclick) (inherited from Window)
- makeDynamicTooltip(callback, x, y, r, b, tooltip_x, tooltip_y) (inherited from Window)
- makeScrollbarOnPanel(panel, slider_colour, callback, min_value, max_value, page_size, value) (inherited from Window)
- makeTextboxOnPanel(panel, confirm_callback, abort_callback) (inherited from Window)
- makeTooltip(text, x, y, r, b, tooltip_x, tooltip_y) (inherited from Window)
- onChangeLanguage() (inherited from Window)
- onChangeResolution() (inherited from Window)
- onCursorWorldPositionChange(x, y) (inherited from Window)
- onMouseDown(button, x, y) (overrides Window:onMouseDown)
- onMouseMove(x, y, dx, dy) (inherited from Window)
- onMouseUp(button, x, y) (inherited from Window)
- onTick() (overrides Window:onTick)
- onWorldTick() (inherited from Window)
- removeAllPanels() (inherited from Window)
- removeWindow(window) (inherited from Window)
- say(speech, talk_until_next_announce, override_current)
- sendToBottom(window) (inherited from Window)
- sendToTop(window) (inherited from Window)
- setDefaultPosition(x, y) (inherited from Window)
- setPosition(x, y) (inherited from Window)
- show()
- startButtonBlinking(button_index) (inherited from Window)
- stopButtonBlinking() (inherited from Window)
- talk()
Member Index
- active_button (*)
- active_scrollbar (*)
- balloon_width
- black_font
- blink_counter (*)
- blinking_button (*)
- btn_repeat_delay (*)
- buttons (*)
- buttons_down (*)
- closed (*)
- default_button_sound (*)
- draggable (*)
- dragging (*)
- enabled
- esc_closes
- frame
- height
- key_handlers (*)
- modal_class
- number_frames
- panel_sprites
- panels (*)
- parent (*)
- phase
- queued_messages
- scrollbars (*)
- speech
- stay_up
- textboxes (*)
- th
- tick_rate
- tick_timer
- timer
- tooltip_regions (*)
- ui
- up_again
- visible (*)
- width
- windows (*)
- x
- x_original (*)
- y
- y_original (*)
function UIAdviser:UIAdviser(ui)
Parameters:
Name | Type | Description |
---|---|---|
ui | ? | ? |
Declared on: line 26 of Lua/dialogs/adviser.lua.
function UIAdviser:afterLoad(old, new)
Parameters:
Name | Type | Description |
---|---|---|
old | ? | ? |
new | ? | ? |
Overrides: Window:afterLoad.
Declared on: line 255 of Lua/dialogs/adviser.lua.
function UIAdviser:draw(canvas, x, y)
Parameters:
Name | Type | Description |
---|---|---|
canvas | ? | ? |
x | ? | ? |
y | ? | ? |
Overrides: Window:draw.
Declared on: line 163 of Lua/dialogs/adviser.lua.
function UIAdviser:hide()
Hides the adviser by running the appropriate animation.
Declared on: line 116 of Lua/dialogs/adviser.lua.
function UIAdviser:idle()
Makes the adviser idle for a while before disappearing.
This means that the text bubble is removed.
Declared on: line 104 of Lua/dialogs/adviser.lua.
function UIAdviser:onMouseDown(button, x, y)
Parameters:
Name | Type | Description |
---|---|---|
button | ? | ? |
x | ? | ? |
y | ? | ? |
Overrides: Window:onMouseDown.
Declared on: line 182 of Lua/dialogs/adviser.lua.
function UIAdviser:onTick()
Overrides: Window:onTick.
Declared on: line 209 of Lua/dialogs/adviser.lua.
function UIAdviser:say(speech, talk_until_next_announce, override_current)
Makes the adviser say something
Parameters:
Name | Type | Description |
---|---|---|
speech | ? | The table containing the text he should say and the priority. |
talk_until_next_announce | ? | Whether he should stay up until the next say() call is made. Useful for the tutorial. |
override_current | ? | Cancels previous messages (if any) immediately and shows this new one instead. |
Declared on: line 125 of Lua/dialogs/adviser.lua.
function UIAdviser:show()
Shows the adviser by running the "popup" animation.
Then moves on to the next phase automatically.
Declared on: line 58 of Lua/dialogs/adviser.lua.
function UIAdviser:talk()
Displays the text bubble along with the next message
from the queue.
Declared on: line 67 of Lua/dialogs/adviser.lua.