mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-31 07:56:57 +00:00
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:
+8
-16
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user