Skip to content

Commit 2531a74

Browse files
authored
render ascendancy flavor text only at higher zoom levels (#9944)
let's only render ascendancy flavor text when we are actually zoomed in enough to read it. also, dim unselected ascendancy flavor text at a clip of 50% (to match the existing background dimming).
1 parent cef72e7 commit 2531a74

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

src/Classes/PassiveTreeView.lua

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,9 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents)
554554
local scrX, scrY = treeToScreen(group.x, group.y)
555555
if group.ascendancyName then
556556
if group.isAscendancyStart then
557-
if group.ascendancyName ~= spec.curAscendClassBaseName and (not spec.curSecondaryAscendClass or group.ascendancyName ~= spec.curSecondaryAscendClass.id) then
558-
SetDrawColor(1, 1, 1, 0.25)
557+
local isSelectedAscendancy = group.ascendancyName == spec.curAscendClassBaseName or (spec.curSecondaryAscendClass and group.ascendancyName == spec.curSecondaryAscendClass.id)
558+
if not isSelectedAscendancy then
559+
SetDrawColor(1, 1, 1, 0.50)
559560
end
560561
self:DrawAsset(tree.assets["Classes"..group.ascendancyName], scrX, scrY, scale)
561562

@@ -585,15 +586,26 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents)
585586
end
586587
if ascendancyData and ascendancyData.flavourTextRect then
587588
local rect = ascendancyData.flavourTextRect
588-
local textColor = "^x" .. ascendancyData.flavourTextColour
589589

590590
-- Normal ascendancy images are 1300x1300, bloodline appears to be 1488x1412
591591
local offsetX = rect.x - (isAlternateAscendancy and 744 or 650)
592592
local offsetY = rect.y - (isAlternateAscendancy and 706 or 650)
593593

594594
local textX, textY = treeToScreen(group.x + offsetX, group.y + offsetY)
595595

596-
DrawString(textX, textY, "LEFT", 52 * scale, "FONTIN ITALIC", textColor .. ascendancyData.flavourText)
596+
local flavourTextBaseFontSize = 52
597+
local flavourTextMinZoom = 2.5
598+
if self.zoom >= flavourTextMinZoom then
599+
local textColor = "^x" .. ascendancyData.flavourTextColour
600+
if not isSelectedAscendancy then
601+
local colour = ascendancyData.flavourTextColour
602+
textColor = string.format("^x%02X%02X%02X",
603+
m_floor(tonumber(colour:sub(1, 2), 16) * 0.5),
604+
m_floor(tonumber(colour:sub(3, 4), 16) * 0.5),
605+
m_floor(tonumber(colour:sub(5, 6), 16) * 0.5))
606+
end
607+
DrawString(textX, textY, "LEFT", flavourTextBaseFontSize * scale, "FONTIN ITALIC", textColor .. ascendancyData.flavourText)
608+
end
597609
end
598610
else
599611
ConPrintTable(tree.classes)

0 commit comments

Comments
 (0)