From 682850738a33c52240cda9492a949415e6c4e43c Mon Sep 17 00:00:00 2001 From: Rob Kelly Date: Tue, 19 Nov 2024 17:45:21 -0700 Subject: [PATCH] Fixed unused tween error --- src/ui/shot_hud/club_selector/club_selector.gd | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ui/shot_hud/club_selector/club_selector.gd b/src/ui/shot_hud/club_selector/club_selector.gd index f948c55..aa0b933 100644 --- a/src/ui/shot_hud/club_selector/club_selector.gd +++ b/src/ui/shot_hud/club_selector/club_selector.gd @@ -60,16 +60,20 @@ func _reset_label_scale() -> void: func _set_value(new_value: Club.Type) -> void: + var old_label := _get_club_label(value) + var new_label := _get_club_label(new_value) + value = new_value + if not (old_label or new_label): + return + var tween := get_tree().create_tween() tween.set_parallel() - var old_label := _get_club_label(value) if old_label: tween.tween_property(old_label, "scale", UNSELECTED_SCALE, LABEL_SCALE_TIME).set_trans( Tween.TRANS_SINE ) - var new_label := _get_club_label(new_value) if new_label: tween.tween_property(new_label, "scale", SELECTED_SCALE, LABEL_SCALE_TIME).set_trans( Tween.TRANS_SINE @@ -78,5 +82,3 @@ func _set_value(new_value: Club.Type) -> void: tween.tween_property(club_hub, "rotation_degrees", theta, HUB_ROTATION_TIME).set_trans( Tween.TRANS_QUAD ) - - value = new_value