FloorController
Summary
A remote control to interact with the floors.
Constructor
FloorController
Syntax
FloorController
-
core
Summary
Parameters:
-
core
CoreWanaplan Core.
Item Index
Methods
Methods
buildHTML
Syntax
buildHTML
()
Summary
Builds the HTML code for the component.
destroy
Syntax
destroy
()
Summary
Method called when the component is destroyeddisable
Syntax
disable
()
Summary
Disables the componentduplicateForFloor
Syntax
duplicateForFloor
-
options
Summary
Duplicates the current floor with the duplication rules chosen by the user.
options["walls"] = true => Keep the wall. options["objects"] = true => Keep the objects. etc...
Parameters:
-
options
ObjectThe different options set by the user.
enable
Syntax
enable
()
Summary
Enables the componentgetTargeted
Syntax
Summary
Finds out if the given position is over an element handled by the componentParameters:
-
vector
VectorA position, usually the cursor's one.
Returns:
initialize
Syntax
initialize
()
Summary
Method called when Wanaplan is initialized. You don't need to call this method manually.insertFloorBefore
Syntax
insertFloorBefore
-
floorIndex
-
beforeIndex
Summary
Inserts a floor before another.
For instance, you can move the 4th floor to the 1st floor, This will shift up every floor after the current 1st one, including the 1st.
onAddItemClick
Syntax
onAddItemClick
-
event
Summary
Opens a new window allowing to add a new floor and choose properties to clone from the floor below.
Triggered on click
on the "+" HTML element.
Parameters:
-
event
EventThe object associated with the event.
onAddItemConfirm
Syntax
onAddItemConfirm
-
event
-
options
Summary
Adds a new floor while duplicating the properties specified in the options.
Triggered on click
on the add button of the duplication window.
Parameters:
-
event
EventThe objet associated with the event.
-
options
ObjectThe different options set by the user.
onContextChanged
Syntax
onContextChanged
-
context
Summary
Method called when the context is switched (2D -> 3D or 3D -> 2D)Parameters:
-
context
StringThe new context
onContextMenuPropertyChanged
Syntax
onContextMenuPropertyChanged
-
target
-
property
-
value
Summary
Triggered when a floor property is changed in a context menu.
Parameters:
-
target
FloorStructureThe floor object.
-
property
StringThe property to change.
-
value
NumberThe new value of the property.
onItemClick
Syntax
onItemClick
-
event
Summary
Selects a chosen floor.
Triggered on event click
on the floor html element.
Parameters:
-
event
EventThe object associated to the event.
onItemContextMenu
Syntax
onItemContextMenu
-
event
Summary
Shows a context menu to change the floor parameters
Triggered on event click
on the "i" inside the floor html element.
Parameters:
-
event
EventThe object associated to the event.
onItemDelete
Syntax
onItemDelete
-
event
Summary
Deletes a floor.
Triggered on click
on the "x" inside the floor html element.
Parameters:
-
event
EventThe associated event.
removeHTML
Syntax
removeHTML
()
Summary
Removes the HTML code for the component.
selectFloor
Syntax
selectFloor
-
id
Summary
Selects a floor to display.
Parameters:
-
id
NumberThe id of the floor to select.
startListening
Syntax
startListening
()
Summary
Calls all the event listeners.stopListening
Syntax
stopListening
()
Summary
Removes all the event listeners.update
Syntax
update
()
Summary
Generic update method, called on every frameupdateHTML
Syntax
updateHTML
()
Summary
Updates the HTML element of the remote control.
Triggered on event wnp.structure.locale.loaded
Properties
priority
Syntax
priority
Number
Summary
Priority of the component in the "update" and "draw" routinesstructure
Syntax
structure
wnp.Structure
Summary
Structure file instance (shortcut to wanaplan.structure). This is the base object where the whole plan is savedEvents
wnp.request.floorAdded
Syntax
wnp.request.floorAdded
Summary
Fired when a floor needs to be added.
wnp.request.floorDeleted
Syntax
wnp.request.floorDeleted
Summary
Fired when a floor needs to be deleted.
wnp.request.floorSelected
Syntax
wnp.request.floorSelected
Summary
Fired when a floor needs to be selected.
wnp.request.floorSelected
Syntax
wnp.request.floorSelected
Summary
Fired when a floor needs to be selected.