From 5943ac7f456ff9e9f77f83ceea4cb835579ea3a6 Mon Sep 17 00:00:00 2001 From: betalars Date: Wed, 12 Jul 2023 18:47:31 +0200 Subject: [PATCH] fixing void card --- src/logic-scenes/board/card.gd | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/logic-scenes/board/card.gd b/src/logic-scenes/board/card.gd index ea2580c3..3801963a 100644 --- a/src/logic-scenes/board/card.gd +++ b/src/logic-scenes/board/card.gd @@ -13,15 +13,15 @@ var scale_tween var on_stage = false @export var text: String = "" : - set (value): + set(value): text = value - if is_inside_tree() or Engine.is_editor_hint(): + if get_children() != [] or Engine.is_editor_hint(): $Label.text = value $BackgroundSprite.frame = text.hash() % $BackgroundSprite.sprite_frames.get_frame_count($BackgroundSprite.animation) - if is_inside_tree() and !Engine.is_editor_hint(): + if !Engine.is_editor_hint(): wiggle_pos = float(text.hash() % 100) _handle_wiggle(0) - if is_inside_tree() and value == "": + if get_children() != [] and !Engine.is_editor_hint() and text == "": $BackgroundSprite.void_active = true @export var wiggle_strength: float = 0.2 @export var wiggle_speed: float = 5 @@ -76,6 +76,7 @@ func _ready(): $BackgroundSprite.frame = text.hash() % $BackgroundSprite.sprite_frames.get_frame_count($BackgroundSprite.animation) $Label.text = self.text + if not Engine.is_editor_hint(): $BackgroundSprite.void_active = text == "" wiggle_pos = float(text.hash() % 100) if not Engine.is_editor_hint():