scrollframe:SetScript("OnMouseWheel", scroll) |
|
InterfaceOptions_AddCategory(debugframe) |
|
debugframe:SetScript("OnShow", function(frame) |
debugframe:SetScript("OnShow", nil) |
|
-- Copied from Chatter by Antiarc |
local PaneBackdrop = { |
bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]], |
edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]], |
tile = true, tileSize = 16, edgeSize = 16, |
insets = { left = 3, right = 3, top = 5, bottom = 3 } |
} |
|
local InsetBackdrop = { |
bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]], |
edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], |
tile = true, tileSize = 16, edgeSize = 16, |
insets = { left = 3, right = 3, top = 5, bottom = 3 } |
} |
|
local frame = CreateFrame("Frame", "DressToKillCopyFrame", UIParent) |
table.insert(UISpecialFrames, "DressToKillCopyFrame") |
frame:SetBackdrop(PaneBackdrop) |
frame:SetBackdropColor(0,0,0,1) |
frame:SetWidth(500) |
frame:SetHeight(200) |
frame:SetPoint("CENTER", UIParent, "CENTER") |
frame:Hide() |
frame:SetFrameStrata("DIALOG") |
|
local scrollArea = CreateFrame("ScrollFrame", "DressToKillCopyScroll", frame, "UIPanelScrollFrameTemplate") |
scrollArea:SetPoint("TOPLEFT", frame, "TOPLEFT", 8, -30) |
scrollArea:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -30, 8) |
|
local editBox = CreateFrame("EditBox", nil, frame) |
editBox:SetMultiLine(true) |
editBox:SetMaxLetters(99999) |
editBox:EnableMouse(true) |
editBox:SetAutoFocus(false) |
editBox:SetFontObject(ChatFontNormal) |
editBox:SetWidth(400) |
editBox:SetHeight(270) |
editBox:SetScript("OnEscapePressed", function() frame:Hide() end) |
|
scrollArea:SetScrollChild(editBox) |
|
local lines = {} |
local function getlines(...) |
local ct = 1 |
for i = select("#", ...), 1, -1 do |
local region = select(i, ...) |
if region:GetObjectType() == "FontString" then |
lines[ct] = tostring(region:GetText()) |
ct = ct + 1 |
end |
end |
return ct - 1 |
end |
|
local close = CreateFrame("Button", nil, frame, "UIPanelCloseButton") |
close:SetPoint("TOPRIGHT", frame, "TOPRIGHT") |
|
copylog = CreateFrame("Button", "DressToKillCopyLogButton", DressToKillDebugScrollFrame, "UIPanelButtonTemplate2") |
copylog:SetText(L["Copy Log"]) |
copylog:SetWidth(80) |
copylog:SetPoint("TOPRIGHT", scrollframe, "BOTTOMRIGHT", 0, -5) |
copylog:SetScript("OnClick", function(self) |
lines = {} |
local _, size = DressToKillDebugScrollFrame:GetFont() |
FCF_SetChatWindowFontSize(DressToKillDebugScrollFrame, 0.01) |
local lineCt = getlines(DressToKillDebugScrollFrame:GetRegions()) |
local text = table.concat(lines, "\n", 1, lineCt) |
FCF_SetChatWindowFontSize(DressToKillDebugScrollFrame, size) |
DressToKillCopyFrame:Show() |
editBox:SetText(text) |
editBox:HighlightText(0) |
end) |
end) |