mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(多人游戏): 添加连接状态检查和断开连接功能
- 在MultiplayerState中添加isConnected方法检查连接状态 - 修改launchServer和connectClient方法以更新连接状态 - 在Starter面板中添加断开连接按钮并实现状态同步 - 更新UI显示连接状态和颜色
This commit is contained in:
@@ -88,9 +88,10 @@ label_settings = SubResource("LabelSettings_lfxcn")
|
||||
|
||||
[node name="connectionState" type="Label" parent="content/wrapper/starter/multiplayer/main" index="1"]
|
||||
unique_name_in_owner = true
|
||||
modulate = Color(1, 0, 0, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "状态:"
|
||||
text = "状态:未连接到服务器。"
|
||||
label_settings = SubResource("LabelSettings_kl3ko")
|
||||
|
||||
[node name="host" type="HBoxContainer" parent="content/wrapper/starter/multiplayer/main" index="2"]
|
||||
@@ -145,6 +146,13 @@ layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "连接服务器"
|
||||
|
||||
[node name="disconnectBtn" type="Button" parent="content/wrapper/starter/multiplayer/main/operation" index="2"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
disabled = true
|
||||
text = "断开连接"
|
||||
|
||||
[node name="serverConfig" type="VBoxContainer" parent="content/wrapper/starter/multiplayer" index="1"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
Reference in New Issue
Block a user