From ce84fa75a0e4849590335eee5453218a3310b508 Mon Sep 17 00:00:00 2001 From: xiaji Date: Mon, 1 Jun 2026 23:08:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20hand=5Farea=20?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E8=B7=AF=E5=BE=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - HandArea 现在在 ScrollContainer 下,路径改为 $ScrollContainer/HandArea - 添加按钮空值检查,防止连接信号时出错 🤖 Generated with [Qoder][https://qoder.com] --- src/ui/scenes/training_room.gd | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ui/scenes/training_room.gd b/src/ui/scenes/training_room.gd index 410aaba..75e0008 100644 --- a/src/ui/scenes/training_room.gd +++ b/src/ui/scenes/training_room.gd @@ -2,7 +2,7 @@ extends Control var controller: TrainingController -@onready var hand_area := $HandArea as HandArea +@onready var hand_area := $ScrollContainer/HandArea as HandArea @onready var play_button: Button = $Buttons/PlayButton @onready var pass_button: Button = $Buttons/PassButton @onready var hint_button: Button = $Buttons/HintButton @@ -10,9 +10,12 @@ var controller: TrainingController @onready var guide_label: Label = $GuideLabel func _ready() -> void: - play_button.pressed.connect(_on_play_pressed) - pass_button.pressed.connect(_on_pass_pressed) - hint_button.pressed.connect(_on_hint_pressed) + if play_button: + play_button.pressed.connect(_on_play_pressed) + if pass_button: + pass_button.pressed.connect(_on_pass_pressed) + if hint_button: + hint_button.pressed.connect(_on_hint_pressed) start_training() func start_training() -> void: