Skip to content

LocalEventPanel ​

Inherits: VBoxContainer

The Local Events tab: the small events of the world you have open. Each rule is a When (what sets it off), an optional If and a Then (what it does), made from short menus of the common things ("A switch is turned on", "Open a door") and pointed at objects by clicking them in the 3D view. A rule is a node of the world scene (LocalEvent, in the LocalEvents container); the list shows every rule of the scene, a row for each cause, condition and effect with the name of what it points at. Everything is one step of Undo and marks the scene as changed. More... in every menu opens the full list of the event editor. See docs: Events > Local events.

Variables ​

EditorPluginpluginnull
DialogManagerdialog_managernull
EditorUndoRedoManagerundo_redonull
Nodeworld_scenenull
LocalEventcurrent_rulenull
intcurrent_side-1
intcurrent_index-1
boolshow_all_wiresfalse
Resourcepick_unitnull
LocalEventpick_rulenull
Labeltitle_label
Labelstatus_label
Treetree
RichTextLabeldetails
LineEditname_input
CheckBoxenabled_check
CheckBoxonce_check
CheckBoxwires_check
MenuButtonnew_button
Buttonduplicate_button
Buttondelete_button
Dictionaryadd_buttons{}
Buttonedit_button
Buttonpick_button
Buttonremove_button
Buttonup_button
Buttonpromote_button
ConfirmationDialogpromote_dialog
Dictionaryproblems{}
Buttondown_button
PopupMenucontext_menu
EventTypeManagertype_managernull

Methods ​

voidload_scene( root: Node )
voidtick()
voidselect_rule( rule: LocalEvent )
voidrefresh_list()
Stringrule_text( rule: LocalEvent )
Stringunit_text( unit: Resource )
Resourcechosen_unit()
Stringrule_details( rule: LocalEvent, unit: Resource )
LocalEventnew_rule( recipe: Dictionary = {} )
voidduplicate_rule()
voiddelete_rule()
voidfinish_edit( rule: LocalEvent, action_name: String, before: Dictionary )
voidapply_state( rule: LocalEvent, state: Dictionary )
voidrename_rule( rule: LocalEvent, new_name: String )
voidset_rule_enabled( rule: LocalEvent, on: bool )
voidset_rule_run_once( rule: LocalEvent, on: bool )
Resourceadd_entry( side: int, entry: Dictionary )
Resourceadd_unit( side: int, unit: Resource )
voidremove_row( rule: LocalEvent, side: int, index: int )
voidmove_row( rule: LocalEvent, side: int, index: int, delta: int )
voidedit_row( rule: LocalEvent, side: int, index: int )
voidrequest_more( side: int )
voidstart_pick( rule: LocalEvent, unit: Resource )
voidstop_pick()
boolpick_target( candidate: Dictionary )
boolpick_place( place: Vector3 )
boolbuild_menu( entry: Dictionary )
Dictionaryget_draw_state( rule: LocalEvent )
Arrayproblems_of( rule: LocalEvent, side: int, index: int )
voidrequest_promote()
Eventpromote_rule()

Signals ​

draw_state_changed() ​

The viewport has to draw again (the wires of the rules)

Enumerations ​

enum MenuID ​

What the right click menu of a row does

  • EDIT = 0
  • PICK = 1
  • DELETE = 2
  • MOVE_UP = 3
  • MOVE_DOWN = 4
  • DUPLICATE = 5
  • RENAME = 6
  • ENABLE = 7

Variable descriptions ​

EditorPlugin plugin = null ​

No description yet.

DialogManager dialog_manager = null ​

No description yet.

EditorUndoRedoManager undo_redo = null ​

No description yet.

Node world_scene = null ​

The world scene that is open (null when the open scene is not a world)

LocalEvent current_rule = null ​

The rule chosen in the list (null = none)

int current_side = -1 ​

The row chosen inside the rule: its side (LocalEventPalette.Side, -1 = the rule itself) and its place

int current_index = -1 ​

No description yet.

bool show_all_wires = false ​

No description yet.

Resource pick_unit = null ​

The row that waits for a click in the viewport, and what it wants

LocalEvent pick_rule = null ​

