feat: add support for alternative skill name

This commit is contained in:
Kazhnuz 2021-08-15 15:30:20 +02:00
parent 39507951b8
commit 76ad185db8

View file

@ -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