Skip to content

Commit fd8edfa

Browse files
justjuanguijustjuangui
andauthored
Granted Skill support added when importing from API (#929)
Co-authored-by: justjuangui <servicios@juacarvajal.com>
1 parent a8664fd commit fd8edfa

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Classes/ImportTab.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,19 @@ function ImportTabClass:ImportItem(itemData, slotName)
941941
end
942942
end
943943

944+
if itemData.grantedSkills then
945+
for _, grantedSkillInfo in ipairs(itemData.grantedSkills) do
946+
local level = grantedSkillInfo.values and #grantedSkillInfo.values > 0 and #grantedSkillInfo.values[1] > 0 and grantedSkillInfo.values[1][1] or "unknown"
947+
local grantedSkills = string.format(
948+
"%s: %s",
949+
grantedSkillInfo.name,
950+
level
951+
)
952+
local modList, extra = modLib.parseMod(grantedSkills)
953+
t_insert(item.implicitModLines, { line = grantedSkills, extra = extra, mods = modList or { } })
954+
end
955+
end
956+
944957
-- Sometimes flavour text has actual mods that PoB cares about
945958
-- Right now, the only known one is "This item can be anointed by Cassia"
946959
if itemData.flavourText then

0 commit comments

Comments
 (0)