API Docs for: 2.7.3
Show:

NewComponent Class

Module: Component
Parent Module: Wanaplan

This component is responsible for creating new plans.

Constructor

NewComponent

(
  • core
)

Parameters:

  • core Core

    The main engine.

Methods

createNewPlan

()

Creates a new plan.

destroy

()

Inherited from BaseComponent2D

Called when the component is destroyed. The menu item is removed.

disable

()

Inherited from BaseComponent2D:

Disables the component

enable

()

Inherited from BaseComponent2D:

Enables the component

getTargeted

(
  • vector
)
Object

Inherited from BaseComponent2D:

Finds out if the given position is over an element handled by the component

Parameters:

  • vector Vector

    A position, usually the cursor's one.

Returns:

Object:

The targeted element, or null if nothing is found.

initialize

()

Inherited from BaseComponent2D

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
)

Inherited from BaseComponent2D:

Method called when the context is switched (2D -> 3D or 3D -> 2D)

Parameters:

  • context String
    The new context

startListening

()

Inherited from BaseComponent2D:

Calls all the event listeners.

stopListening

()

Inherited from BaseComponent2D:

Removes all the event listeners.

update

()

Inherited from BaseComponent2D:

Generic update method, called on every frame

Properties

name

String

Inherited from BaseComponent2D:

Component name

priority

Number

Inherited from BaseComponent2D:

Priority of the component in the "update" and "draw" routines

structure

wnp.Structure

Inherited from BaseComponent2D:

Structure file instance (shortcut to wanaplan.structure). This is the base object where the whole plan is saved

Events

wnp.menu.top.add

Inherited from BaseTopMenuComponent2D:

Fired to add a menu item into the top menu.

wnp.menu.top.delete

Inherited from BaseTopMenuComponent2D:

Fired to delete a menu item from the top menu.

wnp.menu.top.sub.add

Inherited from BaseTopMenuComponent2D:

Fired to add a menu item into the sub menu.

wnp.menu.top.sub.delete

Inherited from BaseTopMenuComponent2D:

Fired to delete a menu item from the sub menu.

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.