From 3ca04376514af16a8235f789d97ddcf2faa86d71 Mon Sep 17 00:00:00 2001 From: cakipaul Date: Tue, 15 Jul 2025 16:14:30 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E4=BC=98=E5=8C=96=20archive=20=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/archive_manager/archive_manager.gd | 29 ++++++++++++++-------- scene/index_page.gd | 4 +-- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/manager/archive_manager/archive_manager.gd b/manager/archive_manager/archive_manager.gd index b51eeba9..3afa75fb 100644 --- a/manager/archive_manager/archive_manager.gd +++ b/manager/archive_manager/archive_manager.gd @@ -12,12 +12,13 @@ var archive: AssembledArchive: # current archive static var user_root_dir := "user://data/" # must end with "/" -static var archive_dir := "user://data/archives/" +static var archive_dir := "user://data/archives_dict/" static var archive_prefix := "save" const CURRENT_VERSION = 6 -var archives := {} +var archives_dict: Dictionary[int, AssembledArchive] = {} +var archives_notes_dict: Dictionary[int, String] = {} var autosave_timer := Timer.new() @@ -35,7 +36,7 @@ func _ready() -> void: load_config() # 在 debug or editor 模式下,直接保证有 archive if GlobalConfig.DEBUG or Engine.is_editor_hint(): - if archives.size() == 0: + if archives_dict.size() == 0: create_and_use_new_archive(0) else: # debug 模式下默认使用 0 号存档 @@ -60,7 +61,7 @@ func _on_archive_id_changed(): # print("_on_archive_id_changed same id=", selected_id) # return print("_on_archive_id_changed id=", selected_id) - if not archives.has(selected_id): + if not archives_dict.has(selected_id): print("新建存档 ", selected_id) create_and_use_new_archive(selected_id) # 已创建新存档 [ID:ui_new_archive] @@ -119,7 +120,10 @@ func _check_dirs_and_archives() -> bool: # get archive number for file in files: if file.begins_with(archive_prefix) and file.ends_with(GlobalConfig.RES_FILE_FORMAT): - var id_str = file.get_basename().substr(archive_prefix.length()).strip_escapes() + # format: save012_xxxxx; save000 + var id_and_note = file.get_basename().substr(archive_prefix.length()).strip_escapes().split("_", true, 1) + var id_str = id_and_note[0] + var note_str = id_and_note[1] if id_and_note.size() >= 2 else (archive_prefix + id_str) # 非三位数的 id 会被忽略 if id_str.length() != 3: continue @@ -127,13 +131,14 @@ func _check_dirs_and_archives() -> bool: # 读取范围是 0-99 if id < 0 or id > 99: continue + archives_notes_dict[id] = note_str var path = archive_dir + file - if not archives.has(id): + if not archives_dict.has(id): var res = ResourceLoader.load( path, "AssembledArchive", ResourceLoader.CACHE_MODE_REPLACE_DEEP ) if is_instance_valid(res) and res.version >= CURRENT_VERSION: - archives[id] = res + archives_dict[id] = res else: printerr("SKIP INVALID ARCHIVE! file=", file) return true @@ -173,7 +178,7 @@ func _create_and_save_new_archive_resoure(id, take_over_path = false) -> void: archive.archive_id = id archive.created_time = Time.get_datetime_string_from_system(false, true) ResourceSaver.save(archive, archive_path) - archives[id] = archive + archives_dict[id] = archive # 超过 999 个存档会出问题;不过这个游戏不会有这么多存档 @@ -188,6 +193,10 @@ func _get_archive_path(id: int) -> String: return archive_dir + archive_prefix + id_str + GlobalConfig.RES_FILE_FORMAT +func allow_resume(id := 1) -> bool: + return archives_dict.has(id) + + func save_all() -> void: # save config var config = GlobalConfigManager.config @@ -238,10 +247,10 @@ func load_archive() -> void: # if archive and selected_id == archive.archive_id: # return print("load_archive ", selected_id) - if not archives.has(selected_id): + if not archives_dict.has(selected_id): _handle_load_error(str(selected_id) + " 号存档", "查找") return - archive = archives[selected_id] + archive = archives_dict[selected_id] # emit signal archive_loaded.emit() check_autosave_options() diff --git a/scene/index_page.gd b/scene/index_page.gd index 52762c52..d0e85a52 100644 --- a/scene/index_page.gd +++ b/scene/index_page.gd @@ -22,7 +22,7 @@ func _ready(): func _check_resume_btn(): - if not ArchiveManager.archives.has(1): + if not ArchiveManager.allow_resume(1): resume_btn.queue_free() @@ -37,7 +37,7 @@ func _on_resume_pressed(): sfx_click.global_play() # 继续一号存档 print("Resume Game") - if ArchiveManager.archives.has(1): + if ArchiveManager.allow_resume(1): # 设置 current_selected_archive_id 后,存档会自动加载 GlobalConfigManager.config.current_selected_archive_id = 1 else: From bc7c73ba69f3a5064ac9460f36764e1b3cc7fd3a Mon Sep 17 00:00:00 2001 From: cakipaul Date: Tue, 15 Jul 2025 18:37:00 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=90=AF=E5=8A=A8=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AF=AD=E8=A8=80=E8=AE=BE=E7=BD=AE=E9=80=89?= =?UTF-8?q?=E9=A1=B9;=20=E7=9B=92=E5=AD=90=E7=8C=AB=E4=BA=8C=E6=A5=BC?= =?UTF-8?q?=E7=8C=AA=E5=A4=B4=E6=80=AAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- asset/art/ui/index/佩戴耳机提示_下方无字.png | Bin 0 -> 16269 bytes .../ui/index/佩戴耳机提示_下方无字.png.import | 34 +++++ asset/dialogue/item_description.csv | 1 + asset/dialogue/item_description.dialogue | 2 + manager/config_manager/global_config.gd | 4 +- .../config_manager/global_config_manager.gd | 44 ++++-- scene/ground/scene/c02/s13_盒子猫二楼.gd | 2 +- scene/settings/settings.gd | 74 ++++++--- scene/settings/settings.tscn | 54 ++++++- scene/trailer.gd | 105 ++++++++++++- scene/trailer.tscn | 142 +++++++++++++++++- 11 files changed, 402 insertions(+), 60 deletions(-) create mode 100644 asset/art/ui/index/佩戴耳机提示_下方无字.png create mode 100644 asset/art/ui/index/佩戴耳机提示_下方无字.png.import diff --git a/asset/art/ui/index/佩戴耳机提示_下方无字.png b/asset/art/ui/index/佩戴耳机提示_下方无字.png new file mode 100644 index 0000000000000000000000000000000000000000..bad41cabb95af1c532ea88d737b0f4083f550e9f GIT binary patch literal 16269 zcmeHN^;Z^Aw;qd-P((md8l;s536U4Xrw_&B^8AiP(Zo_LAsHal$5@E zUcZ0gTlcQJcz+mY&YZL3*>R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zTOoEn!M>{!PRVbv1n~LQVSXEmk9#i`=Z8$Z; z^nMFJbK}Gvjmy2R>)cISv528rx~;CeHKx!YHCWEmyZw&T&Az{FSEpD+17Vx-Pl_+vvGwykrhMkWm7q}f7HL98;-G@%85;Jqh@|I zIwAF(!ewRKaL$weFMMuUz;bu1`Q>GY1zF=?3uGpbqC|s}*Cf+rbvHLi)$Lm53Ev4Bdhqo__Z}%_WZOh8y%u8>zY!e z#jvedIqi$s7jsJDIabyxSSd^>?DwP`L*5V z(k2xfDPv$+Zq@>&FoeSkA**&<(t!~Cp9R#T@8JRrDiS8jaG>{TY+mqd1FiSb~ z3APz(j!?lVi1Ya266`PN0NT*sJZ5xRmlwXy9Q}?EI6~kEfg=Qt5I92M2!SI6{+kG_ zjBbvFp$epb9QIc59r3UKCfG-^j}SOQ;QtN+zQ;|2H^$jl+pSQWl;qT9^JPpQ{tv void: update_locale(config.language, config.caption) -func update_locale(lang_id: int, caption_id: int): - # -1 null; 0 zh; 2 en - # var lang_id = language_options.selected - # zh: 0 _SH, 1 _CN; en: [null]; - # var caption_id = caption_options.selected - var lang = "" - match lang_id: - 0: - if caption_id == 0: - lang = "zh_SH" - elif caption_id == 1: - lang = "zh_CN" - 1: - lang = "en" +# -1 null; 0 zh; 1 en +var language_options = ["中文", "English"] +var caption_options_dict = {0: ["简体中文", "上海话"], 1: [""]} +var caption_loacles_dict = {0: ["zh_CN", "zh_SH"], 1: ["en"]} + + +# return example: "中文_简体中文" "English_" +func update_locale(lang_id: int, caption_id: int) -> void: + lang_id = wrapi(lang_id, 0, language_options.size()) + var caption_loacles = caption_loacles_dict.get(lang_id) + caption_id = wrapi(caption_id, 0, caption_loacles.size()) + var lang = caption_loacles[caption_id] GlobalConfigManager.config.language = lang_id GlobalConfigManager.config.caption = caption_id print("set language to: ", lang) TranslationServer.set_locale(lang) +func get_locale_language_name() -> String: + GlobalConfigManager.config.language = wrapi( + GlobalConfigManager.config.language, 0, language_options.size() + ) + return language_options[GlobalConfigManager.config.language] + + +func get_locale_caption_name() -> String: + GlobalConfigManager.config.language = wrapi( + GlobalConfigManager.config.language, 0, language_options.size() + ) + var caption_options = caption_options_dict.get(GlobalConfigManager.config.language) + GlobalConfigManager.config.caption = wrapi( + GlobalConfigManager.config.caption, 0, caption_options.size() + ) + return caption_options[GlobalConfigManager.config.caption] + + var _on_timer_timeout_counter := 0 diff --git a/scene/ground/scene/c02/s13_盒子猫二楼.gd b/scene/ground/scene/c02/s13_盒子猫二楼.gd index 74f3f711..0a656886 100644 --- a/scene/ground/scene/c02/s13_盒子猫二楼.gd +++ b/scene/ground/scene/c02/s13_盒子猫二楼.gd @@ -28,7 +28,7 @@ func knock_light_door(): boss = get_node_or_null("../DeployLayer/追猫猪头怪_右侧") if boss: boss.allow_restart_game = false - boss = get_node_or_null("追猫猪头怪_传送") + boss = get_node_or_null("../DeployLayer/追猫猪头怪_传送") if boss: boss.allow_restart_game = false do_knock_light_door.call_deferred() diff --git a/scene/settings/settings.gd b/scene/settings/settings.gd index 03b4f446..8356c5fd 100644 --- a/scene/settings/settings.gd +++ b/scene/settings/settings.gd @@ -8,9 +8,16 @@ const dialog_db_offset := -10.0 @onready var master_bus_slider = %HSliderMasterBus as HSlider @onready var sfx_bus_slider = %HSliderSfxBus as HSlider @onready var dialog_bus_slider = %HSliderDialogBus as HSlider -@onready var language_options = %OptionButtonLanguage as OptionButton -@onready var caption_box = %"字幕" as BoxContainer -@onready var caption_options = %OptionButtonCaption as OptionButton + +@onready var lang_label = %LangLabel as Label +@onready var lang_left_btn = %LangLeft as Button +@onready var lang_right_btn = %LangRight as Button + +@onready var caption_box = %CaptionBox as BoxContainer +@onready var caption_label = %CaptionLabel as Label +@onready var caption_left_btn = %CaptionLeft as Button +@onready var caption_right_btn = %CaptionRight as Button + @onready var os_auto_end = %OSAutoEnd as CheckBox @onready var os_wait_time_box = %OSWaitTimeBox as BoxContainer @onready var h_slider_os_wait_time = %HSliderOSWaitTime as HSlider @@ -60,14 +67,15 @@ func _ready(): master_bus_slider.value_changed.connect(_on_master_bus_slider_value_changed) sfx_bus_slider.value_changed.connect(_on_sfx_bus_slider_value_changed) dialog_bus_slider.value_changed.connect(_on_dialog_bus_slider_value_changed) - # language - language_options.selected = GlobalConfigManager.config.language - language_options.item_selected.connect(_on_language_or_caption_options_selected) - # caption - caption_options.selected = GlobalConfigManager.config.caption - caption_options.item_selected.connect(_on_language_or_caption_options_selected) - # setup language - _on_language_or_caption_options_selected() + # language & caption + lang_left_btn.pressed.connect(_on_lang_left_btn_pressed) + lang_right_btn.pressed.connect(_on_lang_right_btn_pressed) + caption_left_btn.pressed.connect(_on_caption_left_btn_pressed) + caption_right_btn.pressed.connect(_on_caption_right_btn_pressed) + # setup language & caption + lang_label.text = GlobalConfigManager.get_locale_language_name() + caption_label.text = GlobalConfigManager.get_locale_caption_name() + caption_box.visible = caption_label.text != "" # os auto finish os_auto_end.button_pressed = GlobalConfigManager.config.os_auto_end os_auto_end.toggled.connect(_on_os_auto_end_toggled) @@ -119,20 +127,36 @@ func _on_dialog_bus_slider_value_changed(value: float) -> void: AudioServer.set_bus_volume_db(AudioServer.get_bus_index("dialog"), db_value) -func _on_language_or_caption_options_selected(_id = null) -> void: - # -1 null; 0 zh; 2 en - var lang_id = language_options.selected - # zh: 0 _CN, _SH; en: [null]; - var caption_id = caption_options.selected - if lang_id != 0: - caption_box.hide() - language_options.focus_neighbor_bottom = os_auto_end.get_path() - os_auto_end.focus_neighbor_top = language_options.get_path() - else: - caption_box.show() - language_options.focus_neighbor_bottom = caption_options.get_path() - os_auto_end.focus_neighbor_top = caption_options.get_path() - GlobalConfigManager.update_locale(lang_id, caption_id) +func _on_lang_left_btn_pressed() -> void: + GlobalConfigManager.update_locale( + GlobalConfigManager.config.language - 1, GlobalConfigManager.config.caption + ) + lang_label.text = GlobalConfigManager.get_locale_language_name() + caption_label.text = GlobalConfigManager.get_locale_caption_name() + caption_box.visible = caption_label.text != "" + + +func _on_lang_right_btn_pressed() -> void: + GlobalConfigManager.update_locale( + GlobalConfigManager.config.language + 1, GlobalConfigManager.config.caption + ) + lang_label.text = GlobalConfigManager.get_locale_language_name() + caption_label.text = GlobalConfigManager.get_locale_caption_name() + caption_box.visible = caption_label.text != "" + + +func _on_caption_left_btn_pressed() -> void: + GlobalConfigManager.update_locale( + GlobalConfigManager.config.language, GlobalConfigManager.config.caption - 1 + ) + caption_label.text = GlobalConfigManager.get_locale_caption_name() + + +func _on_caption_right_btn_pressed() -> void: + GlobalConfigManager.update_locale( + GlobalConfigManager.config.language, GlobalConfigManager.config.caption + 1 + ) + caption_label.text = GlobalConfigManager.get_locale_caption_name() func _on_os_auto_end_toggled(is_pressed: bool) -> void: diff --git a/scene/settings/settings.tscn b/scene/settings/settings.tscn index 680767c1..c46cab8d 100644 --- a/scene/settings/settings.tscn +++ b/scene/settings/settings.tscn @@ -156,11 +156,31 @@ layout_mode = 2 theme_override_constants/separation = 31 theme_override_styles/separator = SubResource("StyleBoxEmpty_n2b1f") -[node name="OptionButtonLanguage" type="OptionButton" parent="MarginContainer/VBoxContainer/语言"] +[node name="LangLeft" type="Button" parent="MarginContainer/VBoxContainer/语言"] unique_name_in_owner = true layout_mode = 2 +text = "<" +flat = true + +[node name="LangLabel" type="Label" parent="MarginContainer/VBoxContainer/语言"] +unique_name_in_owner = true +custom_minimum_size = Vector2(50, 0) +layout_mode = 2 +text = "中文" +horizontal_alignment = 1 + +[node name="LangRight" type="Button" parent="MarginContainer/VBoxContainer/语言"] +unique_name_in_owner = true +layout_mode = 2 +text = ">" +flat = true + +[node name="OptionButtonLanguage" type="OptionButton" parent="MarginContainer/VBoxContainer/语言"] +unique_name_in_owner = true +visible = false +layout_mode = 2 focus_neighbor_top = NodePath("../../对话音量/HSliderDialogBus") -focus_neighbor_bottom = NodePath("../../字幕/OptionButtonCaption") +focus_neighbor_bottom = NodePath("../../CaptionBox/OptionButtonCaption") selected = 0 allow_reselect = true item_count = 2 @@ -169,23 +189,24 @@ popup/item_0/id = 0 popup/item_1/text = "English" popup/item_1/id = 2 -[node name="字幕" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] +[node name="CaptionBox" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 4 -[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/字幕"] +[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/CaptionBox"] custom_minimum_size = Vector2(50, 0) layout_mode = 2 text = "setting_字幕" -[node name="VSeparator" type="VSeparator" parent="MarginContainer/VBoxContainer/字幕"] +[node name="VSeparator" type="VSeparator" parent="MarginContainer/VBoxContainer/CaptionBox"] layout_mode = 2 theme_override_constants/separation = 31 theme_override_styles/separator = SubResource("StyleBoxEmpty_n2b1f") -[node name="OptionButtonCaption" type="OptionButton" parent="MarginContainer/VBoxContainer/字幕"] +[node name="OptionButtonCaption" type="OptionButton" parent="MarginContainer/VBoxContainer/CaptionBox"] unique_name_in_owner = true +visible = false layout_mode = 2 focus_neighbor_top = NodePath("../../语言/OptionButtonLanguage") focus_neighbor_bottom = NodePath("../../OSAutoEnd") @@ -197,6 +218,25 @@ popup/item_0/id = 1 popup/item_1/text = "普通话" popup/item_1/id = 0 +[node name="CaptionLeft" type="Button" parent="MarginContainer/VBoxContainer/CaptionBox"] +unique_name_in_owner = true +layout_mode = 2 +text = "<" +flat = true + +[node name="CaptionLabel" type="Label" parent="MarginContainer/VBoxContainer/CaptionBox"] +unique_name_in_owner = true +custom_minimum_size = Vector2(50, 0) +layout_mode = 2 +text = "普通话" +horizontal_alignment = 1 + +[node name="CaptionRight" type="Button" parent="MarginContainer/VBoxContainer/CaptionBox"] +unique_name_in_owner = true +layout_mode = 2 +text = ">" +flat = true + [node name="HSeparator2" type="HSeparator" parent="MarginContainer/VBoxContainer"] visible = false layout_mode = 2 @@ -205,7 +245,7 @@ layout_mode = 2 unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 4 -focus_neighbor_top = NodePath("../字幕/OptionButtonCaption") +focus_neighbor_top = NodePath("../CaptionBox/OptionButtonCaption") focus_neighbor_bottom = NodePath("../OSWaitTimeBox/HSliderOSWaitTime") text = "setting_气泡文字自动结束" diff --git a/scene/trailer.gd b/scene/trailer.gd index bd8b923d..c76128df 100644 --- a/scene/trailer.gd +++ b/scene/trailer.gd @@ -4,21 +4,112 @@ extends Control @onready var mask = $"遮罩" @onready var earplug_notice = $"耳机提示" +@onready var sfx_click = $SfxClick as Sfx +@onready var settings = %"设置界面" as Control +@onready var lang_label = %LangLabel as Label +@onready var lang_left_btn = %LangLeft as Button +@onready var lang_right_btn = %LangRight as Button +@onready var caption_box = %CaptionBox as BoxContainer +@onready var caption_label = %CaptionLabel as Label +@onready var caption_left_btn = %CaptionLeft as Button +@onready var caption_right_btn = %CaptionRight as Button +@onready var confirm_btn = %ConfirmButton as Button + var packed_index_page := preload("res://scene/index_page.tscn") +var first_launching_game := true + func _ready() -> void: - if GlobalConfigManager.config and GlobalConfigManager.config.skip_trailer: - SceneManager.checkout_index_page(false) - return + if GlobalConfigManager.config: + var game_launched_times = GlobalConfigManager.config.game_launched_times + GlobalConfigManager.config.game_launched_times = game_launched_times + 1 + first_launching_game = game_launched_times == 0 + if GlobalConfigManager.config.skip_trailer: + SceneManager.checkout_index_page(false) + return video_player.play() - await video_player.finished + video_player.finished.connect(_on_video_finished) + + lang_left_btn.pressed.connect(_on_lang_left_btn_pressed) + lang_right_btn.pressed.connect(_on_lang_right_btn_pressed) + caption_left_btn.pressed.connect(_on_caption_left_btn_pressed) + caption_right_btn.pressed.connect(_on_caption_right_btn_pressed) + + +var earplug_notice_tween: Tween + + +func _on_video_finished() -> void: mask.visible = true earplug_notice.visible = true earplug_notice.modulate.a = 0 + earplug_notice_tween = create_tween() + earplug_notice_tween.tween_property(earplug_notice, "modulate:a", 1.0, 1.0) + if not first_launching_game: + settings.hide() + earplug_notice_tween.tween_interval(3.0) + earplug_notice_tween.tween_property(earplug_notice, "modulate:a", 0.0, 1.0) + earplug_notice_tween.finished.connect(_on_earplug_notice_finished) + else: + settings.show() + confirm_btn.pressed.connect(_on_confirm_btn_pressed) + + +func _on_confirm_btn_pressed() -> void: var tween = create_tween() - tween.tween_property(earplug_notice, "modulate:a", 1.0, 1.0) - tween.tween_interval(3.0) tween.tween_property(earplug_notice, "modulate:a", 0.0, 1.0) - await tween.finished + tween.finished.connect(_on_earplug_notice_finished) + + +func _on_earplug_notice_finished() -> void: SceneManager.checkout_index_page(false) + + +func _unhandled_input(event: InputEvent) -> void: + if event.is_action_pressed("escape") and not first_launching_game: + if video_player.is_playing(): + get_viewport().set_input_as_handled() + video_player.stop() + _on_video_finished() + elif earplug_notice_tween and earplug_notice_tween.is_running(): + get_viewport().set_input_as_handled() + earplug_notice_tween.kill() + earplug_notice.modulate.a = 0 + _on_earplug_notice_finished() + + +func _on_lang_left_btn_pressed() -> void: + sfx_click.play() + GlobalConfigManager.update_locale( + GlobalConfigManager.config.language - 1, GlobalConfigManager.config.caption + ) + lang_label.text = GlobalConfigManager.get_locale_language_name() + caption_label.text = GlobalConfigManager.get_locale_caption_name() + caption_box.visible = caption_label.text != "" + + +func _on_lang_right_btn_pressed() -> void: + sfx_click.play() + GlobalConfigManager.update_locale( + GlobalConfigManager.config.language + 1, GlobalConfigManager.config.caption + ) + lang_label.text = GlobalConfigManager.get_locale_language_name() + caption_label.text = GlobalConfigManager.get_locale_caption_name() + caption_box.visible = caption_label.text != "" + + +func _on_caption_left_btn_pressed() -> void: + sfx_click.play() + GlobalConfigManager.update_locale( + GlobalConfigManager.config.language, GlobalConfigManager.config.caption - 1 + ) + caption_label.text = GlobalConfigManager.get_locale_caption_name() + + +func _on_caption_right_btn_pressed() -> void: + sfx_click.play() + GlobalConfigManager.update_locale( + GlobalConfigManager.config.language, GlobalConfigManager.config.caption + 1 + ) + caption_label.text = GlobalConfigManager.get_locale_caption_name() diff --git a/scene/trailer.tscn b/scene/trailer.tscn index 4d480664..10c8dd10 100644 --- a/scene/trailer.tscn +++ b/scene/trailer.tscn @@ -1,8 +1,14 @@ -[gd_scene load_steps=4 format=3 uid="uid://bpjjq1wdqm7um"] +[gd_scene load_steps=9 format=3 uid="uid://bpjjq1wdqm7um"] [ext_resource type="VideoStream" uid="uid://bkbulg542mj6v" path="res://asset/audio/专用/包包丁片头_5899532.ogv" id="1_24316"] [ext_resource type="Script" uid="uid://dbjwl8l8x1udp" path="res://scene/trailer.gd" id="1_tess7"] -[ext_resource type="Texture2D" uid="uid://c0r4spqoga3of" path="res://asset/art/ui/index/佩戴耳机提示.png" id="3_8aq0n"] +[ext_resource type="Texture2D" uid="uid://b1xp65ac7f1iq" path="res://asset/art/ui/index/佩戴耳机提示_下方无字.png" id="3_a6l8g"] +[ext_resource type="AudioStream" uid="uid://dq7h4qjtd72wk" path="res://asset/audio/sfx/交互/通用点击.ogg" id="4_y2lxw"] +[ext_resource type="Script" uid="uid://rq6w1vuhuq1m" path="res://scene/entity/audio/sfx.gd" id="5_yb8ks"] +[ext_resource type="Theme" uid="uid://be5scnhjobkux" path="res://config/settings_theme.tres" id="6_a6l8g"] +[ext_resource type="FontVariation" uid="uid://1ryw42kej6lv" path="res://config/font_ui.tres" id="7_pe403"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_2v8ms"] [node name="Trailer" type="Control"] layout_mode = 3 @@ -13,6 +19,12 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_tess7") +[node name="SfxClick" type="AudioStreamPlayer" parent="."] +stream = ExtResource("4_y2lxw") +bus = &"game_sfx" +script = ExtResource("5_yb8ks") +metadata/_custom_type_script = "uid://rq6w1vuhuq1m" + [node name="VideoStreamPlayer" type="VideoStreamPlayer" parent="."] layout_mode = 1 anchors_preset = 15 @@ -36,13 +48,135 @@ grow_vertical = 2 color = Color(0, 0, 0, 1) [node name="耳机提示" type="TextureRect" parent="."] -visible = false layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -texture = ExtResource("3_8aq0n") +texture = ExtResource("3_a6l8g") expand_mode = 1 stretch_mode = 5 + +[node name="设置界面" type="MarginContainer" parent="耳机提示"] +unique_name_in_owner = true +layout_mode = 1 +anchors_preset = 7 +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +offset_left = -85.0 +offset_top = -65.0 +offset_right = 85.0 +grow_horizontal = 2 +grow_vertical = 0 + +[node name="VBoxContainer" type="VBoxContainer" parent="耳机提示/设置界面"] +custom_minimum_size = Vector2(0, 100) +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme = ExtResource("6_a6l8g") + +[node name="语言" type="HBoxContainer" parent="耳机提示/设置界面/VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 4 + +[node name="Label" type="Label" parent="耳机提示/设置界面/VBoxContainer/语言"] +custom_minimum_size = Vector2(50, 0) +layout_mode = 2 +text = "setting_语言" + +[node name="VSeparator" type="VSeparator" parent="耳机提示/设置界面/VBoxContainer/语言"] +layout_mode = 2 +theme_override_constants/separation = 31 +theme_override_styles/separator = SubResource("StyleBoxEmpty_2v8ms") + +[node name="LangLeft" type="Button" parent="耳机提示/设置界面/VBoxContainer/语言"] +unique_name_in_owner = true +layout_mode = 2 +text = "<" +flat = true + +[node name="LangLabel" type="Label" parent="耳机提示/设置界面/VBoxContainer/语言"] +unique_name_in_owner = true +custom_minimum_size = Vector2(50, 0) +layout_mode = 2 +text = "中文" +horizontal_alignment = 1 + +[node name="LangRight" type="Button" parent="耳机提示/设置界面/VBoxContainer/语言"] +unique_name_in_owner = true +layout_mode = 2 +text = ">" +flat = true + +[node name="OptionButtonLanguage" type="OptionButton" parent="耳机提示/设置界面/VBoxContainer/语言"] +unique_name_in_owner = true +visible = false +layout_mode = 2 +focus_neighbor_bottom = NodePath("../../CaptionBox/OptionButtonCaption") +selected = 0 +allow_reselect = true +item_count = 2 +popup/item_0/text = "简体中文" +popup/item_0/id = 0 +popup/item_1/text = "English" +popup/item_1/id = 2 + +[node name="CaptionBox" type="HBoxContainer" parent="耳机提示/设置界面/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 4 + +[node name="Label" type="Label" parent="耳机提示/设置界面/VBoxContainer/CaptionBox"] +custom_minimum_size = Vector2(50, 0) +layout_mode = 2 +text = "setting_字幕" + +[node name="VSeparator" type="VSeparator" parent="耳机提示/设置界面/VBoxContainer/CaptionBox"] +layout_mode = 2 +theme_override_constants/separation = 31 +theme_override_styles/separator = SubResource("StyleBoxEmpty_2v8ms") + +[node name="OptionButtonCaption" type="OptionButton" parent="耳机提示/设置界面/VBoxContainer/CaptionBox"] +unique_name_in_owner = true +visible = false +layout_mode = 2 +focus_neighbor_top = NodePath("../../语言/OptionButtonLanguage") +selected = 0 +allow_reselect = true +item_count = 2 +popup/item_0/text = "上海话" +popup/item_0/id = 1 +popup/item_1/text = "普通话" +popup/item_1/id = 0 + +[node name="CaptionLeft" type="Button" parent="耳机提示/设置界面/VBoxContainer/CaptionBox"] +unique_name_in_owner = true +layout_mode = 2 +text = "<" +flat = true + +[node name="CaptionLabel" type="Label" parent="耳机提示/设置界面/VBoxContainer/CaptionBox"] +unique_name_in_owner = true +custom_minimum_size = Vector2(50, 0) +layout_mode = 2 +text = "普通话" +horizontal_alignment = 1 + +[node name="CaptionRight" type="Button" parent="耳机提示/设置界面/VBoxContainer/CaptionBox"] +unique_name_in_owner = true +layout_mode = 2 +text = ">" +flat = true + +[node name="ConfirmButton" type="Button" parent="耳机提示/设置界面/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 6 +size_flags_vertical = 4 +theme_override_fonts/font = ExtResource("7_pe403") +theme_override_font_sizes/font_size = 11 +text = "setting_确认" From 254e8a15e0d8e2f4e929309a7c3e1ed73569d1bf Mon Sep 17 00:00:00 2001 From: cakipaul Date: Tue, 15 Jul 2025 18:40:05 +0800 Subject: [PATCH 3/9] trailer settings focus --- scene/trailer.tscn | 48 +++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/scene/trailer.tscn b/scene/trailer.tscn index 10c8dd10..65534a40 100644 --- a/scene/trailer.tscn +++ b/scene/trailer.tscn @@ -96,6 +96,10 @@ theme_override_styles/separator = SubResource("StyleBoxEmpty_2v8ms") [node name="LangLeft" type="Button" parent="耳机提示/设置界面/VBoxContainer/语言"] unique_name_in_owner = true layout_mode = 2 +focus_neighbor_right = NodePath("../LangRight") +focus_neighbor_bottom = NodePath("../../CaptionBox/CaptionLeft") +focus_next = NodePath("../LangRight") +focus_previous = NodePath("../../ConfirmButton") text = "<" flat = true @@ -109,22 +113,13 @@ horizontal_alignment = 1 [node name="LangRight" type="Button" parent="耳机提示/设置界面/VBoxContainer/语言"] unique_name_in_owner = true layout_mode = 2 +focus_neighbor_left = NodePath("../LangLeft") +focus_neighbor_bottom = NodePath("../../CaptionBox/CaptionRight") +focus_next = NodePath("../../CaptionBox/CaptionLeft") +focus_previous = NodePath("../LangLeft") text = ">" flat = true -[node name="OptionButtonLanguage" type="OptionButton" parent="耳机提示/设置界面/VBoxContainer/语言"] -unique_name_in_owner = true -visible = false -layout_mode = 2 -focus_neighbor_bottom = NodePath("../../CaptionBox/OptionButtonCaption") -selected = 0 -allow_reselect = true -item_count = 2 -popup/item_0/text = "简体中文" -popup/item_0/id = 0 -popup/item_1/text = "English" -popup/item_1/id = 2 - [node name="CaptionBox" type="HBoxContainer" parent="耳机提示/设置界面/VBoxContainer"] unique_name_in_owner = true layout_mode = 2 @@ -140,22 +135,14 @@ layout_mode = 2 theme_override_constants/separation = 31 theme_override_styles/separator = SubResource("StyleBoxEmpty_2v8ms") -[node name="OptionButtonCaption" type="OptionButton" parent="耳机提示/设置界面/VBoxContainer/CaptionBox"] -unique_name_in_owner = true -visible = false -layout_mode = 2 -focus_neighbor_top = NodePath("../../语言/OptionButtonLanguage") -selected = 0 -allow_reselect = true -item_count = 2 -popup/item_0/text = "上海话" -popup/item_0/id = 1 -popup/item_1/text = "普通话" -popup/item_1/id = 0 - [node name="CaptionLeft" type="Button" parent="耳机提示/设置界面/VBoxContainer/CaptionBox"] unique_name_in_owner = true layout_mode = 2 +focus_neighbor_top = NodePath("../../语言/LangLeft") +focus_neighbor_right = NodePath("../CaptionRight") +focus_neighbor_bottom = NodePath("../../ConfirmButton") +focus_next = NodePath("../CaptionRight") +focus_previous = NodePath("../../语言/LangRight") text = "<" flat = true @@ -169,6 +156,12 @@ horizontal_alignment = 1 [node name="CaptionRight" type="Button" parent="耳机提示/设置界面/VBoxContainer/CaptionBox"] unique_name_in_owner = true layout_mode = 2 +focus_neighbor_left = NodePath("../CaptionLeft") +focus_neighbor_top = NodePath("../../语言/LangRight") +focus_neighbor_right = NodePath("../../ConfirmButton") +focus_neighbor_bottom = NodePath("../../ConfirmButton") +focus_next = NodePath("../../ConfirmButton") +focus_previous = NodePath("../CaptionLeft") text = ">" flat = true @@ -177,6 +170,9 @@ unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 6 size_flags_vertical = 4 +focus_neighbor_top = NodePath("../CaptionBox/CaptionLeft") +focus_next = NodePath("../语言/LangLeft") +focus_previous = NodePath("../CaptionBox/CaptionRight") theme_override_fonts/font = ExtResource("7_pe403") theme_override_font_sizes/font_size = 11 text = "setting_确认" From 92cd04847afe97fe74d9b3c385c0f0554293f349 Mon Sep 17 00:00:00 2001 From: cakipaul Date: Tue, 15 Jul 2025 18:45:03 +0800 Subject: [PATCH 4/9] hot fix --- scene/trailer.gd | 4 ++-- scene/trailer.tscn | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/scene/trailer.gd b/scene/trailer.gd index c76128df..06fa1631 100644 --- a/scene/trailer.gd +++ b/scene/trailer.gd @@ -1,7 +1,6 @@ extends Control @onready var video_player = $VideoStreamPlayer -@onready var mask = $"遮罩" @onready var earplug_notice = $"耳机提示" @onready var sfx_click = $SfxClick as Sfx @@ -21,6 +20,7 @@ var first_launching_game := true func _ready() -> void: + earplug_notice.hide() if GlobalConfigManager.config: var game_launched_times = GlobalConfigManager.config.game_launched_times GlobalConfigManager.config.game_launched_times = game_launched_times + 1 @@ -41,7 +41,6 @@ var earplug_notice_tween: Tween func _on_video_finished() -> void: - mask.visible = true earplug_notice.visible = true earplug_notice.modulate.a = 0 earplug_notice_tween = create_tween() @@ -57,6 +56,7 @@ func _on_video_finished() -> void: func _on_confirm_btn_pressed() -> void: + confirm_btn.disabled = true var tween = create_tween() tween.tween_property(earplug_notice, "modulate:a", 0.0, 1.0) tween.finished.connect(_on_earplug_notice_finished) diff --git a/scene/trailer.tscn b/scene/trailer.tscn index 65534a40..ac1ff6fd 100644 --- a/scene/trailer.tscn +++ b/scene/trailer.tscn @@ -25,6 +25,17 @@ bus = &"game_sfx" script = ExtResource("5_yb8ks") metadata/_custom_type_script = "uid://rq6w1vuhuq1m" +[node name="遮罩" type="ColorRect" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -1.0 +offset_bottom = -1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0, 0, 0, 1) + [node name="VideoStreamPlayer" type="VideoStreamPlayer" parent="."] layout_mode = 1 anchors_preset = 15 @@ -37,16 +48,6 @@ volume_db = -8.0 expand = true bus = &"game_sfx" -[node name="遮罩" type="ColorRect" parent="."] -visible = false -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -color = Color(0, 0, 0, 1) - [node name="耳机提示" type="TextureRect" parent="."] layout_mode = 1 anchors_preset = 15 From 1041e1ebab410478cce09309310416234f49cacf Mon Sep 17 00:00:00 2001 From: bbd_pc Date: Tue, 15 Jul 2025 18:47:19 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E8=AF=AD=E8=A8=80(Lang),=20Language=20(?= =?UTF-8?q?=E8=AF=AD=E8=A8=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- asset/dialogue/item_description.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asset/dialogue/item_description.csv b/asset/dialogue/item_description.csv index 667b19b5..818e0c9c 100644 --- a/asset/dialogue/item_description.csv +++ b/asset/dialogue/item_description.csv @@ -10,7 +10,7 @@ ux_panel_退出游戏,退出游戏,,,,,Exit Game setting_总音量,总音量,,,,,Master Volume setting_音效音量,音效音量,,,,,Sound Effects setting_对话音量,对话音量,,,,,Dialogue Volume -setting_语言,语言(Lang),,,,,Language (Lang) +setting_语言,语言(Lang),,,,,Language (语言) setting_字幕,字幕,,,,,Subtitles setting_气泡文字自动结束,气泡文字自动结束,,,,,Auto-dismiss Text Bubbles setting_气泡等待时长,气泡停留,,,,,Text Display Duration From 3e3fb449a297965dfcb2917b43591445a9824758 Mon Sep 17 00:00:00 2001 From: bbd_pc Date: Tue, 15 Jul 2025 18:49:58 +0800 Subject: [PATCH 6/9] =?UTF-8?q?demo=200.5.1=20=E4=BF=AE=E5=A4=8D=E7=8C=AA?= =?UTF-8?q?=E5=A4=B4=E6=80=AAbug=EF=BC=9B=E5=A2=9E=E5=8A=A0=E9=A6=96?= =?UTF-8?q?=E6=AC=A1=E8=BF=9B=E5=85=A5=E6=B8=B8=E6=88=8F=E6=97=B6=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- export_presets.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/export_presets.cfg b/export_presets.cfg index fac0dadd..229e3287 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -9,7 +9,7 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" -export_path="../demo0.5/xiandie.exe" +export_path="../demo0.5.1/xiandie.exe" patches=PackedStringArray() encryption_include_filters="" encryption_exclude_filters="" @@ -37,8 +37,8 @@ application/modify_resources=true application/icon="uid://cxgwspjv16j7m" application/console_wrapper_icon="uid://cxgwspjv16j7m" application/icon_interpolation=4 -application/file_version="0.5.0.0" -application/product_version="0.5.0.0" +application/file_version="0.5.1.0" +application/product_version="0.5.1.0" application/company_name="包包丁" application/product_name="衔蝶" application/file_description="衔蝶" From 3a40adc40f9e306075e39ba043d8b3e4c4ae289f Mon Sep 17 00:00:00 2001 From: bbd_pc Date: Tue, 15 Jul 2025 19:07:08 +0800 Subject: [PATCH 7/9] /archives/ --- manager/archive_manager/archive_manager.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/archive_manager/archive_manager.gd b/manager/archive_manager/archive_manager.gd index 3afa75fb..2b0926f1 100644 --- a/manager/archive_manager/archive_manager.gd +++ b/manager/archive_manager/archive_manager.gd @@ -12,7 +12,7 @@ var archive: AssembledArchive: # current archive static var user_root_dir := "user://data/" # must end with "/" -static var archive_dir := "user://data/archives_dict/" +static var archive_dir := "user://data/archives/" static var archive_prefix := "save" const CURRENT_VERSION = 6 From dd289bd8cfcd3646f2923d781687c7b12c50367b Mon Sep 17 00:00:00 2001 From: bbd_pc Date: Tue, 15 Jul 2025 19:25:15 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E5=AD=A4=E5=84=BF=E9=99=A2=E6=A1=8C?= =?UTF-8?q?=E6=A4=85=E7=A2=B0=E6=92=9E=E6=8B=89=E5=AE=BD=EF=BC=9B=E5=AD=97?= =?UTF-8?q?=E5=B9=95=E9=BB=98=E8=AE=A4=E4=B8=8A=E6=B5=B7=E8=AF=9D=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/config_manager/global_config_manager.gd | 6 +++--- scene/ground/scene/c01/s06_孤儿院长廊围墙.tscn | 3 ++- scene/trailer.gd | 4 ++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/manager/config_manager/global_config_manager.gd b/manager/config_manager/global_config_manager.gd index 3fe329b0..7fd8879b 100644 --- a/manager/config_manager/global_config_manager.gd +++ b/manager/config_manager/global_config_manager.gd @@ -45,9 +45,9 @@ func _set_config(val: GlobalConfig) -> void: # -1 null; 0 zh; 1 en -var language_options = ["中文", "English"] -var caption_options_dict = {0: ["简体中文", "上海话"], 1: [""]} -var caption_loacles_dict = {0: ["zh_CN", "zh_SH"], 1: ["en"]} +var language_options = ["简体中文", "English"] +var caption_options_dict = {0: ["上海话", "普通话"], 1: [""]} +var caption_loacles_dict = {0: ["zh_SH", "zh_CN"], 1: ["en"]} # return example: "中文_简体中文" "English_" diff --git a/scene/ground/scene/c01/s06_孤儿院长廊围墙.tscn b/scene/ground/scene/c01/s06_孤儿院长廊围墙.tscn index 904cff5e..051e9ec1 100644 --- a/scene/ground/scene/c01/s06_孤儿院长廊围墙.tscn +++ b/scene/ground/scene/c01/s06_孤儿院长廊围墙.tscn @@ -362,8 +362,9 @@ shape = SubResource("RectangleShape2D_1ojoa") debug_color = Color(0.519778, 0.447036, 0.929413, 0.42) [node name="Interactable桌椅" parent="Ground/DeployLayer" index="12" instance=ExtResource("12_idjp0")] -position = Vector2(2881, 49) +position = Vector2(2907, 53) enable_snapper = false +collision_width_and_x = Vector2(80, 0) one_shot = false [node name="【站立小孩-3】" parent="Ground/DeployLayer" index="13" instance=ExtResource("8_ouldg")] diff --git a/scene/trailer.gd b/scene/trailer.gd index 06fa1631..3a266b51 100644 --- a/scene/trailer.gd +++ b/scene/trailer.gd @@ -31,6 +31,10 @@ func _ready() -> void: video_player.play() video_player.finished.connect(_on_video_finished) + lang_label.text = GlobalConfigManager.get_locale_language_name() + caption_label.text = GlobalConfigManager.get_locale_caption_name() + if caption_label.text == "": + caption_box.hide() lang_left_btn.pressed.connect(_on_lang_left_btn_pressed) lang_right_btn.pressed.connect(_on_lang_right_btn_pressed) caption_left_btn.pressed.connect(_on_caption_left_btn_pressed) From 6078fb32598a8a610e4411a44726668e65b8508a Mon Sep 17 00:00:00 2001 From: bbd_pc Date: Tue, 15 Jul 2025 19:40:32 +0800 Subject: [PATCH 9/9] demo0.5.2 --- export_presets.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/export_presets.cfg b/export_presets.cfg index 229e3287..18b02023 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -9,7 +9,7 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" -export_path="../demo0.5.1/xiandie.exe" +export_path="../demo0.5.2/xiandie.exe" patches=PackedStringArray() encryption_include_filters="" encryption_exclude_filters="" @@ -37,8 +37,8 @@ application/modify_resources=true application/icon="uid://cxgwspjv16j7m" application/console_wrapper_icon="uid://cxgwspjv16j7m" application/icon_interpolation=4 -application/file_version="0.5.1.0" -application/product_version="0.5.1.0" +application/file_version="0.5.2.0" +application/product_version="0.5.2.0" application/company_name="包包丁" application/product_name="衔蝶" application/file_description="衔蝶"