feat: handle better not having enough pp

Fixes #68
This commit is contained in:
Kazhnuz 2021-03-13 17:28:25 +01:00
parent c521ae3c58
commit 17b3e4e172

View file

@ -104,8 +104,13 @@ function widgets.SkillWidget:new(character, menu_name, skill)
label2 = "0" .. label2
end
end
local color = {1, 1, 1}
if (self.skilldata.cost > character.abstract.pp) then
color = {1, 0.3, 0.3}
end
widgets.SkillWidget.super.new(self, character, menu_name, self.skilldata.fullname, "-" .. label2, "skills")
self.color = color
end
function widgets.SkillWidget:sendCharacterData()
@ -117,6 +122,7 @@ function widgets.SkillWidget:sendCharacterData()
core.debug:warning("cbs/menu", "skill " .. self.skillname .. " doesn't exist")
self.character:doNothing()
self.assets.sfx["mError"]:play()
self.scene.turns.hud:showMessage("You haven't enough PP!")
end
end