Skip to content

Commit ffd33b3

Browse files
committed
Make timeline the default value for EventManager node.timeline
1 parent 47b83b8 commit ffd33b3

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

nodes/editor/timeline_editor/event_timeline_editor.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ func _update_history() -> void:
108108

109109
_history_popup_menu.clear()
110110
for res in refs:
111+
if res == null:
112+
continue
111113
_path = "%s | [%s]"%[res.resource_name,res.resource_path]
112114
_history_popup_menu.add_item(_path)
113115

nodes/event_manager/event_manager.gd

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ signal timeline_finished(timeline_resource)
1313
export(NodePath) var event_node_path:NodePath = "."
1414
export(bool) var start_on_ready:bool = false
1515

16-
export(Resource) var timeline
16+
var timeline
1717

1818
func _ready() -> void:
1919
if Engine.editor_hint:
@@ -90,3 +90,21 @@ func _notify_timeline_end() -> void:
9090

9191
func _hide_script_from_inspector():
9292
return true
93+
94+
95+
func _get_property_list() -> Array:
96+
var p := []
97+
p.append({"type":TYPE_OBJECT, "name":"timeline", "usage":PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_SCRIPT_VARIABLE, "hint":PROPERTY_HINT_RESOURCE_TYPE, "hint_string":"Resource"})
98+
return p
99+
100+
101+
func property_can_revert(property:String) -> bool:
102+
if property == "timeline":
103+
return true
104+
return false
105+
106+
107+
func property_get_revert(property:String):
108+
if property == "timeline":
109+
var tmln := Timeline.new()
110+
return tmln

resources/registered_events/registered_events.tres

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[gd_resource type="Resource" load_steps=12 format=2]
1+
[gd_resource type="Resource" load_steps=13 format=2]
22

33
[ext_resource path="res://addons/event_system_plugin/resources/registered_events/_.gd" type="Script" id=1]
44
[ext_resource path="res://addons/event_system_plugin/events/comment.gd" type="Script" id=2]

0 commit comments

Comments
 (0)