NewComponent Class
This component is responsible for creating new plans.
Constructor
NewComponent
(
-
core
Parameters:
-
core
CoreThe main engine.
Item Index
Methods
Methods
createNewPlan
()
Creates a new plan.
destroy
()
Called when the component is destroyed. The menu item is removed.
disable
()
Disables the component
enable
()
Enables the component
getTargeted
(
Object
-
vector
Finds out if the given position is over an element handled by the component
Parameters:
-
vector
VectorA position, usually the cursor's one.
Returns:
Object:
The targeted element, or null if nothing is found.
initialize
()
Initializes the component by adding a new entry in the top menu.
launchProcess
()
Launches the creation of a new plan. It destroys the previous one, but saves the history.
Triggered on event wnp.request.newPlan
onContextChanged
(
-
context
Method called when the context is switched (2D -> 3D or 3D -> 2D)
Parameters:
-
context
StringThe new context
startListening
()
Calls all the event listeners.
stopListening
()
Removes all the event listeners.
update
()
Generic update method, called on every frame
Properties
structure
wnp.Structure
Structure file instance (shortcut to wanaplan.structure).
This is the base object where the whole plan is saved
Events
wnp.request.closePopup
Fired to close a popup.
wnp.request.newPlan
Fired when a new plan needs to be created.
wnp.request.newPlanReady
Fired when a new plan is ready.
wnp.request.saveStructure
Fired to request the save of a structure.