BehaviorTemplateDialog ​
Inherits: ConfirmationDialog
The window of "Add from template or copy": a list of starting points (the templates that come with the toolkit and the ones you saved) and of the schedules of other NPCs and behaviour scripts. Choose one and press Add: a template is added with its places relative to where the NPC is placed; a schedule of another NPC or script is copied either keeping its places in the world or making them relative to the NPC. The window only chooses: it gives the choice to whoever listens to chosen (the Behaviour tab does the adding, as one step of Undo). kind "template" {"script": the template} kind "copy" {"script": the source script, "index": the schedule, "origin": where the source NPC is placed, "places": BehaviorTemplates.Places}
Variables ​
Tree | tree | |
Label | description_label | |
Label | places_label | |
OptionButton | places_option | |
Button | delete_button |
Methods ​
void | open( npc: Node, target: ModularBehaviorScript ) |
void | fill( npc: Node, target: ModularBehaviorScript ) |
Array[Dictionary] | other_npcs( npc: Node, target: ModularBehaviorScript ) static |
Dictionary | choice() |
Signals ​
chosen( kind: String, data: Dictionary ) ​
template_delete_requested( template: ModularBehaviorScript ) ​
The user wants a template of theirs deleted from the database
Variable descriptions ​
Tree tree ​
No description yet.
Label description_label ​
No description yet.
Label places_label ​
No description yet.
OptionButton places_option ​
No description yet.
Button delete_button ​
No description yet.
Method descriptions ​
void open( npc: Node, target: ModularBehaviorScript ) ​
Opens the window for an NPC: target is the script the choice will go into (the NPC's own), npc is the NPC (it is left out of the sources)
void fill( npc: Node, target: ModularBehaviorScript ) ​
Fills the list: the templates, then the other NPCs of the scene with the schedules of their scripts, then the other behaviour scripts of the database
Array[Dictionary] other_npcs( npc: Node, target: ModularBehaviorScript ) ​
The other placed NPCs of the scene that have a script with schedules: [{"name", "script", "origin"}]
Dictionary choice() ​
What is chosen in the list: {"kind", ...} (see the top of the file), {} when nothing