PageRenderTime 187ms CodeModel.GetById 184ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Tukui/modules/chat/mousescroll.lua

http://github.com/Asphyxia/Tukui
Lua | 27 lines | 22 code | 2 blank | 3 comment | 6 complexity | 34c1c9a5e2156d98cbb8108535b0f457 MD5 | raw file
 1local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2if C["chat"].enable ~= true then return end
 3
 4------------------------------------------------------------------------
 5--	Enhance/rewrite a Blizzard feature, chatframe mousewheel.
 6------------------------------------------------------------------------
 7
 8local ScrollLines = 3 -- set the jump when a scroll is done !
 9function FloatingChatFrame_OnMouseScroll(self, delta)
10	if delta < 0 then
11		if IsShiftKeyDown() then
12			self:ScrollToBottom()
13		else
14			for i = 1, ScrollLines do
15				self:ScrollDown()
16			end
17		end
18	elseif delta > 0 then
19		if IsShiftKeyDown() then
20			self:ScrollToTop()
21		else
22			for i = 1, ScrollLines do
23				self:ScrollUp()
24			end
25		end
26	end
27end