Scroll chat with ScrollByAmount

The mouse wheel on the chat frames and on the AFK camera's chat moves by
ScrollByAmount instead of looping ScrollUp / ScrollDown. Shift-wheel up
scrolls by the full range, so the oldest line stops on top as it does
with the wheel; ScrollToTop would leave it alone on the bottom line.
This commit is contained in:
Brues
2026-10-30 23:26:36 -05:00
parent 5224d02572
commit c5894f7f15
2 changed files with 9 additions and 21 deletions
+1 -5
View File
@@ -74,11 +74,7 @@ pfUI:RegisterModule("afkcam", function ()
chat:RegisterEvent(ctype)
end
chat:SetScript("OnMouseWheel",function()
if arg1 > 0 then
this:ScrollUp()
else
this:ScrollDown()
end
this:ScrollByAmount(arg1)
end)
overlay.chat = chat
+8 -16
View File
@@ -278,22 +278,14 @@ pfUI:RegisterModule("chat", function ()
pfUI.chat:RegisterEvent("UI_SCALE_CHANGED")
local function ChatOnMouseWheel()
if (arg1 > 0) then
if IsShiftKeyDown() then
this:ScrollToTop()
else
for i=1, C.chat.global.scrollspeed do
this:ScrollUp()
end
end
elseif (arg1 < 0) then
if IsShiftKeyDown() then
this:ScrollToBottom()
else
for i=1, C.chat.global.scrollspeed do
this:ScrollDown()
end
end
if not IsShiftKeyDown() then
this:ScrollByAmount(arg1 * C.chat.global.scrollspeed)
elseif arg1 > 0 then
-- stops with the oldest line on top, as the wheel does; ScrollToTop
-- would leave it alone on the bottom line
this:ScrollByAmount(this:GetMaxScrollRange())
else
this:ScrollToBottom()
end
end