Code:
<Ability><Name>-- DEBUG --</Name><Default>false</Default><SpellID>0</SpellID><Actions></Actions>
<Lua>
if not PQ_DebugFrameLoaded then
local frame = CreateFrame(&apos;Frame&apos;, &apos;DebugFrame&apos;, UIParent)
frame.width = 580
frame.height = 250
frame:SetFrameStrata(&apos;FULLSCREEN_DIALOG&apos;)
frame:SetSize(frame.width, frame.height)
frame:SetPoint(&apos;CENTER&apos;, UIParent, &apos;CENTER&apos;, 0, 0)
frame:SetBackdrop({
bgFile = &apos;Interface\\DialogFrame\\UI-DialogBox-Background&apos;,
edgeFile = &apos;Interface\\DialogFrame\\UI-DialogBox-Border&apos;,
tile = true,
tileSize = 32,
edgeSize = 32,
insets = { left = 8, right = 8, top = 8, bottom = 8 }
})
frame:SetBackdropColor(0, 0, 0, 1)
frame:EnableMouse(true)
frame:EnableMouseWheel(true)
-- Make movable/resizable
frame:SetMovable(true)
frame:SetResizable(enable)
frame:SetMinResize(100, 100)
frame:RegisterForDrag(&apos;LeftButton&apos;)
frame:SetScript(&apos;OnDragStart&apos;, frame.StartMoving)
frame:SetScript(&apos;OnDragStop&apos;, frame.StopMovingOrSizing)
tinsert(UISpecialFrames, &apos;DebugFrame&apos;)
-- Close button
local closeButton = CreateFrame(&apos;Button&apos;, nil, frame, &apos;UIPanelButtonTemplate&apos;)
closeButton:SetPoint(&apos;BOTTOM&apos;, 0, 10)
closeButton:SetHeight(25)
closeButton:SetWidth(70)
closeButton:SetText(CLOSE)
closeButton:SetScript(&apos;OnClick&apos;, function(self)
HideParentPanel(self)
end)
frame.closeButton = closeButton
-- ScrollingMessageFrame
local messageFrame = CreateFrame(&apos;ScrollingMessageFrame&apos;, nil, frame)
messageFrame:SetPoint(&apos;CENTER&apos;, 15, 20)
messageFrame:SetSize(frame.width - 40, frame.height - 50)
messageFrame:SetFontObject(GameFontNormal)
messageFrame:SetTextColor(1, 1, 1, 1) -- default color
messageFrame:SetJustifyH(&apos;LEFT&apos;)
messageFrame:SetHyperlinksEnabled(true)
messageFrame:SetFading(false)
messageFrame:SetMaxLines(300)
frame.messageFrame = messageFrame
--messageFrame:ScrollToBottom()
--messageFrame:ScrollDown()
-------------------------------------------------------------------------------
-- Scroll bar
-------------------------------------------------------------------------------
local scrollBar = CreateFrame(&apos;Slider&apos;, nil, frame, &apos;UIPanelScrollBarTemplate&apos;)
scrollBar:SetPoint(&apos;RIGHT&apos;, frame, &apos;RIGHT&apos;, -10, 10)
scrollBar:SetSize(30, frame.height - 90)
scrollBar:SetMinMaxValues(0, 300)
scrollBar:SetValueStep(1)
scrollBar.scrollStep = 1
frame.scrollBar = scrollBar
scrollBar:SetScript(&apos;OnValueChanged&apos;, function(self, value)
messageFrame:SetScrollOffset(select(2, scrollBar:GetMinMaxValues()) - value)
end)
scrollBar:SetValue(select(2, scrollBar:GetMinMaxValues()))
frame:SetScript(&apos;OnMouseWheel&apos;, function(self, delta)
local cur_val = scrollBar:GetValue()
local min_val, max_val = scrollBar:GetMinMaxValues()
if delta &lt; 0 and cur_val &lt; max_val then
cur_val = math.min(max_val, cur_val + 1)
scrollBar:SetValue(cur_val)
elseif delta &gt; 0 and cur_val &gt; min_val then
cur_val = math.max(min_val, cur_val - 1)
scrollBar:SetValue(cur_val)
end
end)
SLASH_DEBUG1 = &apos;/pqd&apos;
SlashCmdList.DEBUG = function()
if DebugFrame:IsShown() then
DebugFrame:Hide()
else
DebugFrame:Show()
end
end
DebugFrame:Hide()
PQ_DebugFrameLoaded = true
PQ_Debug = true
end
</Lua>
<RecastDelay>0</RecastDelay><Target>Player</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability>
Its minor code that I made from different examples(coz I mainly don't program GUI),but still we all need this.