local db |
local frames = {UIErrorsFrame, RaidWarningFrame, RaidBossEmoteFrame} |
local UIErrorsFrame, RaidWarningFrame, RaidBossEmoteFrame = UIErrorsFrame, RaidWarningFrame, RaidBossEmoteFrame |
local RN_AM = RaidNotice_AddMessage |
local db, bg |
--local uief = UIErrorsFrame |
|
local function MoveUIEF(anchor, x, y) |
if anchor then |
UIErrorsFrame:ClearAllPoints() |
UIErrorsFrame:SetPoint(anchor, x, y) |
UIErrorsFrame:SetPoint(anchor, tonumber(x), tonumber(y)) |
end |
end |
|
local function NEW_RN_AM(frame, ...) |
if frame == RaidBossEmoteFrame then |
return RN_AM(RaidWarningFrame, ...) |
else |
return RN_AM(frame, ...) |
end |
end |
|
local function SlashHandler(args) |
if args ~= "" then |
local a, x, y = strsplit(" ", strupper(args), 3) |
x, y = tonumber(x), tonumber(y) |
if a == "CONDENSE" then |
db.condense = not db.condense |
RaidNotice_AddMessage = db.condense and NEW_RN_AM or RN_AM |
if UIErrorsFrame.bg and UIErrorsFrame.bg:IsShown() then |
RaidNotice_Clear(RaidWarningFrame) |
RaidNotice_Clear(RaidBossEmoteFrame) |
RaidNotice_AddMessage(RaidWarningFrame, "This is a TEST of Raid Warnings!", ChatTypeInfo["RAID_WARNING"], 500) |
RaidNotice_AddMessage(RaidBossEmoteFrame, "Raid Boss Emotes now shown here!", ChatTypeInfo["RAID_BOSS_EMOTE"], 500) |
end |
print("|cffff9000MoveOverErrors:|r Boss emotes are "..((db.condense and "now") or "no longer").." condensed with raid warnings.") |
elseif x and y then |
MoveUIEF(a, x, y) |
db.anchor, db.x, db.y = a, x, y |
else |
print("|cffff9000MoveOverErrors:|r Slash-command help") |
print([[ - type "/moe condense" to toggle moving messages from the RaidBossEmoteFrame into the RaidWarningFrame.]]) |
print([[ - type "/moe anchor x y" to move the UIErrorsFrame (and those attached to it). anchor may be "BOTTOM", "TOP", "CENTER", "RIGHT", "LEFT", "TOPRIGHT", etc. x and y are horizontal and vertical offsets (+/- numbers).]]) |
end |
local a, x, y = strsplit(" ", args, 3) |
MoveUIEF(a, x, y) |
db = {["anchor"] = a, ["x"] = x, ["y"] = y} |
else |
local bg |
if not UIErrorsFrame.bg then |
for i=1,3 do |
bg = frames[i]:CreateTexture() |
frames[i].bg = bg |
bg:SetAllPoints() |
bg:SetTexture(i==1 and 1 or 0, i==2 and 1 or 0, i==3 and 1 or 0, .4) |
bg:Hide() |
end |
local bgText = UIErrorsFrame:CreateFontString(nil, nil, "GameFontHighlightLarge") |
UIErrorsFrame.bgText = bgText |
bgText:SetPoint("CENTER") |
bgText:SetText("UI messages and quest text") |
bgText:Hide() |
if not bg then |
bg = UIErrorsFrame:CreateTexture() |
bg:SetAllPoints() |
bg:SetTexture(0,0,0,.3) |
bg:Hide() |
end |
if UIErrorsFrame.bg:IsShown() then |
for i=1,3 do |
frames[i].bg:Hide() |
end |
RaidNotice_Clear(RaidWarningFrame) |
RaidNotice_Clear(RaidBossEmoteFrame) |
UIErrorsFrame.bgText:Hide() |
if bg:IsShown() then |
bg:Hide() |
else |
RaidNotice_AddMessage(RaidWarningFrame, "This is a TEST of Raid Warnings!", ChatTypeInfo["RAID_WARNING"], 500) |
RaidNotice_AddMessage(RaidBossEmoteFrame, "This is a TEST of Raid Boss Emotes!", ChatTypeInfo["RAID_BOSS_EMOTE"], 500) |
--UIErrorsFrame:AddMessage("UI messages and quest text") |
--UIErrorsFrame:AddMessage("UIErrorsFrame") |
for i=1,3 do |
frames[i].bg:Show() |
end |
UIErrorsFrame.bgText:Show() |
bg:Show() |
end |
end |
end |