3 ## A scene shown at the end of events that contain other events
5 var resource: DialogicEndBranchEvent
8 var parent_node: Control = null
9 var end_control: Control = null
13 var current_indent_level := 1
17 func _ready() -> void:
18 $Icon.icon = get_theme_icon("GuiSpinboxUpdown", "EditorIcons")
19 $Spacer.custom_minimum_size.x = 90 * DialogicUtil.get_editor_scale()
24 ## Called by the visual timeline editor
25 func visual_select() -> void:
26 modulate = get_theme_color("highlighted_font_color", "Editor")
30 ## Called by the visual timeline editor
31 func visual_deselect() -> void:
32 if !parent_node:return
34 modulate = parent_node.resource.event_color.lerp(get_theme_color("font_color", "Editor"), 0.3)
37 func is_selected() -> bool:
41 ## Called by the visual timeline editor
42 func highlight() -> void:
43 if !parent_node:return
44 modulate = parent_node.resource.event_color.lerp(get_theme_color("font_color", "Editor"), 0.6)
47 ## Called by the visual timeline editor
48 func unhighlight() -> void:
49 modulate = parent_node.resource.event_color
52 func update_hidden_events_indicator(hidden_events_count:int = 0) -> void:
53 $HiddenEventsLabel.visible = hidden_events_count > 0
54 if hidden_events_count == 1:
55 $HiddenEventsLabel.text = "[1 event hidden]"
57 $HiddenEventsLabel.text = "["+str(hidden_events_count)+ " events hidden]"
60 ## Called by the visual timeline editor
61 func set_indent(indent: int) -> void:
62 $Indent.custom_minimum_size = Vector2(indent_size * indent * DialogicUtil.get_editor_scale(), 0)
63 $Indent.visible = indent != 0
64 current_indent_level = indent
68 ## Called by the visual timeline editor if something was edited on the parent event block
69 func parent_node_changed() -> void:
70 if parent_node and end_control and end_control.has_method('refresh'):
74 ## Called on creation if the parent event provides an end control
75 func add_end_control(control:Control) -> void:
79 control.size_flags_vertical = SIZE_SHRINK_CENTER
80 if "parent_resource" in control:
81 control.parent_resource = parent_node.resource
82 if control.has_method('refresh'):