update: 更新到godot4.4.1,并大量重构代码

This commit is contained in:
ZZY
2025-06-09 18:17:06 +08:00
parent b27abb55a2
commit 3fa39fc71e
39 changed files with 801 additions and 790 deletions

View File

@ -38,7 +38,7 @@ size_flags_horizontal = 3
[node name="Home" type="Button" parent="Control/VBoxContainer/MarginContainer/HBoxContainer/MarginContainer"]
layout_mode = 2
text = "返回主页"
text = "KEY_BackHome"
[node name="MarginContainer2" type="MarginContainer" parent="Control/VBoxContainer/MarginContainer/HBoxContainer"]
layout_mode = 2
@ -47,7 +47,7 @@ size_flags_horizontal = 3
[node name="Undo" type="Button" parent="Control/VBoxContainer/MarginContainer/HBoxContainer/MarginContainer2"]
layout_mode = 2
size_flags_vertical = 4
text = "撤回"
text = "KEY_GameUndo"
[node name="MarginContainer3" type="MarginContainer" parent="Control/VBoxContainer/MarginContainer/HBoxContainer"]
layout_mode = 2
@ -55,7 +55,7 @@ size_flags_horizontal = 3
[node name="ReInit" type="Button" parent="Control/VBoxContainer/MarginContainer/HBoxContainer/MarginContainer3"]
layout_mode = 2
text = "重开"
text = "KEY_GameReInit"
[node name="MarginContainer3" type="MarginContainer" parent="Control/VBoxContainer"]
layout_mode = 2
@ -65,8 +65,7 @@ layout_mode = 2
[node name="Label" type="Label" parent="Control/VBoxContainer/MarginContainer3/HFlowContainer"]
layout_mode = 2
text = "You Are
"
text = "KEY_Content_YouAre"
[node name="LineEdit" type="LineEdit" parent="Control/VBoxContainer/MarginContainer3/HFlowContainer"]
layout_mode = 2
@ -75,7 +74,7 @@ editable = false
[node name="Label2" type="Label" parent="Control/VBoxContainer/MarginContainer3/HFlowContainer"]
layout_mode = 2
text = "Turns On"
text = "KEY_Content_TurnOn"
[node name="LineEdit2" type="LineEdit" parent="Control/VBoxContainer/MarginContainer3/HFlowContainer"]
layout_mode = 2
@ -94,8 +93,7 @@ grow_vertical = 0
[node name="Over" type="Button" parent="Control/MarginContainer2"]
layout_mode = 2
text = "结束回合
(提示对方结束)"
text = "KEY_OverThisTurn"
[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"]

View File

@ -10,7 +10,7 @@ metadata/_edit_use_anchors_ = true
[node name="Label" type="Label" parent="."]
layout_mode = 2
size_flags_horizontal = 0
text = "Server Status"
text = "KEY_ServerConnectStatus"
[node name="ColorRect" type="ColorRect" parent="."]
custom_minimum_size = Vector2(15, 15)

View File

@ -29,8 +29,7 @@ layout_mode = 2
[node name="Button" type="Button" parent="MarginContainer/VBoxContainer/MarginContainer"]
layout_mode = 2
text = "Back
"
text = "KEY_BackHome"
[node name="MarginContainer2" type="HFlowContainer" parent="MarginContainer/VBoxContainer"]
layout_mode = 2
@ -40,7 +39,7 @@ layout_mode = 2
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/MarginContainer2/MarginContainer"]
layout_mode = 2
text = "Connect States"
text = "KEY_ServerConnectStatus"
[node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/VBoxContainer/MarginContainer2"]
layout_mode = 2

23
Scenes/Mods.tscn Normal file
View File

@ -0,0 +1,23 @@
[gd_scene load_steps=3 format=3 uid="uid://c2ov83uk7r6rq"]
[ext_resource type="Theme" uid="uid://intlbeu8h82r" path="res://Asserts/defaultTheme.tres" id="1_mhtia"]
[ext_resource type="Script" uid="uid://c8t8d8e7inajy" path="res://Scripts/Controllers/Mods.cs" id="1_mnyng"]
[node name="MarginContainer" type="MarginContainer"]
offset_right = 720.0
offset_bottom = 1280.0
theme = ExtResource("1_mhtia")
theme_override_constants/margin_left = 30
theme_override_constants/margin_top = 30
theme_override_constants/margin_right = 30
theme_override_constants/margin_bottom = 30
script = ExtResource("1_mnyng")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2
[node name="Button" type="Button" parent="VBoxContainer"]
layout_mode = 2
text = "back"
[connection signal="pressed" from="VBoxContainer/Button" to="." method="OnBack"]

View File

@ -1,9 +1,11 @@
[gd_scene load_steps=4 format=3 uid="uid://c6gxufppw1fu3"]
[gd_scene load_steps=5 format=3 uid="uid://c6gxufppw1fu3"]
[ext_resource type="Theme" uid="uid://intlbeu8h82r" path="res://Asserts/defaultTheme.tres" id="1_6yfoi"]
[ext_resource type="Script" uid="uid://71ril3nh84rw" 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"]
[sub_resource type="ButtonGroup" id="ButtonGroup_efio3"]
[node name="Setting" type="MarginContainer"]
anchors_preset = 15
anchor_right = 1.0
@ -21,14 +23,21 @@ layout_mode = 2
[node name="Back" type="Button" parent="BoxContainer/MarginContainer"]
layout_mode = 2
text = "Back"
text = "KEY_BackHome"
[node name="MarginContainer7" type="MarginContainer" parent="BoxContainer"]
layout_mode = 2
[node name="Button" type="Button" parent="BoxContainer/MarginContainer7"]
layout_mode = 2
text = "Save"
text = "KEY_SaveConfigFile"
[node name="MarginContainer9" type="MarginContainer" parent="BoxContainer"]
layout_mode = 2
[node name="Button" type="Button" parent="BoxContainer/MarginContainer9"]
layout_mode = 2
text = "KEY_GetConfigDir"
[node name="MarginContainer2" type="MarginContainer" parent="BoxContainer"]
layout_mode = 2
@ -38,7 +47,7 @@ layout_mode = 2
[node name="Label" type="Label" parent="BoxContainer/MarginContainer2/Server"]
layout_mode = 2
text = "Server IP"
text = "KEY_ServerIP"
[node name="LineEdit" type="LineEdit" parent="BoxContainer/MarginContainer2/Server"]
layout_mode = 2
@ -52,7 +61,7 @@ layout_mode = 2
[node name="Label" type="Label" parent="BoxContainer/MarginContainer3/Name"]
layout_mode = 2
text = "Name"
text = "KEY_UserName"
[node name="LineEdit" type="LineEdit" parent="BoxContainer/MarginContainer3/Name"]
layout_mode = 2
@ -86,7 +95,7 @@ layout_mode = 2
[node name="Label" type="Label" parent="BoxContainer/MarginContainer5/HBoxContainer"]
layout_mode = 2
text = "Font Size"
text = "KEY_GlobalFontSize"
[node name="FontSize" type="LineEdit" parent="BoxContainer/MarginContainer5/HBoxContainer"]
layout_mode = 2
@ -103,6 +112,30 @@ min_value = 10.0
max_value = 50.0
value = 10.0
[node name="HBoxContainer2" type="HFlowContainer" parent="BoxContainer"]
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="BoxContainer/HBoxContainer2"]
layout_mode = 2
size_flags_horizontal = 3
[node name="Button" type="Button" parent="BoxContainer/HBoxContainer2/MarginContainer"]
layout_mode = 2
size_flags_horizontal = 3
toggle_mode = true
button_group = SubResource("ButtonGroup_efio3")
text = "简体中文"
[node name="MarginContainer2" type="MarginContainer" parent="BoxContainer/HBoxContainer2"]
layout_mode = 2
size_flags_horizontal = 3
[node name="Button2" type="Button" parent="BoxContainer/HBoxContainer2/MarginContainer2"]
layout_mode = 2
toggle_mode = true
button_group = SubResource("ButtonGroup_efio3")
text = "English"
[node name="HBoxContainer" type="HFlowContainer" parent="BoxContainer"]
layout_mode = 2
@ -161,9 +194,12 @@ text = "Trace Color"
[connection signal="pressed" from="BoxContainer/MarginContainer/Back" to="." method="OnBack"]
[connection signal="pressed" from="BoxContainer/MarginContainer7/Button" to="." method="OnSave"]
[connection signal="pressed" from="BoxContainer/MarginContainer9/Button" to="." method="OnGetSettingsFile"]
[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="toggled" from="BoxContainer/HBoxContainer2/MarginContainer/Button" to="." method="ChangeLangZHCN"]
[connection signal="toggled" from="BoxContainer/HBoxContainer2/MarginContainer2/Button2" to="." method="ChangeLangEN"]
[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"]