CorsixTH Lua Documentation

UIPlaceObjects Class

The dialog shown when placing objects.

Declared on: line 30 of Lua/dialogs/place_objects.lua.
Inheritance: UIPlaceObjects ยป Window
Subclasses: UIEditRoom

Method Index

Member Index

(*) only used in superclass methods
function UIPlaceObjects:UIPlaceObjects(ui, object_list, pay_for)

Constructor for the class.

Parameters:

NameTypeDescription
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:

NameTypeDescription
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:

NameTypeDescription
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:

NameTypeDescription
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:

NameTypeDescription
x ? ?
y ? ?
map ? ?
valid_placement ? ?

Declared on: line 1021 of Lua/dialogs/place_objects.lua.

function UIPlaceObjects:addObjects(object_list, pay_for)

Parameters:

NameTypeDescription
object_list ? ?
pay_for ? ?

Declared on: line 165 of Lua/dialogs/place_objects.lua.

function UIPlaceObjects:afterLoad(old, new)

Parameters:

NameTypeDescription
old ? ?
new ? ?

Overrides: Window:afterLoad.
Declared on: line 1118 of Lua/dialogs/place_objects.lua.

function UIPlaceObjects:close(move_canceled)

Close menu.

Parameters:

NameTypeDescription
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:

NameTypeDescription
canvas ? ?
x ? ?
y ? ?

Overrides: Window:draw.
Declared on: line 596 of Lua/dialogs/place_objects.lua.

function UIPlaceObjects:onMouseMove(x, y, dx, dy)

Parameters:

NameTypeDescription
x ? ?
y ? ?
dx ? ?
dy ? ?

Overrides: Window:onMouseMove.
Declared on: line 648 of Lua/dialogs/place_objects.lua.

function UIPlaceObjects:onMouseUp(button, x, y)

Parameters:

NameTypeDescription
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:

NameTypeDescription
dont_close_if_empty ? ?
dont_remove ? ?

Declared on: line 531 of Lua/dialogs/place_objects.lua.

function UIPlaceObjects:removeAllObjects(move_canceled)

Remove all items from the menu.

Parameters:

NameTypeDescription
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:

NameTypeDescription
object ? ?
dont_close_if_empty ? ?
placed ? ?
move_canceled ? ?

Declared on: line 244 of Lua/dialogs/place_objects.lua.

function UIPlaceObjects:removeObjects(object_list)

Parameters:

NameTypeDescription
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:

NameTypeDescription
num_slots ? ?

Declared on: line 100 of Lua/dialogs/place_objects.lua.

function UIPlaceObjects:selectObjectType(object_type)

Parameters:

NameTypeDescription
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:

NameTypeDescription
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:

NameTypeDescription
x ? ?
y ? ?

Declared on: line 692 of Lua/dialogs/place_objects.lua.

function UIPlaceObjects:setOrientation(orient)

Parameters:

NameTypeDescription
orient ? ?

Declared on: line 417 of Lua/dialogs/place_objects.lua.