Skip to content

Commit febef50

Browse files
committed
Relic header colours
1 parent dd3de65 commit febef50

4 files changed

Lines changed: 43 additions & 7 deletions

File tree

src/Classes/Item.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,13 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
314314
if colorCodes[rarity:upper()] then
315315
self.rarity = rarity:upper()
316316
end
317-
if self.rarity == "UNIQUE" then
317+
if self.rarity == "UNIQUE" or self.rarity == "RELIC" then
318318
-- Hack for relics
319319
for _, line in ipairs(self.rawLines) do
320320
if line:find("Foil Unique") then
321321
self.rarity = "RELIC"
322+
local captured = line:match("%((.-)%)")
323+
self.foilType = captured or "Rainbow"
322324
break
323325
end
324326
end
@@ -388,6 +390,9 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
388390
self.fractured = true
389391
elseif line == "Synthesised Item" then
390392
self.synthesised = true
393+
elseif line:match("Foil Unique") then
394+
local captured = line:match("%((.-)%)")
395+
self.foilType = captured or "Rainbow"
391396
elseif influenceItemMap[line] then
392397
self[influenceItemMap[line]] = true
393398
elseif line == "Requirements:" then
@@ -1176,6 +1181,9 @@ function ItemClass:BuildRaw()
11761181
if self.corrupted or self.scourge then
11771182
t_insert(rawLines, "Corrupted")
11781183
end
1184+
if self.foilType then
1185+
t_insert(rawLines, "Foil Unique" .. " (" .. self.foilType .. ")")
1186+
end
11791187
return table.concat(rawLines, "\n")
11801188
end
11811189

src/Classes/ItemsTab.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3279,6 +3279,7 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode)
32793279
local rarityCode = colorCodes[item.rarity]
32803280
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.
32813281
tooltip.tooltipHeader = item.rarity
3282+
tooltip.foilType = item.foilType
32823283
tooltip.center = true
32833284
tooltip.color = rarityCode
32843285
self:SetTooltipHeaderInfluence(tooltip, item)

src/Classes/PassiveTreeView.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents)
182182
local offsetY = self.zoomY + viewPort.y + viewPort.height/2
183183
local function treeToScreen(x, y)
184184
return x * scale + offsetX,
185-
y * scale + offsetY
185+
y * scale + offsetY
186186
end
187187
local function screenToTree(x, y)
188188
return (x - offsetX) / scale,
189-
(y - offsetY) / scale
189+
(y - offsetY) / scale
190190
end
191191

192192
if IsKeyDown("SHIFT") then

src/Classes/Tooltip.lua

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,29 @@ function TooltipClass:Draw(x, y, w, h, viewPort)
404404
self.influenceIcon2:Load(headerInfluence[self.influenceHeader2])
405405
end
406406

407-
if self.tooltipHeader == "RELIC" then -- Temporary
408-
SetDrawColor(0.6,1,0.5)
407+
local foilTypes = {
408+
["Rainbow"] = {0.6, 1, 0.5},
409+
["Amethyst"] = {0.9, 0.6, 1},
410+
["Verdant"] = {0.5, 1, 0.5},
411+
["Ruby"] = {1, 0.5, 0.6},
412+
["Cobalt"] = {0.6, 0.7, 1},
413+
["Sunset"] = {1, 1, 0.6},
414+
["Aureate"] = {1, 0.85, 0.2},
415+
["Celestial Quartz"] = {1, 0.7, 0.85},
416+
["Celestial Ruby"] = {0.8, 0.3, 0.2},
417+
["Celestial Emerald"] = {0.2, 0.6, 0.3},
418+
["Celestial Aureate"] = {0.8, 0.7, 0.2},
419+
["Celestial Pearl"] = {1, 0.85, 0.9},
420+
["Celestial Amethyst"] = {0.5, 0.6, 1},
421+
}
422+
if self.tooltipHeader == "RELIC" then
423+
--ConPrintf(self.foilType)
424+
local color = foilTypes[self.foilType] or foilTypes["Rainbow"]
425+
if color then
426+
SetDrawColor(color[1], color[2], color[3])
427+
else
428+
SetDrawColor(0.6, 1, 0.5) -- fallback to green
429+
end
409430
end
410431
-- Draw left cap first, then influence icon on top
411432
DrawImage(self.headerLeft, headerX, headerY, headerSideWidth, headerHeight)
@@ -414,8 +435,14 @@ function TooltipClass:Draw(x, y, w, h, viewPort)
414435
DrawImage(self.influenceIcon1, headerX + 2, headerY + (headerHeight - (headerHeight/2))/2, headerHeight/2, headerHeight/2)
415436
end
416437

417-
if self.tooltipHeader == "RELIC" then -- Temporary
418-
SetDrawColor(0.6,1,0.5)
438+
if self.tooltipHeader == "RELIC" then
439+
--ConPrintf(self.foilType)
440+
local color = foilTypes[self.foilType] or foilTypes["Rainbow"]
441+
if color then
442+
SetDrawColor(color[1], color[2], color[3])
443+
else
444+
SetDrawColor(0.6, 1, 0.5) -- fallback to green
445+
end
419446
end
420447
-- Draw middle fill
421448
if headerMiddleAreaWidth > 0 then

0 commit comments

Comments
 (0)