forked from datawhale/whale-town-front
refactor:重构项目架构为分层结构
## 🏗️ 主要变更 ### 目录结构重构 - 将 core/ 迁移到 _Core/(框架层) - 将 scenes/ 重构为 Scenes/(玩法层)和 UI/(界面层) - 将 data/ 迁移到 Config/(配置层) - 添加 Assets/ 资源层和 Utils/ 工具层 - 将 scripts/ 迁移到 tools/(开发工具) ### 架构分层 - **_Core/**: 框架层 - 全局单例和管理器 - **Scenes/**: 玩法层 - 游戏场景和实体 - **UI/**: 界面层 - HUD、窗口、对话系统 - **Assets/**: 资源层 - 精灵图、音频、字体 - **Config/**: 配置层 - 游戏配置和本地化 - **Utils/**: 工具层 - 通用辅助脚本 ### 文件更新 - 更新 project.godot 中的所有路径引用 - 更新自动加载脚本路径 - 更新测试文件的引用路径 - 添加 REFACTORING.md 详细说明 - 添加 MIGRATION_COMPLETE.md 迁移完成标记 - 更新 README.md 反映新架构 ### 设计原则 - ✅ 清晰的分层(框架/玩法/界面) - ✅ 场景内聚(脚本紧邻场景文件) - ✅ 组件化设计(可复用组件) - ✅ 职责单一(每个目录职责明确) ## 📋 详细信息 查看 REFACTORING.md 了解完整的重构说明和迁移映射表 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
116
scenes/Maps/MainScene.gd
Normal file
116
scenes/Maps/MainScene.gd
Normal file
@@ -0,0 +1,116 @@
|
||||
extends Control
|
||||
|
||||
# 场景节点引用
|
||||
@onready var auth_scene: Control = $AuthScene
|
||||
@onready var main_game_ui: Control = $MainGameUI
|
||||
@onready var user_label: Label = $MainGameUI/TopBar/HBoxContainer/UserLabel
|
||||
@onready var logout_button: Button = $MainGameUI/TopBar/HBoxContainer/LogoutButton
|
||||
|
||||
# 游戏功能按钮
|
||||
@onready var explore_button: Button = $MainGameUI/MainContent/CenterContainer/VBoxContainer/GameMenuGrid/ExploreButton
|
||||
@onready var inventory_button: Button = $MainGameUI/MainContent/CenterContainer/VBoxContainer/GameMenuGrid/InventoryButton
|
||||
@onready var shop_button: Button = $MainGameUI/MainContent/CenterContainer/VBoxContainer/GameMenuGrid/ShopButton
|
||||
@onready var friends_button: Button = $MainGameUI/MainContent/CenterContainer/VBoxContainer/GameMenuGrid/FriendsButton
|
||||
|
||||
# 状态标签
|
||||
@onready var level_label: Label = $MainGameUI/MainContent/CenterContainer/VBoxContainer/StatusPanel/StatusContainer/StatusGrid/LevelLabel
|
||||
@onready var coins_label: Label = $MainGameUI/MainContent/CenterContainer/VBoxContainer/StatusPanel/StatusContainer/StatusGrid/CoinsLabel
|
||||
@onready var exp_label: Label = $MainGameUI/MainContent/CenterContainer/VBoxContainer/StatusPanel/StatusContainer/StatusGrid/ExpLabel
|
||||
@onready var energy_label: Label = $MainGameUI/MainContent/CenterContainer/VBoxContainer/StatusPanel/StatusContainer/StatusGrid/EnergyLabel
|
||||
|
||||
# 游戏状态
|
||||
enum GameState {
|
||||
AUTH, # 登录/注册状态
|
||||
MAIN_GAME # 主游戏状态
|
||||
}
|
||||
|
||||
var current_state: GameState = GameState.AUTH
|
||||
var current_user: String = ""
|
||||
|
||||
# 玩家数据
|
||||
var player_level: int = 1
|
||||
var player_coins: int = 100
|
||||
var player_exp: int = 0
|
||||
var player_max_exp: int = 100
|
||||
var player_energy: int = 100
|
||||
var player_max_energy: int = 100
|
||||
|
||||
func _ready():
|
||||
# 初始化游戏状态
|
||||
setup_game()
|
||||
|
||||
# 连接登录成功信号
|
||||
auth_scene.login_success.connect(_on_login_success)
|
||||
|
||||
# 连接按钮信号
|
||||
logout_button.pressed.connect(_on_logout_pressed)
|
||||
explore_button.pressed.connect(_on_explore_pressed)
|
||||
inventory_button.pressed.connect(_on_inventory_pressed)
|
||||
shop_button.pressed.connect(_on_shop_pressed)
|
||||
friends_button.pressed.connect(_on_friends_pressed)
|
||||
|
||||
func setup_game():
|
||||
# 设置初始状态为登录界面
|
||||
show_auth_scene()
|
||||
|
||||
func show_auth_scene():
|
||||
current_state = GameState.AUTH
|
||||
auth_scene.visible = true
|
||||
main_game_ui.visible = false
|
||||
|
||||
func show_main_game():
|
||||
current_state = GameState.MAIN_GAME
|
||||
auth_scene.visible = false
|
||||
main_game_ui.visible = true
|
||||
user_label.text = "当前用户: " + current_user
|
||||
update_player_status()
|
||||
print("进入主游戏界面")
|
||||
|
||||
func update_player_status():
|
||||
level_label.text = "等级: " + str(player_level)
|
||||
coins_label.text = "金币: " + str(player_coins)
|
||||
exp_label.text = "经验: " + str(player_exp) + "/" + str(player_max_exp)
|
||||
energy_label.text = "体力: " + str(player_energy) + "/" + str(player_max_energy)
|
||||
|
||||
func _on_login_success(username: String):
|
||||
# 登录成功后的处理
|
||||
current_user = username
|
||||
print("用户 ", username, " 登录成功!")
|
||||
show_main_game()
|
||||
|
||||
func _on_logout_pressed():
|
||||
# 登出处理
|
||||
current_user = ""
|
||||
show_auth_scene()
|
||||
|
||||
# 游戏功能按钮处理
|
||||
func _on_explore_pressed():
|
||||
print("探索小镇功能")
|
||||
show_game_message("🗺️ 探索功能开发中...")
|
||||
|
||||
func _on_inventory_pressed():
|
||||
print("背包功能")
|
||||
show_game_message("🎒 背包功能开发中...")
|
||||
|
||||
func _on_shop_pressed():
|
||||
print("商店功能")
|
||||
show_game_message("🏪 商店功能开发中...")
|
||||
|
||||
func _on_friends_pressed():
|
||||
print("好友功能")
|
||||
show_game_message("👥 好友功能开发中...")
|
||||
|
||||
func show_game_message(message: String):
|
||||
print("游戏消息: ", message)
|
||||
# 这里可以添加UI提示框显示消息
|
||||
|
||||
# 处理全局输入
|
||||
func _input(event):
|
||||
if event.is_action_pressed("ui_cancel"):
|
||||
match current_state:
|
||||
GameState.AUTH:
|
||||
# 在登录界面按ESC退出游戏
|
||||
get_tree().quit()
|
||||
GameState.MAIN_GAME:
|
||||
# 在游戏中按ESC可能显示菜单或返回登录
|
||||
show_auth_scene()
|
||||
1
scenes/Maps/MainScene.gd.uid
Normal file
1
scenes/Maps/MainScene.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://blp30m0tuach8
|
||||
@@ -1,8 +1,8 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://4ptgx76y83mx"]
|
||||
|
||||
[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://scenes/auth_scene.tscn" id="2_main"]
|
||||
[ext_resource type="Script" uid="uid://cejrxy23ldhug" path="res://scripts/scenes/MainScene.gd" id="3_script"]
|
||||
[ext_resource type="PackedScene" uid="uid://by7m8snb4xllf" path="res://UI/Windows/LoginWindow.tscn" id="2_main"]
|
||||
[ext_resource type="Script" uid="uid://cejrxy23ldhug" path="res://Scenes/Maps/MainScene.gd" id="3_script"]
|
||||
|
||||
[node name="Main" type="Control"]
|
||||
layout_mode = 3
|
||||
@@ -1,561 +0,0 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://by7m8snb4xllf"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bx17oy8lvaca4" path="res://assets/ui/auth/bg_auth_scene.png" id="1_background"]
|
||||
[ext_resource type="Texture2D" uid="uid://de4q4s1gxivtf" path="res://assets/ui/auth/login_frame_smart_transparent.png" id="2_frame"]
|
||||
[ext_resource type="Script" uid="uid://nv8eitxieqtm" path="res://scripts/scenes/AuthScene.gd" id="3_script"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_1"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_hover"]
|
||||
bg_color = Color(0.3, 0.6, 0.9, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.2, 0.5, 0.8, 1)
|
||||
corner_radius_top_left = 8
|
||||
corner_radius_top_right = 8
|
||||
corner_radius_bottom_right = 8
|
||||
corner_radius_bottom_left = 8
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_normal"]
|
||||
bg_color = Color(0.2, 0.5, 0.8, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.15, 0.4, 0.7, 1)
|
||||
corner_radius_top_left = 8
|
||||
corner_radius_top_right = 8
|
||||
corner_radius_bottom_right = 8
|
||||
corner_radius_bottom_left = 8
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pressed"]
|
||||
bg_color = Color(0.4, 0.7, 1, 1)
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(0.3, 0.6, 0.9, 1)
|
||||
corner_radius_top_left = 8
|
||||
corner_radius_top_right = 8
|
||||
corner_radius_bottom_right = 8
|
||||
corner_radius_bottom_left = 8
|
||||
|
||||
[sub_resource type="Theme" id="Theme_main_button"]
|
||||
Button/colors/font_color = Color(1, 1, 1, 1)
|
||||
Button/colors/font_hover_color = Color(1, 1, 1, 1)
|
||||
Button/colors/font_pressed_color = Color(1, 1, 1, 1)
|
||||
Button/font_sizes/font_size = 18
|
||||
Button/styles/hover = SubResource("StyleBoxFlat_hover")
|
||||
Button/styles/normal = SubResource("StyleBoxFlat_normal")
|
||||
Button/styles/pressed = SubResource("StyleBoxFlat_pressed")
|
||||
|
||||
[sub_resource type="Theme" id="Theme_button"]
|
||||
Button/colors/font_color = Color(1, 1, 1, 1)
|
||||
Button/colors/font_hover_color = Color(1, 1, 1, 1)
|
||||
Button/colors/font_pressed_color = Color(1, 1, 1, 1)
|
||||
Button/styles/hover = SubResource("StyleBoxFlat_hover")
|
||||
Button/styles/normal = SubResource("StyleBoxFlat_normal")
|
||||
Button/styles/pressed = SubResource("StyleBoxFlat_pressed")
|
||||
|
||||
[node name="AuthScene" 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="HTTPRequest" type="HTTPRequest" parent="."]
|
||||
|
||||
[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
|
||||
|
||||
[node name="WhaleFrame" type="TextureRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -300.0
|
||||
offset_top = -300.0
|
||||
offset_right = 300.0
|
||||
offset_bottom = 300.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("2_frame")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -175.0
|
||||
offset_top = -184.0
|
||||
offset_right = 175.0
|
||||
offset_bottom = 236.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="LoginPanel" type="Panel" parent="CenterContainer"]
|
||||
custom_minimum_size = Vector2(350, 400)
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_1")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/LoginPanel"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 30.0
|
||||
offset_top = 30.0
|
||||
offset_right = -30.0
|
||||
offset_bottom = -30.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="TitleLabel" type="Label" parent="CenterContainer/LoginPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 24
|
||||
text = "Whaletown"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="SubtitleLabel" type="Label" parent="CenterContainer/LoginPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 14
|
||||
text = "开始你的小镇之旅!"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="CenterContainer/LoginPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="LoginForm" type="VBoxContainer" parent="CenterContainer/LoginPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="UsernameContainer" type="VBoxContainer" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="UsernameLabelContainer" type="HBoxContainer" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/UsernameContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="UsernameLabel" type="Label" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/UsernameContainer/UsernameLabelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "用户名/手机/邮箱"
|
||||
|
||||
[node name="RequiredStar" type="Label" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/UsernameContainer/UsernameLabelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.2, 0.2, 1)
|
||||
text = " *"
|
||||
|
||||
[node name="Spacer" type="Control" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/UsernameContainer/UsernameLabelContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="UsernameError" type="Label" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/UsernameContainer/UsernameLabelContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.2, 0.2, 1)
|
||||
theme_override_font_sizes/font_size = 12
|
||||
text = "用户名不能为空"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="UsernameInput" type="LineEdit" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/UsernameContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_placeholder_color = Color(0.5, 0.5, 0.5, 1)
|
||||
placeholder_text = "用户名/手机/邮箱"
|
||||
|
||||
[node name="PasswordContainer" type="VBoxContainer" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PasswordLabelContainer" type="HBoxContainer" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/PasswordContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PasswordLabel" type="Label" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/PasswordContainer/PasswordLabelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "密码"
|
||||
|
||||
[node name="RequiredStar" type="Label" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/PasswordContainer/PasswordLabelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.2, 0.2, 1)
|
||||
text = " *"
|
||||
|
||||
[node name="Spacer" type="Control" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/PasswordContainer/PasswordLabelContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="PasswordError" type="Label" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/PasswordContainer/PasswordLabelContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.2, 0.2, 1)
|
||||
theme_override_font_sizes/font_size = 12
|
||||
text = "密码不能为空"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="PasswordInput" type="LineEdit" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/PasswordContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_placeholder_color = Color(0.5, 0.5, 0.5, 1)
|
||||
placeholder_text = "请输入密码"
|
||||
secret = true
|
||||
|
||||
[node name="VerificationContainer" type="VBoxContainer" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VerificationLabelContainer" type="HBoxContainer" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/VerificationContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VerificationLabel" type="Label" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/VerificationContainer/VerificationLabelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "验证码"
|
||||
|
||||
[node name="RequiredStar" type="Label" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/VerificationContainer/VerificationLabelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.2, 0.2, 1)
|
||||
text = " *"
|
||||
|
||||
[node name="Spacer" type="Control" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/VerificationContainer/VerificationLabelContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="VerificationError" type="Label" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/VerificationContainer/VerificationLabelContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.2, 0.2, 1)
|
||||
theme_override_font_sizes/font_size = 12
|
||||
text = "请输入验证码"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="VerificationInputContainer" type="HBoxContainer" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/VerificationContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VerificationInput" type="LineEdit" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/VerificationContainer/VerificationInputContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_placeholder_color = Color(0.5, 0.5, 0.5, 1)
|
||||
placeholder_text = "请输入6位验证码"
|
||||
max_length = 6
|
||||
|
||||
[node name="GetCodeBtn" type="Button" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/VerificationContainer/VerificationInputContainer"]
|
||||
layout_mode = 2
|
||||
text = "获取验证码"
|
||||
|
||||
[node name="CheckboxContainer" type="HBoxContainer" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="RememberPassword" type="CheckBox" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/CheckboxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "记住密码"
|
||||
|
||||
[node name="AutoLogin" type="CheckBox" parent="CenterContainer/LoginPanel/VBoxContainer/LoginForm/CheckboxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "自动登录"
|
||||
|
||||
[node name="HSeparator2" type="HSeparator" parent="CenterContainer/LoginPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MainButton" type="Button" parent="CenterContainer/LoginPanel/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(280, 50)
|
||||
layout_mode = 2
|
||||
theme = SubResource("Theme_main_button")
|
||||
text = "进入小镇"
|
||||
|
||||
[node name="HSeparator3" type="HSeparator" parent="CenterContainer/LoginPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ButtonContainer" type="HBoxContainer" parent="CenterContainer/LoginPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="LoginBtn" type="Button" parent="CenterContainer/LoginPanel/VBoxContainer/ButtonContainer"]
|
||||
custom_minimum_size = Vector2(100, 35)
|
||||
layout_mode = 2
|
||||
theme = SubResource("Theme_button")
|
||||
text = "密码登录"
|
||||
|
||||
[node name="BottomLinks" type="HBoxContainer" parent="CenterContainer/LoginPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="ForgotPassword" type="Button" parent="CenterContainer/LoginPanel/VBoxContainer/BottomLinks"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "忘记密码?"
|
||||
flat = true
|
||||
|
||||
[node name="RegisterLink" type="Button" parent="CenterContainer/LoginPanel/VBoxContainer/BottomLinks"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "注册居民身份"
|
||||
flat = true
|
||||
|
||||
[node name="RegisterPanel" type="Panel" parent="CenterContainer"]
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(400, 570)
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_1")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/RegisterPanel"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 30.0
|
||||
offset_top = 75.0
|
||||
offset_right = -30.0
|
||||
offset_bottom = -72.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="TitleLabel" type="Label" parent="CenterContainer/RegisterPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 20
|
||||
text = "注册新居民"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="CenterContainer/RegisterPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="RegisterForm" type="VBoxContainer" parent="CenterContainer/RegisterPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
alignment = 1
|
||||
|
||||
[node name="UsernameContainer" type="VBoxContainer" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="UsernameLabelContainer" type="HBoxContainer" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/UsernameContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="UsernameLabel" type="Label" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/UsernameContainer/UsernameLabelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "用户名"
|
||||
|
||||
[node name="RequiredStar" type="Label" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/UsernameContainer/UsernameLabelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.2, 0.2, 1)
|
||||
text = " *"
|
||||
|
||||
[node name="Spacer" type="Control" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/UsernameContainer/UsernameLabelContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="UsernameError" type="Label" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/UsernameContainer/UsernameLabelContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.2, 0.2, 1)
|
||||
theme_override_font_sizes/font_size = 12
|
||||
text = "用户名不能为空"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="UsernameInput" type="LineEdit" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/UsernameContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_placeholder_color = Color(0.5, 0.5, 0.5, 1)
|
||||
placeholder_text = "请输入用户名"
|
||||
|
||||
[node name="EmailContainer" type="VBoxContainer" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="EmailLabelContainer" type="HBoxContainer" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/EmailContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="EmailLabel" type="Label" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/EmailContainer/EmailLabelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "邮箱"
|
||||
|
||||
[node name="RequiredStar" type="Label" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/EmailContainer/EmailLabelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.2, 0.2, 1)
|
||||
text = " *"
|
||||
|
||||
[node name="Spacer" type="Control" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/EmailContainer/EmailLabelContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="EmailError" type="Label" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/EmailContainer/EmailLabelContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.2, 0.2, 1)
|
||||
theme_override_font_sizes/font_size = 12
|
||||
text = "邮箱不能为空"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="EmailInput" type="LineEdit" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/EmailContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_placeholder_color = Color(0.5, 0.5, 0.5, 1)
|
||||
placeholder_text = "请输入邮箱地址"
|
||||
|
||||
[node name="PasswordContainer" type="VBoxContainer" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PasswordLabelContainer" type="HBoxContainer" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/PasswordContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PasswordLabel" type="Label" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/PasswordContainer/PasswordLabelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "密码"
|
||||
|
||||
[node name="RequiredStar" type="Label" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/PasswordContainer/PasswordLabelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.2, 0.2, 1)
|
||||
text = " *"
|
||||
|
||||
[node name="Spacer" type="Control" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/PasswordContainer/PasswordLabelContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="PasswordError" type="Label" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/PasswordContainer/PasswordLabelContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.2, 0.2, 1)
|
||||
theme_override_font_sizes/font_size = 12
|
||||
text = "密码不能为空"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="PasswordInput" type="LineEdit" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/PasswordContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_placeholder_color = Color(0.5, 0.5, 0.5, 1)
|
||||
placeholder_text = "请输入密码(至少8位)"
|
||||
secret = true
|
||||
|
||||
[node name="ConfirmContainer" type="VBoxContainer" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ConfirmLabelContainer" type="HBoxContainer" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/ConfirmContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ConfirmLabel" type="Label" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/ConfirmContainer/ConfirmLabelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "确认密码"
|
||||
|
||||
[node name="RequiredStar" type="Label" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/ConfirmContainer/ConfirmLabelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.2, 0.2, 1)
|
||||
text = " *"
|
||||
|
||||
[node name="Spacer" type="Control" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/ConfirmContainer/ConfirmLabelContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="ConfirmError" type="Label" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/ConfirmContainer/ConfirmLabelContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.2, 0.2, 1)
|
||||
theme_override_font_sizes/font_size = 12
|
||||
text = "确认密码不能为空"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="ConfirmInput" type="LineEdit" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/ConfirmContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_placeholder_color = Color(0.5, 0.5, 0.5, 1)
|
||||
placeholder_text = "请再次输入密码"
|
||||
secret = true
|
||||
|
||||
[node name="VerificationContainer" type="VBoxContainer" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VerificationLabelContainer" type="HBoxContainer" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/VerificationContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VerificationLabel" type="Label" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/VerificationContainer/VerificationLabelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "邮箱验证码"
|
||||
|
||||
[node name="RequiredStar" type="Label" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/VerificationContainer/VerificationLabelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.2, 0.2, 1)
|
||||
text = " *"
|
||||
|
||||
[node name="Spacer" type="Control" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/VerificationContainer/VerificationLabelContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="VerificationError" type="Label" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/VerificationContainer/VerificationLabelContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.2, 0.2, 1)
|
||||
theme_override_font_sizes/font_size = 12
|
||||
text = "验证码不能为空"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="VerificationInputContainer" type="HBoxContainer" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/VerificationContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VerificationInput" type="LineEdit" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/VerificationContainer/VerificationInputContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_placeholder_color = Color(0.5, 0.5, 0.5, 1)
|
||||
placeholder_text = "请输入6位验证码"
|
||||
max_length = 6
|
||||
|
||||
[node name="SendCodeBtn" type="Button" parent="CenterContainer/RegisterPanel/VBoxContainer/RegisterForm/VerificationContainer/VerificationInputContainer"]
|
||||
layout_mode = 2
|
||||
text = "发送验证码"
|
||||
|
||||
[node name="HSeparator2" type="HSeparator" parent="CenterContainer/RegisterPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ButtonContainer" type="HBoxContainer" parent="CenterContainer/RegisterPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="RegisterBtn" type="Button" parent="CenterContainer/RegisterPanel/VBoxContainer/ButtonContainer"]
|
||||
custom_minimum_size = Vector2(120, 45)
|
||||
layout_mode = 2
|
||||
theme = SubResource("Theme_button")
|
||||
text = "注册"
|
||||
|
||||
[node name="ToLoginBtn" type="Button" parent="CenterContainer/RegisterPanel/VBoxContainer/ButtonContainer"]
|
||||
custom_minimum_size = Vector2(120, 45)
|
||||
layout_mode = 2
|
||||
theme = SubResource("Theme_button")
|
||||
text = "返回登录"
|
||||
|
||||
[node name="ToastContainer" type="Control" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
Reference in New Issue
Block a user