3 Commits

Author SHA1 Message Date
f24a01dbca fix: 修复交互与通知板问题
- 修复Z轴逻辑调整精灵与物品的排序
- 渲染前强制 content_container.modulate.a = 1.0,避免内容区被透明度状态卡住导致看起来空白
2026-02-07 21:07:59 +08:00
19794d896e fix: 修复欢迎板和通知板通知无法关闭问题
- 修复欢迎板和通知板当前被ChatUI 抢占鼠标问题,通过设置启动弹窗时ChatUI 根节点 mouse_filter 临时改为 IGNORE来实现
- ToDo: 后续统一规划事件逻辑
2026-02-07 20:01:48 +08:00
7fcb41d576 fix: 修复欢迎板和通知板图像引用错误问题 2026-02-07 19:33:06 +08:00
15 changed files with 96 additions and 43 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 142 KiB

View File

@@ -2,7 +2,7 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://dw7lapxn4m8ry" uid="uid://b4aildrnhbpl4"
path="res://.godot/imported/NoticeBoard.png-038eefee12f116fb9502ed755594cede.ctex" path="res://.godot/imported/NoticeBoard.png-038eefee12f116fb9502ed755594cede.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
@@ -37,4 +37,4 @@ process/normal_map_invert_y=false
process/hdr_as_srgb=false process/hdr_as_srgb=false
process/hdr_clamp_exposure=false process/hdr_clamp_exposure=false
process/size_limit=0 process/size_limit=0
detect_3d/compress_to=0 detect_3d/compress_to=1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 179 KiB

View File

@@ -2,7 +2,7 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://c5y8qxm3jn2wv" uid="uid://v7loa3smfkrd"
path="res://.godot/imported/WelcomeBoard.png-bcff7f9bf968cb5d7630e2ad47f2fb42.ctex" path="res://.godot/imported/WelcomeBoard.png-bcff7f9bf968cb5d7630e2ad47f2fb42.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
@@ -37,4 +37,4 @@ process/normal_map_invert_y=false
process/hdr_as_srgb=false process/hdr_as_srgb=false
process/hdr_clamp_exposure=false process/hdr_clamp_exposure=false
process/size_limit=0 process/size_limit=0
detect_3d/compress_to=0 detect_3d/compress_to=1

View File

