Fixed unused tween error

This commit is contained in:
Rob Kelly 2024-11-19 17:45:21 -07:00
parent 7201c030e6
commit 682850738a
1 changed files with 6 additions and 4 deletions

View File

@ -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