diff --git a/src/logic-scenes/board/card.gd b/src/logic-scenes/board/card.gd index ea2580c..3801963 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():