diff --git a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua index a32edf66a1..2544dd46bb 100644 --- a/src/Classes/ItemsTab.lua +++ b/src/Classes/ItemsTab.lua @@ -908,13 +908,21 @@ holding Shift will put it in the second.]]) -- Section: Modifier Range self.controls.displayItemSectionRange = new("Control", {"TOPLEFT",self.controls.displayItemSectionCustom,"BOTTOMLEFT"}, {0, 0, 0, function() - return self.displayItem.rangeLineList[1] and 28 or 0 + if not self.displayItem or not self.displayItem.rangeLineList[1] then + return 0 + end + if main.showAllItemAffixes and self.displayItem.rarity == "UNIQUE" then + local count = #self.displayItem.rangeLineList + return count * 22 + 4 + else + return 28 + end end}) self.controls.displayItemRangeLine = new("DropDownControl", {"TOPLEFT",self.controls.displayItemSectionRange,"TOPLEFT"}, {0, 0, 350, 18}, nil, function(index, value) self.controls.displayItemRangeSlider.val = self.displayItem.rangeLineList[index].range end) self.controls.displayItemRangeLine.shown = function() - return self.displayItem and self.displayItem.rangeLineList[1] ~= nil + return self.displayItem and self.displayItem.rangeLineList[1] ~= nil and not (main.showAllItemAffixes and self.displayItem.rarity == "UNIQUE") end self.controls.displayItemRangeSlider = new("SliderControl", {"LEFT",self.controls.displayItemRangeLine,"RIGHT"}, {8, 0, 100, 18}, function(val) self.displayItem.rangeLineList[self.controls.displayItemRangeLine.selIndex].range = val @@ -923,6 +931,34 @@ holding Shift will put it in the second.]]) self:UpdateCustomControls() end) + for i = 1, 20 do + local prevControl = i == 1 and self.controls.displayItemSectionRange or self.controls["displayItemStackedRangeLine"..(i-1)] + + self.controls["displayItemStackedRangeLine"..i] = new("LabelControl", {"TOPLEFT",prevControl,"TOPLEFT"}, {0, function() + return i == 1 and 2 or 22 + end, 350, 14}, function() + if self.displayItem and self.displayItem.rangeLineList[i] then + return "^7" .. self.displayItem.rangeLineList[i].line + end + return "" + end) + self.controls["displayItemStackedRangeLine"..i].shown = function() + return main.showAllItemAffixes and self.displayItem and self.displayItem.rarity == "UNIQUE" and self.displayItem.rangeLineList[i] ~= nil + end + + self.controls["displayItemStackedRangeSlider"..i] = new("SliderControl", {"LEFT",self.controls["displayItemStackedRangeLine"..i],"RIGHT"}, {8, 0, 100, 18}, function(val) + if self.displayItem and self.displayItem.rangeLineList[i] then + self.displayItem.rangeLineList[i].range = val + self.displayItem:BuildAndParseRaw() + self:UpdateDisplayItemTooltip() + self:UpdateCustomControls() + end + end) + self.controls["displayItemStackedRangeSlider"..i].shown = function() + return self.controls["displayItemStackedRangeLine"..i]:IsShown() + end + end + -- Tooltip anchor self.controls.displayItemTooltipAnchor = new("Control", {"TOPLEFT",self.controls.displayItemSectionRange,"BOTTOMLEFT"}) @@ -1871,8 +1907,11 @@ end function ItemsTabClass:UpdateDisplayItemRangeLines() if self.displayItem and self.displayItem.rangeLineList[1] then wipeTable(self.controls.displayItemRangeLine.list) - for _, modLine in ipairs(self.displayItem.rangeLineList) do + for i, modLine in ipairs(self.displayItem.rangeLineList) do t_insert(self.controls.displayItemRangeLine.list, modLine.line) + if self.controls["displayItemStackedRangeSlider"..i] then + self.controls["displayItemStackedRangeSlider"..i].val = modLine.range + end end self.controls.displayItemRangeLine.selIndex = 1 self.controls.displayItemRangeSlider.val = self.displayItem.rangeLineList[1].range diff --git a/src/Modules/Main.lua b/src/Modules/Main.lua index 48599d4ddc..d53535448e 100644 --- a/src/Modules/Main.lua +++ b/src/Modules/Main.lua @@ -112,6 +112,7 @@ function main:Init() self.POESESSID = "" self.showPublicBuilds = true self.showFlavourText = true + self.showAllItemAffixes = false if not SetDPIScaleOverridePercent then SetDPIScaleOverridePercent = function(scale) end end @@ -645,6 +646,9 @@ function main:LoadSettings(ignoreBuild) if node.attrib.showFlavourText then self.showFlavourText = node.attrib.showFlavourText == "true" end + if node.attrib.showAllItemAffixes then + self.showAllItemAffixes = node.attrib.showAllItemAffixes == "true" + end if node.attrib.dpiScaleOverridePercent then self.dpiScaleOverridePercent = tonumber(node.attrib.dpiScaleOverridePercent) or 0 SetDPIScaleOverridePercent(self.dpiScaleOverridePercent) @@ -767,6 +771,7 @@ function main:SaveSettings() disableDevAutoSave = tostring(self.disableDevAutoSave), showPublicBuilds = tostring(self.showPublicBuilds), showFlavourText = tostring(self.showFlavourText), + showAllItemAffixes = tostring(self.showAllItemAffixes), dpiScaleOverridePercent = tostring(self.dpiScaleOverridePercent), } }) local res, errMsg = common.xml.SaveXMLFile(setXML, self.userPath.."Settings.xml") @@ -969,6 +974,12 @@ function main:OpenOptionsPopup() self.showFlavourText = state end) + nextRow() + controls.showAllItemAffixes = new("CheckBoxControl", { "TOPLEFT", nil, "TOPLEFT" }, { defaultLabelPlacementX, currentY, 20 }, "^7Show all item affixes sans dropdowns:", function(state) + self.showAllItemAffixes = state + end) + controls.showAllItemAffixes.tooltipText = "Display all item affix slots as a stacked list instead of hiding them in dropdowns" + nextRow() drawSectionHeader("build", "Build-related options") @@ -1058,6 +1069,7 @@ function main:OpenOptionsPopup() controls.titlebarName.state = self.showTitlebarName controls.showPublicBuilds.state = self.showPublicBuilds controls.showFlavourText.state = self.showFlavourText + controls.showAllItemAffixes.state = self.showAllItemAffixes local initialNodePowerTheme = self.nodePowerTheme local initialColorPositive = self.colorPositive local initialColorNegative = self.colorNegative @@ -1077,6 +1089,7 @@ function main:OpenOptionsPopup() local initialInvertSliderScrollDirection = self.invertSliderScrollDirection local initialDisableDevAutoSave = self.disableDevAutoSave local initialShowPublicBuilds = self.showPublicBuilds + local initialShowAllItemAffixes = self.showAllItemAffixes local initialShowFlavourText = self.showFlavourText local initialDpiScaleOverridePercent = self.dpiScaleOverridePercent @@ -1132,6 +1145,7 @@ function main:OpenOptionsPopup() self.disableDevAutoSave = initialDisableDevAutoSave self.showPublicBuilds = initialShowPublicBuilds self.showFlavourText = initialShowFlavourText + self.showAllItemAffixes = initialShowAllItemAffixes self.dpiScaleOverridePercent = initialDpiScaleOverridePercent SetDPIScaleOverridePercent(self.dpiScaleOverridePercent) main:ClosePopup()