diff --git a/_Core/ProjectPaths.gd b/_Core/ProjectPaths.gd index bdcbf2a..7df5859 100644 --- a/_Core/ProjectPaths.gd +++ b/_Core/ProjectPaths.gd @@ -31,8 +31,8 @@ const SCENES_ITEM_COMPONENTS = SCENES_COMPONENTS + "items/" # ============================================================================ # UI路径 # ============================================================================ -const UI_ROOT = "res://UI/" -const UI_WINDOWS = UI_ROOT + "Windows/" +const UI_ROOT = "res://scenes/ui/" +const UI_WINDOWS = UI_ROOT # ============================================================================ # 资源路径 @@ -69,7 +69,7 @@ const TESTS_AUTH = TESTS_ROOT + "auth/" # ============================================================================ # 工具路径 # ============================================================================ -const UTILS_ROOT = "res://Utils/" +const UTILS_ROOT = "res://_Core/utils/" # ============================================================================ # 模块路径 diff --git a/_Core/managers/SceneManager.gd b/_Core/managers/SceneManager.gd index 1b8b5f9..ec0ef7e 100644 --- a/_Core/managers/SceneManager.gd +++ b/_Core/managers/SceneManager.gd @@ -11,13 +11,13 @@ var is_changing_scene: bool = false # 场景路径映射 var scene_paths: Dictionary = { - "main": "res://Scenes/Maps/main_scene.tscn", - "auth": "res://UI/Windows/LoginWindow.tscn", - "game": "res://Scenes/Maps/game_scene.tscn", - "battle": "res://Scenes/Maps/battle_scene.tscn", - "inventory": "res://UI/Windows/InventoryWindow.tscn", - "shop": "res://UI/Windows/ShopWindow.tscn", - "settings": "res://UI/Windows/SettingsWindow.tscn" + "main": "res://scenes/maps/main_scene.tscn", + "auth": "res://scenes/ui/LoginWindow.tscn", + "game": "res://scenes/maps/game_scene.tscn", + "battle": "res://scenes/maps/battle_scene.tscn", + "inventory": "res://scenes/ui/InventoryWindow.tscn", + "shop": "res://scenes/ui/ShopWindow.tscn", + "settings": "res://scenes/ui/SettingsWindow.tscn" } func _ready(): diff --git a/project.godot b/project.godot index aeeb2d3..49e9865 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="whaleTown" -run/main_scene="res://Scenes/Maps/main_scene.tscn" +run/main_scene="res://scenes/maps/main_scene.tscn" config/features=PackedStringArray("4.5", "Forward Plus") config/icon="res://icon.svg" diff --git a/scenes/Maps/MainScene.gd b/scenes/Maps/MainScene.gd index 004ae0d..3818a01 100644 --- a/scenes/Maps/MainScene.gd +++ b/scenes/Maps/MainScene.gd @@ -113,4 +113,4 @@ func _input(event): get_tree().quit() GameState.MAIN_GAME: # 在游戏中按ESC可能显示菜单或返回登录 - show_auth_scene() + show_auth_scene() \ No newline at end of file diff --git a/scenes/Maps/MainScene.gd.uid b/scenes/Maps/MainScene.gd.uid index 4feac40..2d135e3 100644 --- a/scenes/Maps/MainScene.gd.uid +++ b/scenes/Maps/MainScene.gd.uid @@ -1 +1 @@ -uid://blp30m0tuach8 +uid://cn2xjgj3h847p diff --git a/scenes/Maps/main_scene.tscn b/scenes/Maps/main_scene.tscn index c7df691..cb02a22 100644 --- a/scenes/Maps/main_scene.tscn +++ b/scenes/Maps/main_scene.tscn @@ -1,28 +1,14 @@ -[gd_scene load_steps=4 format=3 uid="uid://4ptgx76y83mx"] +[gd_scene load_steps=3 format=3 uid="uid://21a49e14a0c58d7941d04142a5bf9ddc"] -[ext_resource type="Texture2D" uid="uid://bx17oy8lvaca4" path="res://assets/ui/auth/bg_auth_scene.png" id="1_background"] -[ext_resource type="PackedScene" uid="uid://by7m8snb4xllf" path="res://UI/Windows/LoginWindow.tscn" id="2_main"] -[ext_resource type="Script" uid="uid://blp30m0tuach8" path="res://Scenes/Maps/MainScene.gd" id="3_script"] +[ext_resource type="Script" path="res://scenes/maps/MainScene.gd" id="1_script"] +[ext_resource type="PackedScene" uid="uid://by7m8snb4xllf" path="res://scenes/ui/LoginWindow.tscn" id="2_main"] [node name="Main" type="Control"] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -script = ExtResource("3_script") - -[node name="BackgroundImage" type="TextureRect" parent="."] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -texture = ExtResource("1_background") -expand_mode = 1 -stretch_mode = 6 +script = ExtResource("1_script") [node name="AuthScene" parent="." instance=ExtResource("2_main")] layout_mode = 1 @@ -33,24 +19,12 @@ layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 - -[node name="UIOverlay" type="ColorRect" parent="MainGameUI"] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -color = Color(0, 0, 0, 0.3) [node name="TopBar" type="Panel" parent="MainGameUI"] layout_mode = 1 anchors_preset = 10 anchor_right = 1.0 offset_bottom = 60.0 -grow_horizontal = 2 [node name="HBoxContainer" type="HBoxContainer" parent="MainGameUI/TopBar"] layout_mode = 1 @@ -61,26 +35,16 @@ offset_left = 20.0 offset_top = 10.0 offset_right = -20.0 offset_bottom = -10.0 -grow_horizontal = 2 -grow_vertical = 2 - -[node name="WelcomeLabel" type="Label" parent="MainGameUI/TopBar/HBoxContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_colors/font_color = Color(1, 1, 1, 1) -text = "🐋 欢迎来到鲸鱼镇!" -vertical_alignment = 1 [node name="UserLabel" type="Label" parent="MainGameUI/TopBar/HBoxContainer"] layout_mode = 2 -theme_override_colors/font_color = Color(1, 1, 1, 1) -text = "当前用户: [用户名]" -horizontal_alignment = 2 +size_flags_horizontal = 3 +text = "当前用户: " vertical_alignment = 1 [node name="LogoutButton" type="Button" parent="MainGameUI/TopBar/HBoxContainer"] layout_mode = 2 -text = "退出" +text = "登出" [node name="MainContent" type="Control" parent="MainGameUI"] layout_mode = 1 @@ -88,80 +52,29 @@ anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 offset_top = 60.0 -grow_horizontal = 2 -grow_vertical = 2 [node name="CenterContainer" type="CenterContainer" parent="MainGameUI/MainContent"] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 [node name="VBoxContainer" type="VBoxContainer" parent="MainGameUI/MainContent/CenterContainer"] -custom_minimum_size = Vector2(600, 400) -layout_mode = 2 - -[node name="GameTitle" type="Label" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer"] -layout_mode = 2 -theme_override_colors/font_color = Color(1, 1, 1, 1) -theme_override_font_sizes/font_size = 24 -text = "🏘️ 鲸鱼镇主界面" -horizontal_alignment = 1 - -[node name="HSeparator" type="HSeparator" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer"] -layout_mode = 2 - -[node name="GameMenuGrid" type="GridContainer" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer"] -layout_mode = 2 -size_flags_vertical = 3 -columns = 2 - -[node name="ExploreButton" type="Button" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer/GameMenuGrid"] -custom_minimum_size = Vector2(280, 80) -layout_mode = 2 -text = "🗺️ 探索小镇" - -[node name="InventoryButton" type="Button" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer/GameMenuGrid"] -custom_minimum_size = Vector2(280, 80) -layout_mode = 2 -text = "🎒 背包物品" - -[node name="ShopButton" type="Button" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer/GameMenuGrid"] -custom_minimum_size = Vector2(280, 80) -layout_mode = 2 -text = "🏪 商店购物" - -[node name="FriendsButton" type="Button" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer/GameMenuGrid"] -custom_minimum_size = Vector2(280, 80) -layout_mode = 2 -text = "👥 好友列表" - -[node name="HSeparator2" type="HSeparator" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer"] layout_mode = 2 [node name="StatusPanel" type="Panel" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer"] -custom_minimum_size = Vector2(0, 120) layout_mode = 2 +custom_minimum_size = Vector2(400, 150) -[node name="StatusContainer" type="VBoxContainer" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer/StatusPanel"] +[node name="StatusContainer" type="MarginContainer" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer/StatusPanel"] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 offset_left = 20.0 -offset_top = 10.0 +offset_top = 20.0 offset_right = -20.0 -offset_bottom = -10.0 -grow_horizontal = 2 -grow_vertical = 2 - -[node name="StatusTitle" type="Label" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer/StatusPanel/StatusContainer"] -layout_mode = 2 -theme_override_colors/font_color = Color(1, 1, 1, 1) -text = "📊 玩家状态" -horizontal_alignment = 1 +offset_bottom = -20.0 [node name="StatusGrid" type="GridContainer" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer/StatusPanel/StatusContainer"] layout_mode = 2 @@ -169,20 +82,40 @@ columns = 2 [node name="LevelLabel" type="Label" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer/StatusPanel/StatusContainer/StatusGrid"] layout_mode = 2 -theme_override_colors/font_color = Color(1, 1, 1, 1) text = "等级: 1" [node name="CoinsLabel" type="Label" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer/StatusPanel/StatusContainer/StatusGrid"] layout_mode = 2 -theme_override_colors/font_color = Color(1, 1, 1, 1) text = "金币: 100" [node name="ExpLabel" type="Label" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer/StatusPanel/StatusContainer/StatusGrid"] layout_mode = 2 -theme_override_colors/font_color = Color(1, 1, 1, 1) text = "经验: 0/100" [node name="EnergyLabel" type="Label" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer/StatusPanel/StatusContainer/StatusGrid"] layout_mode = 2 -theme_override_colors/font_color = Color(1, 1, 1, 1) text = "体力: 100/100" + +[node name="GameMenuGrid" type="GridContainer" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer"] +layout_mode = 2 +columns = 2 + +[node name="ExploreButton" type="Button" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer/GameMenuGrid"] +layout_mode = 2 +custom_minimum_size = Vector2(150, 50) +text = "🗺️ 探索小镇" + +[node name="InventoryButton" type="Button" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer/GameMenuGrid"] +layout_mode = 2 +custom_minimum_size = Vector2(150, 50) +text = "🎒 背包" + +[node name="ShopButton" type="Button" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer/GameMenuGrid"] +layout_mode = 2 +custom_minimum_size = Vector2(150, 50) +text = "🏪 商店" + +[node name="FriendsButton" type="Button" parent="MainGameUI/MainContent/CenterContainer/VBoxContainer/GameMenuGrid"] +layout_mode = 2 +custom_minimum_size = Vector2(150, 50) +text = "👥 好友" \ No newline at end of file