Merge remote-tracking branch 'origin/demo'
This commit is contained in:
commit
e546aa2d95
@ -64,7 +64,7 @@ class_name EventBinder extends Node
|
|||||||
if is_node_ready() and Engine.is_editor_hint():
|
if is_node_ready() and Engine.is_editor_hint():
|
||||||
_auto_memo()
|
_auto_memo()
|
||||||
|
|
||||||
var _local_enable_event_stage := 0
|
var _local_updater_event_stage := 0
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
@ -76,8 +76,8 @@ func _ready() -> void:
|
|||||||
if not parent:
|
if not parent:
|
||||||
printerr("[EventBinder] bind_enable is true but parent is null. path: %s" % get_path())
|
printerr("[EventBinder] bind_enable is true but parent is null. path: %s" % get_path())
|
||||||
return
|
return
|
||||||
_local_enable_event_stage = EventManager.get_stage(updater_event)
|
_local_updater_event_stage = EventManager.get_stage(updater_event)
|
||||||
_update_binding_state(_local_enable_event_stage)
|
_update_binding_state(_local_updater_event_stage)
|
||||||
EventManager.stage_updated.connect(_on_global_stage_updated)
|
EventManager.stage_updated.connect(_on_global_stage_updated)
|
||||||
if not trigger_event.is_empty():
|
if not trigger_event.is_empty():
|
||||||
# connect trigger_mode signal
|
# connect trigger_mode signal
|
||||||
@ -105,7 +105,7 @@ func _on_happened() -> void:
|
|||||||
|
|
||||||
func _on_global_stage_updated(e: StringName, s: int):
|
func _on_global_stage_updated(e: StringName, s: int):
|
||||||
if e == updater_event:
|
if e == updater_event:
|
||||||
_local_enable_event_stage = s
|
_local_updater_event_stage = s
|
||||||
_update_binding_state(s)
|
_update_binding_state(s)
|
||||||
|
|
||||||
|
|
||||||
@ -132,13 +132,18 @@ func _update_binding_state(stage: int):
|
|||||||
|
|
||||||
func _toggle_parent_visibility_with_ease(parent, show: bool):
|
func _toggle_parent_visibility_with_ease(parent, show: bool):
|
||||||
if parent is CanvasItem:
|
if parent is CanvasItem:
|
||||||
parent.visible = true
|
if updater_ease_duration > 0.0:
|
||||||
parent.modulate.a = 0.0 if show else 1.0
|
if show:
|
||||||
var target_a = 1.0 if show else 0.0
|
parent.show()
|
||||||
var tween = create_tween()
|
var original_a = parent.modulate.a
|
||||||
tween.tween_property(parent, "modulate:a", target_a, updater_ease_duration)
|
var target_a = 1.0 if show else 0.0
|
||||||
if not show:
|
var tween = create_tween()
|
||||||
tween.tween_callback(parent.hide)
|
tween.tween_property(parent, "modulate:a", target_a, updater_ease_duration)
|
||||||
|
if not show:
|
||||||
|
tween.tween_callback(parent.hide)
|
||||||
|
tween.tween_callback(func(): parent.modulate.a = original_a)
|
||||||
|
else:
|
||||||
|
parent.visible = show
|
||||||
|
|
||||||
|
|
||||||
func _auto_detect_mode():
|
func _auto_detect_mode():
|
||||||
|
Loading…
Reference in New Issue
Block a user