TourGuide - Reworking some stuff with ally around 51
[WoW-TourGuide.git] / OHDebug.lua
blob3a2be9adfef0c1499da9da60becd79c42f3c38cc
2 local function OnMouseWheel(frame, delta)
3 if delta > 0 then
4 if IsShiftKeyDown() then frame:ScrollToTop()
5 else frame:ScrollUp() end
6 elseif delta < 0 then
7 if IsShiftKeyDown() then frame:ScrollToBottom()
8 else frame:ScrollDown() end
9 end
10 end
13 local f = CreateFrame("ScrollingMessageFrame", nil, UIParent)
14 f:SetMaxLines(250)
15 f:SetFontObject(ChatFontNormal)
16 f:SetJustifyH("LEFT")
17 f:SetFading(false)
18 f:EnableMouseWheel(true)
19 f:SetScript("OnMouseWheel", OnMouseWheel)
20 f:SetScript("OnHide", f.ScrollToBottom)
21 f:Hide()
24 local orig = f.AddMessage
25 f.AddMessage = function(self, txt, ...)
26 local newtext = txt:gsub("TourGuide|r:", date("%X").."|r", 1)
27 return orig(self, newtext, ...)
28 end
31 TourGuideOHDebugFrame = f