Add text after red mods to show that PoB does not currently handle them (#8925)

* Add text after red mods to show that PoB does not currently handle them

PoB does not calculate mods that have red text on them but many users do not know this. Adding this reminder text after all the lines should make it more obvious

* Fix first load crash

* Fix check for empty line

* Typo

* FIX: fixes toggle requiring reload, minor optimalizations (#8928)

The TooltipClass:CheckForUpdate had to be updated so that
the tooltip updates correctly after changing the option.
I kinda obsessed over optimizing this. Removed the secondary
loop as the first one without the break statement will
update all the records. Though this has the cost of doing
more comparisons which could end up being more expensive if
strings end up being compared often. Looking through current
calls to this function it seems like it's all just addresses
and booleans.

---------

Co-authored-by: LocalIdentity <localidentity2@gmail.com>
Co-authored-by: Paliak <91493239+Paliak@users.noreply.github.com>
This commit is contained in:
LocalIdentity
2025-08-07 19:19:19 +10:00
committed by GitHub
parent 635905f96e
commit 9a02431069
8 changed files with 63 additions and 16 deletions

View File

@@ -719,7 +719,9 @@ function GemSelectClass:AddCommonGemInfo(gemInstance, grantedEffect, addReq, mer
if launch.devModeAlt then
line = line .. " ^1" .. lineMap[line]
end
self.tooltip:AddLine(16, colorCodes.UNSUPPORTED .. line)
local line = colorCodes.UNSUPPORTED .. line
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
self.tooltip:AddLine(line)
end
end
end

View File

@@ -762,7 +762,13 @@ holding Shift will put it in the second.]])
if node.sd[1] then
tooltip:AddLine(16, "")
for i, line in ipairs(node.sd) do
tooltip:AddLine(16, ((node.mods[i].extra or not node.mods[i].list) and colorCodes.UNSUPPORTED or colorCodes.MAGIC)..line)
if line ~= " " and (node.mods[i].extra or not node.mods[i].list) then
local line = colorCodes.UNSUPPORTED .. line
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
tooltip:AddLine(16, line)
else
tooltip:AddLine(16, colorCodes.MAGIC..line)
end
end
end
@@ -3338,7 +3344,13 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode)
main:StatColor(flaskData.chargesMax, base.flask.chargesMax), flaskData.chargesMax
))
for _, modLine in pairs(item.buffModLines) do
tooltip:AddLine(16, (modLine.extra and colorCodes.UNSUPPORTED or colorCodes.MAGIC) .. modLine.line)
if modLine.extra then
local line = colorCodes.UNSUPPORTED..modLine.line
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
tooltip:AddLine(16, line)
else
tooltip:AddLine(16, colorCodes.MAGIC..modLine.line)
end
end
elseif base.tincture then
-- Tincture-specific info
@@ -3351,7 +3363,13 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode)
tooltip:AddLine(16, s_format("^x7F7F7FInflicts Mana Burn every %s%.2f ^x7F7F7FSeconds", main:StatColor(tinctureData.manaBurn, base.tincture.manaBurn), tinctureData.manaBurn))
tooltip:AddLine(16, s_format("^x7F7F7F%s%.2f ^x7F7F7FSecond Cooldown When Deactivated", main:StatColor(tinctureData.cooldown, base.tincture.cooldown), tinctureData.cooldown))
for _, modLine in pairs(item.buffModLines) do
tooltip:AddLine(16, (modLine.extra and colorCodes.UNSUPPORTED or colorCodes.MAGIC) .. modLine.line)
if modLine.extra then
local line = colorCodes.UNSUPPORTED..modLine.line
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
tooltip:AddLine(16, line)
else
tooltip:AddLine(16, colorCodes.MAGIC..modLine.line)
end
end
elseif item.type == "Jewel" then
-- Jewel-specific info

View File

@@ -254,7 +254,13 @@ function NotableDBClass:AddValueTooltip(tooltip, index, node)
if node.sd[1] then
tooltip:AddLine(16, "")
for i, line in ipairs(node.sd) do
tooltip:AddLine(16, ((node.mods[i].extra or not node.mods[i].list) and colorCodes.UNSUPPORTED or colorCodes.MAGIC)..line)
if line ~= " " and (node.mods[i].extra or not node.mods[i].list) then
local line = colorCodes.UNSUPPORTED..modLine.line
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
tooltip:AddLine(16, line)
else
tooltip:AddLine(16, colorCodes.MAGIC..line)
end
end
end

View File

@@ -1028,7 +1028,13 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build)
line = line .. " " .. modStr
end
end
tooltip:AddLine(16, ((node.mods[i].extra or not node.mods[i].list) and colorCodes.UNSUPPORTED or colorCodes.MAGIC)..line)
if line ~= " " and (node.mods[i].extra or not node.mods[i].list) then
local line = colorCodes.UNSUPPORTED..line
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
tooltip:AddLine(16, line)
else
tooltip:AddLine(16, colorCodes.MAGIC..line)
end
end
end

View File

