Skip to content

Commit 9a02431

Browse files
LocalIdentityLocalIdentityPaliak
authored
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>
1 parent 635905f commit 9a02431

File tree

8 files changed

+63
-16
lines changed

8 files changed

+63
-16
lines changed

src/Classes/GemSelectControl.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,9 @@ function GemSelectClass:AddCommonGemInfo(gemInstance, grantedEffect, addReq, mer
719719
if launch.devModeAlt then
720720
line = line .. " ^1" .. lineMap[line]
721721
end
722-
self.tooltip:AddLine(16, colorCodes.UNSUPPORTED .. line)
722+
local line = colorCodes.UNSUPPORTED .. line
723+
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
724+
self.tooltip:AddLine(line)
723725
end
724726
end
725727
end

src/Classes/ItemsTab.lua

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,13 @@ holding Shift will put it in the second.]])
762762
if node.sd[1] then
763763
tooltip:AddLine(16, "")
764764
for i, line in ipairs(node.sd) do
765-
tooltip:AddLine(16, ((node.mods[i].extra or not node.mods[i].list) and colorCodes.UNSUPPORTED or colorCodes.MAGIC)..line)
765+
if line ~= " " and (node.mods[i].extra or not node.mods[i].list) then
766+
local line = colorCodes.UNSUPPORTED .. line
767+
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
768+
tooltip:AddLine(16, line)
769+
else
770+
tooltip:AddLine(16, colorCodes.MAGIC..line)
771+
end
766772
end
767773
end
768774

@@ -3338,7 +3344,13 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode)
33383344
main:StatColor(flaskData.chargesMax, base.flask.chargesMax), flaskData.chargesMax
33393345
))
33403346
for _, modLine in pairs(item.buffModLines) do
3341-
tooltip:AddLine(16, (modLine.extra and colorCodes.UNSUPPORTED or colorCodes.MAGIC) .. modLine.line)
3347+
if modLine.extra then
3348+
local line = colorCodes.UNSUPPORTED..modLine.line
3349+
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
3350+
tooltip:AddLine(16, line)
3351+
else
3352+
tooltip:AddLine(16, colorCodes.MAGIC..modLine.line)
3353+
end
33423354
end
33433355
elseif base.tincture then
33443356
-- Tincture-specific info
@@ -3351,7 +3363,13 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode)
33513363
tooltip:AddLine(16, s_format("^x7F7F7FInflicts Mana Burn every %s%.2f ^x7F7F7FSeconds", main:StatColor(tinctureData.manaBurn, base.tincture.manaBurn), tinctureData.manaBurn))
33523364
tooltip:AddLine(16, s_format("^x7F7F7F%s%.2f ^x7F7F7FSecond Cooldown When Deactivated", main:StatColor(tinctureData.cooldown, base.tincture.cooldown), tinctureData.cooldown))
33533365
for _, modLine in pairs(item.buffModLines) do
3354-
tooltip:AddLine(16, (modLine.extra and colorCodes.UNSUPPORTED or colorCodes.MAGIC) .. modLine.line)
3366+
if modLine.extra then
3367+
local line = colorCodes.UNSUPPORTED..modLine.line
3368+
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
3369+
tooltip:AddLine(16, line)
3370+
else
3371+
tooltip:AddLine(16, colorCodes.MAGIC..modLine.line)
3372+
end
33553373
end
33563374
elseif item.type == "Jewel" then
33573375
-- Jewel-specific info

src/Classes/NotableDBControl.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,13 @@ function NotableDBClass:AddValueTooltip(tooltip, index, node)
254254
if node.sd[1] then
255255
tooltip:AddLine(16, "")
256256
for i, line in ipairs(node.sd) do
257-
tooltip:AddLine(16, ((node.mods[i].extra or not node.mods[i].list) and colorCodes.UNSUPPORTED or colorCodes.MAGIC)..line)
257+
if line ~= " " and (node.mods[i].extra or not node.mods[i].list) then
258+
local line = colorCodes.UNSUPPORTED..modLine.line
259+
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
260+
tooltip:AddLine(16, line)
261+
else
262+
tooltip:AddLine(16, colorCodes.MAGIC..line)
263+
end
258264
end
259265
end
260266

src/Classes/PassiveTreeView.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,13 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build)
10281028
line = line .. " " .. modStr
10291029
end
10301030
end
1031-
tooltip:AddLine(16, ((node.mods[i].extra or not node.mods[i].list) and colorCodes.UNSUPPORTED or colorCodes.MAGIC)..line)
1031+
if line ~= " " and (node.mods[i].extra or not node.mods[i].list) then
1032+
local line = colorCodes.UNSUPPORTED..line
1033+
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
1034+
tooltip:AddLine(16, line)
1035+
else
1036+
tooltip:AddLine(16, colorCodes.MAGIC..line)
1037+
end
10321038
end
10331039
end
10341040

src/Classes/SkillsTab.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,9 @@ function SkillsTabClass:CreateGemSlot(index)
769769
if grantedEffect.statMap[qual[1]] or self.build.data.skillStatMap[qual[1]] then
770770
tooltip:AddLine(16, colorCodes.MAGIC..line)
771771
else
772-
tooltip:AddLine(16, colorCodes.UNSUPPORTED..line)
772+
local line = colorCodes.UNSUPPORTED..line
773+
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
774+
tooltip:AddLine(16, line)
773775
end
774776
end
775777
end

