Spell points are off now, as I think trainers will work better for this game. Made the spell book window handle it properly.

This commit is contained in:
Relintai 2020-09-10 10:46:49 +02:00
parent 6fb1f1ca9b
commit 6a70b36e04
3 changed files with 44 additions and 24 deletions

View File

@ -195,7 +195,6 @@ window/size/ui_scale_touch=1.0
[ess] [ess]
spells/use_spell_points=true
level/auto_learn_spells=false level/auto_learn_spells=false
data/ess_resource_db_path="res://data/resource_db.tres" data/ess_resource_db_path="res://data/resource_db.tres"
data/ess_entity_spawner_path="res://player/bs_entity_spawner.tres" data/ess_entity_spawner_path="res://player/bs_entity_spawner.tres"

View File

@ -65,6 +65,9 @@ func _ready() -> void:
_prev_button.connect("pressed", self, "dec_page") _prev_button.connect("pressed", self, "dec_page")
_next_button.connect("pressed", self, "inc_page") _next_button.connect("pressed", self, "inc_page")
if ESS.use_spell_points:
_spell_points_label.text = ""
connect("visibility_changed", self, "_visibility_changed") connect("visibility_changed", self, "_visibility_changed")
func inc_page() -> void: func inc_page() -> void:
@ -135,6 +138,7 @@ func refresh_all() -> void:
if _page > _max_pages: if _page > _max_pages:
_page = _max_pages _page = _max_pages
if ESS.use_spell_points:
_spell_points_label.text = "Free spell points: " + str(_player.getc_free_spell_points()) _spell_points_label.text = "Free spell points: " + str(_player.getc_free_spell_points())
refresh_entries() refresh_entries()

View File

@ -106,7 +106,8 @@ func spell_button_pressed() -> void:
_popup.popup(Rect2(pos, _popup.rect_size)) _popup.popup(Rect2(pos, _popup.rect_size))
func update_spell_indicators(): func update_spell_indicators():
if _spell_known && ESS.use_spell_points: if ESS.use_spell_points:
if _spell_known:
get_node(known_label_path).show() get_node(known_label_path).show()
get_node(learn_button_path).hide() get_node(learn_button_path).hide()
@ -129,5 +130,21 @@ func update_spell_indicators():
get_node(learn_button_path).show() get_node(learn_button_path).show()
modulate = not_known_color modulate = not_known_color
else:
get_node(known_label_path).hide()
get_node(learn_button_path).hide()
if _spell_known:
modulate = known_color
else:
if _spell != null:
if _spell.training_required_spell:
if not _player.spell_hasc(_spell.training_required_spell):
modulate = unlearnable_color
return
modulate = not_known_color