优化 release_stage 加载机制

This commit is contained in:
cakipaul 2025-07-11 03:30:35 +08:00
parent e546aa2d95
commit c1362ebc06
4 changed files with 7 additions and 10 deletions

View File

@ -9,6 +9,10 @@ var archive: AssembledArchive:
if archive:
GlobalConfigManager.print_global_info()
print("use archive ", archive.resource_path)
archive.event_stage["release_stage"] = GlobalConfig.RELEASE_STAGE
print_rich("[color=brown] release_stage = %s[/color]" % GlobalConfig.RELEASE_STAGE)
# current archive
static var user_root_dir := "user://data/" # must end with "/"

View File

@ -77,6 +77,8 @@ func _ready() -> void:
printerr("[EventBinder] bind_enable is true but parent is null. path: %s" % get_path())
return
_local_updater_event_stage = EventManager.get_stage(updater_event)
if GlobalConfig.DEBUG:
print(updater_event, " updater stage:", _local_updater_event_stage)
_update_binding_state(_local_updater_event_stage)
EventManager.stage_updated.connect(_on_global_stage_updated)
if not trigger_event.is_empty():

View File

@ -4,14 +4,6 @@ extends Node
signal stage_updated(event_name: StringName, stage: int)
func _ready() -> void:
if Engine.is_editor_hint():
return
# 0demo 1release
set_stage("release_stage", GlobalConfig.RELEASE_STAGE)
print_rich("[color=brown] release_stage = %s[/color]" % GlobalConfig.RELEASE_STAGE)
func get_chapter_stage() -> int:
return get_stage("current_chapter_stage")

View File

@ -147,10 +147,9 @@ packed_scene = ExtResource("7_d27sg")
[node name="EventBinder" type="Node" parent="Ground/DeployLayer/Event2D放肉后/CloseupDemo公告"]
script = ExtResource("6_yaa68")
memo = "release_stage=[0:demo] 时,显示: [公告]
memo = "release_stage=[0:demo] 时,启用: [公告]
"
updater_event = &"release_stage"
updater_mode = "shower"
updater_stages = Array[int]([0])
metadata/_custom_type_script = "uid://0wjaho6qkg6s"