UIPlaceObjects Class
The dialog shown when placing objects.
Inheritance: UIPlaceObjects ยป Window
Subclasses: UIEditRoom
Method Index
- _isNonSideObjectPlacementValid(x, y, object, object_orientation, room_id)
- _isSideObjectPlacementValid(x, y, room_id, passable_flag, map)
- _placementAvailableHereAndOtherObjectsDoNotInterfere(x, y, object, real_obj, object_footprint, room, map)
- _setBlueprintPartialFlags(x, y, map, valid_placement)
- addBevelPanel(x, y, w, h, colour, highlight_colour, shadow_colour, disabled_colour, lowered_colour, apply_ui_scale) (inherited from Window)
- addColourPanel(x, y, w, h, r, g, b, apply_ui_scale) (inherited from Window)
- addKeyHandler(key, handler, ...) (inherited from Window)
- addObjects(object_list, pay_for)
- addPanel(sprite_index, x, y, w, h, apply_ui_scale, draw_flags) (inherited from Window)
- addWindow(window) (inherited from Window)
- afterLoad(old, new) (overrides Window:afterLoad)
- beginDrag(x, y) (inherited from Window)
- bringToTop() (inherited from Window)
- calculateBestPlacementPosition(x, y)
- cancel()
- clearBlueprint()
- close(move_canceled) (overrides Window:close)
- draw(canvas, x, y) (overrides Window:draw)
- getRealXY() (inherited from Window)
- 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)
- hoverTest(active_hover, mouse_x, mouse_y, min_x, max_x, min_y, max_y) (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)
- makeHotkeyBoxOnPanel(panel, confirm_callback, abort_callback) (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, apply_ui_scale) (inherited from Window)
- mustPause() (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) (overrides Window:onMouseMove)
- onMouseUp(button, x, y) (overrides Window:onMouseUp)
- onMouseWheel(x, y) (inherited from Window)
- onTick() (inherited from Window)
- onWorldTick() (inherited from Window)
- placeObject(dont_close_if_empty, dont_remove)
- registerKeyHandlers()
- removeAllObjects(move_canceled)
- removeAllPanels() (inherited from Window)
- removeKeyHandler(keys) (inherited from Window)
- removeObject(object, dont_close_if_empty, placed, move_canceled)
- removeObjects(object_list)
- removeWindow(window) (inherited from Window)
- resize(num_slots)
- selectObjectType(object_type)
- sell()
- 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)
- setSize(width, height, apply_ui_scale) (inherited from Window)
- startButtonBlinking(button_index) (inherited from Window)
- stopButtonBlinking() (inherited from Window)
- tryNextOrientation()
- undo()
Member Index
- active_button (*)
- active_hover_index
- active_index
- active_scrollbar (*)
- anims
- apply_ui_scale (*)
- blink_counter (*)
- blinking_button (*)
- blue_font
- btn_repeat_delay (*)
- buttons
- buttons_down (*)
- closed (*)
- confirm
- confirm_button
- cursor_x (*)
- cursor_y (*)
- default_button_sound (*)
- desc_text
- draggable (*)
- dragging (*)
- height
- hotkeyboxes (*)
- hover_sound
- 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 36 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:_isNonSideObjectPlacementValid(x, y, object, object_orientation, room_id)
param room_id (integer) room id if we in a build mode.
return (bool) is this placement not going to break path finding.
Parameters:
| Name | Type | Description |
|---|---|---|
| x | ? | ? |
| y | ? | ? |
| object | ? | ? |
| object_orientation | ? | ? |
| room_id | ? | ? |
Declared on: line 864 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:_isSideObjectPlacementValid(x, y, room_id, passable_flag, map)
param map (object) map class instance.
return (bool) is this placement not going to break path finding.
Parameters:
| Name | Type | Description |
|---|---|---|
| x | ? | ? |
| y | ? | ? |
| room_id | ? | ? |
| passable_flag | ? | ? |
| map | ? | ? |
Declared on: line 924 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:_placementAvailableHereAndOtherObjectsDoNotInterfere(x, y, object, real_obj, object_footprint, room, map)
Function checks whether this space is available for placing an object and
whether the space is not occupied by other objects.
Parameters:
| Name | Type | Description |
|---|---|---|
| x | ? | ? |
| y | ? | ? |
| object | ? | ? |
| real_obj | ? | ? |
| object_footprint | ? | ? |
| room | ? | ? |
| map | ? | ? |
Declared on: line 733 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:_setBlueprintPartialFlags(x, y, map, valid_placement)
Parameters:
| Name | Type | Description |
|---|---|---|
| x | ? | ? |
| y | ? | ? |
| map | ? | ? |
| valid_placement | ? | ? |
Declared on: line 1021 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:addObjects(object_list, pay_for)
Parameters:
| Name | Type | Description |
|---|---|---|
| object_list | ? | ? |
| pay_for | ? | ? |
Declared on: line 165 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:afterLoad(old, new)
Parameters:
| Name | Type | Description |
|---|---|---|
| old | ? | ? |
| new | ? | ? |
Overrides: Window:afterLoad.
Declared on: line 1118 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:calculateBestPlacementPosition(x, y)
Parameters:
| Name | Type | Description |
|---|---|---|
| x | ? | ? |
| y | ? | ? |
Declared on: line 1051 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:close(move_canceled)
Close menu.
Parameters:
| Name | Type | Description |
|---|---|---|
| move_canceled | bool | moving objects has been cancelled. |
Overrides: Window:close.
Declared on: line 344 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 596 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:onCursorWorldPositionChange(x, y)
Parameters:
| Name | Type | Description |
|---|---|---|
| x | ? | ? |
| y | ? | ? |
Overrides: Window:onCursorWorldPositionChange.
Declared on: line 1085 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:onMouseMove(x, y, dx, dy)
Parameters:
| Name | Type | Description |
|---|---|---|
| x | ? | ? |
| y | ? | ? |
| dx | ? | ? |
| dy | ? | ? |
Overrides: Window:onMouseMove.
Declared on: line 648 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 498 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:placeObject(dont_close_if_empty, dont_remove)
Parameters:
| Name | Type | Description |
|---|---|---|
| dont_close_if_empty | ? | ? |
| dont_remove | ? | ? |
Declared on: line 531 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:registerKeyHandlers()
Declared on: line 93 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:removeAllObjects(move_canceled)
Remove all items from the menu.
Parameters:
| Name | Type | Description |
|---|---|---|
| move_canceled | bool | moving objects has been cancelled. |
Declared on: line 314 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:removeObject(object, dont_close_if_empty, placed, move_canceled)
precondition: self.active_index has to correspond to the object to be removed
Parameters:
| Name | Type | Description |
|---|---|---|
| object | ? | ? |
| dont_close_if_empty | ? | ? |
| placed | ? | ? |
| move_canceled | ? | ? |
Declared on: line 244 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:removeObjects(object_list)
Parameters:
| Name | Type | Description |
|---|---|---|
| object_list | ? | ? |
Declared on: line 326 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 100 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:selectObjectType(object_type)
Parameters:
| Name | Type | Description |
|---|---|---|
| object_type | ? | ? |
Declared on: line 1109 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:sell()
Helper function to stop UIEditRoom going back to doors phase
Declared on: line 358 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:setActiveIndex(index)
Parameters:
| Name | Type | Description |
|---|---|---|
| index | ? | ? |
Declared on: line 369 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:setBlueprintCell(x, y)
at the given coordinates or not. A gray blueprint means placement is prohibited.
A colored blueprint means placement is permitted.
Parameters:
| Name | Type | Description |
|---|---|---|
| x | ? | ? |
| y | ? | ? |
Declared on: line 692 of Lua/dialogs/place_objects.lua.
function UIPlaceObjects:setOrientation(orient)
Parameters:
| Name | Type | Description |
|---|---|---|
| orient | ? | ? |
Declared on: line 417 of Lua/dialogs/place_objects.lua.