mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-11-13 20:47:19 +01:00
Now the spell book can hide not learned class spells.
This commit is contained in:
parent
a8868d81dc
commit
55c5791991
@ -25,6 +25,7 @@ export(NodePath) var prev_button_path : NodePath
|
||||
export(NodePath) var next_button_path : NodePath
|
||||
export(NodePath) var spell_points_label_path : NodePath
|
||||
|
||||
export(bool) var show_not_learned : bool = true
|
||||
export(bool) var show_not_learnable : bool = false
|
||||
|
||||
var _spell_entry_container : Node
|
||||
@ -93,18 +94,22 @@ func refresh_entries() -> void:
|
||||
var spindex : int = i + (_page * len(_spell_entries))
|
||||
|
||||
if spindex >= _spells.size():
|
||||
_spell_entries[i].set_spell(_player, null)
|
||||
_spell_entries[n].set_spell(_player, null)
|
||||
i += 1
|
||||
n += 1
|
||||
continue
|
||||
|
||||
var spell : Spell = _spells[spindex]
|
||||
|
||||
if not show_not_learnable:
|
||||
if not _player.hasc_spell(spell) and spell.training_required_spell \
|
||||
and not _player.hasc_spell(spell.training_required_spell):
|
||||
i += 1
|
||||
continue
|
||||
if not _player.hasc_spell(spell):
|
||||
if not show_not_learned:
|
||||
i += 1
|
||||
continue
|
||||
|
||||
if not show_not_learnable:
|
||||
if spell.training_required_spell and not _player.hasc_spell(spell.training_required_spell):
|
||||
i += 1
|
||||
continue
|
||||
|
||||
|
||||
_spell_entries[n].set_spell(_player, spell)
|
||||
|
@ -16,7 +16,7 @@ spell_entry_container_path = NodePath("PagedContent/GridContainer")
|
||||
prev_button_path = NodePath("PagedContent/Controls/HBoxContainer/Button2")
|
||||
next_button_path = NodePath("PagedContent/Controls/HBoxContainer/Button")
|
||||
spell_points_label_path = NodePath("PagedContent/Controls/HBoxContainer/SpellPoints")
|
||||
show_not_learnable = true
|
||||
show_not_learned = false
|
||||
|
||||
[node name="PagedContent" type="VBoxContainer" parent="."]
|
||||
margin_left = 4.0
|
||||
|
Loading…
Reference in New Issue
Block a user