Files
coa-ace3/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua
T
florian.berthold d422ad36b8 fix(compat): convert FileDataID Set*Texture() calls to string paths
WoW 3.3.5 / CoA does not support numeric FileDataIDs in Set(*)Texture —
only string paths. Upstream Ace3 uses FDIDs in 42 places across
AceGUI-3.0/widgets and AceConfigDialog-3.0, which silently fail and
render as red placeholders (visible as solid-red squares where color
swatches, checkboxes, and window chrome should be).

Substituted each FDID with the string path documented in the trailing
comment. Files touched:

  AceGUI-3.0/widgets/AceGUIContainer-Frame.lua             (5)
  AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua         (4)
  AceGUI-3.0/widgets/AceGUIContainer-Window.lua           (12)
  AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua             (9)
  AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua          (3)
  AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua       (3)
  AceGUI-3.0/widgets/AceGUIWidget-Heading.lua              (2)
  AceGUI-3.0/widgets/AceGUIWidget-Icon.lua                 (1)
  AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua (3)

Documented as patch #1 in README.md.
2026-05-23 14:03:09 +02:00

79 lines
2.2 KiB
Lua

--[[-----------------------------------------------------------------------------
Heading Widget
-------------------------------------------------------------------------------]]
local Type, Version = "Heading", 20
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:SetText()
self:SetFullWidth()
self:SetHeight(18)
end,
-- ["OnRelease"] = nil,
["SetText"] = function(self, text)
self.label:SetText(text or "")
if text and text ~= "" then
self.left:SetPoint("RIGHT", self.label, "LEFT", -5, 0)
self.right:Show()
else
self.left:SetPoint("RIGHT", -3, 0)
self.right:Hide()
end
end
}
--[[-----------------------------------------------------------------------------
Constructor
-------------------------------------------------------------------------------]]
local function Constructor()
local frame = CreateFrame("Frame", nil, UIParent)
frame:Hide()
local label = frame:CreateFontString(nil, "BACKGROUND", "GameFontNormal")
label:SetPoint("TOP")
label:SetPoint("BOTTOM")
label:SetJustifyH("CENTER")
local left = frame:CreateTexture(nil, "BACKGROUND")
left:SetHeight(8)
left:SetPoint("LEFT", 3, 0)
left:SetPoint("RIGHT", label, "LEFT", -5, 0)
left:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border")
left:SetTexCoord(0.81, 0.94, 0.5, 1)
local right = frame:CreateTexture(nil, "BACKGROUND")
right:SetHeight(8)
right:SetPoint("RIGHT", -3, 0)
right:SetPoint("LEFT", label, "RIGHT", 5, 0)
right:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border")
right:SetTexCoord(0.81, 0.94, 0.5, 1)
local widget = {
label = label,
left = left,
right = right,
frame = frame,
type = Type
}
for method, func in pairs(methods) do
widget[method] = func
end
return AceGUI:RegisterAsWidget(widget)
end
AceGUI:RegisterWidgetType(Type, Constructor, Version)