@@ -769,7 +769,9 @@ function SkillsTabClass:CreateGemSlot(index)
if grantedEffect.statMap[qual[1]] or self.build.data.skillStatMap[qual[1]] then
tooltip:AddLine(16, colorCodes.MAGIC..line)
else
tooltip:AddLine(16, colorCodes.UNSUPPORTED..line)
local line = colorCodes.UNSUPPORTED..line
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
tooltip:AddLine(16, line)
end
end
end

View File

@@ -49,9 +49,6 @@ end)
function TooltipClass:Clear()
wipeTable(self.lines)
wipeTable(self.blocks)
if self.updateParams then
wipeTable(self.updateParams)
end
self.recipe = nil
self.center = false
self.color = { 0.5, 0.3, 0 }
@@ -63,17 +60,17 @@ function TooltipClass:CheckForUpdate(...)
if not self.updateParams then
self.updateParams = { }
end
for i = 1, select('#', ...) do
if self.updateParams[i] ~= select(i, ...) then
local temp = select(i, ...)
if self.updateParams[i] ~= temp then
self.updateParams[i] = temp
doUpdate = true
break
end
end
if doUpdate then
if doUpdate or self.updateParams.notSupportedModTooltips ~= main.notSupportedModTooltips then
self.updateParams.notSupportedModTooltips = main.notSupportedModTooltips
self:Clear()
for i = 1, select('#', ...) do
self.updateParams[i] = select(i, ...)
end
return true
end
end

View File

@@ -127,6 +127,7 @@ function itemLib.formatModLine(modLine, dbMode)
local colorCode
if modLine.extra then
colorCode = colorCodes.UNSUPPORTED
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
if launch.devModeAlt then
line = line .. " ^1'" .. modLine.extra .. "'"
end

View File

@@ -101,6 +101,8 @@ function main:Init()
self.showTitlebarName = true
self.showWarnings = true
self.slotOnlyTooltips = true
self.notSupportedModTooltips = true
self.notSupportedTooltipText = " ^8(Not supported in PoB yet)"
self.POESESSID = ""
self.showPublicBuilds = true
@@ -606,6 +608,9 @@ function main:LoadSettings(ignoreBuild)
if node.attrib.slotOnlyTooltips then
self.slotOnlyTooltips = node.attrib.slotOnlyTooltips == "true"
end
if node.attrib.notSupportedModTooltips then
self.notSupportedModTooltips = node.attrib.notSupportedModTooltips == "true"
end
if node.attrib.POESESSID then
self.POESESSID = node.attrib.POESESSID or ""
end
@@ -725,6 +730,7 @@ function main:SaveSettings()
lastExportWebsite = self.lastExportWebsite,
showWarnings = tostring(self.showWarnings),
slotOnlyTooltips = tostring(self.slotOnlyTooltips),
notSupportedModTooltips = tostring(self.notSupportedModTooltips),
POESESSID = self.POESESSID,
invertSliderScrollDirection = tostring(self.invertSliderScrollDirection),
disableDevAutoSave = tostring(self.disableDevAutoSave),
@@ -969,6 +975,13 @@ function main:OpenOptionsPopup()
end)
controls.slotOnlyTooltips.state = self.slotOnlyTooltips
nextRow()
controls.notSupportedModTooltips = new("CheckBoxControl", { "TOPLEFT", nil, "TOPLEFT" }, { defaultLabelPlacementX, currentY, 20 }, "^7Show tooltip for unsupported mods :", function(state)
self.notSupportedModTooltips = state
end)
controls.notSupportedModTooltips.tooltipText = "Show ^8(Not supported in PoB yet) ^7next to unsupported mods\nRequires PoB to restart for it to take effect"
controls.notSupportedModTooltips.state = self.notSupportedModTooltips
nextRow()
controls.invertSliderScrollDirection = new("CheckBoxControl", { "TOPLEFT", nil, "TOPLEFT" }, { defaultLabelPlacementX, currentY, 20 }, "^7Invert slider scroll direction:", function(state)
self.invertSliderScrollDirection = state
@@ -1004,6 +1017,7 @@ function main:OpenOptionsPopup()
local initialDefaultItemAffixQuality = self.defaultItemAffixQuality or 0.5
local initialShowWarnings = self.showWarnings
local initialSlotOnlyTooltips = self.slotOnlyTooltips
local initialNotSupportedModTooltips = self.notSupportedModTooltips
local initialInvertSliderScrollDirection = self.invertSliderScrollDirection
local initialDisableDevAutoSave = self.disableDevAutoSave
local initialShowPublicBuilds = self.showPublicBuilds
@@ -1054,6 +1068,7 @@ function main:OpenOptionsPopup()
self.defaultItemAffixQuality = initialDefaultItemAffixQuality
self.showWarnings = initialShowWarnings
self.slotOnlyTooltips = initialSlotOnlyTooltips
self.notSupportedModTooltips = initialNotSupportedModTooltips
self.invertSliderScrollDirection = initialInvertSliderScrollDirection
self.disableDevAutoSave = initialDisableDevAutoSave
self.showPublicBuilds = initialShowPublicBuilds