diff --git a/asset/art/prop/c02/火柴.png b/asset/art/prop/c02/火柴.png new file mode 100755 index 00000000..4261d278 Binary files /dev/null and b/asset/art/prop/c02/火柴.png differ diff --git a/asset/art/prop/c02/火柴.png.import b/asset/art/prop/c02/火柴.png.import new file mode 100644 index 00000000..ab00f9d1 --- /dev/null +++ b/asset/art/prop/c02/火柴.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://6wkwq2j8f2fi" +path="res://.godot/imported/火柴.png-600e0bd30c45465ad00d6f1eca531094.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://asset/art/prop/c02/火柴.png" +dest_files=["res://.godot/imported/火柴.png-600e0bd30c45465ad00d6f1eca531094.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/asset/art/临时草稿/煤油灯.png b/asset/art/临时草稿/煤油灯.png new file mode 100644 index 00000000..2a781c44 Binary files /dev/null and b/asset/art/临时草稿/煤油灯.png differ diff --git a/asset/art/临时草稿/煤油灯.png.import b/asset/art/临时草稿/煤油灯.png.import new file mode 100644 index 00000000..301dc6a4 --- /dev/null +++ b/asset/art/临时草稿/煤油灯.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c4c7t2lttcf0a" +path="res://.godot/imported/煤油灯.png-4b4e3a68e5a7458aa1134ee578e8c883.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://asset/art/临时草稿/煤油灯.png" +dest_files=["res://.godot/imported/煤油灯.png-4b4e3a68e5a7458aa1134ee578e8c883.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/asset/art/临时草稿/煤油灯_点燃.png b/asset/art/临时草稿/煤油灯_点燃.png new file mode 100644 index 00000000..a8fa238b Binary files /dev/null and b/asset/art/临时草稿/煤油灯_点燃.png differ diff --git a/asset/art/临时草稿/煤油灯_点燃.png.import b/asset/art/临时草稿/煤油灯_点燃.png.import new file mode 100644 index 00000000..5c6a052e --- /dev/null +++ b/asset/art/临时草稿/煤油灯_点燃.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://doqtpiaf1weqc" +path="res://.godot/imported/煤油灯_点燃.png-aace2ea6aeaad791da0fdcb57c8433a0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://asset/art/临时草稿/煤油灯_点燃.png" +dest_files=["res://.godot/imported/煤油灯_点燃.png-aace2ea6aeaad791da0fdcb57c8433a0.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/asset/dialogue/inspect_content.csv b/asset/dialogue/inspect_content.csv index b09c2a75..dc0ba5d8 100644 --- a/asset/dialogue/inspect_content.csv +++ b/asset/dialogue/inspect_content.csv @@ -5,3 +5,4 @@ t344c97cf2c,据闻奉贤县分水墩又有七人染受鼠疫,病状可怖, tdb119a3714,有地方人称鼠疫为妖邪作祟,甚为惊骇,一时人心惶惶,竟有聚众滋闹之事,政府以防疫事宜关系紧要,拟赴分水墩一带调查防疫事宜云。,,,, ta750647b12,《申报》,,,, t736cca4563,民国五年一月十三日,,,, +公寓告示正文_1,公寓告示正文,,,, diff --git a/asset/dialogue/inspect_content.dialogue b/asset/dialogue/inspect_content.dialogue index 5a2b8208..ffb251b5 100644 --- a/asset/dialogue/inspect_content.dialogue +++ b/asset/dialogue/inspect_content.dialogue @@ -10,3 +10,6 @@ x年 [ID:t89c0f4a8de] 民国五年一月十三日 [ID:t736cca4563] => END +~ c02_公寓告示 +公寓告示正文 [ID:公寓告示正文_1] +=> END diff --git a/asset/dialogue/item_description.csv b/asset/dialogue/item_description.csv index f6add9a6..7ee97417 100644 --- a/asset/dialogue/item_description.csv +++ b/asset/dialogue/item_description.csv @@ -19,6 +19,8 @@ c02_老鼠洞2,在这种楼里挺常见的,,,, ui_新游戏,新游戏,,,, ui_继续游戏,继续游戏,,,, ui_退出游戏,退出游戏,,,, +c02_寻人启事,"似乎是一张寻人启事 +脸的部分被撕掉了,看不清",,,, index_新游戏,新游戏,,,, index_继续游戏,继续游戏,,,, index_退出游戏,退出游戏,,,, @@ -53,6 +55,7 @@ prop_空手,空手,,,, prop_令牌,令牌,,,,[#texture=c01/令牌物品.png][#inspect=c01/令牌.png] prop_信碎片1,信碎片(一),,,,[#texture=c01/信碎片1.png] prop_装有灵魂的令牌,装有灵魂的令牌,,,,[#texture=c01/装有灵魂的令牌物品.png][#inspect=c01/装有灵魂的令牌.png] +prop_火柴,火柴,,,,[#texture=c02/火柴.png] prop_小猫玩具的脑袋,小猫玩具的脑袋,Catty's Head,,,[#texture=c02/小猫玩具脑袋物品.png][#inspect=c02/小猫玩具脑袋.png] prop_绳子,绳子,Rope,,,[#texture=c02/绳子物品.png][#inspect=c02/绳子.png] prop_1012钥匙,1012钥匙,1012 Key,,,[#texture=c02/1012钥匙物品.png][#inspect=c02/1012钥匙.png] @@ -77,7 +80,7 @@ c01_倾斜的洋相片,洋相片,,,, c01_摆正的洋相片,是院长的女儿吗,,,, c01_s06_院长房间,这是院长的房间,,,, c01_s06_小朋友房间,这是其他小朋友的房间,,,, -c02_寻人启事,"似乎是一张寻人启事 +c02_小蝉寻人启事_脸部破碎,"似乎是一张寻人启事 脸的部分被撕掉了,看不清",,,, c02_卫生宣传画,几张卫生宣传画,,,, c02_老鼠洞,"一个老鼠洞 diff --git a/asset/dialogue/item_description.dialogue b/asset/dialogue/item_description.dialogue index d3763d61..e44179d9 100644 --- a/asset/dialogue/item_description.dialogue +++ b/asset/dialogue/item_description.dialogue @@ -47,6 +47,7 @@ 信碎片(一) [#texture=c01/信碎片1.png] [ID:prop_信碎片1] 装有灵魂的令牌 [#texture=c01/装有灵魂的令牌物品.png][#inspect=c01/装有灵魂的令牌.png] [ID:prop_装有灵魂的令牌] # c02 +火柴 [#texture=c02/火柴.png] [ID:prop_火柴] 小猫玩具的脑袋 [#texture=c02/小猫玩具脑袋物品.png][#inspect=c02/小猫玩具脑袋.png] [ID:prop_小猫玩具的脑袋] 绳子 [#texture=c02/绳子物品.png][#inspect=c02/绳子.png] [ID:prop_绳子] 1012钥匙 [#texture=c02/1012钥匙物品.png][#inspect=c02/1012钥匙.png] [ID:prop_1012钥匙] @@ -79,7 +80,7 @@ # c02 # c02-s01 街道 -似乎是一张寻人启事\n脸的部分被撕掉了,看不清 [ID:c02_寻人启事] +似乎是一张寻人启事\n脸的部分被撕掉了,看不清 [ID:c02_小蝉寻人启事_脸部破碎] # c02-s02 走道 几张卫生宣传画 [ID:c02_卫生宣传画] 一个老鼠洞\n在这种楼里挺常见的 [ID:c02_老鼠洞] diff --git a/manager/archive_manager/assembled_archive.gd b/manager/archive_manager/assembled_archive.gd index d524a62f..0324d83c 100644 --- a/manager/archive_manager/assembled_archive.gd +++ b/manager/archive_manager/assembled_archive.gd @@ -59,8 +59,6 @@ func ground_archive(scene_name := current_scene) -> GroundArchive: var g = GroundArchive.new() g.scene_name = scene_name ground_archives[scene_name] = g - # # 保存新建的 GroundArchive - # ArchiveManager.save_all() return ground_archives[scene_name] diff --git a/manager/config_manager/global_config.gd b/manager/config_manager/global_config.gd index 3804bd14..2e4cb616 100644 --- a/manager/config_manager/global_config.gd +++ b/manager/config_manager/global_config.gd @@ -7,10 +7,10 @@ const DEBUG = true const RES_FILE_FORMAT = ".tres" ## layers +const CANVAS_LAYER_SETTINGS = 30 const CANVAS_LAYER_DIALOG = 23 const CANVAS_LAYER_UI = 22 const CANVAS_LAYER_PROP_INSPECTOR = 21 -const CANVAS_LAYER_SETTINGS = 20 const CANVAS_LAYER_BAG = 12 const CANVAS_LAYER_GROUND_MASK = 11 const CANVAS_LAYER_SHADING = 10 diff --git a/manager/scene/scene_manager.gd b/manager/scene/scene_manager.gd index 5e5cabbe..1131124f 100644 --- a/manager/scene/scene_manager.gd +++ b/manager/scene/scene_manager.gd @@ -153,12 +153,16 @@ func enable_prop_item(prop_key: String) -> void: var prop_hud = get_prop_hud() if prop_hud: prop_hud.enable_prop_item(prop_key) + else: + printerr("enable_prop_item PropHud node not found") func disable_prop_item(prop_key: String) -> void: var prop_hud = get_prop_hud() if prop_hud: prop_hud.disable_prop_item(prop_key) + else: + printerr("disable_prop_item PropHud node not found") func pop_os(lines := []): diff --git a/scene/dialog/balloon.tscn b/scene/dialog/balloon.tscn index 55d7e435..3f388cfa 100644 --- a/scene/dialog/balloon.tscn +++ b/scene/dialog/balloon.tscn @@ -57,7 +57,7 @@ MarginContainer/constants/margin_top = 15 Panel/styles/panel = SubResource("StyleBoxEmpty_jydvi") [node name="Balloon" type="CanvasLayer"] -layer = 100 +layer = 23 script = ExtResource("1_36de5") metadata/_edit_vertical_guides_ = [-78.0] metadata/_edit_horizontal_guides_ = [276.0] diff --git a/scene/entity/ambush.gd b/scene/entity/ambush.gd index 4f3a4758..61b67212 100644 --- a/scene/entity/ambush.gd +++ b/scene/entity/ambush.gd @@ -59,23 +59,24 @@ var ground_archive: GroundArchive var played: bool: set(val): played = val - ground_archive.set_pair(name, "played", played) + if not Engine.is_editor_hint() and ground_archive: + ground_archive.set_pair(name, "played", played) # Called when the node enters the scene tree for the first time. func _ready() -> void: - # setup default value - ground_archive = ArchiveManager.archive.ground_archive() - played = ground_archive.get_value(name, "played", false) - played_time = 0.0 - sign_mark.enabled = enabled - _check_sign_display() if Engine.is_editor_hint(): var animation_player = _get_animation_player() # 更新 hook_animation 的可选项 if animation_player: animation_player.animation_libraries_updated.connect(notify_property_list_changed) return + # setup default value + ground_archive = ArchiveManager.archive.ground_archive() + played = ground_archive.get_value(name, "played", false) + played_time = 0.0 + sign_mark.enabled = enabled + _check_sign_display() if played: if GlobalConfig.DEBUG: print("Ambush has played, name=", name, " one_shot=", one_shot) diff --git a/scene/entity/general/sfx.gd b/scene/entity/general/sfx.gd index b4d867e0..f0de375e 100644 --- a/scene/entity/general/sfx.gd +++ b/scene/entity/general/sfx.gd @@ -24,12 +24,13 @@ func _reload_sfx(): if not Engine.is_editor_hint(): return var path = sfx_root_path + dir + "/" + file - print("path=", path) if file and dir and FileAccess.file_exists(path): sfx = load(sfx_root_path + dir + "/" + file) as AudioStream else: sfx = null - stream = sfx + set("stream", sfx) + if stream: + print("sfx [", name, "] stream=", stream.resource_path) func _update_files(): @@ -40,7 +41,6 @@ func _update_files(): for f in dir_access.get_files(): if f.ends_with(".wav") or f.ends_with(".ogg") or f.ends_with(".mp3"): current_files.push_back(f) - _reload_sfx() notify_property_list_changed() @@ -65,7 +65,6 @@ func _set(property: StringName, value: Variant) -> bool: if property == &"file": file = value _reload_sfx() - # notify_property_list_changed() return true return false diff --git a/scene/entity/general/sfx_2d.gd b/scene/entity/general/sfx2d.gd similarity index 96% rename from scene/entity/general/sfx_2d.gd rename to scene/entity/general/sfx2d.gd index 8fb03643..7e5e1d4a 100644 --- a/scene/entity/general/sfx_2d.gd +++ b/scene/entity/general/sfx2d.gd @@ -36,6 +36,8 @@ func _reload_sfx(): else: sfx = null stream = sfx + if stream: + print("sfx2d [", name, "] stream=", stream.resource_path) func _update_files(): @@ -46,7 +48,6 @@ func _update_files(): for f in dir_access.get_files(): if f.ends_with(".wav") or f.ends_with(".ogg") or f.ends_with(".mp3"): current_files.push_back(f) - _reload_sfx() notify_property_list_changed() diff --git a/scene/entity/general/sfx2d.tscn b/scene/entity/general/sfx2d.tscn index 5e4882b5..d05e85d2 100644 --- a/scene/entity/general/sfx2d.tscn +++ b/scene/entity/general/sfx2d.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=4 format=3 uid="uid://cyobva6ppmapr"] [ext_resource type="AudioStream" uid="uid://cvttds81trcoc" path="res://asset/audio/sfx/ui/click.wav" id="1_7vcpo"] -[ext_resource type="Script" path="res://scene/entity/general/sfx_2d.gd" id="1_k1qpr"] +[ext_resource type="Script" path="res://scene/entity/general/sfx2d.gd" id="1_k1qpr"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_xx2jy"] size = Vector2(200, 200) diff --git a/scene/entity/interactable.gd b/scene/entity/interactable.gd index e2a3e598..04b9262c 100644 --- a/scene/entity/interactable.gd +++ b/scene/entity/interactable.gd @@ -11,6 +11,8 @@ signal interacted @export var unmatched_sign_texture: Texture2D @export var matched_sign_texture: Texture2D @export var one_shot := true +@export var diable_prop_after_interacted := false +@export var interacted_texture: Texture2D var prop_key := "" @@ -42,6 +44,8 @@ func _ready() -> void: # setup default value ground_archive = ArchiveManager.archive.ground_archive() interacted_times = ground_archive.get_value(name, "interacted_times", 0) + if interacted_times and interacted_texture: + texture = interacted_texture _check_sign_display() @@ -110,9 +114,11 @@ func _on_interacted() -> void: interact_mutex.unlock() return sfx_success.play() - # if one_shot: - # SceneManager.disable_prop_item(prop_key) + if diable_prop_after_interacted and prop_key: + SceneManager.disable_prop_item(prop_key) interacted_times += 1 + if interacted_texture: + texture = interacted_texture interacted.emit() EventManager.prop_interacted(name, prop_key, interacted_times) # print("%s interacted with %s. total times: %s" % [name, prop_key, interacted_times]) diff --git a/scene/entity/interactable.tscn b/scene/entity/interactable.tscn index 4deeabb2..b0ce2693 100644 --- a/scene/entity/interactable.tscn +++ b/scene/entity/interactable.tscn @@ -3,9 +3,9 @@ [ext_resource type="Script" path="res://scene/entity/interactable.gd" id="1_6nrd3"] [ext_resource type="PackedScene" uid="uid://c85t6stvytvjn" path="res://scene/entity/general/sfx.tscn" id="2_bvj74"] [ext_resource type="Texture2D" uid="uid://b343nvvbtpglb" path="res://asset/art/ui/互动提示符/ui 像素版_纯白.png" id="2_tvf5d"] -[ext_resource type="AudioStream" uid="uid://ccng5y2fip6mc" path="res://asset/audio/sfx/ui/开锁声.mp3" id="3_o5jv1"] [ext_resource type="PackedScene" uid="uid://c4tipnj1cr1j3" path="res://scene/entity/ux/sign.tscn" id="3_qsms8"] -[ext_resource type="AudioStream" uid="uid://b1aslyewxbej8" path="res://asset/audio/sfx/ui/钥匙.mp3" id="3_tq35w"] +[ext_resource type="AudioStream" uid="uid://inmdv5gqqius" path="res://asset/audio/sfx/ui/门锁互动.mp3" id="4_n1rbo"] +[ext_resource type="AudioStream" uid="uid://ccng5y2fip6mc" path="res://asset/audio/sfx/ui/开锁声.mp3" id="5_exp6m"] [sub_resource type="AtlasTexture" id="AtlasTexture_0gwq7"] atlas = ExtResource("2_tvf5d") @@ -26,11 +26,11 @@ matched_sign_texture = SubResource("AtlasTexture_0ks5m") prop_key = "" [node name="SfxInvalid" parent="." instance=ExtResource("2_bvj74")] -stream = ExtResource("3_tq35w") -file = "钥匙.mp3" +stream = ExtResource("4_n1rbo") +file = "门锁互动.mp3" [node name="SfxSuccess" parent="." instance=ExtResource("2_bvj74")] -stream = ExtResource("3_o5jv1") +stream = ExtResource("5_exp6m") file = "开锁声.mp3" [node name="Sign" parent="." instance=ExtResource("3_qsms8")] diff --git a/scene/entity/local_inspectable.gd b/scene/entity/local_inspectable.gd index f97211fa..1a44c146 100644 --- a/scene/entity/local_inspectable.gd +++ b/scene/entity/local_inspectable.gd @@ -10,7 +10,7 @@ signal quit_inspecting enum { STATUS_NORAML, STATUS_TRANSITIONING, STATUS_INSPECTING_COVER, STATUS_INSPECTING_NOTES } -@export var entity_name: String = "" +# @export var entity_name: String = "" @export var texture_cover: Texture2D @export_enum("none", "c01", "c02", "c03", "c04", "c05") var editor_filter := "none": set(val): diff --git a/scene/entity/old/inspectable.gd b/scene/entity/old/inspectable.gd index 8e9f486d..740f3fde 100644 --- a/scene/entity/old/inspectable.gd +++ b/scene/entity/old/inspectable.gd @@ -1,34 +1,35 @@ +@tool extends Sprite2D -# @export var entity_config: EntityConfig: -# set(value): -# entity_config = value - -@export var entity_name: String = "" -@export var note_key: String = "" +# @export var entity_name: String = "" +@export_enum("none", "c01", "c02", "c03", "c04", "c05") var editor_filter := "none": + set(val): + editor_filter = val + if is_node_ready() and Engine.is_editor_hint(): + notify_property_list_changed() @export var texture_cover: Texture2D @export var texture_note: Texture2D +@export var note_centered := false +var content_key: String = "" @onready var sign_mark = %Sign as Sign @onready var area2d = %Area2D as Area2D -var content_res = preload("res://asset/dialogue/inspect_content.dialogue") as DialogueResource +var content_dialogue = preload("res://asset/dialogue/inspect_content.dialogue") as DialogueResource var inspecting = false func _ready() -> void: + if Engine.is_editor_hint(): + return area2d.body_entered.connect(_reset) area2d.body_exited.connect(_on_cancel) sign_mark.interacted.connect(_on_interacted) sign_mark.cancel.connect(_on_cancel) - # if GlobalConfig.DEBUG: - # var label = DebugLabel.new() - # add_child(label) - # label.name = "DebugLabel" func _on_interacted() -> void: - if not texture_cover or not texture_note: + if not texture_cover: push_error("entity/inspectable.gd: texture_cover or texture_note is not set") return if inspecting: @@ -37,30 +38,34 @@ func _on_interacted() -> void: # connect inspector quit signal var inspector = SceneManager.get_inspector() if inspector: - inspector.quit.connect(_on_quit_inspector) - if not texture_note: - texture_note = texture_cover + inspector.quit_and_hidden.connect(_on_quit_inspector) var inspection_note = _get_tr_content() - inspector.pop_standard_inspection(texture_cover, texture_note, inspection_note) + inspector.pop_standard_inspection( + texture_cover, texture_note, inspection_note, note_centered + ) inspecting = true sign_mark.display_sign = false + func _get_tr_content(): + if content_key == "": + return "" var inspection_note = "" # get note content - var line_id = content_res.titles.get(note_key) + var line_id = content_dialogue.titles.get(content_key) while line_id and line_id != "end": - var line = content_res.lines[line_id] + var line = content_dialogue.lines[line_id] if line.has("text"): inspection_note += tr(line.get("text")) + "\n" line_id = line.get("next_id") return inspection_note + func _on_quit_inspector(): var inspector = SceneManager.get_inspector() if inspector: # disconnect inspector quit signal - inspector.quit.disconnect(_on_quit_inspector) + inspector.quit_and_hidden.disconnect(_on_quit_inspector) inspecting = false sign_mark.display_sign = true @@ -71,3 +76,41 @@ func _on_cancel(_body = null): func _reset(_body): inspecting = false + + +func _set(property: StringName, value: Variant) -> bool: + if property == "content_key": + content_key = value + return true + return false + + +func _get(property: StringName) -> Variant: + if property == "content_key": + return content_key + return null + + +func _get_property_list() -> Array[Dictionary]: + var titles = "" + # only show notes_ properties in editor + if Engine.is_editor_hint(): + var ordered_titles = content_dialogue.get_ordered_titles() + if editor_filter and editor_filter != "none": + var filted_titles = ordered_titles.filter(_filter_property) + if filted_titles.size() > 0: + titles = ",".join(filted_titles) + else: + titles = ",".join(ordered_titles) + return [ + { + "name": "content_key", + "type": TYPE_STRING, + "hint": PROPERTY_HINT_ENUM_SUGGESTION, + "hint_string": titles + } + ] + + +func _filter_property(property: StringName) -> bool: + return property.find(editor_filter) >= 0 diff --git a/scene/entity/old/inspectable.tscn b/scene/entity/old/inspectable.tscn index 9f887dd7..1af1881b 100644 --- a/scene/entity/old/inspectable.tscn +++ b/scene/entity/old/inspectable.tscn @@ -12,6 +12,7 @@ size = Vector2(35, 70) [node name="Inspectable" type="Sprite2D"] script = ExtResource("1_0pc4s") +content_key = "" [node name="Sfx" parent="." instance=ExtResource("2_wrnix")] unique_name_in_owner = true diff --git a/scene/entity/ux/sign.gd b/scene/entity/ux/sign.gd index c023109e..a269d16b 100644 --- a/scene/entity/ux/sign.gd +++ b/scene/entity/ux/sign.gd @@ -13,13 +13,15 @@ signal cancel activate(null) if not enabled and activated: disactivate(null) + # 保持 player_touching 为 true,避免在 enable 时无法激活 player_touching = true _check_sign_display() @export var display_sign := true: set(val): - display_sign = val - _check_sign_display() -@export var draw_shadow := false + if display_sign != val: + display_sign = val + _check_sign_display() +# @export var draw_shadow := false @onready var texture_container = %TextureContainer as Container @onready var sprite2d = %Sprite2D as Sprite2D @@ -31,6 +33,7 @@ static var occupied: NodePath static var _pending_activate_sign: Array[NodePath] = [] # 使用互斥锁保证线程安全。在操作 occupied 或 _pending_activate_sign 时需要先锁定,操作完成后解锁 static var mutex = Mutex.new() +var tween: Tween var player_touching := false var activated = false: @@ -49,11 +52,11 @@ func _ready() -> void: # var point_light = get_node_or_null("../PointLight2D") # if point_light: # point_light.energy = 0.0 + _check_sign_display() var area2d = get_node_or_null("../Area2D") if area2d: area2d.body_entered.connect(activate) area2d.body_exited.connect(disactivate) - _check_sign_display() visibility_changed.connect(_on_visibility_changed) @@ -70,14 +73,13 @@ func _on_visibility_changed() -> void: func _check_sign_display(): if not enabled or not display_sign or not activated: modulate.a = 0.0 - else: + elif modulate.a == 0.0: modulate.a = 1.0 func activate(_body: Node2D) -> bool: # point_light.energy = 1.0 - if not is_node_ready(): - return false + # print("activate:", get_path()) var path := get_path() mutex.lock() player_touching = true @@ -94,7 +96,9 @@ func activate(_body: Node2D) -> bool: activated = true mutex.unlock() if activated and display_sign: - var tween = create_tween() + if tween and tween.is_valid(): + tween.kill() + tween = create_tween() tween.tween_property(self, "modulate:a", 1.0, 0.2) var p_tween = tween.parallel() p_tween.tween_property(self, "scale", base_scale * Vector2(1.2, 1.2), 0.3) @@ -126,7 +130,7 @@ func activate(_body: Node2D) -> bool: func disactivate(_body: Node2D) -> void: - # release_focus()d + # release_focus() mutex.lock() player_touching = false if activated: @@ -146,8 +150,11 @@ func disactivate(_body: Node2D) -> void: disactivate(_body) mutex.unlock() # point_light.energy = 0.0 - if modulate.a: - create_tween().tween_property(self, "modulate:a", 0.0, 0.2) + if tween and tween.is_valid(): + tween.kill() + if modulate.a > 0.0: + tween = create_tween() + tween.tween_property(self, "modulate:a", 0.0, 0.2) func _unhandled_input(event: InputEvent) -> void: diff --git a/scene/ground/scene/c01/s11_animation.gd b/scene/ground/scene/c01/s11_animation.gd index efa546e8..70f0db5e 100644 --- a/scene/ground/scene/c01/s11_animation.gd +++ b/scene/ground/scene/c01/s11_animation.gd @@ -25,7 +25,7 @@ func _ready() -> void: super._ready() if Engine.is_editor_hint(): return - + func _on_ground_ready() -> void: main_character = $"../DeployLayer/车夫与吕萍" @@ -54,7 +54,13 @@ func pop_title_3(): # 又是这个梦.. 12句 func dialog1() -> void: - DialogueManager.show_dialogue_balloon(dialogue_c01, "c01_s11_车夫对话1") + # debug 模式允许跳过 + if GlobalConfig.DEBUG: + DialogueManager.show_dialogue_balloon(dialogue_c01, "c01_s11_车夫对话1") + else: + DialogueManager.show_dialogue_balloon( + dialogue_c01, "c01_s11_车夫对话1", [GlobalConfig.DIALOG_IGNORE_INPUT] + ) DialogueManager.dialogue_ended.connect(_start_running, CONNECT_ONE_SHOT) @@ -74,14 +80,18 @@ func _loop_sfx(): # 车夫: “小姐,你这是回家过年是哇?” # 车夫: “啊?不会是工作吧” func dialog2() -> void: - DialogueManager.show_dialogue_balloon(dialogue_c01, "c01_s11_车夫对话2") + DialogueManager.show_dialogue_balloon( + dialogue_c01, "c01_s11_车夫对话2", [GlobalConfig.DIALOG_IGNORE_INPUT] + ) # 6句 # 车夫: “这不行的,你这小年夜还要安排工作啊” # 吕萍: “......” func dialog3() -> void: - DialogueManager.show_dialogue_balloon(dialogue_c01, "c01_s11_车夫对话3") + DialogueManager.show_dialogue_balloon( + dialogue_c01, "c01_s11_车夫对话3", [GlobalConfig.DIALOG_IGNORE_INPUT] + ) func _on_finished(): @@ -92,7 +102,9 @@ func _on_finished(): # 车夫: “到了,芦昌路26弄3号,就是这里” # 6句 # 车夫: “嗯,钱正好,那么我先跑了” - DialogueManager.show_dialogue_balloon(dialogue_c01, "c01_s11_车夫对话4") + DialogueManager.show_dialogue_balloon( + dialogue_c01, "c01_s11_车夫对话4", [GlobalConfig.DIALOG_IGNORE_INPUT] + ) # 运镜 marker var marker = Node2D.new() get_parent().add_child(marker) diff --git a/scene/ground/scene/c02/s01_animation.gd b/scene/ground/scene/c02/s01_animation.gd index 306566d8..e52eea0b 100644 --- a/scene/ground/scene/c02/s01_animation.gd +++ b/scene/ground/scene/c02/s01_animation.gd @@ -4,25 +4,26 @@ extends AnimationRoot # 覆盖该方法 func _default_data() -> Dictionary: - return {"received_letter": false} + # return {"received_letter": false} + return {} func _ready() -> void: super._ready() if Engine.is_editor_hint(): return - if not data["received_letter"]: - SceneManager.freeze_player(1.5) - get_tree().create_timer(1.5).timeout.connect(_give_letter) - elif GlobalConfig.DEBUG: - print("_give_letter 已发放") + # if not data["received_letter"]: + # SceneManager.freeze_player(1.5) + # get_tree().create_timer(1.5).timeout.connect(_give_letter) + # elif GlobalConfig.DEBUG: + # print("_give_letter 已发放") func _on_ground_ready() -> void: pass -func _give_letter() -> void: - set_data("received_letter", true) - SceneManager.enable_prop_item("prop_令牌") - print("_give_letter") +# func _give_letter() -> void: +# set_data("received_letter", true) +# SceneManager.enable_prop_item("prop_令牌") +# print("_give_letter") diff --git a/scene/ground/scene/c02/s01_街道.tscn b/scene/ground/scene/c02/s01_街道.tscn index 9bf7dd35..1ad6e0ca 100644 --- a/scene/ground/scene/c02/s01_街道.tscn +++ b/scene/ground/scene/c02/s01_街道.tscn @@ -33,7 +33,7 @@ target_portal = "left" [node name="Note寻人启事" parent="Ground/DeployLayer" index="2" instance=ExtResource("3_6lnxd")] position = Vector2(250, -22) title_filter = "c02" -note_key = "c02_寻人启事" +note_key = "c02_小蝉寻人启事_脸部破碎" [node name="Note门口" parent="Ground/DeployLayer" index="3" instance=ExtResource("3_6lnxd")] position = Vector2(311, -27) diff --git a/scene/ground/scene/c02/s02_animation.gd b/scene/ground/scene/c02/s02_animation.gd index 02bf1e8a..cb277f7a 100644 --- a/scene/ground/scene/c02/s02_animation.gd +++ b/scene/ground/scene/c02/s02_animation.gd @@ -3,6 +3,7 @@ extends AnimationRoot var wind_blows: AnimatedSprite2D var paper_man: Ambush2D +var gaslight: Interactable2D # 覆盖该方法 @@ -23,6 +24,13 @@ func _on_ground_ready() -> void: paper_man.enabled = data.display_paper_man paper_man.visible = data.display_paper_man paper_man.get_node("wall/CollisionShape2D").disabled = !data.display_paper_man + gaslight = $"../DeployLayer/Interactable煤油灯" + gaslight.get_node("PointLight2D").visible = gaslight.interacted_times > 0 + gaslight.interacted.connect(_on_gaslight_interacted, CONNECT_ONE_SHOT) + + +func _on_gaslight_interacted(): + gaslight.get_node("PointLight2D").visible = true func _oneshot_wind(): @@ -47,6 +55,7 @@ func _on_dialogue_ended(_res): func lumber_interacted(): + SceneManager.call_deferred("enable_prop_item", "prop_火柴") SceneManager.pop_debug_dialog_info("美术", "杂物堆⾥有眼睛瞟向玩家/眨动,然后消失(动画)") _display_paper_man() diff --git a/scene/ground/scene/c02/s02_走道.tscn b/scene/ground/scene/c02/s02_走道.tscn index 93201e7e..a2e8a07d 100644 --- a/scene/ground/scene/c02/s02_走道.tscn +++ b/scene/ground/scene/c02/s02_走道.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=17 format=3 uid="uid://brck77w81fhvc"] +[gd_scene load_steps=22 format=3 uid="uid://brck77w81fhvc"] [ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_wrr6r"] [ext_resource type="Script" path="res://scene/ground/scene/c02/s02_animation.gd" id="2_5p8ev"] @@ -12,6 +12,10 @@ [ext_resource type="PackedScene" uid="uid://c85t6stvytvjn" path="res://scene/entity/general/sfx.tscn" id="10_pelha"] [ext_resource type="AudioStream" uid="uid://dq2ndg5yd3rps" path="res://asset/audio/sfx/c02/出现.mp3" id="11_u68d7"] [ext_resource type="PackedScene" uid="uid://ci5anaxsa1apl" path="res://scene/entity/local_inspectable.tscn" id="12_0fckv"] +[ext_resource type="PackedScene" uid="uid://cw3q5pvciumil" path="res://scene/entity/interactable.tscn" id="13_ck13g"] +[ext_resource type="Texture2D" uid="uid://c4c7t2lttcf0a" path="res://asset/art/临时草稿/煤油灯.png" id="14_db4pu"] +[ext_resource type="Texture2D" uid="uid://doqtpiaf1weqc" path="res://asset/art/临时草稿/煤油灯_点燃.png" id="15_5rpxj"] +[ext_resource type="Texture2D" uid="uid://b7gyapghy3tsy" path="res://asset/art/neutral_point_light.png" id="16_asses"] [sub_resource type="Animation" id="Animation_abofy"] resource_name = "oneshot_天冷" @@ -43,6 +47,10 @@ size = Vector2(10, 70) [sub_resource type="RectangleShape2D" id="RectangleShape2D_mjnwv"] size = Vector2(17, 91) +[sub_resource type="RectangleShape2D" id="RectangleShape2D_maywn"] +resource_local_to_scene = true +size = Vector2(10, 70) + [node name="S02" type="Node2D"] metadata/_edit_horizontal_guides_ = [98.0] @@ -88,6 +96,7 @@ note_key = "c02_卫生宣传画" [node name="鼠疫海报" parent="Ground/DeployLayer" index="4" instance=ExtResource("12_0fckv")] position = Vector2(439, -18) texture_cover = ExtResource("7_wdwbi") +content_key = "c02_鼠疫海报" [node name="Ambush纸人" parent="Ground/DeployLayer" index="5" instance=ExtResource("8_52as8")] position = Vector2(198, 48) @@ -143,6 +152,28 @@ position = Vector2(510, 60) title_filter = "c02" note_key = "c02_老鼠洞" +[node name="Interactable煤油灯" parent="Ground/DeployLayer" index="9" instance=ExtResource("13_ck13g")] +position = Vector2(334, 69) +texture = ExtResource("14_db4pu") +interacted_texture = ExtResource("15_5rpxj") +prop_key = "prop_火柴" + +[node name="SfxInvalid" parent="Ground/DeployLayer/Interactable煤油灯" index="0"] +file = "门牌互动音.wav" + +[node name="SfxSuccess" parent="Ground/DeployLayer/Interactable煤油灯" index="1"] +file = "物品查看.mp3" + +[node name="CollisionShape2D" parent="Ground/DeployLayer/Interactable煤油灯/Area2D" index="0"] +shape = SubResource("RectangleShape2D_maywn") + +[node name="PointLight2D" type="PointLight2D" parent="Ground/DeployLayer/Interactable煤油灯"] +visible = false +position = Vector2(0, -33.3333) +range_layer_max = 1 +texture = ExtResource("16_asses") +texture_scale = 4.0 + [node name="MainPlayer" parent="Ground" index="5"] position = Vector2(53, 98) @@ -154,3 +185,5 @@ points = PackedVector2Array(37, 150, 670, 150) [editable path="Ground"] [editable path="Ground/DeployLayer/Ambush纸人"] +[editable path="Ground/DeployLayer/Interactable煤油灯"] +[editable path="Ground/DeployLayer/Interactable煤油灯/Sign"] diff --git a/scene/ground/scene/c02/s03_animation.gd b/scene/ground/scene/c02/s03_animation.gd index 6abbcac0..bea4f77b 100644 --- a/scene/ground/scene/c02/s03_animation.gd +++ b/scene/ground/scene/c02/s03_animation.gd @@ -1,6 +1,8 @@ @tool extends AnimationRoot +var gate: Interactable2D + # 覆盖该方法 func _default_data() -> Dictionary: @@ -14,4 +16,12 @@ func _ready() -> void: func _on_ground_ready() -> void: - pass \ No newline at end of file + gate = $"../DeployLayer/Interactable铁门" as Interactable2D + if gate.interacted_times > 0: + gate.get_node("Wall/CollisionShape2D").disabled = true + else: + gate.interacted.connect(_on_gate_interacted) + + +func _on_gate_interacted() -> void: + gate.get_node("Wall/CollisionShape2D").disabled = true diff --git a/scene/ground/scene/c02/s03_院子_黄昏无人.tscn b/scene/ground/scene/c02/s03_院子_黄昏无人.tscn new file mode 100644 index 00000000..29591a5b --- /dev/null +++ b/scene/ground/scene/c02/s03_院子_黄昏无人.tscn @@ -0,0 +1,106 @@ +[gd_scene load_steps=16 format=3 uid="uid://djc2uaefhmu7"] + +[ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_0dylx"] +[ext_resource type="Script" path="res://scene/ground/scene/c02/s03_animation.gd" id="2_dt5aj"] +[ext_resource type="Texture2D" uid="uid://c5xrsf623s0id" path="res://asset/art/scene/c02/s03_院子切换/bg_院子1楼(黄昏无人).png" id="3_bpjlk"] +[ext_resource type="Texture2D" uid="uid://gfb3g4vj5og0" path="res://asset/art/scene/c02/s03_院子切换/n_院子1楼(黄昏无人).png" id="4_1g6ks"] +[ext_resource type="PackedScene" uid="uid://61pis75a8fdq" path="res://scene/entity/portal.tscn" id="5_00b7a"] +[ext_resource type="PackedScene" uid="uid://jr1yd46wm5je" path="res://scene/entity/note.tscn" id="6_t48d1"] +[ext_resource type="Texture2D" uid="uid://dcnlkhicejjqk" path="res://asset/art/scene/c02/s04_院子现实版/e_铁门.png" id="8_fqsc2"] +[ext_resource type="PackedScene" uid="uid://cw3q5pvciumil" path="res://scene/entity/interactable.tscn" id="8_xt8j0"] +[ext_resource type="Texture2D" uid="uid://b343nvvbtpglb" path="res://asset/art/ui/互动提示符/ui 像素版_纯白.png" id="9_c36u3"] +[ext_resource type="Texture2D" uid="uid://i16byso2sxio" path="res://asset/art/scene/c02/s04_院子现实版/e_铁门栏杆背景部分.png" id="9_dck7k"] +[ext_resource type="Texture2D" uid="uid://b72loyn1of7tb" path="res://asset/art/scene/c02/s04_院子现实版/fg_楼梯.png" id="9_r21bs"] + +[sub_resource type="CanvasTexture" id="CanvasTexture_41q0k"] +diffuse_texture = ExtResource("3_bpjlk") +normal_texture = ExtResource("4_1g6ks") + +[sub_resource type="AtlasTexture" id="AtlasTexture_03n47"] +atlas = ExtResource("9_c36u3") +region = Rect2(480, 468, 63, 63) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_er6ob"] +resource_local_to_scene = true +size = Vector2(40, 70) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_mdix7"] +size = Vector2(5, 100) + +[node name="S03" type="Node2D"] + +[node name="Ground" parent="." instance=ExtResource("1_0dylx")] +scene_name = "c02_s03" +player_y = 60 + +[node name="AnimationPlayer" parent="Ground" index="0"] +script = ExtResource("2_dt5aj") +oneshot_animation = "" + +[node name="BGSprite2D" parent="Ground" index="2"] +texture = SubResource("CanvasTexture_41q0k") + +[node name="portal_left" parent="Ground/DeployLayer" index="0"] +position = Vector2(25, 3) +target_scene = "c02_s02" +target_portal = "right" + +[node name="portal_right" parent="Ground/DeployLayer" index="1"] +position = Vector2(2286, 16) + +[node name="portal_1" parent="Ground/DeployLayer" index="2" instance=ExtResource("5_00b7a")] +position = Vector2(193, 14) +debug_note = "1012保卫科" +portal_name = "1" +target_scene = "c02_s05" +target_portal = "left" +status = "locked" +prop_key = "prop_1012钥匙" + +[node name="Interactable铁门" parent="Ground/DeployLayer" index="3" instance=ExtResource("8_xt8j0")] +position = Vector2(1072, 22) +texture = ExtResource("8_fqsc2") +matched_sign_texture = SubResource("AtlasTexture_03n47") +interacted_texture = ExtResource("9_dck7k") +prop_key = "prop_老虎钳" + +[node name="CollisionShape2D" parent="Ground/DeployLayer/Interactable铁门/Area2D" index="0"] +shape = SubResource("RectangleShape2D_er6ob") + +[node name="Wall" type="StaticBody2D" parent="Ground/DeployLayer/Interactable铁门"] +position = Vector2(3, 1) +collision_layer = 2 +collision_mask = 0 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Ground/DeployLayer/Interactable铁门/Wall"] +shape = SubResource("RectangleShape2D_mdix7") + +[node name="Note血迹" parent="Ground/DeployLayer" index="4" instance=ExtResource("6_t48d1")] +position = Vector2(601, 82) +note_key = "notes_干掉的血迹" + +[node name="MainPlayer" parent="Ground" index="5"] +position = Vector2(25, 98) + +[node name="BGParallaxLayer" parent="Ground/ParallaxForeground" index="0"] +use_parent_material = true + +[node name="楼梯" type="Sprite2D" parent="Ground/ParallaxForeground/BGParallaxLayer" index="0"] +position = Vector2(1250, 2) +scale = Vector2(1.05, 1.05) +texture = ExtResource("9_r21bs") + +[node name="FGSprite2D" parent="Ground/ParallaxForeground/FGParallaxLayer" index="0"] +position = Vector2(0, -7) +scale = Vector2(1.08, 1.08) + +[node name="PlayerLine2D" parent="Ground/ParallaxForeground" index="2"] +points = PackedVector2Array(37, 150, 2350, 150) + +[node name="DirectionalLight2D" parent="Ground" index="9"] +visible = false +color = Color(0.688281, 0.748391, 0.96674, 1) + +[editable path="Ground"] +[editable path="Ground/DeployLayer/Interactable铁门"] +[editable path="Ground/DeployLayer/Interactable铁门/Sign"] diff --git a/scene/ground/scene/c02/s03_院子切换.tscn b/scene/ground/scene/c02/s03_院子切换.tscn deleted file mode 100644 index 4ad449fb..00000000 --- a/scene/ground/scene/c02/s03_院子切换.tscn +++ /dev/null @@ -1,98 +0,0 @@ -[gd_scene load_steps=14 format=3 uid="uid://djc2uaefhmu7"] - -[ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_lheeb"] -[ext_resource type="Script" path="res://scene/ground/scene/c02/s03_animation.gd" id="2_l2oec"] -[ext_resource type="PackedScene" uid="uid://0sofmhrl358m" path="res://scene/entity/npc.tscn" id="2_r5smg"] -[ext_resource type="PackedScene" uid="uid://jr1yd46wm5je" path="res://scene/entity/note.tscn" id="3_6x7xl"] -[ext_resource type="Texture2D" uid="uid://c5xrsf623s0id" path="res://asset/art/scene/c02/s03_院子切换/bg_院子1楼(黄昏无人).png" id="3_78bcp"] -[ext_resource type="Texture2D" uid="uid://gfb3g4vj5og0" path="res://asset/art/scene/c02/s03_院子切换/n_院子1楼(黄昏无人).png" id="4_nef6w"] -[ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="6_gg4jv"] -[ext_resource type="Texture2D" uid="uid://b72loyn1of7tb" path="res://asset/art/scene/c02/s04_院子现实版/fg_楼梯.png" id="7_icddm"] -[ext_resource type="PackedScene" uid="uid://cw3q5pvciumil" path="res://scene/entity/interactable.tscn" id="8_vdelk"] -[ext_resource type="PackedScene" uid="uid://svvlohuicvhf" path="res://scene/entity/ambient/light.tscn" id="10_uxbu3"] -[ext_resource type="PackedScene" uid="uid://b8ncf4d0jda8r" path="res://scene/entity/partical/particals_ash.tscn" id="13_kq517"] - -[sub_resource type="CanvasTexture" id="CanvasTexture_41q0k"] -diffuse_texture = ExtResource("3_78bcp") -normal_texture = ExtResource("4_nef6w") - -[sub_resource type="RectangleShape2D" id="RectangleShape2D_ec3g1"] -resource_local_to_scene = true -size = Vector2(40, 70) - -[node name="S03" type="Node2D"] - -[node name="Ground" parent="." instance=ExtResource("1_lheeb")] -scene_name = "c02_s03" -player_y = 60 - -[node name="AnimationPlayer" parent="Ground" index="0"] -script = ExtResource("2_l2oec") -oneshot_animation = "" - -[node name="BGSprite2D" parent="Ground" index="2"] -texture = SubResource("CanvasTexture_41q0k") - -[node name="portal_left" parent="Ground/DeployLayer" index="0"] -position = Vector2(25, 3) -target_scene = "c02_s02" -target_portal = "right" - -[node name="portal_right" parent="Ground/DeployLayer" index="1"] -position = Vector2(629, 2) - -[node name="Npc" parent="Ground/DeployLayer" index="2" instance=ExtResource("2_r5smg")] -position = Vector2(465, 23) -frame_progress = 0.649558 -character_name = "张胖子" -dialogue_title = "张胖子_01" - -[node name="Note" parent="Ground/DeployLayer" index="3" instance=ExtResource("3_6x7xl")] -position = Vector2(268, -36) -note_key = "c02_老鼠洞2" - -[node name="Ambush" parent="Ground/DeployLayer" index="4" instance=ExtResource("6_gg4jv")] -position = Vector2(343, 33) -freeze_time = 15.0 -hook_dialogue_res = "c02" -hook_dialogue_title = "c02_s04_张胖子卖肉" - -[node name="CollisionShape2D" parent="Ground/DeployLayer/Ambush/Area2D" index="0"] -shape = SubResource("RectangleShape2D_ec3g1") - -[node name="Interactable" parent="Ground/DeployLayer" index="5" instance=ExtResource("8_vdelk")] -position = Vector2(1072, 22) -unmatched_sign_texture = null -matched_sign_texture = null - -[node name="灯笼" parent="Ground/AmbientLayer" index="0" instance=ExtResource("10_uxbu3")] -position = Vector2(845, -25) -ambient_light_scale = 2.0 -ambient_light_energy = 2.0 - -[node name="ParticalsAsh" parent="Ground/AmbientLayer" index="1" instance=ExtResource("13_kq517")] -position = Vector2(1120, 5) - -[node name="MainPlayer" parent="Ground" index="5"] -position = Vector2(25, 98) - -[node name="BGParallaxLayer" parent="Ground/ParallaxForeground" index="0"] -use_parent_material = true - -[node name="楼梯" type="Sprite2D" parent="Ground/ParallaxForeground/BGParallaxLayer" index="0"] -position = Vector2(1250, 2) -scale = Vector2(1.05, 1.05) -texture = ExtResource("7_icddm") - -[node name="FGSprite2D" parent="Ground/ParallaxForeground/FGParallaxLayer" index="0"] -position = Vector2(0, -7) -scale = Vector2(1.08, 1.08) - -[node name="PlayerLine2D" parent="Ground/ParallaxForeground" index="2"] -points = PackedVector2Array(37, 150, 2350, 150) - -[node name="DirectionalLight2D" parent="Ground" index="9"] -color = Color(0.688281, 0.748391, 0.96674, 1) - -[editable path="Ground"] -[editable path="Ground/DeployLayer/Ambush"] diff --git a/scene/ground/scene/c02/s04_院子现实版.tscn b/scene/ground/scene/c02/s04_院子现实版.tscn index 1efb999e..c457dd1e 100644 --- a/scene/ground/scene/c02/s04_院子现实版.tscn +++ b/scene/ground/scene/c02/s04_院子现实版.tscn @@ -20,21 +20,13 @@ oneshot_animation = "" [node name="BGSprite2D" parent="Ground" index="2"] texture = ExtResource("3_gmxu4") -[node name="portal_left" parent="Ground/DeployLayer" index="0"] -disable_key_after_used = null - -[node name="portal_right" parent="Ground/DeployLayer" index="1"] -disable_key_after_used = null - [node name="portal_1" parent="Ground/DeployLayer" index="2" instance=ExtResource("4_xw32r")] position = Vector2(194, 10) debug_note = "通往 1012 房间" portal_name = "1" target_scene = "c02_s05" target_portal = "right" -status = "locked" -disable_key_after_used = null -prop_key = "prop_1012钥匙" +status = "opened" [node name="楼梯" type="Sprite2D" parent="Ground/DeployLayer" index="3"] z_index = 7 diff --git a/scene/ground/scene/c02/s05_1012外间现实版.tscn b/scene/ground/scene/c02/s05_1012外间现实版.tscn index 12dbd13e..16aa4357 100644 --- a/scene/ground/scene/c02/s05_1012外间现实版.tscn +++ b/scene/ground/scene/c02/s05_1012外间现实版.tscn @@ -1,9 +1,11 @@ -[gd_scene load_steps=5 format=3 uid="uid://bivc5cdap370p"] +[gd_scene load_steps=7 format=3 uid="uid://bivc5cdap370p"] [ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_2713m"] [ext_resource type="Script" path="res://scene/ground/scene/c02/s05_animation.gd" id="2_3v8iu"] [ext_resource type="Texture2D" uid="uid://cl8no405v4hsk" path="res://asset/art/scene/c02/s05_1012外间现实版/bg_1012外间.png" id="3_8jr2p"] [ext_resource type="Texture2D" uid="uid://d04bppjl5h3vo" path="res://asset/art/scene/c02/s05_1012外间现实版/fg_1012外间.png" id="4_quka7"] +[ext_resource type="Texture2D" uid="uid://bykkjm7wker46" path="res://asset/art/scene/c02/s05_1012外间现实版/ux_公寓告示1.png" id="5_8vm4y"] +[ext_resource type="PackedScene" uid="uid://wyj4qdjyn4ql" path="res://scene/entity/old/inspectable.tscn" id="6_stoff"] [node name="S05" type="Node2D"] @@ -17,23 +19,34 @@ script = ExtResource("2_3v8iu") oneshot_animation = "" [node name="BGSprite2D" parent="Ground" index="2"] -position = Vector2(74, 2) +position = Vector2(72, 2) texture = ExtResource("3_8jr2p") [node name="portal_left" parent="Ground/DeployLayer" index="0"] -position = Vector2(138, 18) -disable_key_after_used = null +position = Vector2(98, 27) +target_scene = "c02_s03" +target_portal = "1" [node name="portal_right" parent="Ground/DeployLayer" index="1"] -position = Vector2(447, 26) -disable_key_after_used = null +position = Vector2(447, 30) +target_scene = "c02_s04" +target_portal = "1" +status = "locked" +prop_key = "prop_3014旋转锁钥匙" + +[node name="Inspectable公寓告示" parent="Ground/DeployLayer" index="2" instance=ExtResource("6_stoff")] +position = Vector2(257, 31) +texture_cover = ExtResource("5_8vm4y") +note_centered = true +content_key = "c02_公寓告示" [node name="MainPlayer" parent="Ground" index="5"] position = Vector2(447, 103) facing_direction = Vector2(-1, 0) [node name="FGSprite2D" parent="Ground/ParallaxForeground/FGParallaxLayer" index="0"] -position = Vector2(75, -15) +position = Vector2(53, -15) +scale = Vector2(1.1, 1.1) texture = ExtResource("4_quka7") [node name="PlayerLine2D" parent="Ground/ParallaxForeground" index="2"] diff --git a/scene/ground/scene/c02/s06_院子_黄昏有人.tscn b/scene/ground/scene/c02/s06_院子_黄昏有人.tscn new file mode 100644 index 00000000..004b7c6c --- /dev/null +++ b/scene/ground/scene/c02/s06_院子_黄昏有人.tscn @@ -0,0 +1,67 @@ +[gd_scene load_steps=10 format=3 uid="uid://cootarwb44vvh"] + +[ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_qkymk"] +[ext_resource type="Script" path="res://scene/ground/scene/c02/s06_animation.gd" id="2_4dg6u"] +[ext_resource type="Texture2D" uid="uid://d1cmto7bvap2g" path="res://asset/art/scene/c02/s06_院子回忆版/bg_院子1楼(黄昏有人).png" id="3_tl7hb"] +[ext_resource type="PackedScene" uid="uid://61pis75a8fdq" path="res://scene/entity/portal.tscn" id="4_haidv"] +[ext_resource type="Texture2D" uid="uid://wge8cr5h5p78" path="res://asset/art/scene/c02/s06_院子回忆版/fg_楼梯2.png" id="5_r0p1a"] +[ext_resource type="PackedScene" uid="uid://0sofmhrl358m" path="res://scene/entity/npc.tscn" id="6_03lid"] +[ext_resource type="PackedScene" uid="uid://svvlohuicvhf" path="res://scene/entity/ambient/light.tscn" id="7_1ts7h"] +[ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="7_102ju"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_axmsu"] +resource_local_to_scene = true +size = Vector2(40, 70) + +[node name="S06" type="Node2D"] + +[node name="Ground" parent="." instance=ExtResource("1_qkymk")] +scene_name = "c02_s06" + +[node name="AnimationPlayer" parent="Ground" index="0"] +script = ExtResource("2_4dg6u") +oneshot_animation = "" + +[node name="BGSprite2D" parent="Ground" index="2"] +texture = ExtResource("3_tl7hb") + +[node name="portal_1" parent="Ground/DeployLayer" index="2" instance=ExtResource("4_haidv")] +position = Vector2(194, 11) +debug_note = "1012 保卫室" +portal_name = "1" +target_scene = "c02_s05" +target_portal = "left" +status = "opened" + +[node name="楼梯" type="Sprite2D" parent="Ground/DeployLayer" index="3"] +z_index = 7 +position = Vector2(1264, -3) +texture = ExtResource("5_r0p1a") + +[node name="Npc" parent="Ground/DeployLayer" index="4" instance=ExtResource("6_03lid")] +position = Vector2(465, 23) +frame_progress = 0.649558 +character_name = "张胖子" +dialogue_title = "张胖子_01" + +[node name="Ambush张胖子对话" parent="Ground/DeployLayer" index="5" instance=ExtResource("7_102ju")] +position = Vector2(343, 33) +freeze_time = 15.0 +hook_dialogue_res = "c02" +hook_dialogue_title = "c02_s04_张胖子卖肉" + +[node name="CollisionShape2D" parent="Ground/DeployLayer/Ambush张胖子对话/Area2D" index="0"] +shape = SubResource("RectangleShape2D_axmsu") + +[node name="灯笼" parent="Ground/AmbientLayer" index="0" instance=ExtResource("7_1ts7h")] +position = Vector2(1539, -95) + +[node name="FGSprite2D" parent="Ground/ParallaxForeground/FGParallaxLayer" index="0"] +position = Vector2(0, -5) +scale = Vector2(1.1, 1.1) + +[node name="PlayerLine2D" parent="Ground/ParallaxForeground" index="2"] +points = PackedVector2Array(37, 150, 2350, 150) + +[editable path="Ground"] +[editable path="Ground/DeployLayer/Ambush张胖子对话"] diff --git a/scene/ground/scene/c02/s06_院子回忆版.tscn b/scene/ground/scene/c02/s06_院子回忆版.tscn deleted file mode 100644 index 96a5a4e1..00000000 --- a/scene/ground/scene/c02/s06_院子回忆版.tscn +++ /dev/null @@ -1,37 +0,0 @@ -[gd_scene load_steps=6 format=3 uid="uid://cootarwb44vvh"] - -[ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_1kelt"] -[ext_resource type="Script" path="res://scene/ground/scene/c02/s06_animation.gd" id="2_d64eu"] -[ext_resource type="Texture2D" uid="uid://d1cmto7bvap2g" path="res://asset/art/scene/c02/s06_院子回忆版/bg_院子1楼(黄昏有人).png" id="3_4fobb"] -[ext_resource type="PackedScene" uid="uid://61pis75a8fdq" path="res://scene/entity/portal.tscn" id="4_1mes0"] -[ext_resource type="Texture2D" uid="uid://wge8cr5h5p78" path="res://asset/art/scene/c02/s06_院子回忆版/fg_楼梯2.png" id="6_5nv2j"] - -[node name="S06" type="Node2D"] - -[node name="Ground" parent="." instance=ExtResource("1_1kelt")] -scene_name = "c02_s06" - -[node name="AnimationPlayer" parent="Ground" index="0"] -script = ExtResource("2_d64eu") -oneshot_animation = "" - -[node name="BGSprite2D" parent="Ground" index="2"] -texture = ExtResource("3_4fobb") - -[node name="portal_1" parent="Ground/DeployLayer" index="2" instance=ExtResource("4_1mes0")] -position = Vector2(1739, 9) -portal_name = "1" - -[node name="楼梯" type="Sprite2D" parent="Ground/DeployLayer" index="3"] -z_index = 7 -position = Vector2(1264, -3) -texture = ExtResource("6_5nv2j") - -[node name="FGSprite2D" parent="Ground/ParallaxForeground/FGParallaxLayer" index="0"] -position = Vector2(0, -5) -scale = Vector2(1.1, 1.1) - -[node name="PlayerLine2D" parent="Ground/ParallaxForeground" index="2"] -points = PackedVector2Array(37, 150, 2350, 150) - -[editable path="Ground"] diff --git a/scene/prop/prop_hud.gd b/scene/prop/prop_hud.gd index 8c1c2373..8a080375 100644 --- a/scene/prop/prop_hud.gd +++ b/scene/prop/prop_hud.gd @@ -310,8 +310,6 @@ func disable_prop_item(prop_key: String) -> void: inventory.disable_item(prop_key) _load_texture_cache() _update_prop_display_with_texture() - # save to archive immediately - ArchiveManager.save_all() var shake_tween diff --git a/scene/prop/prop_inspector.gd b/scene/prop/prop_inspector.gd index 9d8dd047..8c2f70b9 100644 --- a/scene/prop/prop_inspector.gd +++ b/scene/prop/prop_inspector.gd @@ -6,6 +6,7 @@ enum { STATUS_HIDDEN, STATUS_INSPECTING_PROP, STATUS_INSPECTING_COVER, STATUS_IN # must be connected to signal quit_and_hidden +@onready var notes_bg = %NotesBG as TextureRect @onready var prop_bg = %PropBG as TextureRect @onready var origin_texture = %OriginPropTexture as TextureRect @onready var full_texture = %FullTexture as TextureRect @@ -55,6 +56,7 @@ func _post_hide(): texture_notes = null content_label.text = "" tip_label.text = tip_cover + notes_bg.visible = false visible = false quit_and_hidden.emit() @@ -71,7 +73,11 @@ func _blink_label(init := true): blinking_tween.tween_callback(_blink_label.bind(true)) -func pop_standard_inspection(cover_texture, notes_texture, inspection_note): +func pop_standard_inspection(cover_texture, notes_texture, inspection_note, centered := true): + if centered: + content_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER + else: + content_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT if status != STATUS_HIDDEN: _hide() status = STATUS_INSPECTING_COVER @@ -133,16 +139,16 @@ func _unhandled_input(event: InputEvent) -> void: if status == STATUS_INSPECTING_COVER: # inspect notes status = STATUS_INSPECTING_NOTES - # if not texture_notes: - # prop_bg.visible = true - # else: - # texture_rect.texture = texture_notes - full_texture.texture = texture_notes + if not texture_notes: + notes_bg.visible = true + else: + full_texture.texture = texture_notes tip_label.text = tip_notes create_tween().tween_property(content_label, "modulate:a", 1.0, 0.2) elif status == STATUS_INSPECTING_NOTES: # inspect cover status = STATUS_INSPECTING_COVER + notes_bg.visible = false full_texture.texture = texture_cover tip_label.text = tip_cover create_tween().tween_property(content_label, "modulate:a", 0.0, 0.2) diff --git a/scene/prop/prop_inspector.tscn b/scene/prop/prop_inspector.tscn index 936041c6..88d4855d 100644 --- a/scene/prop/prop_inspector.tscn +++ b/scene/prop/prop_inspector.tscn @@ -64,28 +64,47 @@ size_flags_vertical = 4 mouse_filter = 2 texture = ExtResource("2_wr575") -[node name="ContentLabel" type="Label" parent="."] +[node name="NotesBG" type="TextureRect" parent="."] unique_name_in_owner = true -modulate = Color(1, 1, 1, 0) -custom_minimum_size = Vector2(120, 0) -anchors_preset = 8 -anchor_left = 0.5 +visible = false +self_modulate = Color(1, 1, 1, 0.678431) +anchors_preset = 14 anchor_top = 0.5 -anchor_right = 0.5 +anchor_right = 1.0 anchor_bottom = 0.5 -offset_left = -60.0 -offset_top = -97.5 -offset_right = 60.0 -offset_bottom = 97.5 +offset_top = -120.0 +offset_bottom = 120.0 grow_horizontal = 2 grow_vertical = 2 size_flags_horizontal = 4 +mouse_filter = 2 +texture = ExtResource("2_j83lq") + +[node name="MarginContainer2" type="MarginContainer" parent="."] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +theme_override_constants/margin_left = 200 +theme_override_constants/margin_top = 60 +theme_override_constants/margin_right = 200 +theme_override_constants/margin_bottom = 60 + +[node name="ContentLabel" type="Label" parent="MarginContainer2"] +unique_name_in_owner = true +modulate = Color(1, 1, 1, 0) +custom_minimum_size = Vector2(150, 0) +layout_mode = 2 +size_flags_horizontal = 4 text = "据闻奉贤县分水墩又有七人染受鼠疫,病状可怖,闻医官药治无用,免职。 有地方人称鼠疫为妖邪作祟,甚为惊骇,一时人心惶惶,竟有聚众滋闹之事,政府以防疫事宜关系紧要,拟赴分水墩一带调查防疫事宜云。 《申报》 民国五年一月十三日" label_settings = SubResource("LabelSettings_5qe7a") +horizontal_alignment = 1 vertical_alignment = 1 autowrap_mode = 3 diff --git a/scene/settings/settings.tscn b/scene/settings/settings.tscn index 21034e03..93318594 100644 --- a/scene/settings/settings.tscn +++ b/scene/settings/settings.tscn @@ -4,6 +4,7 @@ [node name="Settings" type="CanvasLayer"] process_mode = 3 +layer = 30 script = ExtResource("1_7u4nq") [node name="PanelContainer" type="PanelContainer" parent="."] diff --git a/ui/settings.tscn b/ui/settings.tscn deleted file mode 100644 index 3cbb7a6d..00000000 --- a/ui/settings.tscn +++ /dev/null @@ -1,7 +0,0 @@ -[gd_scene load_steps=2 format=3 uid="uid://c5wtakm14h7cy"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_jngmd"] -region = Rect2(254, 362, 994, 1314) - -[node name="Settings" type="Sprite2D"] -texture = SubResource("AtlasTexture_jngmd")