mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-31 08:21:54 +08:00
feat(UI): 添加教程开关按钮并优化面板控制逻辑
- 在Starter面板中添加新手教程开关按钮 - 为MakeFeed和SelectInitialFeed面板添加class_name - 重构UIState中的输入处理逻辑,修复面板切换问题
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
@tool
|
||||
extends FullscreenPanelBase
|
||||
class_name MakeFeedPanel
|
||||
|
||||
var selectedCount: int = 0
|
||||
var refreshNeedBaseballCount = 10
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
@tool
|
||||
extends FullscreenPanelBase
|
||||
class_name SelectInitialFeedPanel
|
||||
|
||||
@onready var initialFeedSelection: HBoxContainer = $%initialFeedSelection
|
||||
@onready var initialWeaponSelection: HBoxContainer = $%initialWeaponSelection
|
||||
|
||||
@@ -5,6 +5,7 @@ class_name StarterPanel
|
||||
@onready var diffEdit: HSlider = $%diffEdit
|
||||
@onready var playerNameInput: LineEdit = $%playerNameInput
|
||||
@onready var gamemodeOption: OptionButton = $%gamemodeOption
|
||||
@onready var useTutorialBtn: Button = $%useTutorialBtn
|
||||
|
||||
@onready var startSingleplayerBtn: Button = $%startSingleplayerBtn
|
||||
@onready var startMultiplayerBtn: Button = $%startMultiplayerBtn
|
||||
@@ -59,6 +60,7 @@ func rebuildAllPlayers(playerNames: Array[String]):
|
||||
i.queue_free()
|
||||
for i in playerNames:
|
||||
addPlayerName(i)
|
||||
|
||||
@rpc("any_peer")
|
||||
func startMultiplayerGame():
|
||||
MultiplayerState.isMultiplayer = true
|
||||
@@ -81,6 +83,10 @@ func _ready():
|
||||
diffEdit.min_value = GameRule.difficultyRange.x
|
||||
diffEdit.max_value = GameRule.difficultyRange.y
|
||||
diffEdit.value = GameRule.difficulty
|
||||
useTutorialBtn.toggled.connect(
|
||||
func(on: bool):
|
||||
useTutorialBtn.text = "观看" if on else "跳过"
|
||||
)
|
||||
multiplayer.connection_failed.connect(
|
||||
func():
|
||||
setState(MultiplayerState.ConnectionState.DISCONNECTED)
|
||||
|
||||
Reference in New Issue
Block a user