UIPlaceObjects Class
The dialog shown when placing objects.
Inheritance: UIPlaceObjects ยป Window
Subclasses: UIEditRoom
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)
- addObjects(object_list, pay_for)
- addPanel(sprite_index, x, y, w, h) (inherited from Window)
- addWindow(window) (inherited from Window)
- afterLoad(old, new) (inherited from Window)
- beginDrag(x, y) (inherited from Window)
- bringToTop() (inherited from Window)
- calculateBestPlacementPosition(x, y)
- cancel()
- clearBlueprint()
- close() (overrides Window:close)
- 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)
- hitTest(x, y) (inherited from Window)
- hitTestPanel(x, y, panel) (inherited from Window)
- 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)
- nextOrientation()
- onChangeLanguage() (inherited from Window)
- onChangeResolution() (inherited from Window)
- onCursorWorldPositionChange(x, y) (overrides Window:onCursorWorldPositionChange)
- onMouseDown(button, x, y) (inherited from Window)
- onMouseMove(x, y, dx, dy) (inherited from Window)
- onMouseUp(button, x, y) (overrides Window:onMouseUp)
- onTick() (inherited from Window)
- onWorldTick() (inherited from Window)
- placeObject(dont_close_if_empty)
- removeAllObjects(refund)
- removeAllPanels() (inherited from Window)
- removeObject(object, dont_close_if_empty, refund)
- removeObjects(object_list, refund)
- removeWindow(window) (inherited from Window)
- resize(num_slots)
- selectObjectType(object_type)
- sendToBottom(window) (inherited from Window)
- sendToTop(window) (inherited from Window)
- setActiveIndex(index)
- setBlueprintCell(x, y)
- setDefaultPosition(x, y) (inherited from Window)
- setOrientation(orient)
- setPosition(x, y) (inherited from Window)
- startButtonBlinking(button_index) (inherited from Window)
- stopButtonBlinking() (inherited from Window)
- tryNextOrientation()
Member Index
- active_button (*)
- active_index
- active_scrollbar (*)
- anims
- blink_counter (*)
- blinking_button (*)
- blue_font
- btn_repeat_delay (*)
- buttons
- buttons_down (*)
- closed (*)
- confirm
- confirm_button
- default_button_sound (*)
- desc_text
- draggable (*)
- dragging (*)
- height
- key_handlers (*)
- list_header
- map
- modal_class
- num_slots
- object_anim
- object_blueprint_good
- object_cell_x
- object_cell_y
- object_footprint
- object_orientation
- object_slave_anim
- objects
- panel_sprites
- panels
- parent (*)
- pickupItems
- pickup_button
- place_objects
- purchaseItems
- purchase_button
- room
- scrollbars (*)
- textboxes (*)
- title_text
- tooltip_regions (*)
- ui
- visible
- white_font
- width
- windows (*)
- world
- x
- x_original (*)
- y
- y_original (*)
function UIPlaceObjects:UIPlaceObjects(ui, object_list, pay_for)
Constructor for the class.
Parameters:
Name | Type | Description |
---|---|---|
ui | UI | The active ui. |
object_list | table | a list of tables with objects to place. Keys are "object", "qty" and "existing_object". The first is the object_type of the object, the second how many, and if the key "existing_object" is set it should be an already existing object that is about to be moved. In particular, if that object has a variable called current_frame then that frame will be used when drawing the object as it is being moved. |
pay_for | ? | ? |
Declared on: line 33 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:addObjects(object_list, pay_for)
Parameters:
Name | Type | Description |
---|---|---|
object_list | ? | ? |
pay_for | ? | ? |
Declared on: line 156 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:calculateBestPlacementPosition(x, y)
Parameters:
Name | Type | Description |
---|---|---|
x | ? | ? |
y | ? | ? |
Declared on: line 820 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:close()
Overrides: Window:close.
Declared on: line 308 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:draw(canvas, x, y)
Parameters:
Name | Type | Description |
---|---|---|
canvas | ? | ? |
x | ? | ? |
y | ? | ? |
Overrides: Window:draw.
Declared on: line 518 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:onCursorWorldPositionChange(x, y)
Parameters:
Name | Type | Description |
---|---|---|
x | ? | ? |
y | ? | ? |
Overrides: Window:onCursorWorldPositionChange.
Declared on: line 854 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:onMouseUp(button, x, y)
Parameters:
Name | Type | Description |
---|---|---|
button | ? | ? |
x | ? | ? |
y | ? | ? |
Overrides: Window:onMouseUp.
Declared on: line 448 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:placeObject(dont_close_if_empty)
Parameters:
Name | Type | Description |
---|---|---|
dont_close_if_empty | ? | ? |
Declared on: line 476 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:removeAllObjects(refund)
Parameters:
Name | Type | Description |
---|---|---|
refund | ? | ? |
Declared on: line 280 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:removeObject(object, dont_close_if_empty, refund)
precondition: self.active_index has to correspond to the object to be removed
Parameters:
Name | Type | Description |
---|---|---|
object | ? | ? |
dont_close_if_empty | ? | ? |
refund | ? | ? |
Declared on: line 239 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:removeObjects(object_list, refund)
Parameters:
Name | Type | Description |
---|---|---|
object_list | ? | ? |
refund | ? | ? |
Declared on: line 290 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:resize(num_slots)
changes the window size and buttons to num_slots slots
Parameters:
Name | Type | Description |
---|---|---|
num_slots | ? | ? |
Declared on: line 91 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:selectObjectType(object_type)
Parameters:
Name | Type | Description |
---|---|---|
object_type | ? | ? |
Declared on: line 878 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:setActiveIndex(index)
Parameters:
Name | Type | Description |
---|---|---|
index | ? | ? |
Declared on: line 320 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:setBlueprintCell(x, y)
Parameters:
Name | Type | Description |
---|---|---|
x | ? | ? |
y | ? | ? |
Declared on: line 574 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:setOrientation(orient)
Parameters:
Name | Type | Description |
---|---|---|
orient | ? | ? |
Declared on: line 367 of Lua/dialogs/place_objects.lua.