Skip to content

Commit 8872cc4

Browse files
committed
1 parent a3d1562 commit 8872cc4

File tree

3 files changed

+116
-2
lines changed

3 files changed

+116
-2
lines changed

src/Classes/ItemsTab.lua

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,13 +813,21 @@ holding Shift will put it in the second.]])
813813

814814
-- Section: Modifier Range
815815
self.controls.displayItemSectionRange = new("Control", {"TOPLEFT",self.controls.displayItemSectionCustom,"BOTTOMLEFT"}, {0, 0, 0, function()
816-
return self.displayItem.rangeLineList[1] and 28 or 0
816+
if not self.displayItem or not self.displayItem.rangeLineList[1] then
817+
return 0
818+
end
819+
if main.showAllItemAffixes and self.displayItem.rarity == "UNIQUE" then
820+
local count = #self.displayItem.rangeLineList
821+
return count * 22 + 4
822+
else
823+
return 28
824+
end
817825
end})
818826
self.controls.displayItemRangeLine = new("DropDownControl", {"TOPLEFT",self.controls.displayItemSectionRange,"TOPLEFT"}, {0, 0, 350, 18}, nil, function(index, value)
819827
self.controls.displayItemRangeSlider.val = self.displayItem.rangeLineList[index].range
820828
end)
821829
self.controls.displayItemRangeLine.shown = function()
822-
return self.displayItem and self.displayItem.rangeLineList[1] ~= nil
830+
return self.displayItem and self.displayItem.rangeLineList[1] ~= nil and not (main.showAllItemAffixes and self.displayItem.rarity == "UNIQUE")
823831
end
824832
self.controls.displayItemRangeSlider = new("SliderControl", {"LEFT",self.controls.displayItemRangeLine,"RIGHT"}, {8, 0, 100, 18}, function(val)
825833
self.displayItem.rangeLineList[self.controls.displayItemRangeLine.selIndex].range = val
@@ -828,6 +836,34 @@ holding Shift will put it in the second.]])
828836
self:UpdateCustomControls()
829837
end)
830838

839+
for i = 1, 20 do
840+
local prevControl = i == 1 and self.controls.displayItemSectionRange or self.controls["displayItemStackedRangeLine"..(i-1)]
841+
842+
self.controls["displayItemStackedRangeLine"..i] = new("LabelControl", {"TOPLEFT",prevControl,"TOPLEFT"}, {0, function()
843+
return i == 1 and 2 or 22
844+
end, 350, 14}, function()
845+
if self.displayItem and self.displayItem.rangeLineList[i] then
846+
return "^7" .. self.displayItem.rangeLineList[i].line
847+
end
848+
return ""
849+
end)
850+
self.controls["displayItemStackedRangeLine"..i].shown = function()
851+
return main.showAllItemAffixes and self.displayItem and self.displayItem.rarity == "UNIQUE" and self.displayItem.rangeLineList[i] ~= nil
852+
end
853+
854+
self.controls["displayItemStackedRangeSlider"..i] = new("SliderControl", {"LEFT",self.controls["displayItemStackedRangeLine"..i],"RIGHT"}, {8, 0, 100, 18}, function(val)
855+
if self.displayItem and self.displayItem.rangeLineList[i] then
856+
self.displayItem.rangeLineList[i].range = val
857+
self.displayItem:BuildAndParseRaw()
858+
self:UpdateDisplayItemTooltip()
859+
self:UpdateCustomControls()
860+
end
861+
end)
862+
self.controls["displayItemStackedRangeSlider"..i].shown = function()
863+
return self.controls["displayItemStackedRangeLine"..i]:IsShown()
864+
end
865+
end
866+
831867
-- Tooltip anchor
832868
self.controls.displayItemTooltipAnchor = new("Control", {"TOPLEFT",self.controls.displayItemSectionRange,"BOTTOMLEFT"})
833869

src/Classes/ItemsTab.lua.rej

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua (rejected hunks)
2+
@@ -1871,8 +1907,11 @@ end
3+
function ItemsTabClass:UpdateDisplayItemRangeLines()
4+
if self.displayItem and self.displayItem.rangeLineList[1] then
5+
wipeTable(self.controls.displayItemRangeLine.list)
6+
- for _, modLine in ipairs(self.displayItem.rangeLineList) do
7+
+ for i, modLine in ipairs(self.displayItem.rangeLineList) do
8+
t_insert(self.controls.displayItemRangeLine.list, modLine.line)
9+
+ if self.controls["displayItemStackedRangeSlider"..i] then
10+
+ self.controls["displayItemStackedRangeSlider"..i].val = modLine.range
11+
+ end
12+
end
13+
self.controls.displayItemRangeLine.selIndex = 1
14+
self.controls.displayItemRangeSlider.val = self.displayItem.rangeLineList[1].range

