Skip to content

Commit 32ada3b

Browse files
committed
Small check for old trees, before 3.10 were different
1 parent 6a0860d commit 32ada3b

1 file changed

Lines changed: 30 additions & 26 deletions

File tree

src/Classes/PassiveTreeView.lua

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -465,40 +465,44 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents)
465465
end
466466
self:DrawAsset(tree.assets["Classes"..group.ascendancyName], scrX, scrY, scale)
467467

468-
local ascendancyData
469-
local isAlternateAscendancy = false
470-
-- Search normal ascendancies
471-
for _, class in ipairs(tree.classes) do
472-
for _, ascendancy in ipairs(class.ascendancies) do
473-
if ascendancy.id == group.ascendancyName then
474-
ascendancyData = ascendancy
475-
break
468+
if tree.classes[1].ascendancies then
469+
local ascendancyData
470+
local isAlternateAscendancy = false
471+
-- Search normal ascendancies
472+
for _, class in ipairs(tree.classes) do
473+
for _, ascendancy in ipairs(class.ascendancies) do
474+
if ascendancy.id == group.ascendancyName then
475+
ascendancyData = ascendancy
476+
break
477+
end
476478
end
479+
if ascendancyData then break end
477480
end
478-
if ascendancyData then break end
479-
end
480481

481-
-- Search alternate ascendancies if not found
482-
if not ascendancyData and tree.alternate_ascendancies then
483-
for _, ascendancy in pairs(tree.alternate_ascendancies) do
484-
if ascendancy.id == group.ascendancyName then
485-
ascendancyData = ascendancy
486-
isAlternateAscendancy = true
487-
break
482+
-- Search alternate ascendancies if not found
483+
if not ascendancyData and tree.alternate_ascendancies then
484+
for _, ascendancy in pairs(tree.alternate_ascendancies) do
485+
if ascendancy.id == group.ascendancyName then
486+
ascendancyData = ascendancy
487+
isAlternateAscendancy = true
488+
break
489+
end
488490
end
489491
end
490-
end
491-
if ascendancyData and ascendancyData.flavourTextRect then
492-
local rect = ascendancyData.flavourTextRect
493-
local textColor = "^x" .. ascendancyData.flavourTextColour
492+
if ascendancyData and ascendancyData.flavourTextRect then
493+
local rect = ascendancyData.flavourTextRect
494+
local textColor = "^x" .. ascendancyData.flavourTextColour
494495

495-
-- Normal ascendancy images are 1300x1300, bloodline appears to be 1488x1412
496-
local offsetX = rect.x - (isAlternateAscendancy and 744 or 650)
497-
local offsetY = rect.y - (isAlternateAscendancy and 706 or 650)
496+
-- Normal ascendancy images are 1300x1300, bloodline appears to be 1488x1412
497+
local offsetX = rect.x - (isAlternateAscendancy and 744 or 650)
498+
local offsetY = rect.y - (isAlternateAscendancy and 706 or 650)
498499

499-
local textX, textY = treeToScreen(group.x + offsetX, group.y + offsetY)
500+
local textX, textY = treeToScreen(group.x + offsetX, group.y + offsetY)
500501

501-
DrawString(textX, textY, "LEFT", 52 * scale, "FONTIN ITALIC", textColor .. ascendancyData.flavourText)
502+
DrawString(textX, textY, "LEFT", 52 * scale, "FONTIN ITALIC", textColor .. ascendancyData.flavourText)
503+
end
504+
else
505+
ConPrintTable(tree.classes)
502506
end
503507
SetDrawColor(1, 1, 1)
504508
end

0 commit comments

Comments
 (0)