Files
coa-mapster/Mapster/Libs/AceGUI-3.0/widgets/AceGUIContainer-InlineGroup.lua
florian.berthold 4a65f00aca
release / release (push) Successful in 3s
vendor: Libs/ from coa-ace3 + LibBabble-Zone / LibWindow; pin TOC version
Upstream Mapster relies on the CurseForge packager to fetch its libs
at release time; the raw repo has no Libs/ folder, so the freshly-
imported addon failed to load (LibStub missing).

- Vendored canonical Ace3 from coa-ace3 (11 libs Mapster's TOC loads:
  LibStub, CallbackHandler-1.0, AceAddon-3.0, AceEvent-3.0, AceHook-3.0,
  AceDB-3.0, AceDBOptions-3.0, AceLocale-3.0, AceGUI-3.0, AceConsole-3.0,
  AceConfig-3.0). This brings the CoA-compat FileDataID / BlizOptionsGroup
  parent-guard / Settings.* fallback / AceDB falsy-defaults patches.
- LibBabble-Zone-3.0 and LibWindow-1.1 vendored from the working PTR
  install (not part of Ace3).
- TOC: replaced @project-version@ CurseForge placeholder with the real
  release string 1.3.9-coa.2 so the in-game About panel reads correctly.

Mapster source itself was clean against the PORTING.md checklist
(no FDID calls, no retail-only globals, no Minimap mask trap, no CLEU
arg mismatch) — expected, since 1.3.9 was the WotLK-era release.
2026-05-25 13:11:21 +02:00

104 lines
2.9 KiB
Lua

--[[-----------------------------------------------------------------------------
InlineGroup Container
Simple container widget that creates a visible "box" with an optional title.
-------------------------------------------------------------------------------]]
local Type, Version = "InlineGroup", 22
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
-- Lua APIs
local pairs = pairs
-- WoW APIs
local CreateFrame, UIParent = CreateFrame, UIParent
--[[-----------------------------------------------------------------------------
Methods
-------------------------------------------------------------------------------]]
local methods = {
["OnAcquire"] = function(self)
self:SetWidth(300)
self:SetHeight(100)
self:SetTitle("")
end,
-- ["OnRelease"] = nil,
["SetTitle"] = function(self,title)
self.titletext:SetText(title)
end,
["LayoutFinished"] = function(self, width, height)
if self.noAutoHeight then return end
self:SetHeight((height or 0) + 40)
end,
["OnWidthSet"] = function(self, width)
local content = self.content
local contentwidth = width - 20
if contentwidth < 0 then
contentwidth = 0
end
content:SetWidth(contentwidth)
content.width = contentwidth
end,
["OnHeightSet"] = function(self, height)
local content = self.content
local contentheight = height - 20
if contentheight < 0 then
contentheight = 0
end
content:SetHeight(contentheight)
content.height = contentheight
end
}
--[[-----------------------------------------------------------------------------
Constructor
-------------------------------------------------------------------------------]]
local PaneBackdrop = {
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
tile = true, tileSize = 16, edgeSize = 16,
insets = { left = 3, right = 3, top = 5, bottom = 3 }
}
local function Constructor()
local frame = CreateFrame("Frame", nil, UIParent)
frame:SetFrameStrata("FULLSCREEN_DIALOG")
local titletext = frame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
titletext:SetPoint("TOPLEFT", 14, 0)
titletext:SetPoint("TOPRIGHT", -14, 0)
titletext:SetJustifyH("LEFT")
titletext:SetHeight(18)
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
border:SetPoint("TOPLEFT", 0, -17)
border:SetPoint("BOTTOMRIGHT", -1, 3)
border:SetBackdrop(PaneBackdrop)
border:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
border:SetBackdropBorderColor(0.4, 0.4, 0.4)
--Container Support
local content = CreateFrame("Frame", nil, border)
content:SetPoint("TOPLEFT", 10, -10)
content:SetPoint("BOTTOMRIGHT", -10, 10)
local widget = {
frame = frame,
content = content,
titletext = titletext,
type = Type
}
for method, func in pairs(methods) do
widget[method] = func
end
return AceGUI:RegisterAsContainer(widget)
end
AceGUI:RegisterWidgetType(Type, Constructor, Version)