No description yet.

Label title_label ​

No description yet.

Label status_label ​

No description yet.

Tree tree ​

No description yet.

RichTextLabel details ​

No description yet.

LineEdit name_input ​

No description yet.

CheckBox enabled_check ​

No description yet.

CheckBox once_check ​

No description yet.

CheckBox wires_check ​

No description yet.

MenuButton new_button ​

No description yet.

Button duplicate_button ​

No description yet.

Button delete_button ​

No description yet.

Dictionary add_buttons = ​

LocalEventPalette.Side -> MenuButton

Button edit_button ​

No description yet.

Button pick_button ​

No description yet.

Button remove_button ​

No description yet.

Button up_button ​

No description yet.

Button promote_button ​

No description yet.

ConfirmationDialog promote_dialog ​

No description yet.

Dictionary problems = ​

The problems of every rule of the scene (LocalEventCheck.check_scene): local_id -> [problems]

Button down_button ​

No description yet.

PopupMenu context_menu ​

No description yet.

EventTypeManager type_manager = null ​

No description yet.

Method descriptions ​

void load_scene( root: Node ) ​

The scene that is open: a world scene shows its rules, any other scene shows nothing

void tick() ​

Called now and then by the plugin: the open scene changed, or rules were added or removed outside the tab

void select_rule( rule: LocalEvent ) ​

The rule of the scene that is chosen in the editor's own selection (a rule picked in the 3D view is chosen in the tab)

void refresh_list() ​

No description yet.

String rule_text( rule: LocalEvent ) ​

The line of a rule in the list

String unit_text( unit: Resource ) ​

The line of a row: what it is, and what it points at

Resource chosen_unit() ​

No description yet.

String rule_details( rule: LocalEvent, unit: Resource ) ​

The text of the details for a rule (and the row chosen in it)

LocalEvent new_rule( recipe: Dictionary = {} ) ​

Makes a rule (empty, or from a recipe of the palette) and chooses it. One step of Undo

void duplicate_rule() ​

No description yet.

void delete_rule() ​

No description yet.

void finish_edit( rule: LocalEvent, action_name: String, before: Dictionary ) ​

A change to a rule: it is one step of Undo (before is what LocalEventEditing.capture found before), the list shows it and the scene is marked changed

void apply_state( rule: LocalEvent, state: Dictionary ) ​

Puts a rule back as a state of capture (Undo and Redo)

void rename_rule( rule: LocalEvent, new_name: String ) ​

No description yet.

void set_rule_enabled( rule: LocalEvent, on: bool ) ​

No description yet.

void set_rule_run_once( rule: LocalEvent, on: bool ) ​

No description yet.

Resource add_entry( side: int, entry: Dictionary ) ​

Adds the row of a palette entry to the chosen rule

Resource add_unit( side: int, unit: Resource ) ​

No description yet.

void remove_row( rule: LocalEvent, side: int, index: int ) ​

No description yet.

void move_row( rule: LocalEvent, side: int, index: int, delta: int ) ​

No description yet.

void edit_row( rule: LocalEvent, side: int, index: int ) ​

The window with every setting of a row (the same as the event editor's)

void request_more( side: int ) ​

More...: the full list of triggers, conditions or actions of the event editor

void start_pick( rule: LocalEvent, unit: Resource ) ​

The row waits for a click on the thing it is about

void stop_pick() ​

No description yet.

bool pick_target( candidate: Dictionary ) ​

The row is about a thing: its number is set (one step of Undo), and the rule moves to it when it is still where it was made

bool pick_place( place: Vector3 ) ​

A place of the ground was clicked for a row about a place

bool build_menu( entry: Dictionary ) ​

Fills the right click menu for a row (false when the row has none)

Dictionary get_draw_state( rule: LocalEvent ) ​

The answer to the gizmo: what to draw for a rule (empty = nothing)

Array problems_of( rule: LocalEvent, side: int, index: int ) ​

The problems of a rule (side -1: the rule itself) or of one of its rows

void request_promote() ​

Asks whether to make a global event of the chosen rule

Event promote_rule() ​

Makes the global event and takes the rule out of the world