4 var parent_resource: DialogicChoiceEvent = null
6 func refresh() -> void:
7 $AddChoice.icon = get_theme_icon("Add", "EditorIcons")
9 if parent_resource is DialogicChoiceEvent:
11 if len(parent_resource.text) > 12:
12 $Label.text = "End of choice ("+parent_resource.text.substr(0,12)+"...)"
14 $Label.text = "End of choice ("+parent_resource.text+")"
19 func _on_add_choice_pressed() -> void:
20 var timeline := find_parent('VisualEditor')
22 var resource := DialogicChoiceEvent.new()
23 resource.created_by_button = true
24 timeline.add_event_undoable(resource, get_parent().get_index()+1)
25 timeline.indent_events()
26 timeline.something_changed()
27 # Prevent focusing on future redos
28 resource.created_by_button = false