883 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
33 lines
1.9 KiB
Lua
33 lines
1.9 KiB
Lua
local function widget()
|
|
return setmetatable({}, {__index = {
|
|
Hide = function(self) self.hidden = true end,
|
|
SetText = function(self, v) self.text = v end,
|
|
SetWidth = function(self, v) self.width = v end,
|
|
ClearAllPoints = function(self) self.points = {} end,
|
|
SetPoint = function(self, ...) self.points = self.points or {}; table.insert(self.points, {...}) end,
|
|
SetSize = function(self, w, h) self.width = w; self.height = h end,
|
|
GetWidth = function(self) return self.width end,
|
|
GetScrollChild = function(self) return self.child end,
|
|
}})
|
|
end
|
|
GUILD_MOTD_LABEL = "Message of the Day"
|
|
dofile(arg[1])
|
|
local frame = widget(); frame.width = 586
|
|
for _, key in ipairs({"BG", "Header1Label", "Header2Label", "Bar1Left", "HorizontalBar", "Bar2Left", "Bar2Right", "Header2", "Header1", "Header3", "EditMOTDButton", "MOTDScrollFrame", "DetailsFrame"}) do frame[key] = widget() end
|
|
frame.Challenges = {widget(), widget(), widget(), widget()}
|
|
frame.MOTDScrollFrame.MOTD = widget()
|
|
frame.DetailsFrame.child = widget(); frame.DetailsFrame.child.Details = widget()
|
|
CommunitiesGuildInfoFrame_HideChallenges(frame)
|
|
assert(frame.Header1Label.text == GUILD_MOTD_LABEL)
|
|
assert(frame.BG.hidden and frame.Bar2Right.hidden and frame.Header2.hidden)
|
|
for _, challenge in ipairs(frame.Challenges) do assert(challenge.hidden) end
|
|
assert(frame.MOTDScrollFrame.width == 550 and frame.MOTDScrollFrame.height == 70)
|
|
assert(frame.MOTDScrollFrame.MOTD.width == 550)
|
|
assert(frame.DetailsFrame.child.Details.width == 550)
|
|
assert(frame.DetailsFrame.points[2][1] == "BOTTOMRIGHT")
|
|
assert(not frame.MOTDScrollFrame.hidden and not frame.DetailsFrame.hidden)
|
|
-- Reopening the page recalculates original text areas for the actual frame size.
|
|
frame.width = 620
|
|
CommunitiesGuildInfoFrame_HideChallenges(frame)
|
|
assert(frame.MOTDScrollFrame.width == 584 and #frame.DetailsFrame.points == 2)
|