合并主场景和个人小屋

This commit is contained in:
王浩
2026-02-07 14:11:00 +08:00
parent 603e7d9fc6
commit 326ab7ce5c
360 changed files with 4913 additions and 21701 deletions

View File

@@ -102,7 +102,7 @@ func _validate_texture():
return false
# ============================================================================
# 调试方法
# 信息方法
# ============================================================================
# 获取瓦片信息
@@ -113,10 +113,3 @@ func get_tile_info() -> Dictionary:
"texture_size": texture.get_size() if texture else Vector2.ZERO,
"auto_snap": auto_snap
}
# 打印瓦片信息
func print_info():
var info = get_tile_info()
print("=== 草地瓦片信息 ===")
for key in info:
print(key, ": ", info[key])

View File

@@ -0,0 +1,11 @@
extends StaticBody2D
func interact():
# Check if dialog already exists
if get_tree().root.has_node("NoticeDialog"):
return
var dialog = preload("res://scenes/ui/notice_dialog.tscn").instantiate()
dialog.name = "NoticeDialog"
get_tree().root.add_child(dialog)
return null # No bubble text needed

View File

@@ -0,0 +1 @@
uid://pnlgf420wktn

View File

@@ -0,0 +1,13 @@
extends StaticBody2D
func interact():
# Prevent multiple dialogs
if get_tree().root.has_node("WelcomeDialog"):
return null
# Spawn the Welcome Dialog
var dialog = preload("res://scenes/ui/welcome_dialog.tscn").instantiate()
dialog.name = "WelcomeDialog"
# Add to the Scene Root (World) or CanvasLayer if it has one
get_tree().root.add_child(dialog)
return null # Return null prevents Player from showing a bubble

View File

@@ -0,0 +1 @@
uid://d2od22agputjt

View File

@@ -0,0 +1,20 @@
[gd_scene load_steps=4 format=3 uid="uid://rdmrm7j4iokr"]
[ext_resource type="Script" uid="uid://pnlgf420wktn" path="res://scenes/prefabs/items/NoticeBoard.gd" id="1_script"]
[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)
[node name="NoticeBoard" type="StaticBody2D"]
scale = Vector2(0.6, 0.6)
script = ExtResource("1_script")
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(0, -16)
scale = Vector2(0.5, 0.5)
texture = ExtResource("2_sprite")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 13.333335)
shape = SubResource("RectangleShape2D_nb")

View File

@@ -0,0 +1,19 @@
[gd_scene load_steps=4 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"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_board"]
size = Vector2(112, 26.5)
[node name="WelcomeBoard" type="StaticBody2D"]
collision_layer = 3
script = ExtResource("1_script")
[node name="Sprite2D" type="Sprite2D" parent="."]
scale = Vector2(0.25, 0.25)
texture = ExtResource("2_sprite")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 18.75)
shape = SubResource("RectangleShape2D_board")

View File

@@ -209,11 +209,3 @@ func _format_timestamp(timestamp: float) -> String:
# 格式化为 HH:MM
return "%02d:%02d" % [datetime.hour, datetime.minute]
# 获取所有子节点名称(调试用)
func _get_all_children_names(node: Node, _indent: int = 0) -> String:
var result := ""
for child in node.get_children():
result += " ".repeat(_indent) + child.name + "\n"
result += _get_all_children_names(child, _indent + 1)
return result