From 17b3e4e17241841863163a68b94eeb64814d0a65 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 13 Mar 2021 17:28:25 +0100 Subject: [PATCH] feat: handle better not having enough pp Fixes #68 --- sonic-radiance.love/scenes/battlesystem/menus/widgets.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sonic-radiance.love/scenes/battlesystem/menus/widgets.lua b/sonic-radiance.love/scenes/battlesystem/menus/widgets.lua index 3a2c691..7b9b339 100644 --- a/sonic-radiance.love/scenes/battlesystem/menus/widgets.lua +++ b/sonic-radiance.love/scenes/battlesystem/menus/widgets.lua @@ -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