Skip to content

Commit 61c8094

Browse files
LocalIdentityLocalIdentity
andauthored
Add text after red mods to show that PoB does not currently handle them (#1173)
Duplicate of PathOfBuildingCommunity/PathOfBuilding#8925 Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 8c0d6b4 commit 61c8094

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
@@ -717,7 +717,9 @@ function GemSelectClass:AddStatSetInfo(gemInstance, grantedEffect, statSet)
717717
if launch.devModeAlt then
718718
line = line .. " ^1" .. lineMap[line]
719719
end
720-
self.tooltip:AddLine(16, colorCodes.UNSUPPORTED .. line)
720+
local line = colorCodes.UNSUPPORTED .. line
721+
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
722+
self.tooltip:AddLine(16, line)
721723
end
722724
end
723725
end

src/Classes/ItemsTab.lua

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,13 @@ holding Shift will put it in the second.]])
677677
if node.sd[1] then
678678
tooltip:AddLine(16, "")
679679
for i, line in ipairs(node.sd) do
680-
tooltip:AddLine(16, ((node.mods[i].extra or not node.mods[i].list) and colorCodes.UNSUPPORTED or colorCodes.MAGIC)..line)
680+
if line ~= " " and (node.mods[i].extra or not node.mods[i].list) then
681+
local line = colorCodes.UNSUPPORTED .. line
682+
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
683+
tooltip:AddLine(16, line)
684+
else
685+
tooltip:AddLine(16, colorCodes.MAGIC..line)
686+
end
681687
end
682688
end
683689

@@ -2715,7 +2721,13 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode)
27152721
main:StatColor(flaskData.chargesMax, base.flask.chargesMax), flaskData.chargesMax
27162722
))
27172723
for _, modLine in pairs(item.buffModLines) do
2718-
tooltip:AddLine(16, (modLine.extra and colorCodes.UNSUPPORTED or colorCodes.MAGIC) .. modLine.line)
2724+
if modLine.extra then
2725+
local line = colorCodes.UNSUPPORTED..modLine.line
2726+
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
2727+
tooltip:AddLine(16, line)
2728+
else
2729+
tooltip:AddLine(16, colorCodes.MAGIC..modLine.line)
2730+
end
27192731
end
27202732
elseif base.charm then
27212733
-- Charm-specific info
@@ -2727,7 +2739,13 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode)
27272739
main:StatColor(charmData.chargesMax, base.charm.chargesMax), charmData.chargesMax
27282740
))
27292741
for _, modLine in pairs(item.buffModLines) do
2730-
tooltip:AddLine(16, (modLine.extra and colorCodes.UNSUPPORTED or colorCodes.MAGIC) .. modLine.line)
2742+
if modLine.extra then
2743+
local line = colorCodes.UNSUPPORTED..modLine.line
2744+
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
2745+
tooltip:AddLine(16, line)
2746+
else
2747+
tooltip:AddLine(16, colorCodes.MAGIC..modLine.line)
2748+
end
27312749
end
27322750
elseif item.type == "Jewel" then
27332751
-- Jewel-specific info

src/Classes/NotableDBControl.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,13 @@ function NotableDBClass:AddValueTooltip(tooltip, index, node)
302302
if node.sd[1] then
303303
tooltip:AddLine(16, "")
304304
for i, line in ipairs(node.sd) do
305-
tooltip:AddLine(16, ((node.mods[i].extra or not node.mods[i].list) and colorCodes.UNSUPPORTED or colorCodes.MAGIC)..line)
305+
if line ~= " " and (node.mods[i].extra or not node.mods[i].list) then
306+
local line = colorCodes.UNSUPPORTED..line
307+
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
308+
tooltip:AddLine(16, line)
309+
else
310+
tooltip:AddLine(16, colorCodes.MAGIC..line)
311+
end
306312
end
307313
end
308314

src/Classes/PassiveTreeView.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,13 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi
11941194
-- line = line .. " ^8(Effect increased by "..incSmallPassiveSkillEffect.."%)"
11951195
end
11961196

1197-
tooltip:AddLine(16, ((node.mods[i].extra or not node.mods[i].list) and colorCodes.UNSUPPORTED or colorCodes.MAGIC)..line)
1197+
if line ~= " " and (node.mods[i].extra or not node.mods[i].list) then
1198+
local line = colorCodes.UNSUPPORTED..line
1199+
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
1200+
tooltip:AddLine(16, line)
1201+
else
1202+
tooltip:AddLine(16, colorCodes.MAGIC..line)
1203+
end
11981204
end
11991205
end
12001206

src/Classes/SkillsTab.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,9 @@ function SkillsTabClass:CreateGemSlot(index)
773773
if grantedEffect.statSets[1].statMap[qual[1]] or self.build.data.skillStatMap[qual[1]] then
774774
tooltip:AddLine(16, colorCodes.MAGIC..line)
775775
else
776-
tooltip:AddLine(16, colorCodes.UNSUPPORTED..line)
776+
local line = colorCodes.UNSUPPORTED..line
777+
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
778+
tooltip:AddLine(16, line)
777779
end
778780
end
779781
end

