chat-tweaks: enable mousewheel and sticky chat
This commit is contained in:
@@ -34,6 +34,9 @@ Every of the listed features below, can be completely disabled in that menu in c
|
||||
- **Chat Hyperlinks**
|
||||
*Copy website URLs from the chat, transforms CLINKs into real items and handles quest links.*
|
||||
|
||||
- **Chat Tweaks**
|
||||
*Allows to scroll using the mouse wheel and enables sticky chat channels.*
|
||||
|
||||
- **Darkened UI**
|
||||
*Turns the entire interface into darker colors.*
|
||||
|
||||
|
||||
@@ -53,3 +53,4 @@ mods\auto-dismount.lua
|
||||
mods\auto-stance.lua
|
||||
mods\tooltip-details.lua
|
||||
mods\hide-errors.lua
|
||||
mods\chat-tweaks.lua
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
local _G = _G or getfenv(0)
|
||||
local scrollspeed = 1
|
||||
|
||||
local module = ShaguTweaks:register({
|
||||
title = "Chat Tweaks",
|
||||
description = "Allows to scroll using the mouse wheel and enables sticky chat channels.",
|
||||
enabled = true,
|
||||
})
|
||||
|
||||
local function ChatOnMouseWheel()
|
||||
if arg1 > 0 then
|
||||
if IsShiftKeyDown() then
|
||||
this:ScrollToTop()
|
||||
else
|
||||
for i=1, scrollspeed do
|
||||
this:ScrollUp()
|
||||
end
|
||||
end
|
||||
elseif arg1 < 0 then
|
||||
if IsShiftKeyDown() then
|
||||
this:ScrollToBottom()
|
||||
else
|
||||
for i=1, scrollspeed do
|
||||
this:ScrollDown()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
module.enable = function(self)
|
||||
-- enable sticky chat types
|
||||
ChatTypeInfo.WHISPER.sticky = 1
|
||||
ChatTypeInfo.OFFICER.sticky = 1
|
||||
ChatTypeInfo.RAID_WARNING.sticky = 1
|
||||
ChatTypeInfo.CHANNEL.sticky = 1
|
||||
|
||||
for i=1, NUM_CHAT_WINDOWS do
|
||||
-- enable mouse wheel scrolling
|
||||
_G["ChatFrame" .. i]:EnableMouseWheel(true)
|
||||
_G["ChatFrame" .. i]:SetScript("OnMouseWheel", ChatOnMouseWheel)
|
||||
|
||||
-- hide buttons
|
||||
--_G["ChatFrame" .. i .. "UpButton"]:Hide()
|
||||
--_G["ChatFrame" .. i .. "UpButton"].Show = function() return end
|
||||
--_G["ChatFrame" .. i .. "DownButton"]:Hide()
|
||||
--_G["ChatFrame" .. i .. "DownButton"].Show = function() return end
|
||||
--_G["ChatFrame" .. i .. "BottomButton"]:Hide()
|
||||
--_G["ChatFrame" .. i .. "BottomButton"].Show = function() return end
|
||||
--_G["ChatFrameMenuButton"]:Hide()
|
||||
--_G["ChatFrameMenuButton"].Show = function() return end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user