@@ -11,4 +11,4 @@ texture = ExtResource("1_jrtph")
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
position = Vector2(152, 16) 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)

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=39 format=4 uid="uid://5cc0c6cpnhe8"] [gd_scene load_steps=40 format=4 uid="uid://5cc0c6cpnhe8"]
[ext_resource type="Script" uid="uid://c5ml4722ptwp2" path="res://scenes/Maps/BaseLevel.gd" id="1_m4als"] [ext_resource type="Script" uid="uid://b43tvo8cykfrq" path="res://scenes/Maps/BaseLevel.gd" id="1_m4als"]
[ext_resource type="Texture2D" uid="uid://baa5wkuyqouh6" path="res://assets/sprites/environment/standard_brick_128_128.jpg" id="1_rb5kq"] [ext_resource type="Texture2D" uid="uid://baa5wkuyqouh6" path="res://assets/sprites/environment/standard_brick_128_128.jpg" id="1_rb5kq"]
[ext_resource type="Texture2D" uid="uid://dwlnclqw6lsa7" path="res://assets/sprites/environment/grass_256_256.png" id="2_dly5q"] [ext_resource type="Texture2D" uid="uid://dwlnclqw6lsa7" path="res://assets/sprites/environment/grass_256_256.png" id="2_dly5q"]
[ext_resource type="Texture2D" uid="uid://ccqxsarxnnf4e" path="res://assets/sprites/environment/ground.png" id="2_rb5kq"] [ext_resource type="Texture2D" uid="uid://ccqxsarxnnf4e" path="res://assets/sprites/environment/ground.png" id="2_rb5kq"]
@@ -18,7 +18,8 @@
[ext_resource type="PackedScene" uid="uid://c7k8yay002w4" path="res://scenes/prefabs/items/welcome_board.tscn" id="16_edt5w"] [ext_resource type="PackedScene" uid="uid://c7k8yay002w4" path="res://scenes/prefabs/items/welcome_board.tscn" id="16_edt5w"]
[ext_resource type="PackedScene" uid="uid://bvfyllcy5fi8o" path="res://scenes/Maps/datawhale_home.tscn" id="16_m4als"] [ext_resource type="PackedScene" uid="uid://bvfyllcy5fi8o" path="res://scenes/Maps/datawhale_home.tscn" id="16_m4als"]
[ext_resource type="PackedScene" uid="uid://rdmrm7j4iokr" path="res://scenes/prefabs/items/notice_board.tscn" id="16_rixdf"] [ext_resource type="PackedScene" uid="uid://rdmrm7j4iokr" path="res://scenes/prefabs/items/notice_board.tscn" id="16_rixdf"]
[ext_resource type="Script" uid="uid://b068cnbw3a8wt" path="res://scenes/Maps/DoorTeleport.gd" id="18_0xqio"] [ext_resource type="Script" uid="uid://d2od22agputjt" path="res://scenes/prefabs/items/WelcomeBoard.gd" id="16_u1t8b"]
[ext_resource type="Script" uid="uid://rlkavptfhr4y" path="res://scenes/Maps/DoorTeleport.gd" id="18_0xqio"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_7nixu"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_7nixu"]
texture = ExtResource("1_rb5kq") texture = ExtResource("1_rb5kq")
@@ -1078,14 +1079,11 @@ tile_set = SubResource("TileSet_0xqio")
z_index = -1 z_index = -1
position = Vector2(0, 320) position = Vector2(0, 320)
[node name="NoticeBoard" parent="." instance=ExtResource("16_rixdf")] [node name="NPC" parent="." instance=ExtResource("15_0xqio")]
z_index = 1 position = Vector2(-81, -64)
position = Vector2(-184, -76)
[node name="WelcomeBoard" parent="." instance=ExtResource("16_edt5w")] [node name="DataWhaleHome" parent="." instance=ExtResource("16_m4als")]
z_index = 1 position = Vector2(8, -128)
y_sort_enabled = true
position = Vector2(128, -80)
[node name="DefaultSpawn" type="Marker2D" parent="."] [node name="DefaultSpawn" type="Marker2D" parent="."]
y_sort_enabled = true y_sort_enabled = true
@@ -1095,14 +1093,8 @@ position = Vector2(647, 500)
y_sort_enabled = true y_sort_enabled = true
position = Vector2(648, 24) 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="."] [node name="DoorArea" type="Area2D" parent="."]
position = Vector2(0, 5) position = Vector2(2, 14)
script = ExtResource("18_0xqio") script = ExtResource("18_0xqio")
target_scene_name = "room" target_scene_name = "room"
target_spawn_name = "FromSquare" target_spawn_name = "FromSquare"
@@ -1112,8 +1104,17 @@ position = Vector2(644, -62.5)
shape = SubResource("RectangleShape2D_edt5w") shape = SubResource("RectangleShape2D_edt5w")
[node name="Community" parent="." instance=ExtResource("16_0xqio")] [node name="Community" parent="." instance=ExtResource("16_0xqio")]
y_sort_enabled = true
position = Vector2(646, 3) 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="Boundaries" type="Node2D" parent="."]
[node name="StaticBody2D" type="StaticBody2D" parent="Boundaries"] [node name="StaticBody2D" type="StaticBody2D" parent="Boundaries"]

View File

@@ -3,7 +3,7 @@ extends StaticBody2D
func interact(): func interact():
# Check if dialog already exists # Check if dialog already exists
if get_tree().root.has_node("NoticeDialog"): if get_tree().root.has_node("NoticeDialog"):
return return null
var dialog = preload("res://scenes/ui/notice_dialog.tscn").instantiate() var dialog = preload("res://scenes/ui/notice_dialog.tscn").instantiate()
dialog.name = "NoticeDialog" dialog.name = "NoticeDialog"

View File

