Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,14 @@ The parent section controls the font, separate duration/stack sizes, and
duration placement below or inside the icon. **Icon frame** styles each
individual icon border. **Global Settings > Aura Icons** sets these icon
options (time and stack text, debuff colours and glow, icon frame) for every
frame and ClickGrid at once; a frame's own value still wins. The small frames
(pet, target of target, ClickGrid) keep smaller time and stack text, and the
icon row and priority icons keep their own time position. Centre alignment centres the whole aura block;
frame and ClickGrid at once, and the **Buffs**, **Debuffs** and **Spacing &
shared side** options (which auras, how many, size, side, growth, swipe) for
every frame's external icons; a frame's own value still wins, and only the
on/off switch stays per frame. Its preview shows sample buffs and debuffs with
exactly the shared values. The main frames keep their own side and gap, and the
small frames (pet, target of target, ClickGrid) their own sizes, counts and
smaller time and stack text; the icon row and priority icons keep their own
layout and time position. Centre alignment centres the whole aura block;
use offsets to separate groups when placing both on the same side.
**Debuff border colours** customises the full frame tint for magic, curse,
disease, poison, and debuffs without a dispel type. Turn off **Colour debuff
Expand Down
4 changes: 2 additions & 2 deletions UnitFrames/Components/AuraBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ local LAYOUT_TEMPLATE = "DisableUntrustedLayoutScriptsTemplate"
-- never read in Lua: a hidden native "presence" container sizes a clipping
-- viewport through anchors, and the neighbour anchors to that viewport.
-- Everything depending on it opts into the forbidden layout aspect.
local schema = ns.Schema.Without(ns.Util.Copy(Auras.schema), { buffs = true, debuffs = true, sharedSide = true, stackFirst = true })
local schema = ns.Schema.Without(ns.Util.Copy(Auras.ownSchema), { buffs = true, debuffs = true, sharedSide = true, stackFirst = true })
schema = ns.Schema.Override(schema, "enabled", { default = false })
schema = ns.Schema.Override(schema, "durationPosition", { default = "BOTTOM", inherit = false,
tooltip = "Below the icon resolves to inside-bottom for this row. Text remains inside the visible strip.",
Expand All @@ -36,7 +36,7 @@ AuraBar.schema = ns.Schema.Insert(schema, "enabled", {
defaults = { enabled = false, border = "None", inset = 0 } },
})
for _, kind in ipairs(KINDS) do
local source = ns.Schema.Find(Auras.schema, kind)
local source = ns.Schema.Find(Auras.ownSchema, kind)
local group = ns.Schema.Without(ns.Util.Copy(source.schema), {
position = true, alignment = true, growth = true, gap = true, offsetX = true, offsetY = true, lineSize = true,
separateHeight = true, height = true,
Expand Down
15 changes: 14 additions & 1 deletion UnitFrames/Components/Auras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ local function GroupSchema(label, filters, size, position)
end

-- The shared artwork options sit between the spacing and the two groups.
Auras.schema = ns.Schema.Insert({
local ownSchema = ns.Schema.Insert({
{ key = "enabled", type = "toggle", label = "Enabled", default = true },
{ key = "spacing", type = "range", label = "Icon spacing", min = 0, max = 10, step = 1, default = 2 },
{ key = "sharedSide", type = "select", label = "Buffs and debuffs on one side", values = Auras.SHARED_SIDE, default = "combined",
Expand All @@ -139,6 +139,19 @@ Auras.schema = ns.Schema.Insert({
{ key = "debuffs", type = "group", label = "Debuffs", schema = GroupSchema("debuffs", Auras.DEBUFF_FILTERS, 26, "bottom") },
}, "spacing", ns.Util.Copy(AuraIcon.schema))

-- Without theme inheritance, for displays deriving their own options (AuraBar).
Auras.ownSchema = ownSchema

-- Everything but the on/off switch is also edited globally: the theme's
-- "auras" group (started by AuraIcon) gains the two groups and the layout
-- options, and every frame inherits them unless it sets its own value.
local LAYOUT_KEYS = { spacing = true, sharedSide = true, stackFirst = true }
local inheriting, themeSchema = ns.Schema.Inheriting(ns.Schema.Without(ownSchema, { enabled = true }), "auras.")
Auras.schema = ns.Schema.Concat({ ownSchema[1] }, inheriting)
local themeGroup = ns.Schema.Find(ns.Theme.schema, "auras")
themeGroup.schema = ns.Schema.Concat(ns.Schema.Without(themeSchema, LAYOUT_KEYS),
ns.Schema.Without(themeSchema, { buffs = true, debuffs = true }), themeGroup.schema)

function Auras:OnCreate(parent)
self.frame = CreateFrame("Frame", nil, parent)
self.frame:SetAllPoints(parent)
Expand Down
2 changes: 1 addition & 1 deletion UnitFrames/Core/Theme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local _, ns = ...

-- Global look shared by every component. Component options with `inherit`
-- read from here unless the component overrides them. AuraIcon appends the
-- "auras" group.
-- "auras" group and Auras adds the buff and debuff options to it.
local Theme = {}
ns.Theme = Theme

Expand Down
8 changes: 6 additions & 2 deletions UnitFrames_Workbench/Entries/Theme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,19 @@ Workbench:Register({
local text = C.Text:New(bar:GetTextParent(), {})
text:SetPoint("CENTER", bar:GetTextParent(), "CENTER")
text:SetText("Theme preview")
-- No settings of its own: the sample icons show the shared values.
local auras = C.Auras:New(bar:GetFrame(), {})
auras:ShowSample({ buffs = UF.Units.SAMPLE.buffs, debuffs = UF.Units.SAMPLE.debuffs })
-- Rows follow the bar's width, which the stage sets after the first apply.
bar:GetFrame():HookScript("OnSizeChanged", function(_, width, height)
if auras.resolved then auras:Layout(width, height) end
end)
return Workbench.Composite({
{ key = "bar", label = "Bar", component = bar },
{ key = "text", label = "Text", component = text },
{ key = "auras", label = "Aura icons", component = auras },
}, bar:GetFrame())
end,
defaultConfig = { bar = { border = { enabled = true } },
auras = { buffs = { max = 7, size = 22 }, debuffs = { max = 5, size = 22 } } },
defaultConfig = { bar = { border = { enabled = true } } },
styleTarget = ThemeTarget,
})
5 changes: 5 additions & 0 deletions UnitFrames_Workbench/Pages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ local function Location(entry, path)
if root == "colors" then return "colours", "Colours", "colours", "Colours" end
if root == "auras" then
local group = path:match("^auras%.([^%.]+)")
if group == "buffs" then return "auraIcons", "Aura icons", "auraBuffs", "Buffs" end
if group == "debuffs" then return "auraIcons", "Aura icons", "auraDebuffs", "Debuffs" end
if group == "spacing" or group == "sharedSide" or group == "stackFirst" then
return "auraIcons", "Aura icons", "auraLayout", "Spacing & shared side"
end
if group == "border" then return "auraIcons", "Aura icons", "auraFrame", "Icon frame" end
if group:find("^dispel") then return "auraIcons", "Aura icons", "auraDispel", "Debuff colours & glow" end
return "auraIcons", "Aura icons", "auraText", "Time & stacks"
Expand Down
6 changes: 6 additions & 0 deletions UnitFrames_Workbench/Presentation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ function Presentation.Hint(pageId, section)
if section.id:match(":categoryAuras$") then return "Crowd control, defensive abilities and important buffs. The highest enabled priority covers overlapping icons." end
return "External icons, an embedded row and priority icons are independent displays and can be used together."
end
if pageId == "@auraIcons" then
if section.id:match(":auraBuffs$") or section.id:match(":auraDebuffs$") or section.id:match(":auraLayout$") then
return "Defaults for the external icons of every frame and ClickGrid. A frame's own default or custom value takes precedence."
end
return "Defaults for every aura icon. A frame's own default or custom value takes precedence."
end
if pageId == "@fonts" or pageId == "@artwork" or pageId == "@colours" then
return "Defaults for settings that inherit them. Frame defaults and custom overrides can take precedence."
end
Expand Down
2 changes: 1 addition & 1 deletion UnitFrames_Workbench/Workbench.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ end
-- Saved state ---------------------------------------------------------------

-- Bump when saved entry configs no longer fit the entries; old ones are dropped.
local DB_VERSION = 2
local DB_VERSION = 3

function Workbench:GetDB()
UnitFramesWorkbenchDB = UnitFramesWorkbenchDB or {}
Expand Down
Loading
Loading