src/Classes/Tooltip.lua

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ end)
2424
function TooltipClass:Clear()
2525
wipeTable(self.lines)
2626
wipeTable(self.blocks)
27-
if self.updateParams then
28-
wipeTable(self.updateParams)
29-
end
3027
self.recipe = nil
3128
self.center = false
3229
self.color = { 0.5, 0.3, 0 }
@@ -38,17 +35,17 @@ function TooltipClass:CheckForUpdate(...)
3835
if not self.updateParams then
3936
self.updateParams = { }
4037
end
38+
4139
for i = 1, select('#', ...) do
42-
if self.updateParams[i] ~= select(i, ...) then
40+
local temp = select(i, ...)
41+
if self.updateParams[i] ~= temp then
42+
self.updateParams[i] = temp
4343
doUpdate = true
44-
break
4544
end
4645
end
47-
if doUpdate then
46+
if doUpdate or self.updateParams.notSupportedModTooltips ~= main.notSupportedModTooltips then
47+
self.updateParams.notSupportedModTooltips = main.notSupportedModTooltips
4848
self:Clear()
49-
for i = 1, select('#', ...) do
50-
self.updateParams[i] = select(i, ...)
51-
end
5249
return true
5350
end
5451
end

src/Modules/ItemTools.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ function itemLib.formatModLine(modLine, dbMode)
326326
local colorCode
327327
if modLine.extra then
328328
colorCode = colorCodes.UNSUPPORTED
329+
line = main.notSupportedModTooltips and (line .. main.notSupportedTooltipText) or line
329330
if launch.devModeAlt then
330331
line = line .. " ^1'" .. modLine.extra .. "'"
331332
end

src/Modules/Main.lua

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

@@ -607,6 +609,9 @@ function main:LoadSettings(ignoreBuild)
607609
if node.attrib.slotOnlyTooltips then
608610
self.slotOnlyTooltips = node.attrib.slotOnlyTooltips == "true"
609611
end
612+
if node.attrib.notSupportedModTooltips then
613+
self.notSupportedModTooltips = node.attrib.notSupportedModTooltips == "true"
614+
end
610615
if node.attrib.POESESSID then
611616
self.POESESSID = node.attrib.POESESSID or ""
612617
end
@@ -726,6 +731,7 @@ function main:SaveSettings()
726731
lastExportWebsite = self.lastExportWebsite,
727732
showWarnings = tostring(self.showWarnings),
728733
slotOnlyTooltips = tostring(self.slotOnlyTooltips),
734+
notSupportedModTooltips = tostring(self.notSupportedModTooltips),
729735
POESESSID = self.POESESSID,
730736
invertSliderScrollDirection = tostring(self.invertSliderScrollDirection),
731737
disableDevAutoSave = tostring(self.disableDevAutoSave),
@@ -970,6 +976,13 @@ function main:OpenOptionsPopup()
970976
end)
971977
controls.slotOnlyTooltips.state = self.slotOnlyTooltips
972978

979+
nextRow()
980+
controls.notSupportedModTooltips = new("CheckBoxControl", { "TOPLEFT", nil, "TOPLEFT" }, { defaultLabelPlacementX, currentY, 20 }, "^7Show tooltip for unsupported mods :", function(state)
981+
self.notSupportedModTooltips = state
982+
end)
983+
controls.notSupportedModTooltips.tooltipText = "Show ^8(Not supported in PoB yet) ^7next to unsupported mods\nRequires PoB to restart for it to take effect"
984+
controls.notSupportedModTooltips.state = self.notSupportedModTooltips
985+
973986
nextRow()
974987
controls.invertSliderScrollDirection = new("CheckBoxControl", { "TOPLEFT", nil, "TOPLEFT" }, { defaultLabelPlacementX, currentY, 20 }, "^7Invert slider scroll direction:", function(state)
975988
self.invertSliderScrollDirection = state
@@ -1005,6 +1018,7 @@ function main:OpenOptionsPopup()
10051018
local initialDefaultItemAffixQuality = self.defaultItemAffixQuality or 0.5
10061019
local initialShowWarnings = self.showWarnings
10071020
local initialSlotOnlyTooltips = self.slotOnlyTooltips
1021+
local initialNotSupportedModTooltips = self.notSupportedModTooltips
10081022
local initialInvertSliderScrollDirection = self.invertSliderScrollDirection
10091023
local initialDisableDevAutoSave = self.disableDevAutoSave
10101024
local initialShowPublicBuilds = self.showPublicBuilds
@@ -1055,6 +1069,7 @@ function main:OpenOptionsPopup()
10551069
self.defaultItemAffixQuality = initialDefaultItemAffixQuality
10561070
self.showWarnings = initialShowWarnings
10571071
self.slotOnlyTooltips = initialSlotOnlyTooltips
1072+
self.notSupportedModTooltips = initialNotSupportedModTooltips
10581073
self.invertSliderScrollDirection = initialInvertSliderScrollDirection
10591074
self.disableDevAutoSave = initialDisableDevAutoSave
10601075
self.showPublicBuilds = initialShowPublicBuilds

0 commit comments

Comments
 (0)