@@ -4,7 +4,7 @@
[ext_resource type="Texture2D" uid="uid://b4aildrnhbpl4" path="res://assets/materials/NoticeBoard.png" id="2_sprite"] [ext_resource type="Texture2D" uid="uid://b4aildrnhbpl4" path="res://assets/materials/NoticeBoard.png" id="2_sprite"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_nb"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_nb"]
size = Vector2(160, 53.333332) size = Vector2(160, 40)
[node name="NoticeBoard" type="StaticBody2D"] [node name="NoticeBoard" type="StaticBody2D"]
scale = Vector2(0.6, 0.6) scale = Vector2(0.6, 0.6)
@@ -16,5 +16,5 @@ scale = Vector2(0.5, 0.5)
texture = ExtResource("2_sprite") texture = ExtResource("2_sprite")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."] [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 13.333335) position = Vector2(0, 6.6666665)
shape = SubResource("RectangleShape2D_nb") shape = SubResource("RectangleShape2D_nb")

View File

@@ -1,19 +1,17 @@
[gd_scene load_steps=4 format=3 uid="uid://c7k8yay002w4"] [gd_scene load_steps=3 format=3 uid="uid://c7k8yay002w4"]
[ext_resource type="Script" uid="uid://d2od22agputjt" path="res://scenes/prefabs/items/WelcomeBoard.gd" id="1_script"]
[ext_resource type="Texture2D" uid="uid://v7loa3smfkrd" path="res://assets/materials/WelcomeBoard.png" id="2_sprite"] [ext_resource type="Texture2D" uid="uid://v7loa3smfkrd" path="res://assets/materials/WelcomeBoard.png" id="2_sprite"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_board"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_board"]
size = Vector2(112, 26.5) size = Vector2(112, 18.5)
[node name="WelcomeBoard" type="StaticBody2D"] [node name="WelcomeBoard" type="StaticBody2D"]
collision_layer = 3 collision_layer = 3
script = ExtResource("1_script")
[node name="Sprite2D" type="Sprite2D" parent="."] [node name="Sprite2D" type="Sprite2D" parent="."]
scale = Vector2(0.25, 0.25) scale = Vector2(0.25, 0.25)
texture = ExtResource("2_sprite") texture = ExtResource("2_sprite")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."] [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 18.75) position = Vector2(0, 14.75)
shape = SubResource("RectangleShape2D_board") shape = SubResource("RectangleShape2D_board")

View File

