From f24a01dbca157d6fc19b29815d7726eb245428af Mon Sep 17 00:00:00 2001 From: xiangwang Date: Sat, 7 Feb 2026 21:07:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E4=B8=8E=E9=80=9A=E7=9F=A5=E6=9D=BF=E9=97=AE=E9=A2=98=20-=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8DZ=E8=BD=B4=E9=80=BB=E8=BE=91=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E7=B2=BE=E7=81=B5=E4=B8=8E=E7=89=A9=E5=93=81=E7=9A=84?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=20-=20=E6=B8=B2=E6=9F=93=E5=89=8D=E5=BC=BA?= =?UTF-8?q?=E5=88=B6=20content=5Fcontainer.modulate.a=20=3D=201.0=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E5=86=85=E5=AE=B9=E5=8C=BA=E8=A2=AB=E9=80=8F?= =?UTF-8?q?=E6=98=8E=E5=BA=A6=E7=8A=B6=E6=80=81=E5=8D=A1=E4=BD=8F=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9C=8B=E8=B5=B7=E6=9D=A5=E7=A9=BA=E7=99=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/Maps/community.tscn | 2 +- scenes/Maps/square.tscn | 29 ++++++++++++------------- scenes/prefabs/items/NoticeBoard.gd | 2 +- scenes/prefabs/items/notice_board.tscn | 4 ++-- scenes/prefabs/items/welcome_board.tscn | 4 ++-- scenes/ui/NoticeDialog.gd | 16 ++++++-------- scenes/ui/notice_dialog.tscn | 2 +- scenes/ui/welcome_dialog.tscn | 2 +- 8 files changed, 29 insertions(+), 32 deletions(-) diff --git a/scenes/Maps/community.tscn b/scenes/Maps/community.tscn index 326da6e..891718a 100644 --- a/scenes/Maps/community.tscn +++ b/scenes/Maps/community.tscn @@ -11,4 +11,4 @@ texture = ExtResource("1_jrtph") [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] position = Vector2(152, 16) -polygon = PackedVector2Array(-456, -48, -192, -48, -192, -112, -120, -112, -120, -56, 168, -48, 168, -696, -472, -688, -472, -48) +polygon = PackedVector2Array(-456, -48, -192, -48, -192, -72, -152, -72, -120, -72, -120, -56, 168, -48, 168, -696, -472, -688, -472, -48) diff --git a/scenes/Maps/square.tscn b/scenes/Maps/square.tscn index 17d9328..c09c540 100644 --- a/scenes/Maps/square.tscn +++ b/scenes/Maps/square.tscn @@ -1079,15 +1079,11 @@ tile_set = SubResource("TileSet_0xqio") z_index = -1 position = Vector2(0, 320) -[node name="NoticeBoard" parent="." instance=ExtResource("16_rixdf")] -z_index = 1 -position = Vector2(-184, -76) +[node name="NPC" parent="." instance=ExtResource("15_0xqio")] +position = Vector2(-81, -64) -[node name="WelcomeBoard" parent="." instance=ExtResource("16_edt5w")] -z_index = 1 -y_sort_enabled = true -position = Vector2(128, -80) -script = ExtResource("16_u1t8b") +[node name="DataWhaleHome" parent="." instance=ExtResource("16_m4als")] +position = Vector2(8, -128) [node name="DefaultSpawn" type="Marker2D" parent="."] y_sort_enabled = true @@ -1097,14 +1093,8 @@ position = Vector2(647, 500) y_sort_enabled = true position = Vector2(648, 24) -[node name="NPC" parent="." instance=ExtResource("15_0xqio")] -position = Vector2(-81, -64) - -[node name="DataWhaleHome" parent="." instance=ExtResource("16_m4als")] -position = Vector2(8, -128) - [node name="DoorArea" type="Area2D" parent="."] -position = Vector2(0, 5) +position = Vector2(2, 14) script = ExtResource("18_0xqio") target_scene_name = "room" target_spawn_name = "FromSquare" @@ -1114,8 +1104,17 @@ position = Vector2(644, -62.5) shape = SubResource("RectangleShape2D_edt5w") [node name="Community" parent="." instance=ExtResource("16_0xqio")] +y_sort_enabled = true position = Vector2(646, 3) +[node name="NoticeBoard" parent="." instance=ExtResource("16_rixdf")] +position = Vector2(-216, -72) + +[node name="WelcomeBoard" parent="." instance=ExtResource("16_edt5w")] +y_sort_enabled = true +position = Vector2(128, -80) +script = ExtResource("16_u1t8b") + [node name="Boundaries" type="Node2D" parent="."] [node name="StaticBody2D" type="StaticBody2D" parent="Boundaries"] diff --git a/scenes/prefabs/items/NoticeBoard.gd b/scenes/prefabs/items/NoticeBoard.gd index 8c8b535..6d1ffd0 100644 --- a/scenes/prefabs/items/NoticeBoard.gd +++ b/scenes/prefabs/items/NoticeBoard.gd @@ -3,7 +3,7 @@ extends StaticBody2D func interact(): # Check if dialog already exists if get_tree().root.has_node("NoticeDialog"): - return + return null var dialog = preload("res://scenes/ui/notice_dialog.tscn").instantiate() dialog.name = "NoticeDialog" diff --git a/scenes/prefabs/items/notice_board.tscn b/scenes/prefabs/items/notice_board.tscn index 491e23c..3f03262 100644 --- a/scenes/prefabs/items/notice_board.tscn +++ b/scenes/prefabs/items/notice_board.tscn @@ -4,7 +4,7 @@ [ext_resource type="Texture2D" uid="uid://b4aildrnhbpl4" path="res://assets/materials/NoticeBoard.png" id="2_sprite"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_nb"] -size = Vector2(160, 53.333332) +size = Vector2(160, 40) [node name="NoticeBoard" type="StaticBody2D"] scale = Vector2(0.6, 0.6) @@ -16,5 +16,5 @@ scale = Vector2(0.5, 0.5) texture = ExtResource("2_sprite") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2(0, 13.333335) +position = Vector2(0, 6.6666665) shape = SubResource("RectangleShape2D_nb") diff --git a/scenes/prefabs/items/welcome_board.tscn b/scenes/prefabs/items/welcome_board.tscn index 6fcf63b..fcdf14a 100644 --- a/scenes/prefabs/items/welcome_board.tscn +++ b/scenes/prefabs/items/welcome_board.tscn @@ -3,7 +3,7 @@ [ext_resource type="Texture2D" uid="uid://v7loa3smfkrd" path="res://assets/materials/WelcomeBoard.png" id="2_sprite"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_board"] -size = Vector2(112, 26.5) +size = Vector2(112, 18.5) [node name="WelcomeBoard" type="StaticBody2D"] collision_layer = 3 @@ -13,5 +13,5 @@ scale = Vector2(0.25, 0.25) texture = ExtResource("2_sprite") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2(0, 18.75) +position = Vector2(0, 14.75) shape = SubResource("RectangleShape2D_board") diff --git a/scenes/ui/NoticeDialog.gd b/scenes/ui/NoticeDialog.gd index 394e000..eea43f1 100644 --- a/scenes/ui/NoticeDialog.gd +++ b/scenes/ui/NoticeDialog.gd @@ -43,16 +43,13 @@ func _ready(): $CenterContainer/PanelContainer/VBoxContainer/Header/RightContainer/CloseButton.pressed.connect(_on_close_pressed) prev_btn.pressed.connect(_on_prev_pressed) next_btn.pressed.connect(_on_next_pressed) - - # Network Integration - Use direct callback for better error handling - # Short timeout (2.0s) so mock data appears quickly if server is down - NetworkManager.get_request("/notices", _on_notices_response, 2.0) - - # Initial Setup (with generic "Loading" state) + + # Local-only setup: use built-in pages directly, no network dependency. mock_pages = pages.duplicate(true) - pages = [{"text": "[center]Loading notices...[/center]", "image_color": Color(0.9, 0.9, 0.9)}] + current_page = 0 + content_container.modulate.a = 1.0 _setup_dots() - _update_ui(false) + _update_ui(false) func _exit_tree(): _restore_chat_ui_mouse_input() @@ -73,7 +70,8 @@ func _on_notices_response(success: bool, data: Dictionary, _error_info: Dictiona current_page = 0 _setup_dots() - _update_ui(true) + content_container.modulate.a = 1.0 + _update_ui(false) func _setup_dots(): diff --git a/scenes/ui/notice_dialog.tscn b/scenes/ui/notice_dialog.tscn index d06b199..3acdff8 100644 --- a/scenes/ui/notice_dialog.tscn +++ b/scenes/ui/notice_dialog.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=3 uid="uid://rdmro1jxs6ga"] -[ext_resource type="Script" uid="uid://c227m0okmjt2t" path="res://scenes/prefabs/ui/NoticeDialog.gd" id="1_script"] +[ext_resource type="Script" uid="uid://c227m0okmjt2t" path="res://scenes/ui/NoticeDialog.gd" id="1_script"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_rounded"] bg_color = Color(0.95, 0.95, 0.95, 1) diff --git a/scenes/ui/welcome_dialog.tscn b/scenes/ui/welcome_dialog.tscn index 0699bfa..0ce8033 100644 --- a/scenes/ui/welcome_dialog.tscn +++ b/scenes/ui/welcome_dialog.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=5 format=3 uid="uid://d8mam0n1a3b5"] -[ext_resource type="Script" uid="uid://cohijfo0yeo34" path="res://scenes/ui/WelcomeDialog.gd" id="1_vs5b1"] +[ext_resource type="Script" uid="uid://cohijfo0yeo34" path="res://scenes/prefabs/ui/WelcomeDialog.gd" id="1_vs5b1"] [ext_resource type="Texture2D" uid="uid://v7loa3smfkrd" path="res://assets/materials/WelcomeBoard.png" id="2_dy5hw"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_card"]