Skip to content

Commit d104804

Browse files
LocalIdentityLocalIdentity
andauthored
Unique slider fixes / changes (#9322)
Fix the file formatting to use tabs Set the feature to be on by default Change sliders to appear first then the mod text Co-authored-by: LocalIdentity <[email protected]>
1 parent 20b7fe2 commit d104804

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

src/Classes/ItemsTab.lua

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -932,30 +932,30 @@ holding Shift will put it in the second.]])
932932
end)
933933

934934
for i = 1, 20 do
935-
local prevControl = i == 1 and self.controls.displayItemSectionRange or self.controls["displayItemStackedRangeLine"..(i-1)]
935+
local baseControl = i == 1 and self.controls.displayItemSectionRange or self.controls["displayItemStackedRangeSlider"..(i-1)]
936936

937-
self.controls["displayItemStackedRangeLine"..i] = new("LabelControl", {"TOPLEFT",prevControl,"TOPLEFT"}, {0, function()
937+
self.controls["displayItemStackedRangeSlider"..i] = new("SliderControl", {"TOPLEFT",baseControl,"TOPLEFT"}, {0, function()
938938
return i == 1 and 2 or 22
939-
end, 350, 14}, function()
940-
if self.displayItem and self.displayItem.rangeLineList[i] then
941-
return "^7" .. self.displayItem.rangeLineList[i].line
942-
end
943-
return ""
944-
end)
945-
self.controls["displayItemStackedRangeLine"..i].shown = function()
946-
return main.showAllItemAffixes and self.displayItem and self.displayItem.rarity == "UNIQUE" and self.displayItem.rangeLineList[i] ~= nil
947-
end
948-
949-
self.controls["displayItemStackedRangeSlider"..i] = new("SliderControl", {"LEFT",self.controls["displayItemStackedRangeLine"..i],"RIGHT"}, {8, 0, 100, 18}, function(val)
939+
end, 100, 18}, function(val)
950940
if self.displayItem and self.displayItem.rangeLineList[i] then
951941
self.displayItem.rangeLineList[i].range = val
952942
self.displayItem:BuildAndParseRaw()
953943
self:UpdateDisplayItemTooltip()
954944
self:UpdateCustomControls()
955945
end
956946
end)
947+
self.controls["displayItemStackedRangeLine"..i] = new("LabelControl", {"LEFT",self.controls["displayItemStackedRangeSlider"..i],"RIGHT"}, {8, -2, 350, 14}, function()
948+
if self.displayItem and self.displayItem.rangeLineList[i] then
949+
return "^7" .. self.displayItem.rangeLineList[i].line
950+
end
951+
return ""
952+
end)
957953
self.controls["displayItemStackedRangeSlider"..i].shown = function()
958-
return self.controls["displayItemStackedRangeLine"..i]:IsShown()
954+
return main.showAllItemAffixes and self.displayItem and self.displayItem.rarity == "UNIQUE" and self.displayItem.rangeLineList[i] ~= nil
955+
end
956+
957+
self.controls["displayItemStackedRangeLine"..i].shown = function()
958+
return self.controls["displayItemStackedRangeSlider"..i]:IsShown()
959959
end
960960
end
961961

src/Modules/Main.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ function main:Init()
113113
self.showPublicBuilds = true
114114
self.showFlavourText = true
115115
self.showAnimations = true
116-
self.errorReadingSettings = false
117-
self.showAllItemAffixes = false
116+
self.showAllItemAffixes = true
117+
self.errorReadingSettings = false
118118

119119
if not SetDPIScaleOverridePercent then SetDPIScaleOverridePercent = function(scale) end end
120120

@@ -655,10 +655,10 @@ function main:LoadSettings(ignoreBuild)
655655
if node.attrib.showFlavourText then
656656
self.showFlavourText = node.attrib.showFlavourText == "true"
657657
end
658-
if node.attrib.showAnimations then
658+
if node.attrib.showAnimations then
659659
self.showAnimations = node.attrib.showAnimations == "true"
660660
end
661-
if node.attrib.showAllItemAffixes then
661+
if node.attrib.showAllItemAffixes then
662662
self.showAllItemAffixes = node.attrib.showAllItemAffixes == "true"
663663
end
664664
if node.attrib.dpiScaleOverridePercent then
@@ -794,7 +794,7 @@ function main:SaveSettings()
794794
showPublicBuilds = tostring(self.showPublicBuilds),
795795
showFlavourText = tostring(self.showFlavourText),
796796
showAnimations = tostring(self.showAnimations),
797-
showAllItemAffixes = tostring(self.showAllItemAffixes),
797+
showAllItemAffixes = tostring(self.showAllItemAffixes),
798798
dpiScaleOverridePercent = tostring(self.dpiScaleOverridePercent),
799799
} })
800800
local res, errMsg = common.xml.SaveXMLFile(setXML, self.userPath.."Settings.xml")
@@ -1099,7 +1099,7 @@ function main:OpenOptionsPopup()
10991099
controls.showPublicBuilds.state = self.showPublicBuilds
11001100
controls.showFlavourText.state = self.showFlavourText
11011101
controls.showAnimations.state = self.showAnimations
1102-
controls.showAllItemAffixes.state = self.showAllItemAffixes
1102+
controls.showAllItemAffixes.state = self.showAllItemAffixes
11031103
local initialNodePowerTheme = self.nodePowerTheme
11041104
local initialColorPositive = self.colorPositive
11051105
local initialColorNegative = self.colorNegative
@@ -1121,7 +1121,7 @@ function main:OpenOptionsPopup()
11211121
local initialShowPublicBuilds = self.showPublicBuilds
11221122
local initialShowFlavourText = self.showFlavourText
11231123
local initialShowAnimations = self.showAnimations
1124-
local initialShowAllItemAffixes = self.showAllItemAffixes
1124+
local initialShowAllItemAffixes = self.showAllItemAffixes
11251125
local initialDpiScaleOverridePercent = self.dpiScaleOverridePercent
11261126

11271127
-- last line with buttons has more spacing
@@ -1177,7 +1177,7 @@ function main:OpenOptionsPopup()
11771177
self.showPublicBuilds = initialShowPublicBuilds
11781178
self.showFlavourText = initialShowFlavourText
11791179
self.showAnimations = initialShowAnimations
1180-
self.showAllItemAffixes = initialShowAllItemAffixes
1180+
self.showAllItemAffixes = initialShowAllItemAffixes
11811181
self.dpiScaleOverridePercent = initialDpiScaleOverridePercent
11821182
SetDPIScaleOverridePercent(self.dpiScaleOverridePercent)
11831183
main:ClosePopup()

0 commit comments

Comments
 (0)