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

104 lines
3.6 KiB
Plaintext

[gd_scene load_steps=4 format=3 uid="uid://g40y10iaf7qb"]
[ext_resource type="Script" path="res://Scripts/Controllers/ChessGame.cs" id="1_3x8ac"]
[ext_resource type="PackedScene" uid="uid://b1tx7v3230wab" path="res://Scenes/Entities/Chessboard.tscn" id="1_yheur"]
[ext_resource type="Theme" uid="uid://intlbeu8h82r" path="res://Asserts/defaultTheme.tres" id="3_rcfhx"]
[node name="ChessGame" type="Node2D"]
script = ExtResource("1_3x8ac")
[node name="Chessboard" parent="." instance=ExtResource("1_yheur")]
position = Vector2(360, 650)
scale = Vector2(2.5, 2.5)
[node name="Control" type="Control" parent="."]
custom_minimum_size = Vector2(720, 1280)
layout_mode = 3
anchors_preset = 0
offset_right = 720.0
offset_bottom = 1280.0
theme = ExtResource("3_rcfhx")
[node name="VBoxContainer" type="VBoxContainer" parent="Control"]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_bottom = 133.0
grow_horizontal = 2
[node name="MarginContainer" type="MarginContainer" parent="Control/VBoxContainer"]
layout_mode = 2
[node name="HBoxContainer" type="HBoxContainer" parent="Control/VBoxContainer/MarginContainer"]
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="Control/VBoxContainer/MarginContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="Home" type="Button" parent="Control/VBoxContainer/MarginContainer/HBoxContainer/MarginContainer"]
layout_mode = 2
text = "返回主页"
[node name="MarginContainer2" type="MarginContainer" parent="Control/VBoxContainer/MarginContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="Undo" type="Button" parent="Control/VBoxContainer/MarginContainer/HBoxContainer/MarginContainer2"]
layout_mode = 2
size_flags_vertical = 4
text = "撤回"
[node name="MarginContainer3" type="MarginContainer" parent="Control/VBoxContainer/MarginContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="ReInit" type="Button" parent="Control/VBoxContainer/MarginContainer/HBoxContainer/MarginContainer3"]
layout_mode = 2
text = "重开"
[node name="MarginContainer3" type="MarginContainer" parent="Control/VBoxContainer"]
layout_mode = 2
[node name="HFlowContainer" type="HFlowContainer" parent="Control/VBoxContainer/MarginContainer3"]
layout_mode = 2
[node name="Label" type="Label" parent="Control/VBoxContainer/MarginContainer3/HFlowContainer"]
layout_mode = 2
text = "You Are
"
[node name="LineEdit" type="LineEdit" parent="Control/VBoxContainer/MarginContainer3/HFlowContainer"]
layout_mode = 2
size_flags_horizontal = 3
editable = false
[node name="Label2" type="Label" parent="Control/VBoxContainer/MarginContainer3/HFlowContainer"]
layout_mode = 2
text = "Turns On"
[node name="LineEdit2" type="LineEdit" parent="Control/VBoxContainer/MarginContainer3/HFlowContainer"]
layout_mode = 2
size_flags_horizontal = 3
editable = false
[node name="MarginContainer2" type="MarginContainer" parent="Control"]
layout_mode = 1
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -114.0
grow_horizontal = 2
grow_vertical = 0
[node name="Over" type="Button" parent="Control/MarginContainer2"]
layout_mode = 2
text = "结束回合
(提示对方结束)"
[connection signal="pressed" from="Control/VBoxContainer/MarginContainer/HBoxContainer/MarginContainer/Home" to="." method="GoHome"]
[connection signal="pressed" from="Control/VBoxContainer/MarginContainer/HBoxContainer/MarginContainer2/Undo" to="." method="Undo"]
[connection signal="pressed" from="Control/VBoxContainer/MarginContainer/HBoxContainer/MarginContainer3/ReInit" to="." method="ReInit"]
[connection signal="pressed" from="Control/MarginContainer2/Over" to="." method="BtnOver"]