src/Modules/Main.lua.rej

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
diff a/src/Modules/Main.lua b/src/Modules/Main.lua (rejected hunks)
2+
@@ -112,6 +112,7 @@ function main:Init()
3+
self.POESESSID = ""
4+
self.showPublicBuilds = true
5+
self.showFlavourText = true
6+
+ self.showAllItemAffixes = false
7+
8+
if not SetDPIScaleOverridePercent then SetDPIScaleOverridePercent = function(scale) end end
9+
10+
@@ -645,6 +646,9 @@ function main:LoadSettings(ignoreBuild)
11+
if node.attrib.showFlavourText then
12+
self.showFlavourText = node.attrib.showFlavourText == "true"
13+
end
14+
+ if node.attrib.showAllItemAffixes then
15+
+ self.showAllItemAffixes = node.attrib.showAllItemAffixes == "true"
16+
+ end
17+
if node.attrib.dpiScaleOverridePercent then
18+
self.dpiScaleOverridePercent = tonumber(node.attrib.dpiScaleOverridePercent) or 0
19+
SetDPIScaleOverridePercent(self.dpiScaleOverridePercent)
20+
@@ -767,6 +771,7 @@ function main:SaveSettings()
21+
disableDevAutoSave = tostring(self.disableDevAutoSave),
22+
showPublicBuilds = tostring(self.showPublicBuilds),
23+
showFlavourText = tostring(self.showFlavourText),
24+
+ showAllItemAffixes = tostring(self.showAllItemAffixes),
25+
dpiScaleOverridePercent = tostring(self.dpiScaleOverridePercent),
26+
} })
27+
local res, errMsg = common.xml.SaveXMLFile(setXML, self.userPath.."Settings.xml")
28+
@@ -969,6 +974,12 @@ function main:OpenOptionsPopup()
29+
self.showFlavourText = state
30+
end)
31+
32+
+ nextRow()
33+
+ controls.showAllItemAffixes = new("CheckBoxControl", { "TOPLEFT", nil, "TOPLEFT" }, { defaultLabelPlacementX, currentY, 20 }, "^7Show all item affixes sans dropdowns:", function(state)
34+
+ self.showAllItemAffixes = state
35+
+ end)
36+
+ controls.showAllItemAffixes.tooltipText = "Display all item affix slots as a stacked list instead of hiding them in dropdowns"
37+
+
38+
nextRow()
39+
drawSectionHeader("build", "Build-related options")
40+
41+
@@ -1058,6 +1069,7 @@ function main:OpenOptionsPopup()
42+
controls.titlebarName.state = self.showTitlebarName
43+
controls.showPublicBuilds.state = self.showPublicBuilds
44+
controls.showFlavourText.state = self.showFlavourText
45+
+ controls.showAllItemAffixes.state = self.showAllItemAffixes
46+
local initialNodePowerTheme = self.nodePowerTheme
47+
local initialColorPositive = self.colorPositive
48+
local initialColorNegative = self.colorNegative
49+
@@ -1077,6 +1089,7 @@ function main:OpenOptionsPopup()
50+
local initialInvertSliderScrollDirection = self.invertSliderScrollDirection
51+
local initialDisableDevAutoSave = self.disableDevAutoSave
52+
local initialShowPublicBuilds = self.showPublicBuilds
53+
+ local initialShowAllItemAffixes = self.showAllItemAffixes
54+
local initialShowFlavourText = self.showFlavourText
55+
local initialDpiScaleOverridePercent = self.dpiScaleOverridePercent
56+
57+
@@ -1132,6 +1145,7 @@ function main:OpenOptionsPopup()
58+
self.disableDevAutoSave = initialDisableDevAutoSave
59+
self.showPublicBuilds = initialShowPublicBuilds
60+
self.showFlavourText = initialShowFlavourText
61+
+ self.showAllItemAffixes = initialShowAllItemAffixes
62+
self.dpiScaleOverridePercent = initialDpiScaleOverridePercent
63+
SetDPIScaleOverridePercent(self.dpiScaleOverridePercent)
64+
main:ClosePopup()

0 commit comments

Comments
 (0)