chinese_chess/Scenes/Setting.tscn
ZZY 6daf09b300 feat(chess): 初始化棋盘和玩家颜色,优化代码结构,重构多人游戏代码
- 在 ChessGame 中初始化棋盘,根据玩家颜色设置棋子
- 更新 UI 显示玩家颜色
- 调整棋盘位置和 UI 布局
- 重构部分代码以提高可读性和维护性
2024-11-07 15:28:03 +08:00

159 lines
5.5 KiB
Plaintext

[gd_scene load_steps=4 format=3 uid="uid://c6gxufppw1fu3"]
[ext_resource type="Theme" uid="uid://intlbeu8h82r" path="res://Asserts/defaultTheme.tres" id="1_6yfoi"]
[ext_resource type="Script" path="res://Scripts/Controllers/Setting.cs" id="1_xbvb3"]
[ext_resource type="PackedScene" uid="uid://pc83bstfltn" path="res://Scenes/Entities/ServerStatus.tscn" id="3_e50hu"]
[node name="Setting" type="MarginContainer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_6yfoi")
script = ExtResource("1_xbvb3")
[node name="BoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="BoxContainer"]
layout_mode = 2
[node name="Back" type="Button" parent="BoxContainer/MarginContainer"]
layout_mode = 2
text = "Back"
[node name="MarginContainer7" type="MarginContainer" parent="BoxContainer"]
layout_mode = 2
[node name="Button" type="Button" parent="BoxContainer/MarginContainer7"]
layout_mode = 2
text = "Save"
[node name="MarginContainer2" type="MarginContainer" parent="BoxContainer"]
layout_mode = 2
[node name="Server" type="HFlowContainer" parent="BoxContainer/MarginContainer2"]
layout_mode = 2
[node name="Label" type="Label" parent="BoxContainer/MarginContainer2/Server"]
layout_mode = 2
text = "Server IP"
[node name="LineEdit" type="LineEdit" parent="BoxContainer/MarginContainer2/Server"]
layout_mode = 2
size_flags_horizontal = 3
[node name="MarginContainer3" type="MarginContainer" parent="BoxContainer"]
layout_mode = 2
[node name="Name" type="HFlowContainer" parent="BoxContainer/MarginContainer3"]
layout_mode = 2
[node name="Label" type="Label" parent="BoxContainer/MarginContainer3/Name"]
layout_mode = 2
text = "Name"
[node name="LineEdit" type="LineEdit" parent="BoxContainer/MarginContainer3/Name"]
layout_mode = 2
size_flags_horizontal = 3
[node name="Button" type="Button" parent="BoxContainer/MarginContainer3/Name"]
visible = false
layout_mode = 2
text = "OK"
[node name="MarginContainer4" type="MarginContainer" parent="BoxContainer"]
layout_mode = 2
[node name="HFlowContainer" type="HFlowContainer" parent="BoxContainer/MarginContainer4"]
layout_mode = 2
[node name="ServerStatus" parent="BoxContainer/MarginContainer4/HFlowContainer" instance=ExtResource("3_e50hu")]
layout_mode = 2
size_flags_horizontal = 3
[node name="CheckButton" type="CheckButton" parent="BoxContainer/MarginContainer4/HFlowContainer"]
visible = false
layout_mode = 2
text = "Server Start"
[node name="MarginContainer5" type="MarginContainer" parent="BoxContainer"]
layout_mode = 2
[node name="HBoxContainer" type="HFlowContainer" parent="BoxContainer/MarginContainer5"]
layout_mode = 2
[node name="Label" type="Label" parent="BoxContainer/MarginContainer5/HBoxContainer"]
layout_mode = 2
text = "Font Size"
[node name="FontSize" type="LineEdit" parent="BoxContainer/MarginContainer5/HBoxContainer"]
layout_mode = 2
editable = false
[node name="MarginContainer6" type="MarginContainer" parent="BoxContainer"]
layout_mode = 2
[node name="FontSizeBar" type="HSlider" parent="BoxContainer/MarginContainer6"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 4
min_value = 10.0
max_value = 50.0
value = 10.0
[node name="HBoxContainer" type="HFlowContainer" parent="BoxContainer"]
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="BoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="Button" type="Button" parent="BoxContainer/HBoxContainer/MarginContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "Clear Config"
[node name="MarginContainer2" type="MarginContainer" parent="BoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="Button2" type="Button" parent="BoxContainer/HBoxContainer/MarginContainer2"]
layout_mode = 2
text = "Clear User Data"
[node name="HFlowContainer" type="HFlowContainer" parent="BoxContainer"]
layout_mode = 2
[node name="Button" type="Button" parent="BoxContainer/HFlowContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "GetCacheDir"
[node name="Button2" type="Button" parent="BoxContainer/HFlowContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "GetConfigDir"
[node name="Button3" type="Button" parent="BoxContainer/HFlowContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "GetDataDir"
[node name="Button4" type="Button" parent="BoxContainer/HFlowContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "GetUserDataDir"
[connection signal="pressed" from="BoxContainer/MarginContainer/Back" to="." method="OnBack"]
[connection signal="pressed" from="BoxContainer/MarginContainer7/Button" to="." method="OnSave"]
[connection signal="text_changed" from="BoxContainer/MarginContainer2/Server/LineEdit" to="." method="OnServerUrlChanged"]
[connection signal="text_changed" from="BoxContainer/MarginContainer3/Name/LineEdit" to="." method="OnNameChanged"]
[connection signal="value_changed" from="BoxContainer/MarginContainer6/FontSizeBar" to="." method="OnFontSizeChanged"]
[connection signal="pressed" from="BoxContainer/HBoxContainer/MarginContainer2/Button2" to="." method="OnClearUserData"]
[connection signal="pressed" from="BoxContainer/HFlowContainer/Button" to="." method="OnGetCacheDir"]
[connection signal="pressed" from="BoxContainer/HFlowContainer/Button2" to="." method="OnGetConfigDir"]
[connection signal="pressed" from="BoxContainer/HFlowContainer/Button3" to="." method="OnGetDataDir"]
[connection signal="pressed" from="BoxContainer/HFlowContainer/Button4" to="." method="OnGetUserDataDir"]