diff --git a/src/dev-util/hardcoded_cards.gd b/src/dev-util/hardcoded_cards.gd index fe249d3..9bf0e24 100644 --- a/src/dev-util/hardcoded_cards.gd +++ b/src/dev-util/hardcoded_cards.gd @@ -243,7 +243,6 @@ func create_dev_board(parent: Control, _rect: Rect2) -> void: card.add_child(sticky, false, Node.INTERNAL_MODE_BACK) sticky.position = card.sticky_note_position + Vector2(0, 80) * z z += 1 - y += 1 panel.custom_minimum_size.x = source_dicts.size() * 256 diff --git a/src/dev-util/room_template.gd b/src/dev-util/room_template.gd index 9bd6819..7c02bd3 100644 --- a/src/dev-util/room_template.gd +++ b/src/dev-util/room_template.gd @@ -42,7 +42,6 @@ func pull_save_state(_save: SaveGame) -> void: pass func save_room(): - pull_save_state(save_game) save_game.save_to_file(get_tree().root.get_texture()) func prepare_transition(): diff --git a/src/logic-scenes/board/card-board.gd b/src/logic-scenes/board/card-board.gd index 2ce600a..b5b64d9 100644 --- a/src/logic-scenes/board/card-board.gd +++ b/src/logic-scenes/board/card-board.gd @@ -601,7 +601,8 @@ func get_save_dict() -> Dictionary: if child.picked_random: randoms.append(child.name) - if child.has_sticky_note_attached(): + var note : StickyNote = child.get_attached_sticky_note() + if note: # Saves Card Name as position of it's children. stickies[child.get_attached_sticky_note().name] = child.name if child.get_attached_sticky_note().picked_random: diff --git a/src/logic-scenes/board/card.gd b/src/logic-scenes/board/card.gd index 5092377..7aecd61 100644 --- a/src/logic-scenes/board/card.gd +++ b/src/logic-scenes/board/card.gd @@ -134,6 +134,8 @@ var mouse_offset: Vector2 func init(card_name: String = "card", own_id:StringName = "-1") -> void: if card_name != "c_void": text = card_name + if !card_name.begins_with("c"): + push_error("Illegal card.") card_id = own_id name = card_name @@ -232,7 +234,11 @@ func has_sticky_note_attached() -> bool: return get_child_count(false) > 0 func get_attached_sticky_note() -> StickyNote: - return null if not has_sticky_note_attached() else get_child(0) + for child in get_children(false): + if child is StickyNote: + return child + return null + func preview_sticky_note(sticky_note: StickyNote): sticky_note.reparent(self.get_parent()) diff --git a/src/logic-scenes/card_picker/card_picker.gd b/src/logic-scenes/card_picker/card_picker.gd index 2dce14e..8057d03 100644 --- a/src/logic-scenes/card_picker/card_picker.gd +++ b/src/logic-scenes/card_picker/card_picker.gd @@ -247,3 +247,4 @@ func pick_cards(id: Scenes.id, repeat: bool): if id == Scenes.id.YOUTH_DRAVEN and not repeat: $Meaning.play() await cards_picked + hide() diff --git a/src/logic-scenes/card_picker/card_picker.tscn b/src/logic-scenes/card_picker/card_picker.tscn index 548d53a..96c5a61 100644 --- a/src/logic-scenes/card_picker/card_picker.tscn +++ b/src/logic-scenes/card_picker/card_picker.tscn @@ -1774,17 +1774,6 @@ libraries = { } [node name="Card" parent="cards/card_1" instance=ExtResource("2_t7byf")] -picked_random = null -wiggle_strength = null -wiggle_speed = null -scale_bump = null -bounce_speed = null -highlighted = null -is_dragable = null -diameter = null -burn_progress = null -burn_state = null -direction = null [node name="card_2" type="Control" parent="cards"] anchors_preset = 0 @@ -1795,17 +1784,6 @@ libraries = { } [node name="Card" parent="cards/card_2" instance=ExtResource("2_t7byf")] -picked_random = null -wiggle_strength = null -wiggle_speed = null -scale_bump = null -bounce_speed = null -highlighted = null -is_dragable = null -diameter = null -burn_progress = null -burn_state = null -direction = null [node name="card_3" type="Control" parent="cards"] anchors_preset = 0 @@ -1821,17 +1799,6 @@ libraries = { } [node name="Card" parent="cards/card_3" instance=ExtResource("2_t7byf")] -picked_random = null -wiggle_strength = null -wiggle_speed = null -scale_bump = null -bounce_speed = null -highlighted = null -is_dragable = null -diameter = null -burn_progress = null -burn_state = null -direction = null [node name="sticky_notes" type="Panel" parent="."] layout_mode = 2