Skip to content

Commit f196f65

Browse files
authored
Fix Ascendancy header image and rename itemTooltip to tooltipHeader (#1189)
1 parent 96d2d7b commit f196f65

7 files changed

Lines changed: 19 additions & 13 deletions
24.7 KB
Loading
24.7 KB
Loading
24.7 KB
Loading

src/Classes/GemSelectControl.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ function GemSelectClass:AddGemTooltip(gemInstance)
528528
self.tooltip.color = colorCodes.GEM
529529
local grantedEffect = gemInstance.gemData.grantedEffect
530530
local additionalEffects = gemInstance.gemData.additionalGrantedEffects
531-
self.tooltip.itemTooltip = "GEM"
531+
self.tooltip.tooltipHeader = "GEM"
532532
if grantedEffect.name:match("^Spectre:") or grantedEffect.name:match("^Companion:") then
533533
self.tooltip:AddLine(20, colorCodes.GEM .. (gemInstance.displayEffect and gemInstance.displayEffect.nameSpec or gemInstance.gemData.name))
534534
else

src/Classes/ItemsTab.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2596,7 +2596,7 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode)
25962596
-- Item name
25972597
local rarityCode = colorCodes[item.rarity]
25982598
tooltip.maxWidth = 600 -- Should instead get the longest mod and set the width to that. Some flavour text is way too long so we need a cap of sorts.
2599-
tooltip.itemTooltip = item.rarity
2599+
tooltip.tooltipHeader = item.rarity
26002600
tooltip.center = true
26012601
tooltip.color = rarityCode
26022602
if item.title then

src/Classes/PassiveTreeView.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,8 +1079,13 @@ function PassiveTreeViewClass:AddNodeName(tooltip, node, build)
10791079
Notable = "NOTABLE",
10801080
Socket = "JEWEL",
10811081
Keystone = "KEYSTONE",
1082+
Ascendancy = "ASCENDANCY",
10821083
}
1083-
tooltip.itemTooltip = tooltipMap[node.type] or "UNKNOWN"
1084+
if (node.type == "Notable" or node.type == "Normal") and node.ascendancyName then
1085+
tooltip.tooltipHeader = "ASCENDANCY"
1086+
else
1087+
tooltip.tooltipHeader = tooltipMap[node.type] or "UNKNOWN"
1088+
end
10841089
tooltip:AddLine(24, "^7"..node.dn..(launch.devModeAlt and " ["..node.id.."]" or ""))
10851090
if launch.devModeAlt and node.id > 65535 then
10861091
-- Decompose cluster node Id

src/Classes/Tooltip.lua

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ end)
2424
function TooltipClass:Clear()
2525
wipeTable(self.lines)
2626
wipeTable(self.blocks)
27-
self.itemTooltip = false
27+
self.tooltipHeader = false
2828
self.titleYOffset = 0
2929
self.recipe = nil
3030
self.center = false
@@ -86,8 +86,8 @@ function TooltipClass:AddSeparator(size)
8686

8787
local separatorImage = nil
8888

89-
if self.itemTooltip then
90-
local rarity = tostring(self.itemTooltip):upper()
89+
if self.tooltipHeader then
90+
local rarity = tostring(self.tooltipHeader):upper()
9191
local separatorConfigs = {
9292
RELIC = "Assets/ItemsSeparatorFoil.png",
9393
UNIQUE = "Assets/ItemsSeparatorUnique.png",
@@ -258,8 +258,8 @@ function TooltipClass:Draw(x, y, w, h, viewPort)
258258
end
259259
local ttW, ttH = self:GetSize()
260260

261-
-- ensure ttW is at least title width + 50 pixels, this fixes the header image for Magic items and some Tree passives. NOT WORKING NOW?????
262-
if self.itemTooltip and self.lines[1] and self.lines[1].text then
261+
-- ensure ttW is at least title width + 50 pixels, this fixes the header image for Magic items and some Tree passives.
262+
if self.tooltipHeader and self.lines[1] and self.lines[1].text then
263263
local titleW = DrawStringWidth(self.lines[1].size, "VAR", self.lines[1].text)
264264
if titleW + 50 > ttW then
265265
ttW = titleW + 50
@@ -276,10 +276,11 @@ function TooltipClass:Draw(x, y, w, h, viewPort)
276276
NOTABLE = {left="Assets/NotablePassiveHeaderLeft.png",middle="Assets/NotablePassiveHeaderMiddle.png",right="Assets/NotablePassiveHeaderRight.png",height=38,sideWidth=38,middleWidth=32,textYOffset=2},
277277
PASSIVE = {left="Assets/NormalPassiveHeaderLeft.png",middle="Assets/NormalPassiveHeaderMiddle.png",right="Assets/NormalPassiveHeaderRight.png",height=38,sideWidth=32,middleWidth=32,textYOffset=2},
278278
KEYSTONE = {left="Assets/KeystonePassiveHeaderLeft.png",middle="Assets/KeystonePassiveHeaderMiddle.png",right="Assets/KeystonePassiveHeaderRight.png",height=38,sideWidth=32,middleWidth=32,textYOffset=2},
279+
ASCENDANCY = {left="Assets/AscendancyPassiveHeaderLeft.png",middle="Assets/AscendancyPassiveHeaderMiddle.png",right="Assets/AscendancyPassiveHeaderRight.png",height=38,sideWidth=32,middleWidth=32,textYOffset=2},
279280
}
280281
local config
281-
if self.itemTooltip and main.showFlavourText and self.lines[1] and self.lines[1].text then
282-
local rarity = tostring(self.itemTooltip):upper()
282+
if self.tooltipHeader and main.showFlavourText and self.lines[1] and self.lines[1].text then
283+
local rarity = tostring(self.tooltipHeader):upper()
283284
config = headerConfigs[rarity] or headerConfigs.NORMAL
284285
self.titleYOffset = config.textYOffset or 0
285286
end
@@ -310,8 +311,8 @@ function TooltipClass:Draw(x, y, w, h, viewPort)
310311
SetDrawColor(1, 1, 1)
311312

312313
-- Item header (drawn within borders)
313-
if self.itemTooltip and main.showFlavourText and self.lines[1] and self.lines[1].text then
314-
local rarity = tostring(self.itemTooltip):upper()
314+
if self.tooltipHeader and main.showFlavourText and self.lines[1] and self.lines[1].text then
315+
local rarity = tostring(self.tooltipHeader):upper()
315316
local config = headerConfigs[rarity] or headerConfigs.NORMAL
316317

317318
self.titleYOffset = config.textYOffset or 0
@@ -365,7 +366,7 @@ function TooltipClass:Draw(x, y, w, h, viewPort)
365366
local skip = false
366367
if line[1] and type(line[1]) == "table" and line[1].isSeparator then
367368
-- Only skip first separator for items and skill gems
368-
local tooltipType = self.itemTooltip and tostring(self.itemTooltip):upper() or ""
369+
local tooltipType = self.tooltipHeader and tostring(self.tooltipHeader):upper() or ""
369370
if main.showFlavourText and not firstSeparatorSkipped and
370371
(tooltipType == "RELIC" or tooltipType == "UNIQUE" or tooltipType == "RARE" or tooltipType == "MAGIC" or tooltipType == "GEM") then
371372
firstSeparatorSkipped = true

0 commit comments

Comments
 (0)