From 3b0c2d3d23304ecb89b8d799e831369ecb6bf257 Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 15 Feb 2022 00:26:59 +0100 Subject: [PATCH] Connect to the deserialized signal in SpellBookWindow. --- game/ui/player/spellbook/SpellBookWindow.gd | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/game/ui/player/spellbook/SpellBookWindow.gd b/game/ui/player/spellbook/SpellBookWindow.gd index b91f0263..b1ee5c3d 100644 --- a/game/ui/player/spellbook/SpellBookWindow.gd +++ b/game/ui/player/spellbook/SpellBookWindow.gd @@ -150,11 +150,13 @@ func set_player(p_player: Entity) -> void: if _player != null: _player.disconnect("cfree_spell_points_changed", self, "cfree_spell_points_changed") _player.disconnect("centity_data_changed", self, "centity_data_changed") + _player.disconnect("deserialized", self, "on_deserialized") _player = p_player _player.connect("cfree_spell_points_changed", self, "cfree_spell_points_changed") _player.connect("centity_data_changed", self, "centity_data_changed") + _player.connect("deserialized", self, "on_deserialized") if _player != null: centity_data_changed(_player.centity_data) @@ -183,7 +185,9 @@ func centity_data_changed(data: EntityData): _spells.append(_character_class.get_spell(i)) _spells.sort_custom(CustomSpellSorter, "sort") - + +func on_deserialized(data: Entity): + refresh_entries() class CustomSpellSorter: static func sort(a, b):