feat: add support for alternative skill name
This commit is contained in:
parent
39507951b8
commit
76ad185db8
1 changed files with 13 additions and 1 deletions
|
@ -108,11 +108,23 @@ function widgets.SkillWidget:new(character, menu_name, skill)
|
||||||
if (self.skilldata.cost > character.abstract.pp) then
|
if (self.skilldata.cost > character.abstract.pp) then
|
||||||
color = {1, 0.3, 0.3}
|
color = {1, 0.3, 0.3}
|
||||||
end
|
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
|
self.color = color
|
||||||
end
|
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()
|
function widgets.SkillWidget:sendCharacterData()
|
||||||
|
|
||||||
if (self.skilldata ~= nil and self.skilldata.cost <= self.character.abstract.pp) then
|
if (self.skilldata ~= nil and self.skilldata.cost <= self.character.abstract.pp) then
|
||||||
|
|
Loading…
Reference in a new issue