Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Classes/DropDownControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,9 @@ function DropDownClass:OnKeyUp(key)
if self.dropped and self.controls.scrollBar.enabled then
self.controls.scrollBar:Scroll(1)
else
if main.disableScrollControlInteraction then
return
end
self:SetSel(self:ListIndexToDropIndex(self.selIndex, 0) + 1)
end
return self
Expand All @@ -473,6 +476,9 @@ function DropDownClass:OnKeyUp(key)
if self.dropped and self.controls.scrollBar.enabled then
self.controls.scrollBar:Scroll(-1)
else
if main.disableScrollControlInteraction then
return
end
self:SetSel(self:ListIndexToDropIndex(self.selIndex, 0) - 1)
end
return self
Expand Down
4 changes: 2 additions & 2 deletions src/Classes/EditControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ function EditClass:OnKeyUp(key)
end
elseif self.isNumeric then
local cur = tonumber(self.buf)
if key == "WHEELUP" or key == "UP" then
if not main.disableScrollControlInteraction and (key == "WHEELUP" or key == "UP") then
if cur then
self:SetText(tostring(cur + (self.numberInc or 1)), true)
else
Expand All @@ -685,7 +685,7 @@ function EditClass:OnKeyUp(key)
self:SetText("1", true)
end
end
elseif key == "WHEELDOWN" or key == "DOWN" then
elseif not main.disableScrollControlInteraction and (key == "WHEELDOWN" or key == "DOWN") then
if cur then
local value = cur - (self.numberInc or 1)
if self.filter == "%D" or self.filter == "^%d." then
Expand Down
4 changes: 2 additions & 2 deletions src/Classes/SliderControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ function SliderClass:OnKeyUp(key)
local cursorX, cursorY = GetCursorPos()
self:SetValFromKnobX((cursorX - self.dragCX) + self.dragKnobX)
end
elseif (not main.invertSliderScrollDirection and key == "WHEELDOWN") or (main.invertSliderScrollDirection and key == "WHEELUP") or key == "DOWN" or key == "LEFT" then
elseif not main.disableScrollControlInteraction and (not main.invertSliderScrollDirection and key == "WHEELDOWN") or (main.invertSliderScrollDirection and key == "WHEELUP") or key == "DOWN" or key == "LEFT" then
if IsKeyDown("SHIFT") then
self:SetVal(self.val - self.scrollWheelSpeedTbl["SHIFT"])
elseif IsKeyDown("CTRL") then
self:SetVal(self.val - self.scrollWheelSpeedTbl["CTRL"])
else
self:SetVal(self.val - self.scrollWheelSpeedTbl["DEFAULT"])
end
elseif (not main.invertSliderScrollDirection and key == "WHEELUP") or (main.invertSliderScrollDirection and key == "WHEELDOWN") or key == "UP" or key == "RIGHT" then
elseif not main.disableScrollControlInteraction and (not main.invertSliderScrollDirection and key == "WHEELUP") or (main.invertSliderScrollDirection and key == "WHEELDOWN") or key == "UP" or key == "RIGHT" then
if IsKeyDown("SHIFT") then
self:SetVal(self.val + self.scrollWheelSpeedTbl["SHIFT"])
elseif IsKeyDown("CTRL") then
Expand Down
15 changes: 14 additions & 1 deletion src/Modules/Main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ function main:Init()
self.showFlavourText = true
self.showAnimations = true
self.showAllItemAffixes = true
self.disableScrollControlInteraction = false
self.errorReadingSettings = false

if not SetDPIScaleOverridePercent then SetDPIScaleOverridePercent = function(scale) end end
Expand Down Expand Up @@ -662,6 +663,9 @@ function main:LoadSettings(ignoreBuild)
if node.attrib.showAllItemAffixes then
self.showAllItemAffixes = node.attrib.showAllItemAffixes == "true"
end
if node.attrib.disableScrollControlInteraction then
self.disableScrollControlInteraction = node.attrib.disableScrollControlInteraction == "true"
end
if node.attrib.dpiScaleOverridePercent then
self.dpiScaleOverridePercent = tonumber(node.attrib.dpiScaleOverridePercent) or 0
SetDPIScaleOverridePercent(self.dpiScaleOverridePercent)
Expand Down Expand Up @@ -797,6 +801,7 @@ function main:SaveSettings()
showFlavourText = tostring(self.showFlavourText),
showAnimations = tostring(self.showAnimations),
showAllItemAffixes = tostring(self.showAllItemAffixes),
disableScrollControlInteraction = tostring(self.disableScrollControlInteraction),
dpiScaleOverridePercent = tostring(self.dpiScaleOverridePercent)
} })
local res, errMsg = common.xml.SaveXMLFile(setXML, self.userPath.."Settings.xml")
Expand Down Expand Up @@ -881,6 +886,7 @@ function main:OpenOptionsPopup(savedState)
showFlavourText = self.showFlavourText,
showAnimations = self.showAnimations,
showAllItemAffixes = self.showAllItemAffixes,
disableScrollControlInteraction = self.disableScrollControlInteraction,
dpiScaleOverridePercent = self.dpiScaleOverridePercent
}

Expand Down Expand Up @@ -1052,7 +1058,13 @@ function main:OpenOptionsPopup(savedState)
controls.showAllItemAffixes = new("CheckBoxControl", { "TOPLEFT", controls.sectionAnchor, "TOPLEFT" }, { currentX + defaultLabelPlacementX, currentY, 20 }, "^7Show all item affixes sliders:", function(state)
self.showAllItemAffixes = state
end)
controls.showAllItemAffixes.tooltipText = "Display all item affix slots as a stacked list instead of hiding them in dropdowns"
controls.showAllItemAffixes.tooltipText = "Display all item affix slots as a stacked list instead of hiding them in dropdowns."

nextRow()
controls.disableScrollControlInteraction = new("CheckBoxControl", { "TOPLEFT", controls.sectionAnchor, "TOPLEFT" }, { currentX + defaultLabelPlacementX, currentY, 20 }, "^7Disable control scroll interaction:", function(state)
self.disableScrollControlInteraction = state
end)
controls.disableScrollControlInteraction.tooltipText = "Disable changing the values in controls such as dropdowns, numeric inputs, or sliders when using the scroll wheel."

nextRow()

Expand Down Expand Up @@ -1169,6 +1181,7 @@ function main:OpenOptionsPopup(savedState)
controls.showFlavourText.state = self.showFlavourText
controls.showAnimations.state = self.showAnimations
controls.showAllItemAffixes.state = self.showAllItemAffixes
controls.disableScrollControlInteraction.state = self.disableScrollControlInteraction

-- Adjust height in case of two-column layout
currentY = m_max(leftColumnMaxY, currentY)
Expand Down
Loading