From 76ad185db83e61706f1bee292fbb1fcf152e575d Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 15 Aug 2021 15:30:20 +0200 Subject: [PATCH] feat: add support for alternative skill name --- .../scenes/battlesystem/menus/widgets.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sonic-radiance.love/scenes/battlesystem/menus/widgets.lua b/sonic-radiance.love/scenes/battlesystem/menus/widgets.lua index 4ec7d51..441f494 100644 --- a/sonic-radiance.love/scenes/battlesystem/menus/widgets.lua +++ b/sonic-radiance.love/scenes/battlesystem/menus/widgets.lua @@ -108,11 +108,23 @@ function widgets.SkillWidget:new(character, menu_name, skill) if (self.skilldata.cost > character.abstract.pp) then color = {1, 0.3, 0.3} end + local fullName = self:getFullName(character) - widgets.SkillWidget.super.new(self, character, menu_name, self.skilldata.fullname, "-" .. label2, "skills") + widgets.SkillWidget.super.new(self, character, menu_name, fullName, "-" .. label2, "skills") self.color = color end +function widgets.SkillWidget:getFullName(character) + if (self.skilldata.altName == nil) then + return self.skilldata.fullname + end + if (self.skilldata.altName[character.abstract.simplename] ~= nil) then + return self.skilldata.altName[character.abstract.simplename] + else + return self.skilldata.fullname + end +end + function widgets.SkillWidget:sendCharacterData() if (self.skilldata ~= nil and self.skilldata.cost <= self.character.abstract.pp) then