src/Classes/Tooltip.lua

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ end)
4949
function TooltipClass:Clear()
5050
wipeTable(self.lines)
5151
wipeTable(self.blocks)
52-
if self.updateParams then
53-
wipeTable(self.updateParams)
54-
end
5552
self.recipe = nil
5653
self.center = false
5754
self.color = { 0.5, 0.3, 0 }
@@ -63,17 +60,17 @@ function TooltipClass:CheckForUpdate(...)
6360
if not self.updateParams then
6461
self.updateParams = { }
6562
end
63+
6664
for i = 1, select('#', ...) do
67-
if self.updateParams[i] ~= select(i, ...) then
65+
local temp = select(i, ...)
66+
if self.updateParams[i] ~= temp then
67+
self.updateParams[i] = temp
6868
doUpdate = true
69-
break
7069
end
7170
end
72-
if doUpdate then
71+
if doUpdate or self.updateParams.notSupportedModTooltips ~= main.notSupportedModTooltips then
72+
self.updateParams.notSupportedModTooltips = main.notSupportedModTooltips
7373
self:Clear()
74-
for i = 1, select('#', ...) do
75-
self.updateParams[i] = select(i, ...)
76-
end
7774
return true
7875
end
7976
end

src/Modules/ItemTools.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ function itemLib.formatModLine(modLine, dbMode)
127127
local colorCode
128128
if modLine.extra then
129129
colorCode = colorCodes.UNSUPPORTED
130+
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
130131
if launch.devModeAlt then
131132
line = line .. " ^1'" .. modLine.extra .. "'"
132133
end

src/Modules/Main.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ function main:Init()
101101
self.showTitlebarName = true
102102
self.showWarnings = true
103103
self.slotOnlyTooltips = true
104+
self.notSupportedModTooltips = true
105+
self.notSupportedTooltipText = " ^8(Not supported in PoB yet)"
104106
self.POESESSID = ""
105107
self.showPublicBuilds = true
106108

@@ -606,6 +608,9 @@ function main:LoadSettings(ignoreBuild)
606608
if node.attrib.slotOnlyTooltips then
607609
self.slotOnlyTooltips = node.attrib.slotOnlyTooltips == "true"
608610
end
611+
if node.attrib.notSupportedModTooltips then
612+
self.notSupportedModTooltips = node.attrib.notSupportedModTooltips == "true"
613+
end
609614
if node.attrib.POESESSID then
610615
self.POESESSID = node.attrib.POESESSID or ""
611616
end
@@ -725,6 +730,7 @@ function main:SaveSettings()
725730
lastExportWebsite = self.lastExportWebsite,
726731
showWarnings = tostring(self.showWarnings),
727732
slotOnlyTooltips = tostring(self.slotOnlyTooltips),
733+
notSupportedModTooltips = tostring(self.notSupportedModTooltips),
728734
POESESSID = self.POESESSID,
729735
invertSliderScrollDirection = tostring(self.invertSliderScrollDirection),
730736
disableDevAutoSave = tostring(self.disableDevAutoSave),
@@ -969,6 +975,13 @@ function main:OpenOptionsPopup()
969975
end)
970976
controls.slotOnlyTooltips.state = self.slotOnlyTooltips
971977

978+
nextRow()
979+
controls.notSupportedModTooltips = new("CheckBoxControl", { "TOPLEFT", nil, "TOPLEFT" }, { defaultLabelPlacementX, currentY, 20 }, "^7Show tooltip for unsupported mods :", function(state)
980+
self.notSupportedModTooltips = state
981+
end)
982+
controls.notSupportedModTooltips.tooltipText = "Show ^8(Not supported in PoB yet) ^7next to unsupported mods\nRequires PoB to restart for it to take effect"
983+
controls.notSupportedModTooltips.state = self.notSupportedModTooltips
984+
972985
nextRow()
973986
controls.invertSliderScrollDirection = new("CheckBoxControl", { "TOPLEFT", nil, "TOPLEFT" }, { defaultLabelPlacementX, currentY, 20 }, "^7Invert slider scroll direction:", function(state)
974987
self.invertSliderScrollDirection = state
@@ -1004,6 +1017,7 @@ function main:OpenOptionsPopup()
10041017
local initialDefaultItemAffixQuality = self.defaultItemAffixQuality or 0.5
10051018
local initialShowWarnings = self.showWarnings
10061019
local initialSlotOnlyTooltips = self.slotOnlyTooltips
1020+
local initialNotSupportedModTooltips = self.notSupportedModTooltips
10071021
local initialInvertSliderScrollDirection = self.invertSliderScrollDirection
10081022
local initialDisableDevAutoSave = self.disableDevAutoSave
10091023
local initialShowPublicBuilds = self.showPublicBuilds
@@ -1054,6 +1068,7 @@ function main:OpenOptionsPopup()
10541068
self.defaultItemAffixQuality = initialDefaultItemAffixQuality
10551069
self.showWarnings = initialShowWarnings
10561070
self.slotOnlyTooltips = initialSlotOnlyTooltips
1071+
self.notSupportedModTooltips = initialNotSupportedModTooltips
10571072
self.invertSliderScrollDirection = initialInvertSliderScrollDirection
10581073
self.disableDevAutoSave = initialDisableDevAutoSave
10591074
self.showPublicBuilds = initialShowPublicBuilds

0 commit comments

Comments
 (0)