@@ -31,24 +31,28 @@ var pages = [
var current_page = 0 var current_page = 0
var tween: Tween var tween: Tween
var mock_pages = [] var mock_pages = []
var _chat_ui: Control
var _chat_ui_prev_mouse_filter: int = Control.MOUSE_FILTER_STOP
var _chat_ui_mouse_disabled: bool = false
func _ready(): func _ready():
# Pause the game # Pause the game
get_tree().paused = true get_tree().paused = true
_disable_chat_ui_mouse_input()
$CenterContainer/PanelContainer/VBoxContainer/Header/RightContainer/CloseButton.pressed.connect(_on_close_pressed) $CenterContainer/PanelContainer/VBoxContainer/Header/RightContainer/CloseButton.pressed.connect(_on_close_pressed)
prev_btn.pressed.connect(_on_prev_pressed) prev_btn.pressed.connect(_on_prev_pressed)
next_btn.pressed.connect(_on_next_pressed) next_btn.pressed.connect(_on_next_pressed)
# Network Integration - Use direct callback for better error handling # Local-only setup: use built-in pages directly, no network dependency.
# 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)
mock_pages = pages.duplicate(true) 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() _setup_dots()
_update_ui(false) _update_ui(false)
func _exit_tree():
_restore_chat_ui_mouse_input()
func _on_notices_response(success: bool, data: Dictionary, _error_info: Dictionary): func _on_notices_response(success: bool, data: Dictionary, _error_info: Dictionary):
var new_pages = [] var new_pages = []
@@ -66,7 +70,8 @@ func _on_notices_response(success: bool, data: Dictionary, _error_info: Dictiona
current_page = 0 current_page = 0
_setup_dots() _setup_dots()
_update_ui(true) content_container.modulate.a = 1.0
_update_ui(false)
func _setup_dots(): func _setup_dots():
@@ -154,3 +159,23 @@ func _on_close_pressed():
# Unpause the game # Unpause the game
get_tree().paused = false get_tree().paused = false
queue_free() queue_free()
func _disable_chat_ui_mouse_input():
var current_scene = get_tree().current_scene
if current_scene:
_chat_ui = current_scene.get_node_or_null("UILayer/ChatUI") as Control
if _chat_ui == null:
_chat_ui = get_tree().root.find_child("ChatUI", true, false) as Control
if _chat_ui:
_chat_ui_prev_mouse_filter = _chat_ui.mouse_filter
_chat_ui.mouse_filter = Control.MOUSE_FILTER_IGNORE
_chat_ui_mouse_disabled = true
func _restore_chat_ui_mouse_input():
if _chat_ui_mouse_disabled and is_instance_valid(_chat_ui):
_chat_ui.mouse_filter = _chat_ui_prev_mouse_filter
_chat_ui_mouse_disabled = false
_chat_ui = null

View File

@@ -1 +1 @@
uid://cxi5rchnmk07p uid://c227m0okmjt2t

View File

@@ -1,6 +1,12 @@
extends CanvasLayer extends CanvasLayer
var _chat_ui: Control
var _chat_ui_prev_mouse_filter: int = Control.MOUSE_FILTER_STOP
var _chat_ui_mouse_disabled: bool = false
func _ready(): func _ready():
_disable_chat_ui_mouse_input()
# Connect close button (X) # Connect close button (X)
var header_close = find_child("CloseButton", true, false) var header_close = find_child("CloseButton", true, false)
if header_close: if header_close:
@@ -11,6 +17,9 @@ func _ready():
if start_btn: if start_btn:
start_btn.pressed.connect(_on_close_pressed) start_btn.pressed.connect(_on_close_pressed)
func _exit_tree():
_restore_chat_ui_mouse_input()
func _on_close_pressed(): func _on_close_pressed():
queue_free() queue_free()
@@ -18,3 +27,23 @@ func _input(event):
# Allow ESC to close # Allow ESC to close
if event.is_action_pressed("ui_cancel"): if event.is_action_pressed("ui_cancel"):
queue_free() queue_free()
func _disable_chat_ui_mouse_input():
var current_scene = get_tree().current_scene
if current_scene:
_chat_ui = current_scene.get_node_or_null("UILayer/ChatUI") as Control
if _chat_ui == null:
_chat_ui = get_tree().root.find_child("ChatUI", true, false) as Control
if _chat_ui:
_chat_ui_prev_mouse_filter = _chat_ui.mouse_filter
_chat_ui.mouse_filter = Control.MOUSE_FILTER_IGNORE
_chat_ui_mouse_disabled = true
func _restore_chat_ui_mouse_input():
if _chat_ui_mouse_disabled and is_instance_valid(_chat_ui):
_chat_ui.mouse_filter = _chat_ui_prev_mouse_filter
_chat_ui_mouse_disabled = false
_chat_ui = null

View File

@@ -1 +1 @@
uid://cu6x4dxhsylw2 uid://cohijfo0yeo34

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=3 uid="uid://rdmro1jxs6ga"] [gd_scene load_steps=3 format=3 uid="uid://rdmro1jxs6ga"]
[ext_resource type="Script" uid="uid://cxi5rchnmk07p" path="res://scenes/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"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_rounded"]
bg_color = Color(0.95, 0.95, 0.95, 1) bg_color = Color(0.95, 0.95, 0.95, 1)

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=5 format=3 uid="uid://d8mam0n1a3b5"] [gd_scene load_steps=5 format=3 uid="uid://d8mam0n1a3b5"]
[ext_resource type="Script" uid="uid://cu6x4dxhsylw2" 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"] [ext_resource type="Texture2D" uid="uid://v7loa3smfkrd" path="res://assets/materials/WelcomeBoard.png" id="2_dy5hw"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_card"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_card"]