From 21b807dfebad5bee25bbf31c0c6f17aa1575651c Mon Sep 17 00:00:00 2001 From: cakipaul Date: Tue, 7 Jan 2025 19:44:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dsign=E7=9A=84=E5=A4=9A?= =?UTF-8?q?=E7=BA=BF=E7=A8=8B&=E5=A4=9A=E8=8A=82=E7=82=B9=E6=8A=A2?= =?UTF-8?q?=E7=94=A8=E9=97=AE=E9=A2=98=EF=BC=8C=E8=87=AA=E5=8A=A8=E6=8C=89?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E9=A1=BA=E5=BA=8F=E4=BE=9D=E6=AC=A1=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- asset/art/ui/chess.png | Bin 817 -> 807 bytes asset/art/ui/journal.aseprite | Bin 4398 -> 4386 bytes scene/entity/ux/sign.gd | 63 ++++++++++------------- scene/ground/scene/c02/s02_走道.tscn | 28 +++++----- scene/ground/scene/c02/s03_院子切换.tscn | 4 +- scene/journal/journal.gd | 6 +++ scene/journal/journal.tscn | 2 +- scene/main.tscn | 3 +- 8 files changed, 51 insertions(+), 55 deletions(-) diff --git a/asset/art/ui/chess.png b/asset/art/ui/chess.png index 93d37ee75b863c34e2c415078acc6cb0d0f7b80a..1c48384555d4b044128651d9f1b9d30564867914 100644 GIT binary patch delta 316 zcmV-C0mJ^W2B!wF^#Ok!NklhW(ML_6{)PE_%R|5 z1Fx5l)&m?+_GZEb)fH)iVrNE3UqF$__(3n>k-+O|7N3tCUy3Gy$zS3Yp85>04!_=< zjH=ueyH$+6q_bh5 zCc(W?b24WB@t|n!-U?|rPFTXLQ|&*(FV1Zz$nT;)XQPd!%{p`Z&@M1M-)W#(A+NN3 z*|K1TUo`$qt*=XA*P`_0!Z|JcsHWqAcvVB{iwCsq`wySi@&i2oRE3AU{;{id3vUA3 zHipleQu&RuRjo7!XHXEvf+@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5Un&r#|Y9V)bxPwk6BrWSn9D3sD{Fh<*sD z^N)^U!S7P2?~sHZvq void: func activate(_body: Node2D) -> void: # point_light.energy = 1.0 + if not is_node_ready(): + await ready + var path := get_path() mutex.lock() - if occupied and occupied != get_path(): - own_callable = activate.bind(_body) - _pending_callables.append(own_callable) + if occupied and occupied != path: + _pending_activate_sign.append(path) + mutex.unlock() + return else: - occupied = get_path() + occupied = path activated = true mutex.unlock() if activated and show_sign: @@ -71,13 +73,23 @@ func activate(_body: Node2D) -> void: func disactivate(_body: Node2D) -> void: - activated = false - if _unoccupy(): - while _pending_callables.size() > 0: - var callable = _pending_callables.pop_front() as Callable - if callable.is_valid(): - callable.call() + mutex.lock() + if activated: + if occupied == get_path(): + occupied = "" + while _pending_activate_sign.size() > 0: + var path = _pending_activate_sign.pop_front() + var _sign = get_node_or_null(path) + if _sign: + _sign.activate(null) break + else: + # make sure the sign is not in the pending list + _pending_activate_sign.erase(get_path()) + # double check. because the sign may be activated by other body + if activated: + disactivate(_body) + mutex.unlock() # point_light.energy = 0.0 if show_sign: create_tween().tween_property(self, "modulate:a", 0.0, 0.2) @@ -90,26 +102,3 @@ func _unhandled_input(event: InputEvent) -> void: elif event.is_action_pressed("cancel"): cancel.emit() get_viewport().set_input_as_handled() - - -func _exit_tree() -> void: - if _unoccupy(): - while _pending_callables.size() > 0: - var callable = _pending_callables.pop_front() as Callable - if callable.is_valid(): - callable.call() - break - cancel.emit() - - -func _unoccupy() -> bool: - var self_occupied = false - mutex.lock() - if occupied == get_path(): - occupied = "" - self_occupied = true - elif own_callable: - _pending_callables.erase(own_callable) - own_callable = null - mutex.unlock() - return self_occupied diff --git a/scene/ground/scene/c02/s02_走道.tscn b/scene/ground/scene/c02/s02_走道.tscn index 7f2e4bd8..fb8b62b3 100644 --- a/scene/ground/scene/c02/s02_走道.tscn +++ b/scene/ground/scene/c02/s02_走道.tscn @@ -60,7 +60,17 @@ inspection_note = "据闻奉贤县分水墩又有七人染受鼠疫,病状可 《申报》 民国五年一月十三日" -[node name="纸人" parent="Ground/DeployLayer" index="4" instance=ExtResource("5_nhtbp")] +[node name="鼠疫海报local" parent="Ground/DeployLayer" index="4" instance=ExtResource("12_0fckv")] +position = Vector2(387, -25) +entity_title = "鼠疫海报" +texture_cover = ExtResource("7_wdwbi") +inspection_note = "据闻奉贤县分水墩又有七人染受鼠疫,病状可怖,闻医官药治无用,免职。 +有地方人称鼠疫为妖邪作祟,甚为惊骇,一时人心惶惶,竟有聚众滋闹之事,政府以防疫事宜关系紧要,拟赴分水墩一带调查防疫事宜云。 + +《申报》 +民国五年一月十三日" + +[node name="纸人" parent="Ground/DeployLayer" index="5" instance=ExtResource("5_nhtbp")] position = Vector2(601, 44) texture = ExtResource("7_xsghn") flip_h = true @@ -72,11 +82,11 @@ collision_mask = 0 [node name="CollisionShape2D" type="CollisionShape2D" parent="Ground/DeployLayer/纸人/StaticBody2D"] shape = SubResource("RectangleShape2D_0xrg2") -[node name="Ambush" parent="Ground/DeployLayer" index="5" instance=ExtResource("6_70vqn")] -position = Vector2(434, 60) +[node name="Ambush" parent="Ground/DeployLayer" index="6" instance=ExtResource("6_70vqn")] +position = Vector2(502, 56) hook_cg = "c02_胖子说话" -[node name="HdEntity" parent="Ground/DeployLayer" index="6" node_paths=PackedStringArray("sprite_ref") instance=ExtResource("10_3c313")] +[node name="HdEntity" parent="Ground/DeployLayer" index="7" node_paths=PackedStringArray("sprite_ref") instance=ExtResource("10_3c313")] position = Vector2(147, 75) sprite_name = "car" texture = ExtResource("11_x0h3x") @@ -88,16 +98,6 @@ position = Vector2(1, -28) [node name="CollisionShape2D" parent="Ground/DeployLayer/HdEntity/Area2D" index="0"] shape = SubResource("RectangleShape2D_3qhvr") -[node name="LocalInspectable" parent="Ground/DeployLayer" index="7" instance=ExtResource("12_0fckv")] -position = Vector2(387, -25) -entity_title = "鼠疫海报" -texture_cover = ExtResource("7_wdwbi") -inspection_note = "据闻奉贤县分水墩又有七人染受鼠疫,病状可怖,闻医官药治无用,免职。 -有地方人称鼠疫为妖邪作祟,甚为惊骇,一时人心惶惶,竟有聚众滋闹之事,政府以防疫事宜关系紧要,拟赴分水墩一带调查防疫事宜云。 - -《申报》 -民国五年一月十三日" - [node name="FGSprite2D" parent="Ground/ParallaxForeground/FGParallaxLayer" index="0"] texture = null diff --git a/scene/ground/scene/c02/s03_院子切换.tscn b/scene/ground/scene/c02/s03_院子切换.tscn index b1890515..0a5bbc6b 100644 --- a/scene/ground/scene/c02/s03_院子切换.tscn +++ b/scene/ground/scene/c02/s03_院子切换.tscn @@ -30,7 +30,7 @@ normal_texture = ExtResource("4_nef6w") [node name="Ground" parent="." instance=ExtResource("1_lheeb")] scene_config = SubResource("Resource_vdo00") -[node name="BGSprite2D" parent="Ground" index="0"] +[node name="BGSprite2D" parent="Ground" index="1"] texture = SubResource("CanvasTexture_41q0k") [node name="PortalLeft" parent="Ground/DeployLayer" index="0"] @@ -78,7 +78,7 @@ texture = ExtResource("7_icddm") position = Vector2(-12, -143) scale = Vector2(1.08, 1.08) -[node name="DirectionalLight2D" parent="Ground" index="5"] +[node name="DirectionalLight2D" parent="Ground" index="6"] color = Color(0.368627, 0.447059, 0.882353, 1) [editable path="Ground"] diff --git a/scene/journal/journal.gd b/scene/journal/journal.gd index bef8e884..01ef2361 100644 --- a/scene/journal/journal.gd +++ b/scene/journal/journal.gd @@ -38,6 +38,12 @@ var items_dict := {} func _ready() -> void: reload() + if GlobalConfig.DEBUG: + locked = false + display = true + else: + locked = true + display = false _toggle_display(false) diff --git a/scene/journal/journal.tscn b/scene/journal/journal.tscn index 1c5fa4f3..152b84fe 100644 --- a/scene/journal/journal.tscn +++ b/scene/journal/journal.tscn @@ -18,7 +18,7 @@ grow_horizontal = 2 grow_vertical = 2 mouse_filter = 2 script = ExtResource("1_y2537") -locked = true +tip_content = "哆莱米发索拉西123456789" [node name="JournalPage" type="TextureRect" parent="JournalRoot"] show_behind_parent = true diff --git a/scene/main.tscn b/scene/main.tscn index 9b3c7817..d13999a6 100644 --- a/scene/main.tscn +++ b/scene/main.tscn @@ -20,7 +20,7 @@ environment = ExtResource("9_jsof5") [node name="GroundLoader" parent="." instance=ExtResource("10_8rc5n")] position = Vector2(1, 0) ignore_archive = true -current_scene = "c01_s05" +current_scene = "c02_s02" [node name="MainPlayer" parent="." instance=ExtResource("6_6geb0")] unique_name_in_owner = true @@ -97,3 +97,4 @@ scale = Vector2(0.24, 0.24) metadata/_edit_use_anchors_ = true [node name="Journal" parent="." instance=ExtResource("10_durpa")] +visible = false