Build on Daylight UI.

Your addon can find the Daylight UI frames, draw on them, restyle them in a look of its own, give players whole themes to pick, add its settings to the Daylight UI options and ship ready-made profiles. This page walks through all of it.

Start here

A plugin is a normal addon that loads after Daylight UI. You don't need to ask anyone or get on a list. The license lets you make, share and upload addons that build on Daylight UI and change how it looks and works. Your addon stays your own work. Reading Daylight UI's files to see how it works is fine, for you or an AI helping you. The one thing you can't do is copy Daylight UI code, art or text into your addon.

Your plugin doesn't have to look like Daylight UI. Matching its look is a choice, never a rule: a plugin can bring its own textures, fonts, colors and shapes, on one bar or on every frame (Your own look). And when this page has no call for what you need, you can use Daylight UI's own code too, knowing it can change in any update (Daylight UI's internals).

Add Daylight UI as a dependency so the game loads it first:

## MyHeals.toc
## Interface: 16001
## Title: My Heals (DaylightUI Plugin)
## Author: You
## Version: 1.0
## Dependencies: DaylightUI
## Category: DaylightUI Plugins
## Group: MyHeals

MyHeals.lua

Every plugin is named Your Plugin (DaylightUI Plugin): in its .toc Title and wherever you upload it (CurseForge, Wago, GitHub). Players can then tell at a glance, in the AddOns list and on download sites, what needs Daylight UI. Inside Daylight UI the tag is left off, so this one shows as "My Heals". A plugin without it still runs, but General > Plugins points out its name.

Category puts every plugin under one "DaylightUI Plugins" heading in the game's AddOns list, next to Daylight UI's own. Group is your addon's folder name, spelled exactly. The game only reads Category from an addon at the top of its group, and it may tuck an addon that depends on DaylightUI under DaylightUI's row by itself, where the heading is lost. Naming your own folder keeps your plugin on its own row. General > Plugins says so when either line is missing.

Then say hello once, at the top of your first file:

DaylightUI:RegisterPlugin("MyHeals", {
    needs = { 1, 7 },   -- the API version you wrote it for
    icon = "Interface\\AddOns\\MyHeals\\icon.png",   -- white on clear, Daylight UI tints it
    color = "66cc99",
    short = "Heals",    -- its name in the options rail
})

local API = DaylightUI.API
local my = API.For("MyHeals")

Your title, author, version and website come from your .toc unless you pass them. Your plugin gets its own section in the Daylight UI options window, under a Plugins heading, and it's credited by name on the General > Plugins page.

API.For("MyHeals") gives you a handle tied to your name. Anything you make through it (movers, commands, settings) is kept separate from everything Daylight UI makes and from other plugins. If your code errors, the player's error report names your addon, not Daylight UI.

Quick recipes

The jobs plugins do most, one short example each. Everything after this section is the full list.

Swap the cast bar's fill for your own texture

local my = DaylightUI.API.For("Neon")

my.Paint("castbar", function(bar, parts, cast)
    parts.fill:SetTexture("Interface\\AddOns\\Neon\\rainbow")
end, { owns = { "fill" } })

It stays on, cast after cast. owns claims the fill, so Daylight UI stops coloring it and your texture shows as you drew it. The same function with "platecast" does the nameplates' cast bars.

Recolor every health bar

for _, kind in ipairs({ "unit", "party", "raid" }) do
    my.Paint(kind, function(frame, parts, unit)
        parts.healthFill:SetVertexColor(0.2, 1, 0.8)
    end, { owns = { "healthFill" } })
end

Recolor the names on nameplates

my.Paint("nameplate", function(plate, parts, unit)
    parts.name:SetTextColor(1, 0.85, 0.4)
end, { owns = { "name" } })

Add your own text to the unit frames

my.AddText("shards", { label = "Soul shards", on = { "power" },
    text = function(unit) return GetItemCount(6265) end })

Players pick it under a frame's Extra text, next to the built-in ones.

Mark items in the bags

my.Paint("bagslot", function(slot, parts, item)
    parts.icon:SetDesaturated(item ~= nil and MyAddon:IsJunk(item.itemID))
end)

Put a setting next to Daylight UI's

my.AddDefaults("UnitFrames", { neonGlow = 0.5 })
local glow = API.GetSetting("UnitFrames", "neonGlow")

Find a frame

Any frame Daylight UI draws for a unit can be looked up. These return the frame, or nil when there isn't one (or that part of the UI is switched off).

-- a raid tile first, then a party tile, then the unit frame
local tile = API.GetUnitFrame("party2")
local plate = API.GetNameplate("nameplate4")
local button = API.GetActionButton(1, 5)   -- bar 1, button 5

for frame, unit in API.Frames("raid") do
    -- every raid tile that's in use
end

GetUnitFrame works like LibGetFrame, so it's handy for anchoring. If you ask for "player" while in a raid, you get your own raid tile. Frames you can see win over hidden ones.

There are seventeen kinds of frame:

KindWhat it is
"unit"Player, target, target of target, pet, focus, the focus's target and the pet's target
"party"Party tiles
"raid"Raid tiles
"partypet"The small pet tiles next to party members
"nameplate"Nameplates
"actionbutton"Buttons on the Daylight UI action bars. Their unit is "bar:button", like "1:5".
"actionbar"A whole bar's holder, the frame its buttons sit in. Its unit is the bar's key ("main", "bar2", "stance", "pet"...), and it gets FrameStyled each time the bar is laid out again.
"shoptile"Item tiles in the Daylight UI vendor window. Their unit is "buy:3" or "buyback:3".
"craftrow"Recipe lines in the Daylight UI profession window. Their unit is the recipe's id.
"castbar"Cast bars: yours, your target's, your focus's, each party member's
"questrow"Quests in the quest tracker. Their unit is the quest's id.
"bagslot"Item slots in the bag, bank and alts windows. Their unit is "bag:slot".
"platecast"A nameplate's cast bar. It comes and goes with its plate, and its unit is the plate's ("nameplate3").
"cdmpiece"A spell's icon or bar in the Cooldown Manager. Its unit is the piece's key.
"buffbar"The holders of the buff bars. Their unit is "buff" or "debuff".
"rollcard"Since 1.13, a loot roll's card. Its unit is the game's roll id. Cards are reused: FrameUnitChanged when one shows the next roll, FrameRemoved when its roll leaves, and FrameStyled on each pick, roll and winner. There are none while the player uses the game's own roll popups.
"buffreminder"Since 1.17, an icon in the missing-buffs row. Its unit is the buff's key: "fortitude", "shout", "armor", "weapon:main" and so on, or a plugin's "<plugin>:<key>". Icons are reused: FrameUnitChanged when one shows another buff, FrameRemoved when its buff stops missing.
local bar = API.GetActionBar("main")       -- a whole bar, also "stance" or "pet"
local tile = API.GetShopTile("buy", 3)   -- the vendor's third item, if it's on show
local row = API.GetCraftRow(3914)         -- a recipe's line, if it's on show
local quest = API.GetQuestRow(176)        -- a quest in the tracker, if it's on show
local card = API.GetRollCard(rollID)      -- a loot roll's card (the id START_LOOT_ROLL gives)

Lookups only ever return real frames. Sample frames from test mode and the options window are never handed back, so you won't end up drawing on a preview by accident.

Hear when things change

Instead of polling or hooking, listen. Every frame event gives you (kind, frame, unit, isPreview).

EventWhen
FrameMadeOnce per frame, after Daylight UI has built it. Make your pieces here.
FrameUnitChangedThe frame now shows someone else. A tile got a new player, a nameplate got a new mob, or you picked a new target.
FrameRemovedThe frame let its unit go. Hide or clear what you put on it.
FrameStyledDaylight UI laid it out again after a setting changed. Move your pieces if they depend on its size.
local handle = my.On("FrameMade", function(kind, frame, unit, isPreview)
    if kind == "raid" then
        -- build something on this tile
    end
end)

API.Off(handle)   -- if you ever want to stop listening

A few things that are good to know:

  • If you start listening after some frames already exist, FrameMade is sent to you right away for each of them. The action bars are built before any plugin loads, so this is how you hear about their buttons.
  • Nameplates get reused. When one moves to a new mob you get FrameRemoved for the old unit before FrameUnitChanged for the new one. You never get FrameMade twice for the same frame.
  • A frame can be made before it has a unit. Handle the unit in both FrameMade and FrameUnitChanged and you're covered either way.
  • The target of target frame can send FrameUnitChanged more than once for one change. Make your handler fine with that.
  • Test mode and the options window's samples send these events too, with isPreview set to true. Draw your sample data on them so players can see your plugin while they set things up.
  • If your handler errors, Daylight UI and other plugins keep running, and the error carries your name.

You can also listen to StyleChanged (the player changed fonts, colors or the accent), SettingChanged (gives you scope, path and value), TestModeChanged, UnlockChanged and Login.

Draw on a frame

API.Attach(frame) gives you a plain frame that sits on top of the Daylight UI frame, the same size, above its art. Put your textures and text on it. You get the same one every time you call it, so it's safe to call from any event.

It fades and scales with the frame underneath, and it isn't protected, so you can draw on a raid tile in the middle of a fight.

Here's a whole plugin. It puts a small dot on the party and raid tiles of anyone who's dead, so a healer knows who needs a res.

DaylightUI:RegisterPlugin("ResReminder", { needs = { 1, 3 } })

local API = DaylightUI.API
local my = API.For("ResReminder")
local dots = {}

local function paint(frame, unit)
    local dot = dots[frame]
    if dot then
        dot:SetShown(unit ~= nil and UnitIsDeadOrGhost(unit))
    end
end

my.On("FrameMade", function(kind, frame, unit)
    if kind ~= "party" and kind ~= "raid" then return end
    local dot = API.Attach(frame):CreateTexture(nil, "OVERLAY")
    dot:SetSize(8, 8)
    dot:SetPoint("TOPRIGHT", -4, -4)
    dot:SetColorTexture(API.Accent())
    dots[frame] = dot
    paint(frame, unit)
end)

my.On("FrameUnitChanged", function(kind, frame, unit) paint(frame, unit) end)
my.On("FrameRemoved", function(kind, frame) paint(frame, nil) end)

-- the player changed their accent: recolor
my.On("StyleChanged", function()
    for frame, dot in pairs(dots) do dot:SetColorTexture(API.Accent()) end
end)

-- someone died or came back
local events = CreateFrame("Frame")
events:RegisterEvent("UNIT_HEALTH")
events:RegisterEvent("UNIT_FLAGS")
events:SetScript("OnEvent", function(_, _, unit)
    local frame = API.GetUnitFrame(unit)
    if frame then paint(frame, unit) end
end)

That's the whole thing. Nothing in it hooks into Daylight UI, so it keeps working when the tiles change in an update.

Only the frame itself is promised, plus the named parts below. What else is inside it (the health bar, the aura row) can change in any update. You can still reach for those (Daylight UI's internals), but your plugin may break when they change. If you need one promised, ask on the Daylight UI Discord.

Named parts

Vendor tiles and recipe lines hand you their own pieces by name, so you can tint them: API.GetPart(frame, "icon") is the icon texture and API.GetPart(frame, "name") the name text. Daylight UI paints them again every time the list fills, and sends FrameStyled right after, so that's where your paint goes.

Restyle a frame

my.Paint(kind, fn, opts) is the one call for changing how Daylight UI's frames look. Your function runs on every frame of that kind already there (a frame made later gets it as it's made), then again right after each time Daylight UI paints one. There are no events to listen to and nothing to hunt down.

local handle = my.Paint("castbar", function(bar, parts, info)
    -- parts: the bar's pieces by name; info: what it shows
end, { owns = { "fill" } })

API.Off(handle)   -- stop: the frames get Daylight UI's look back at once
  • Claiming a piece. owns tells Daylight UI to stop coloring and texturing those pieces; their size, place and shape stay its own. Without it, Daylight UI keeps its look and yours goes on top after each paint.
  • Two plugins, one piece. The first keeps it and the second gets one line in chat. When the first stops, the piece passes on.
  • Errors. Yours carry your addon's name. Daylight UI's own paint has already happened underneath, so the frame still works.
  • info can be nil on the first call, before anything is shown.
KindPartsPaintedinfo
"castbar"fill, bar, back, name, time, iconEach cast or channel, an interrupt, a settingunit, spellID, channel, notInterruptible, interrupted
"platecast"The same as "castbar"Each cast or channel, an interrupt, a settingThe same as "castbar"
"actionbutton"icon, border, band, hotkey, count, macro, cooldown, highlight, pushed, checked, flashA new action in the slot, a change in how it reads (usable, short of power, out of range, a real cooldown starting or ending, a proc, hover or press), a setting. Never on a cooldown tick.API.ButtonInfo's table
"meterrow"bar, fill, back, name, amount, rank, iconSomeone else in the row, a class or mode change, a settingAn API.MeterRows entry
"nameplate"health, healthFill, healthBack, healthText, power, powerFill, powerBack, name, guild, level, dragon, marker, cast, and since 1.23 quest (the quest mark's text), questArt (its objective icon's frame, the texture is .icon), questCount (the 4/10 beside it)A new unit, a recolor (reaction, threat, tapped, a boss or rare color), the level, guild line or power type, a setting. Never on each health change.The unit
"unit", "party", "raid", "partypet"health, healthFill, healthBack, power, powerFill, powerBack, name, level, texts, portrait, classIcon, ring, dragon, model, crest, badges, border, band, style, row, lineA new unit, a recolor (class, reaction, dead, offline), a layout. Never on each health change.The unit
"questrow"title, objectives, bar, iconEach layout of the trackerquestID
"bagslot"icon, count, borderEach fill of the slotbag, slot, itemID, link, quality, count
"shoptile", "craftrow"icon, nameEach fill of the listWhat it shows
"tooltip" (1.12)panel, light, banner, icon, title, bar, and since 1.13 dpsEach time the Rich card is laid out for something new or its lines change{ kind, style, unit | link | spellID }
"rollcard" (1.13)card, line, icon, name, sub, summary, bar, time, buttons (by pick: need, greed, transmog, disenchant, pass), rowsA new roll on the card, each pick, roll and winner, the time running low{ rollID, link, itemID, quality, done, mine, winner, timeLow, sample, players }
"window" (1.19)shell, topLine, rule, title, sub, close, portrait, portraitRim, tabs, bankTabs, headerRight, gripMade, a new title, each look change, the window's own settings{ name }: the window's global name ("DaylightUIBags"...)
"gamewindow" (1.19)shell, topLine, title, closeDressed, each time it shows, each look change{ name }: the game frame's name
"aura" (1.19)Buff bars: icon, edge, edgeR, caps, shade, duration, count, cooldown, badge. Unit frames and raid tiles: icon, shade, duration, count, cooldown, edge (a debuff's), border (a buff's), haloMade, each restyle, a weapon slot's enchant changingBuff bars: { bar, group, helpful, weapon, popout }. Unit frames: { frame, helpful, tile }
"chat" (1.19)panel, area, rule, tabRow, labels, floats, inputs, side, box, boxTopLine, boxTabs, sideTabsEach refresh (a setting, a look change), the edit box changing channel{ style }: "daylight" or "classic"
"infopanel" (1.19)body, xpBox, meterBox, dataBox, meterWindow, arrow, ring, north, buttons (calendar, tracking, mail, each { case, glyph }), location, clock, fps, coords, dataBarEach refresh, the map re-fit, a claimed minimap button lighting or going quietnil, or { button, lit, alert }
"datatext" (1.19)text, iconEach time its text changes, never on a poll that changes nothing{ key, ink }: ink() is the color Daylight UI would draw its number in
"xpbar" (1.19)XP bar: bar, fill, rested, banked, text, restedSpan, shimmer, ticks, repBar, repShine, shell. Reputation bar: bar, fill, text, shine, shellEach XP or reputation change, a setting, a look change{ which, rep, color }
"combattext" (1.19)text, tick, rule, flare (a warning: text)Each line shown, its spell school's color a moment later, a setting{ kind, crit, stream, school, warning }. No amount: it's secret.

On unit frames, ring is the portrait's ring, dragon an elite's dragon around it, model the 3D portrait, crest the elite badge on a frame with no portrait and badges the status icons by name (leader, rest, pvp, level...). style is the frame style it wears ("daylight", "ribbon" or a plugin's "MyPlugin:key"), row its name row above the bar and line its power line under it, in a style that has them. Claim ring or dragon to color them yourself; the red threat band and pulse stay Daylight UI's over a claimed ring.

A piece a frame doesn't have (a raid tile's portrait) is nil. In a fight, another unit's notInterruptible and spellID can be secrets: hand them to setters that take them, never compare or test them. A cast you can't interrupt still shows Daylight UI's warning over a claimed fill. On nameplates, the threat border, glow and pulse stay Daylight UI's over a claimed health fill: they're fight information. API.Parts(frame) gives you any frame's parts.

The kinds added in 1.19

  • Windows. "window" is every Daylight UI window (spellbook, character, bags, NPC, mail, group finder, the question box...). You can claim topLine, rule, portraitRim, tabs, grip and title. The shell is laid out again on every look change, then your function runs, so paint it there. "gamewindow" is each game window the Skins module dresses. Its parts are only what Daylight UI added (the shell, the accent line) or restyled (the title, the X), so you can claim topLine and title. Leave the game's own frame alone: writing to it can break the game's code.
  • Aura icons. The game makes these buttons and locks them in a fight, a boss encounter, a keystone or a PvP match, even between pulls. Your function is never called while they're locked: those paints wait and run once the lock lifts. You can claim edge on the buff bars' buffs and border on the unit frames' buffs. A debuff's edge is its dispel color, drawn by the game, and stays Daylight UI's because it's fight information.
  • Chat. You can claim panel (every chat panel's border), inputs (the edit boxes' borders, which take the channel's color) and boxTopLine. Only Daylight UI's own pieces are parts. The game's chat windows feed its secure code, so leave them alone.
  • Info panel. You can claim ring (with north), buttons, clock, fps and coords. Daylight UI never lights a claimed minimap button: you get { button, lit, alert } when it should.
  • Data texts. A claimed text is drawn without color codes, so your SetTextColor shows. info.ink() gives the color Daylight UI would have used.
  • XP bar. A claimed fill leaves both the fill and the rested part to you.
  • Combat text. You can claim text, tick, flare and rule, and the school's color stays off them too. Lines come fast in a fight, so keep your function short.

Action bars

Since 1.5 the action buttons take Paint like any other frame. Where ElvUI plugins hook StyleButton or LibActionButton's update callbacks, use Paint on "actionbutton": it runs at the same moments, and info says what changed.

-- gray out every button you're short of power for
my.Paint("actionbutton", function(button, parts, info)
    parts.icon:SetDesaturated(info ~= nil and info.noPower)
end, { owns = { "icon" } })

The claims Daylight UI honors on a button are icon (it stops tinting, fading and graying it), border (the border and band stop changing color, so read info.border and light it yourself), hotkey, count and macro (their text color). Only bars 1 to 8 are Daylight UI's own buttons; the stance and pet buttons are the game's.

CallWhat it does
API.ButtonInfo(button)What a button shows and how it reads now, the same table its paint gets: bar, barKey, index, slot, type and id, empty, usable, noPower, outOfRange, cooling (a real cooldown, not the global one), proc, checked, and border (why it's lit: "proc", "pressed", "hover", "form", "active" or nil).
API.BindKeys()Opens key binding mode on the bars, like the Bind keys button on the Action Bars page. false in a fight or with the bars switched off.
API.Glow(frame, on, r, g, b)The Cooldown Manager's glow, easing in and out, on any Daylight UI frame, in your color or the accent. It sits on the frame's API.Attach holder, so it never fights Daylight UI's own glows.
-- light a button while your addon's buff is missing
API.Glow(API.GetActionButton(1, 3), MyAddon:BuffMissing(), 1, 0.8, 0.2)

The bars are made when the game loads, so a plugin can't add bars of its own.

Texts, internals and settings

Your own texts on the unit frames

my.AddText("shards", {
    label = "Soul shards",
    on = { "power" },            -- redrawn on the frame's own power updates
    events = { "UNIT_AURA" },    -- or on game events whose first value is a unit
    text = function(unit, frame) return "3", 0.6, 0.3, 1 end,   -- text, then an optional color
    sample = "3",                -- shown in test mode and the options preview
})

Players pick it in a frame's Extra text. on can be "health", "power", "identity", "flags" or "roster". The text can be a secret: it's passed to the font string whole. If your addon is removed later, a text a player picked just shows nothing.

Daylight UI's internals

When nothing on this page does what you need, use Daylight UI's own code: it's all there to call, read and hook. The core is the global DaylightUI (DaylightUI.Style, DaylightUI.Widgets, DaylightUI.Motion...), each module's parts are DaylightUI:GetModule(name).ns, and reading Daylight UI's files tells you what each one does.

Internals can break with any update. Only the calls on this page are promised. Daylight UI's own functions, tables and frame pieces can be renamed, moved or changed in any update, even a small fix, with no warning. Your code then does nothing or errors, and keeping up is up to your addon.
  • Check whether a call on this page does the job first, even a little less neatly.
  • Read internals carefully: check a table or function is there before you use it, so an update makes your feature quietly stop instead of throwing errors at players.
  • Test your plugin after each Daylight UI update.
  • Say what you reached in for on the Discord: a call several plugins need is likely to become a promised one.

To change what one of Daylight UI's functions does, hook it:

local UF = DaylightUI:GetModule("UnitFrames").ns.UF

local h = my.Hook(UF, "Layout", function(frame, cfg)
    -- runs after Daylight UI's
end)

my.Wrap(UF, "PaintName", function(original, frame, ...)
    original(frame, ...)   -- call it, change what goes in, or skip it
end)

my.Unhook(h)

Only Daylight UI's own functions can be hooked: the core DaylightUI, a module's ns, or a table up to four tables inside either. A frame or one of the game's tables (even one Daylight UI keeps a reference to) is refused with one line in chat, since hooking the game's would break its own calls. Several addons can hook the same function. If your Wrap errors, Daylight UI's function runs instead, so the frame keeps working.

Settings next to Daylight UI's

my.AddDefaults("UnitFrames", { neonGlow = 0.5 })

Your settings are saved in the player's profile with Daylight UI's own. A name Daylight UI already uses is refused. While your addon is switched off, its saved values stay, so they're back when it is.

On the Plugins page

General > Plugins lists each plugin with its author and version, a switch to turn it off for that character, and one line on what it changes, like "Paints cast bars. Adds 1 text. Hooks 2 functions."

The vendor and profession windows

Since 1.2 the lists in two Daylight UI windows are frames you can build on, the same way as raid tiles: the item tiles at a vendor and the recipe lines in the profession window. They're reused as the list changes (a search, another vendor, a skill-up), so treat them like nameplates: FrameUnitChanged when one shows something else, FrameRemoved when it's hidden or the window closes, and FrameStyled after every fill.

Marking items at a vendor

The vendor's list fills again whenever your money or bags change, so FrameStyled is also your refresh after a purchase. API.ShopItem(tile) tells you what a tile holds: tab, index, itemID, link, where tab is "buy" or "buyback" and index is the game's own, for GetMerchantItemInfo.

-- gray out the grimoires the player already knows
my.On("FrameStyled", function(kind, tile)
    if kind ~= "shoptile" then return end
    local tab, index, itemID = API.ShopItem(tile)
    if tab == "buy" and itemID and MyAddon:Known(itemID) then
        API.GetPart(tile, "icon"):SetVertexColor(0.4, 0.4, 0.4)
        API.GetPart(tile, "name"):SetTextColor(unpack(API.Colors().OFF))
    end
end)

A tile that keeps its place but holds another vendor's item gets FrameUnitChanged with the same unit, so read API.ShopItem again there. For a badge of your own, draw on API.Attach(tile) as with any other frame.

The profession window

EventGives youWhen
CraftShownThe window opened.
CraftHiddenIt closed.
CraftProfessionChangedskillLineIt shows a profession, on opening too.
CraftRecipeSelectedrecipeIDA recipe is picked: a click, your own call, or the first one when a profession opens.
CraftStartedrecipeID, countCreate or Create all started.
CraftMaderecipeID, done, countOne more made.
CraftStoppedrecipeID, done, countMaking ended: all made, stopped, or a cast failed.
CallWhat it does
API.SelectCraftRecipe(recipeID)Picks a recipe as a click would: it lights up, scrolls into view and shows on the right. true when it did.
API.GetCraftProfession()The open profession: skillLine, name, or nil while the window is shut.
my.AttachCraftPane(width)A panel of yours on the window's right edge.
-- a side panel that follows the picked recipe
local pane = my.AttachCraftPane(220)
local title = API.Text(pane, "head")
title:SetPoint("TOPLEFT", 14, -14)

my.On("CraftRecipeSelected", function(recipeID)
    title:SetText(C_TradeSkillUI.GetRecipeInfo(recipeID).name)
end)

The pane is the window's full height, in its shell. It moves, scales, opens and closes with the window, and the game's other windows make room for it. Two plugins' panes sit side by side. Ask again with another width to resize yours.

Players can switch these windows off, or use DaylightMogul's in their place. Then there are no tiles, lines, pane or Craft events. If your addon should work either way, listen to the game's own MERCHANT_SHOW and TRADE_SKILL_SHOW too.

Look like you belong

If you want your pieces to match Daylight UI, use the same tools it uses. They all read the player's font, accent and sizes at the moment you call them, so call them when you paint and again on StyleChanged.

CallWhat you get
API.Skin(frame, opts)The Daylight UI border, band, bevel and shadow, on any frame. Pass { window = true } for a window.
API.Text(parent, size, justify)Text in the player's font. Sizes are "tiny", "small", "body", "head" and "title".
API.Bar(parent)A status bar with the Daylight UI gradient fill
API.Button(parent, text, height)The Daylight UI button, with its hover trace and click sound
API.MainButton(button, on)Since 1.8. Makes an API.Button your window's main action, like Daylight UI's Accept buttons: a lifted band, green text and lights moving round its edge in the glow style the player picked. They rest while the button is off, the player picked Off, or has motion off. on = false makes it plain again. One per window.
API.GlowStyles()Since 1.9. The glow styles a player can pick, yours and other plugins' included: a list of { key, label }, Daylight UI's five first (circle, comet, breathe, twinkle, shine).
API.GlowAround(frame, on, opts)Since 1.9. Runs a glow style round any frame of yours. opts: style (a GlowStyles key; Circling when left out), r, g, b (one color, else the accent's two ends), inset (in from the edges, negative = outside), thick (a strip's width), size (a light's size). It eases in and out; the player's motion off keeps it away.
API.Close(parent, onClick)The close X from every Daylight UI window
API.Switch(parent)An on/off switch
API.Input(parent, opts)A text box. { search = true } makes a search box, onChange tells you what was typed.
API.Menu(owner, keys, values, current, onPick)A dropdown menu
API.Accent()The player's accent color as r, g, b
API.Colors()The text colors:VALUE for numbers, TEXT for sentences, LABEL for labels, plus GOOD, WARN, BAD and a few more
API.Font()The font file the player picked, read when you call it. A font you register with LibSharedMedia (LSM:Register("font", "My Font", file)) is offered everywhere in Daylight UI as "lsm:My Font".
API.ClientFont()Since 1.23. The client's own font, which writes every language (Korean, Chinese, Russian). Use it where your own font would show boxes.
API.FontFile(key)The file of a font your font row saved. "general" is the player's font.
API.ClassColor(token)A class color, softened to match the unit frames
API.Fade(region, alpha, speed)Eases something of yours to an alpha. Speed is "FAST", "NORMAL" or "SLOW".
API.Speed{ FAST = 0.12, NORMAL = 0.2, SLOW = 0.4 }, the only three speeds Daylight UI uses, for your own animations.
API.BarMotion(bar, kind, style, unit)Since 1.23. Daylight UI's bar animations (Flow, Tide, Comet and the rest) on a StatusBar of your own. kind is "health", "power", "cast" or "swing"; style is a key of API.BarMotions() ("none" first), or "none" to stop; unit lets Tide react to its hits and heals.
API.Tab(parent, text, opts)Since 1.18. A text tab: tan at rest, light on hover, the accent when picked, with an underline that grows from the middle. b.Pick(on), b.SetOff(on), b.FitWidth(pad, min).
API.TabLook(button, store, text, opts)Since 1.18. The same look on a button of your own. You call s.Paint(over) on hover and s.Pick(on, animate).
API.Link(parent, size, opts)Since 1.18. A quiet text link that turns the accent on hover as an underline grows. b.SetLabel(text).
API.Chip(parent, text)Since 1.18. A small rounded pill that fills with the accent when picked. b.SetOn(on), b.FitWidth().
API.Icon(parent, file, size, color, layer)Since 1.18. One of Daylight UI's icons (a picture in its Media folder, like "gear-small.png"), tinted.
API.IconButton(parent, file, tip, onClick, size, desc)Since 1.18. A bare icon as a button: tan at rest, the accent on hover, its name in a tooltip.
API.Money(parent, opts)Since 1.18. Gold, silver and copper boxes to type an amount. c.Copper(), c.Set(copper), c.Focus().
API.ProgressBar(parent, height)Since 1.18. The rounded progress pill from Daylight UI's windows. Color it with API.BarAccent(bar, alpha).
API.Scroll(scrollFrame, opts)Since 1.18. The thin scroll pill beside a list, with a gliding wheel. bar.Update() after you refill.
API.Rule(parent, vertical), API.Light(texture, on, instant)Since 1.18. A faint divider, and a row's hover highlight easing in and out.
API.Grip(window, opts)Since 1.18. A resize grip in the bottom-right corner, with min, set, save, resized and reset.
API.PaintAccent(texture, alpha, orientation), API.CardColors()Since 1.18. Fills a texture with the accent (its gradient when the player picked one), and the options window's surface colors. API.LINE is how tall the accent line along a window's top is.
API.Caster(spec)Since 1.18. A secure cast button laid over a row of your window, so a click on the row casts. It hides when a fight starts.

None of this is required. It's there if you want a plugin that feels like part of the UI.

Your own look

A plugin with a look of its own is just as welcome: its own textures, fonts, colors and shapes, on its own windows or over Daylight UI's frames. From the smallest change to the biggest:

  • A whole look at once: my.AddTheme (Themes): your accent, fonts, textures, borders, shell style, window motion and sounds, as one card players apply.
  • Every frame's border, corners and shadow: my.AddShellStyle (Shell styles), picked by players in General.
  • How windows open and close, the accent, the UI sounds: my.AddWindowMotion, my.AddAccent, my.AddSoundSet (Motions, accents and sounds).
  • One piece of one kind of frame: my.Paint with owns (Restyle a frame). Daylight UI stops coloring and texturing what you claim. Since 1.19 that reaches its windows, the game's windows it dresses, buff and debuff icons, the chat, the info panel and minimap, data texts, the XP bar and combat text too.
  • A whole piece drawn your way: my.StandIn (Whole-UI plugins) turns Daylight UI's player frame, raid frames, buff bars, XP bar and more off while yours stands in.
  • Pieces of your own on a frame: draw them on API.Attach(frame), in any look.
  • Unit frames shaped your way: my.AddFrameStyle (Frame styles), with your own heights and pieces.
  • Your own glow: my.AddGlowStyle (Glow styles).
  • Anything else: a shell style covers every shell. When it can't do what you need, every border, band, shadow and background Daylight UI puts on a frame is laid out by DaylightUI.Style.LayoutShell, every text it makes comes from Style.Text, every button from DaylightUI.Widgets.Button. Wrap them and your look reaches every frame, including ones made later and every redraw after a settings change.
local my = DaylightUI.API.For("Brutal")
my.Wrap(DaylightUI.Style, "LayoutShell", function(original, shell, ...)
    original(shell, ...)   -- or skip it and draw the whole shell yourself
    Brutal:Dress(shell, shell:GetParent())
end)

Wrap when your file loads: Daylight UI loads first and builds most of its frames at login, after you. Frames already on screen pick it up at the next redraw (DaylightUI.NotifyStyleChanged() asks for one, once the fight is over). These are Daylight UI's internals, not promised calls, so they can break with an update.

Settings

Plugin settings live in a module, the same way Daylight UI keeps its own. That way they're saved in the player's profile, copied when they copy a profile and shared when they share one.

DaylightUI:RegisterModule("ResReminder", {
    plugin = "ResReminder",
    label = "Res Reminder",
    defaults = { dots = true },
    OnEnable = function(mod) --[[ start up ]] end,
})

local on = API.GetSetting("ResReminder", "dots")

Since 1.23, my.Get(module, path) and my.Set(module, path, value) read and change your own modules' settings (those registered with plugin = "<your name>"). Get already works while your files load, before login: it reads what's saved, or the default once the module is registered. Read a choice there that decides how your addon builds itself. API.IsModuleEnabled(name) says whether one of Daylight UI's modules is on: "UnitFrames", "Nameplates", "ActionBars", "Buffs", "Tooltip", "InfoPanel", "Quests", "Chat", "Bags", "Skins", "QoL".

Pages you add to the module's options show up in your own section of the options window:

DaylightUI:RegisterModule("ResReminder", {
    plugin = "ResReminder",
    label = "Res Reminder",
    defaults = { dots = true, size = 8, font = "general" },
    options = { pages = {
        { id = "main", label = "Res Reminder", desc = "One line under the page's title.",
          groups = {
              { label = "Dots", items = {
                  { type = "toggle", key = "dots", label = "Mark dead players",
                    desc = "A small dot on the tile of anyone who needs a res." },
                  { type = "slider", key = "size", label = "Dot size", min = 4, max = 16, step = 1, unit = "px",
                    disabled = function(get) return not get("dots") end },
                  API.FontRow("font", "Font", "The font of the res count."),
              } },
          } },
    } },
})

Every kind of row

TypeFields
toggleAn on/off switch.
slidermin, max, step, unit ("px", "%" or "x")
dropdownvalues = { key = "Shown word" }
colorA color picker, its value { r, g, b }
buttonfunc, run on a click. No key.
textA line of words on the page. No key.
customSince 1.22. A row you draw yourself, the card's full width: build(row) once, update(row) each time the page refreshes, height(row) (one row's height when left out). Below.
API.FontRow(key, label, desc)The font picker Daylight UI's own pages use, each font shown in itself. Its value is a font's key; "general" follows the player's font. Turn it into a file with API.FontFile.

Every row takes label and desc (one or two sentences on what it does in play), disabled and hidden (functions of get, which reads your settings), and reload = true when the change needs a /reload. Rows with a value take a key: on your own pages its default sits in the module's defaults; on a group you put on a Daylight UI page, give the row a default.

Custom rows

Since 1.22. For anything the other types can't show (a list of spells, an editor, a preview of your own), a custom row hands you the row to draw in:

{ type = "custom", label = "Tracked spells",                    -- the label is only for errors
  build = function(row) MyAddon:BuildList(row) end,             -- once, when the page is first built
  update = function(row) MyAddon:FillList(row) end,             -- each time the page refreshes
  height = function(row) return 24 * #MyAddon.spells + 8 end }  -- its height

Draw with API.Text, API.Button, API.Switch, API.Input and the rest so it looks like the page around it. A card holding a custom row spans every column. An error in your functions is said once and leaves the row empty; the rest of the page keeps working. Search finds the page and its other rows, never what you draw yourself.

A live sample above your page

Since 1.22, like the one over Daylight UI's frame pages. Give the page sample = function(parent) ... end, returning { frame, Refresh }: frame is a frame you made on parent, and Refresh(width, room) draws it width wide, at most room high, and returns the height it used (0 hides the strip). It's made the first time the page shows, and Refresh runs each time the page lays out, so a changed setting shows in it at once. hint adds a short line under it. An error in either is said once and the page shows no sample.

Opening the options window

Since 1.23. API.OpenOptions(page, setting) opens it at a page ("<Module>.<id>", a Daylight UI page, or "plugin:<name>" for your section), scrolled to a setting's row. API.RefreshOptions() redraws the open page, and API.IsOptionsShown() says whether it's open.

Putting a group on a Daylight UI page

Sometimes a setting belongs next to the ones it works with. A healer plugin's switch makes more sense on the Raid page than off in its own corner.

my.AddOptionsGroup("UnitFrames.raid", {
    label = "Res reminder",
    items = {
        { type = "toggle", key = "dots", label = "Mark dead players",
          desc = "A small dot on the tile of anyone who needs a res." },
    },
})
  • The group shows up with "From ResReminder" next to its title, so players know where it came from.
  • Rows save into your module's settings and leave the Daylight UI settings alone. Your module has to be registered (the scope is your plugin's name, or scope = "..." on the group).
  • Page names are the module and the page, like "UnitFrames.raid", "UnitFrames.castbars", "Nameplates.plates", "Nameplates.auras" or "ActionBars.bars".
  • If the page isn't there yet (its part of the UI is off, say), your group waits and appears when the page does.
  • A row Daylight UI can't read (a typo in its type, a missing label) is left out with one line in chat. The rest of the page keeps working.
  • The General > Plugins, Profiles and Gradients pages rebuild themselves, so they don't take groups from plugins.

Movers, fades, commands and skins

These go through your API.For handle, so your names can't clash with anyone else's.

-- an unlock handle for your frame, with the same grid and magnets as the rest of the UI
my.RegisterMover(myFrame, "panel", "Res Reminder", { "CENTER", nil, "CENTER", 0, -200 })

-- the four fade choices every part of Daylight UI has; its settings live at path in your module
my.RegisterFade({ key = "panel", scope = "ResReminder", path = "fade",
                  frames = function() return { myFrame } end })

-- /dui res
my.RegisterCommand("res", function(rest) print("Res Reminder", rest) end, "Res Reminder settings")

-- a box for your piece in the test mode panel (listen to TestModeChanged to show samples)
my.RegisterTestPart("dots", "Res dots")

-- dress another addon's window in the Daylight UI look once that addon loads
my.RegisterSkin("SomeAddon", function(Kit)
    if not SomeAddonFrame then return false end   -- not made yet: asked again later
    Kit.Window(SomeAddonFrame)
    Kit.Auto(SomeAddonFrame)
end)

A settings button on your mover (1.22). Pass a fifth argument and the handle gets a settings button, as Daylight UI's own handles have:

my.RegisterMover(myFrame, "panel", "Res Reminder", { "CENTER", nil, "CENTER", 0, -200 },
    { page = "ResReminder.main", setting = "size" })

The button leaves unlock mode and opens the options window on page, scrolled to the setting row and flashing it. page is one of your module's pages, or a Daylight UI page you added a group to ("UnitFrames.raid"). Leave out setting to just open the page. Give scope when that row saves in a module of yours with another name than your plugin. While the page isn't there (its module off), the handle has no settings button.

A /dui word that's already taken is refused with a line in chat. Since 1.22 each skin also gets its own switch for the player, under Extras > Game window skins > Other addons, named after the addon it dresses. It's on unless the player turns it off (that takes a /reload), and while it's off your function never runs. RegisterSkin returns false when the Daylight UI Skins module isn't installed or is turned off for that character. If it just hasn't loaded yet, your skin waits for it.

What the Kit holds

Kit is the set of tools the built-in skins use on the game's own templates. Most windows need only the first two.

CallFor
Kit.Window(frame, opts)A whole window: its art gone, the window shell, the title font, the close X
Kit.Auto(root, opts)Walks a window and dresses every control in it: buttons, boxes, tabs, checkboxes, dropdowns, scroll bars, item buttons, bars. opts.skip is a set of frames to leave alone.
Kit.Panel(frame), Kit.Inset(frame), Kit.SidePane(pane)A side panel, an inset a shade darker, a detail pane beside a list
Kit.Button, Kit.Close, Kit.Tab, Kit.SideTab, Kit.Check, Kit.EditBox, Kit.DropdownOne control of the game's templates
Kit.IconButton, Kit.PageButton, Kit.CollapseButtonA small icon button, a Prev or Next button, a list heading's +/-
Kit.Item(btn), Kit.Slot(slot)An item button, an equipment slot: the icon cropped, the quality outline
Kit.StatusBar(bar), Kit.ProgressBar(bar)A status bar, a bar drawn with textures
Kit.ScrollBar(bar)A scroll bar, old style or new: the thin pill, the arrows hidden but still there
Kit.EachRow(box, fn, key)A ScrollBox list: fn(row) for every row now and after each update, since rows are reused
Kit.Row(row, keep, selected, shell)One list row. selected is a function of the row (or the game's selection texture); shell = false draws a plain line instead of a box. Kit.RepaintRow(row) after the pick changes.
Kit.Strip(frame), Kit.Font(fs, size), Kit.Light(fs)Hide a frame's art, put the player's font on text, make dark parchment text light
-- a ScrollBox list in the Daylight UI look
Kit.EachRow(SomeAddonFrame.ScrollBox, function(row)
    Kit.Row(row, nil, function(r) return r.isSelected end, false)
end)
Kit.ScrollBar(SomeAddonFrame.ScrollBar)

Your data in a data text slot

The data texts (the strip under the minimap and the data bar along the bottom) take any LibDataBroker-1.1 object, the way most data bars do. Make one and it shows up in every slot menu under Info Panel > Data texts, next to the Daylight UI texts. There's nothing else to call, and the same object works in any other broker display.

local ldb = LibStub("LibDataBroker-1.1")
local obj = ldb:NewDataObject("ResReminder", {
    type = "data source",   -- or "launcher"
    label = "Res",          -- the word before the text
    text = "0",             -- or value = 0, suffix = "dead"
    icon = "Interface\\Icons\\Spell_Holy_Resurrection",
    OnClick = function(slot, button) end,
    OnTooltipShow = function(tooltip)
        tooltip:AddLine("Dead group members")
    end,
})
obj.text = "2"   -- every slot showing it redraws
  • Ship the library yourself. Daylight UI only reads LibDataBroker-1.1; bring it (with LibStub and CallbackHandler-1.0) in your addon.
  • Colors. Your text can carry color codes. Without any, it takes the player's accent, like the built-in texts. Your icon keeps its own colors; iconCoords and iconR/iconG/iconB are followed.
  • Your own tooltip. Give OnEnter(slot) and OnLeave(slot) instead of OnTooltipShow and the hover is yours.
  • Late objects. An object made after login (an addon loaded on demand) joins the menus then. A slot the player set to it stays empty until it's made, then fills.
  • No protected actions. OnClick runs from a plain button, so it can't cast spells or use items.
  • Lots of changes are fine. Changes are gathered for a tenth of a second before a redraw.

A data text of Daylight UI's own kind

Since 1.6 you can skip LibDataBroker, the way ElvUI's DT:RegisterDatatext works. Daylight UI draws it, redraws it on your events and builds its tooltip in its own look.

my.AddDataText("fish", {
    label = "Fish",                               -- its name in the slot menus
    events = { "BAG_UPDATE_DELAYED" },            -- redrawn on these
    text = function() return "Fish", GetItemCount(6303) end,   -- label, value[, r, g, b]
    tooltip = function(tip)
        tip.Line("Raw Slitherskin", GetItemCount(6303))
        tip.Hint("Click: open your bags")
    end,
    click = function(button, slot) ToggleAllBags() end,
})
my.UpdateDataText("fish")   -- redraw it now, from anywhere
  • The text. text() returns a label and a value, plus a color if you want one. The label is tan and drops first on a narrow strip; the value takes the accent unless you color it. Plain strings or numbers only: a secret shows nothing.
  • Redraws. events redraw it, and onEvent(event, ...) runs first to keep your own state. poll = true redraws it twice a second, for something like a clock; use events when you can.
  • The rest. tooltip(tip) gives you Title, Line, Text and Hint. click and wheel run from plain buttons, so no protected actions. icon shows where the player has icons on, and sample is what test mode shows.
  • Saved by name. It's saved as "YourPlugin:fish", so a player's pick stays put across updates.

Data panels of your own

Also since 1.6, the way ElvUI's DT:RegisterPanel works: slots on a frame of yours, drawn like the Daylight UI strip. The player Shift+right-clicks a slot to pick its text from every data text there is, and the picks are kept in their profile.

local strip = CreateFrame("Frame", nil, UIParent)
strip:SetSize(360, 20)
strip:SetPoint("BOTTOM", 0, 4)
API.Skin(strip)
my.AddDataPanel("bottom", strip, { count = 3, slots = { "gold", "Angler:fish", "bags" } })

count is 1 to 5, slots the first picks, and labels, icons and textSize change the look. The slots follow the frame's size and show while it does. It needs the Info Panel module on.

The damage meter

Since 1.6. The Daylight UI meter reads the game's own damage meter. These calls see what its windows show, and the meter rows take Paint like the other frames.

CallWhat it does
API.MeterWindows()Every meter window: { id, kind, name, mode } each. id is "main" (the panel's meter), "threat" or one the player made ("w2"...).
API.GetMeterWindow(id)The window's frame, to put something beside it.
API.MeterRows(id)Everyone it shows now, in order: { rank, name, class, amount, perSecond, isMine, guid, mode, window, sample }. In a fight names and amounts can be secrets: hand them to SetText or a bar, never compare them.
API.MeterModes()Every mode: { key, name, group }.
API.SetMeterMode(id, mode)Switches a window's mode, as its header's menu does.
API.ResetMeters()Clears every fight without asking.
API.OpenMeterBreakdown(id, rank)Opens the spells, targets and death log of the player at that rank, as a click on their row does.

Listen to MeterFightStarted, MeterFightEnded (with the fight's length in seconds, once the game has filed it) and MeterReset.

-- your own row's bar in gold
my.Paint("meterrow", function(row, parts, info)
    if info and info.isMine then parts.fill:SetVertexColor(1, 0.8, 0.2) end
end, { owns = { "fill" } })

A row is painted when it shows someone else, a class or mode changes, or a setting does, never on every redraw. The claims honored are fill, name and amount.

Tooltips

Since 1.7, your own lines on Daylight UI's tooltips, in its look:

my.AddTooltipLines("item", function(lines, data)
    if data.itemID ~= 6303 then return end
    lines.Row("Fish caught", MyAddon.caught)            -- a label and its value
    lines.Bar("Collection", MyAddon.have, MyAddon.of)   -- a row with a thin bar under it
    lines.Tag("Rare find", { 0.3, 0.6, 1 })             -- a tag beside the card's own
end)

The player picks one of two looks: Rich, Daylight UI's own cards drawn over the game's tooltip, or Simple, the game's tooltip in Daylight UI's look. Say what your lines are, and each look draws them its own way.

The kind is "unit" (data.unit), "item" (data.link, data.itemID), "spell" (data.spellID, auras too), and since 1.12 "world" (a node, a chest, a mailbox: data.name) and "compare" (the compare tooltip of what you have on). data.style is "rich" or "simple".

PieceRichSimple
lines.Line(label, value, color) / lines.Row(...)A row: label soft white, value white or colorA line with two sides
lines.Text(text, color)A sentence, wrappedThe same
lines.Hint(text)Small, in the accentA line in the accent
lines.Gap()A little roomA blank line
lines.Bar(label, value, max, color) (1.12)A row "value / max" and a thin bar"label value / max"
lines.Tag(text, color) (1.12)A tag in the card's headerA line
lines.Section(title) (1.12)A small heading in the accentA line in the accent
lines.Tiles({ { value, caption, color }, ... }) (1.12)Value tiles side by sideOne line, "value caption · value caption"

Colors are { r, g, b }. A line already there is never added twice, so it's fine that item tooltips refill several times a second. A value the game keeps secret comes to you as nil. On the Rich card your pieces show even when the player hides other addons' lines. Nothing runs while another addon styles the tooltips instead.

API.TooltipStyle() (1.12) is "rich", "simple", or nil while Daylight UI's tooltips are off, and TooltipStyleChanged(style) says when the player switches. To restyle the Rich card itself, use my.Paint("tooltip", fn) (Restyle a frame).

The setup guide

Since 1.7 a plugin can add its own page to the setup guide:

my.AddSetupStep({
    id = "look", title = "Angler", desc = "How the fishing bar looks.",
    groups = { { label = "Size", rows = { { "Angler", "barSize" } } } },
    onFinish = function() MyAddon:SetUpOtherAddons() end,
})

Your page comes after Daylight UI's own pages, before Finish. Each row is a { scope, key } pair for a setting that's already on an options page, yours or one you added with AddOptionsGroup. The player's picks are a draft until Finish, and closing the guide takes them all back, yours included. onFinish runs on Finish, then the guide asks for a reload. quick = true puts your page in Quick setup too.

A setup guide of your own

Since 1.10, like ElvUI plugins' installers: your own pages in the setup guide's window, shown once Daylight UI is set up on the character.

my.AddInstaller({
    version = 1,   -- raise it to show the guide again
    pages = {
        { title = "Welcome to Angler", text = "Angler adds a fishing bar and a catch log.",
          buttons = { { text = "Set up chat", onClick = function() MyAddon:SetUpChat() return "Chat set up" end } } },
        { title = "Size", groups = { { label = "Size", rows = { { "Angler", "barSize" } } } } },
    },
    onFinish = function() MyAddon.db.installed = true end,   -- return true to ask for a reload
})

Pages take the same fields as AddSetupStep, plus title and desc. Several plugins' guides show one after another, then one reload for all of them if any asked. It's seen once per character at each version (account = true: once per account), and closing it counts as seen. my.ShowInstaller() opens it again, and General > Plugins has a Setup guide button for it.

Since 1.23, the events SetupShown and SetupClosed and API.IsSetupShown() tell you when Daylight UI's own setup guide is up: wait for it to close before you show anything of your own. Since 1.24, my.InstallerSeen() is the version of your guide this character went through, 0 for never, so you can tell a fresh install from an update.

The Cooldown Manager

Since 1.7 each placed spell in the Cooldown Manager is a frame of kind "cdmpiece". You get FrameMade, FrameUnitChanged and FrameRemoved as pieces are placed and taken away, and API.Attach and API.Glow work on them. Since 1.14 you can also ask what a spell reads right now, and follow one spell with a single call.

my.WatchCooldown(12294, {   -- Mortal Strike, any rank
    ready = function() API.Glow(API.GetCooldownPiece(12294), true) end,
    started = function() API.Glow(API.GetCooldownPiece(12294), false) end,
    changed = function(state)
        if state and state.usable and not state.onCooldown then
            -- castable right now
        end
    end,
})
CallWhat it does
API.GetCooldownPiece(spellID)The piece showing that spell, while it's placed and shown. Any rank of the spell finds it, and so does the piece's key.
API.CooldownPieceInfo(frame){ key, spellID, shape, drawnBy, chain }, where shape is "icon" or "bar". chain (1.14) is the key of its group's first piece, so pieces with the same chain sit together.
API.CooldownState(what) (1.14)What a shown piece reads now, by its frame, a spell id (any rank) or its key: ready and onCooldown (a real cooldown, never the global one), usable (castable now), noPower (only short of power), proc, buffUp (as the game's own Cooldown Manager sees it), glowing, plus what CooldownPieceInfo gives. nil for a spell with no piece on show.
my.WatchCooldown(what, handlers) (1.14)One spell's moments in one call: ready, started, usable, buffUp, buffDown (spellID, key), proc (spellID, key, on), and changed(state), called at once and after each moment. Returns a handle for API.Off.
API.OpenCooldownEditor() (1.14)Opens the layout editor, as /cdm does. false in a fight or with Daylight UI's Cooldown Manager off.

Events, each with the spell id and the piece's key: CooldownStarted and CooldownReady, at the same moments Daylight UI's own light runs. Since 1.14 also CooldownUsable (it turns castable while off cooldown, like a block for Revenge, not just rage coming back), CooldownProc (the game's spell alert on or off, with true or false; few spells have one on WoW: Forever), CooldownBuffUp and CooldownBuffDown.

Every answer is a plain value, never a secret, so you can compare it and use it in an if in a fight. Where the game won't say, the answer is nil, never a guess. A buff-only piece hides while its buff is down (unless its group shows missing buffs), so it has no state then; CooldownBuffDown came just before. What draws inside a piece (often the game's own icon) isn't yours to change: draw on its API.Attach frame.

Proc Alerts

Since 1.16. Proc Alerts lights a painted flare around the character when a proc is ready. You can read and follow them, and show alerts of your own in the same flares.

local my = API.For("MyPlugin")
my.AddProcAlert("lust", { name = "Bloodlust", design = "crown", anim = "flash" })
my.WatchProc("overpower", {
    shown = function(key, stacks) -- Overpower is ready end,
    hidden = function(key) end,
})
-- When your own trigger fires:
my.ShowProcAlert("lust", { left = 40, dur = 40 })
CallWhat it does
API.ProcAlerts()The procs this character can be alerted to, its class's and then the gear ones: { key, name, spellID, itemID, design, enabled, drawnBy }. drawnBy is "daylight", or "game" for a buff the client shows by itself, which has no state and no events.
API.ProcState(key)A flare that's up right now: { key, stacks, left, dur, test }, times in seconds. nil when it isn't up.
API.TestProcAlert(key, seconds)Shows a proc's flare for a while (10 seconds by default), like the options' Show button: no sound and no events.
my.WatchProc(key, handlers)One proc's moments: shown, renewed (key, stacks), hidden (key), and changed(state), called at once and after each moment. Returns a handle for API.Off.
my.AddProcAlert(key, spec)An alert of your own: name, design ("wings", "talons", "pillars", "shards", "flames", "bolt", "comet", "crown", "sigil", "sun", "ring", "wave"), anim ("breathe", "pulse", "impact", "flash", "still"), stacks, sound. Others see its key as "MyPlugin:lust".
my.ShowProcAlert(key, info)Shows your alert or updates it: left and dur (it shortens as time runs out), stacks. It stays until you hide it, or the player turns Proc Alerts off.
my.HideProcAlert(key)Takes your alert away.

Events: ProcShown and ProcRenewed (key, stacks) and ProcHidden (key), for real procs and plugins' alerts, never for a test flare or a look change. The flares are pooled and placed in lanes so two never overlap, so there's no flare frame to hold on to: dock to API.GetFrame("procs"), the area they hang in. Every answer is a plain value, safe in a fight, and nil or false while Proc Alerts is off.

XP orbs

Since 1.17. When the player gains experience, Daylight UI's XP orbs bloom where it came from (the mob, the talk window's Complete button, the zone name) and fly into the experience bar, which fills as they land. You can follow them and fly orbs of your own.

local my = API.For("MyPlugin")
my.On("XPGained", function(amount, kind) if kind == "quest" then print("Quest XP:", amount) end end)
-- A burst from the cursor, when your own reward happens:
local x, y = GetCursorPosition()
local s = UIParent:GetEffectiveScale()
my.ShowXPOrbs(x / s, y / s, 10)
CallWhat it does
API.XPOrbs()The player's orb settings: { on, size, flight, color }. on is false while XP gain effects or Motion effects are off, or the XP Orbs addon is loaded. size is a scale (1 = normal), flight the seconds each orb flies, color one of "bar", "accent", "daylight", "gradient", "class", "custom". nil while the info panel is off.
my.ShowXPOrbs(x, y, count)A burst of count orbs (12 by default, at most 30) from x, y (UIParent units from its bottom-left) into the experience bar, in the player's size, speed and color. It only looks: the bar keeps its value and no event fires. false while the orbs are off or the bar isn't on screen.

Events: XPGained (amount, kind, x, y, known) once Daylight UI knows what a gain was: kind is "kill", "quest", "explore" or "other", and x, y is where its orbs bloom. known is false for a default spot: nameplates can't be measured, so a mob's place is where the cursor last was over it. XPOrbsLanded (amount) as a gain's last orb lands. Both fire only while the orbs are on, never for a plugin's own burst, and carry plain values, safe in a fight.

Quests

Rows in the quest menu

my.AddQuestMenu("route", {
    label = "Route to this quest",   -- or function(quest) return "..." end
    show = function(quest) return MyAddon.CanRoute(quest.questID) end,   -- optional
    onClick = function(quest) MyAddon.Route(quest.questID) end,
})

Since 1.11. Your row shows in the right-click menu of a quest, in the quest tracker and in the quest journal, just above Stop tracking and Abandon. quest has questID, title, level, zone and state ("active", "ready" or "failed"). show returning false leaves the row out for that quest. The menu is asked fresh each time it opens. my.RemoveQuestMenu(key) takes the row away, and an error in your functions leaves only your row out.

Slots beside a quest's title

local marks = {}
my.AddQuestSlot("voiced", {
    width = 16,                                                          -- 0 to 64 pixels
    show = function(quest) return MyAddon:HasVoice(quest.questID) end,   -- optional
    draw = function(slot, quest)
        local b = marks[slot]
        if not b then
            b = API.IconButton(slot, "ui-play.png", "Play", function() MyAddon:Play(b.questID) end, 16)
            b:SetPoint("CENTER")
            marks[slot] = b
        end
        b.questID = quest.questID
    end,
})

Since 1.22. Room of your own at the right end of each quest's title in the quest tracker, the way other addons put icons on the game's tracker. The title wraps sooner by width (plus a 2 pixel gap) so nothing covers it, and draw(slot, quest) gets a plain frame there, width wide and as tall as the title's first line, after every layout of the tracker. quest is the same as for menu rows. show returning false gives that title its full width and hides your slot. Several plugins' slots sit side by side, the first added furthest right, left of Daylight UI's own marks.

  • Slots are reused as quests come and go: make your pieces once per slot, and set everything from quest on each call. A slot hides with its row.
  • Keep it cheap. show and draw run for every quest on every layout. An error is said once, and that slot stays hidden while the tracker carries on.
  • Nothing secure. The tracker's rows move in a fight, so don't put a cast button on a slot.
  • my.RefreshQuestSlots() lays the tracker out again when your own state changes, so every draw runs. my.RemoveQuestSlot(key) takes it away. Calling AddQuestSlot again with the same key replaces it. With the quest tracker off, nothing runs.

Bags and buffs

A group in the bags

my.AddBagGroup("fishing", { label = "Fishing", match = function(item)
    return item.itemID == 6256 or item.itemID == 6365   -- poles
end })

Since 1.7. Your group shows in the Categories view after the player's own groups and before Daylight UI's, and takes whatever match says yes to. A pinned item and the player's own searches still win. item has itemID, link, name, quality, classID, subClassID, count, bound, itemLevel, questItem and more. The player can rename and move it but not delete it, since it goes with your addon. my.RemoveBagGroup(key) takes it away, and API.RefreshBags() sorts again when your match would answer differently.

A category on the buff bar

my.AddBuffCategory("food", { label = "Well Fed", spells = { 24870, 25661 }, color = { 0.9, 0.6, 0.2 } })

Also since 1.7. It's made once in the player's list, and from then on it's theirs to move, recolor, hide or delete. It holds its buffs by spell id, so it sorts in fights too. Calling it again updates the spells, and a buff the player moved by hand stays where they put it. The bars' holders are frames of kind "buffbar" to attach to; the game's buttons inside them lock in fights, so never touch those.

A missing buff of your own

my.AddBuffReminder("ward", { label = "Frost Ward", spells = { 6143, 8461, 8462 },
    when = function() return IsInInstance() end })
my.RemoveBuffReminder("ward")

Since 1.17. An icon of yours in the missing-buffs row above the character, shown while none of spells is on the player and when() (optional) says true. It follows the row's own rules: in a group (or solo, when the player allows it), never while resting, dead or traveling, and never added in a fight. A click casts the highest of spells the player knows; with none known it shows but can't be clicked. icon is optional. Its key in the row is "<your plugin>:<key>", and calling it again replaces it. when runs on every look at the row, so keep it cheap; an error in it is reported and the icon stays away. Under the game's aura restrictions the icon only shows when every spell's aura can be read, so it never cries wolf. The row itself is API.GetFrame("reminders").

Aura filters on party and raid frames

my.AddAuraFilter("walls", { label = "Big defensives", spells = { 871, 498, 642 } })
my.AddAuraFilter("hots", { label = "My HoTs", spells = { 774, 8936 }, mine = true })

Your list shows up as one more choice in the Filter dropdown of the party and raid aura rows, next to "Heals and shields" and the others. what is "buffs" (the default) or "debuffs", and mine = true shows only the ones the player cast. The game matches by spell id, so list every rank. It works in fights too.

  • Debuffs are limited. On group members the game only lets addons pick out debuffs it marks as never secret (Sated, Exhaustion and the like), so a boss's debuffs can't be listed. Any other debuff id is left out, and a list with none left returns false. Buffs are always fine.
  • Register early. The game fixes a row's spells the first time it shows, so register your lists when your addon loads. A list changed after that applies after a /reload. Called again with the same key, it replaces the list.

Frame styles

my.AddFrameStyle("slim", {
    label = "Slim",
    desc = "Slim: a thin bar with the name above it and the power as a line under it.",
    row = true, line = true, ring = 0.5,
    sizes = { player = { height = 18, powerHeight = 4, tabHeight = 14 },
              party = { height = 16, powerHeight = 3, tabHeight = 12, spacing = 40 } },
})

Since 1.8. Your style joins Daylight and Ribbon in every Frame style menu (Extras, and the player, target, focus, party and PvP frame pages) and as a card on the setup guide's Frames page. It's built from the pieces Daylight UI's frames already have, so every option keeps working in it.

  • row = true: the name and health number sit on a bare row above the bar instead of in the name tab.
  • line = true: the power is a thin line hung under the frame instead of a bar inside it. Cast bars, combo points, aura rows and party pets keep clear of it.
  • ring: the portrait ring's radius as a share of the whole frame with its row and line (0.3 to 1; Ribbon uses 0.56), centered on it. Leave it out and the ring follows the frame as in Daylight.
  • sizes: each frame's own heights in your style (height, powerHeight, tabHeight, and the party's spacing). Daylight's fill in the rest. Each style keeps its own heights, so a player's changes to yours stay yours.

Then give it its look with my.Paint. Each unit frame's parts say which style it wears, so paint only those, and use row and line for the pieces your style adds.

my.Paint("unit", function(frame, parts)
    if parts.style ~= "MyPlugin:slim" then return end
    -- your colors and textures here
end)
  • Saved as "<your plugin>:<key>". With your plugin off, frames that wore it show Daylight until it's back, with their heights kept.
  • Register it when your addon loads. Called again with the same key, it updates the style.
  • New shapes need a new piece. A style mixes the pieces above and paints over them. A shape they can't make (power beside the health, a vertical frame) needs that piece in Daylight UI first: ask on the Discord.

Glow styles

my.AddGlowStyle("pulse", {
    label = "Pulse",
    lap = 2,  -- seconds a turn
    draw = function(g, at, lo, hi, size)
        g:Light(at, size, hi, 1)                    -- a light a share of the way round
        g:Trail(at, 0.3, 0.8, lo, hi)               -- its tail, fading behind it
        g:Edge(1, 0, 1, 0.3 * at, 0.3 * at, lo, hi) -- the whole top edge, brightening
    end,
})

Since 1.9. Your style joins Daylight UI's five in every glow menu: the main window buttons (General), the target nameplate's outline light (Nameplates > Target) and each Cooldown Manager spell's glow style (its card's Look tab). Its key there and in API.GlowStyles is "YourPlugin:pulse".

draw runs every frame while your glow shows. at goes from 0 to 1 through each turn; lo and hi are the two ends of the player's accent (or the color the glow was given), and size is a light's size for what it's on. Places are a share of the way round, clockwise from the top-left corner, so one style fits a button, a plate or an icon alike:

  • g:Light(at, size, color, alpha): a soft light.
  • g:Trail(at, length, alpha, tailColor, headColor): a strip ending at at and reaching back length of the way round, round the corners, fading to nothing at its far end.
  • g:Edge(side, from, to, alphaFrom, alphaTo, colorFrom, colorTo): a strip along one side (1 top, 2 right, 3 bottom, 4 left) from from to to of it.
  • Alphas are 0 to 1. Daylight UI eases the whole glow in and out on top of them. g.width and g.height say how big the edge is.
  • An error falls back. A style whose draw errors is drawn as Circling from then on, with the error said once.
  • Called again with the same key, it updates the style.

Shell styles

my.AddShellStyle("hard", {
    label = "Hard",
    desc = "Square black borders with a hard drop shadow.",
    hide = { "border", "band", "shadow" },   -- Daylight UI's pieces you draw yourself
    layout = function(layer, look)
        -- layer: a frame over the shell, yours. Make textures once, place them each call.
        layer.edge = layer.edge or layer:CreateTexture(nil, "BORDER")
        layer.edge:SetAllPoints()
        layer.edge:SetColorTexture(unpack(look.border))
    end,
})

Since 1.20. Your style joins Daylight in General > Appearance > Borders and shadows. The Shell style menu shows once a plugin adds a style. Picked, it draws every frame and window Daylight UI makes: unit frames, bars, plates, windows, panels and tooltips.

  • hide: any of "border" (the outline and its corners), "band" (the heavy border's warm band and lit line), "shadow", "background" and "bevel". Daylight UI still lays them out, then hides them.
  • layout(layer, look) runs after each layout of a shell: when it's made, resized, and on every look change. look has borderPx, cornerPx, shadowPx (screen pixels, already sized for the UI scale), border, band, shadow, background (each { r, g, b, a }, the player's colors for that frame), heavy, window, lean, w, h (nil when the game keeps the size secret) and frame.
  • lean = true also draws the small icons' thin shells (aura buttons). Without it they keep Daylight's edge. Those buttons are locked in a fight, so their layout only runs outside one.
  • Hover and highlight colors go on Daylight UI's own pieces. With border hidden, read API.Accent() in your layout if you want them.
  • Errors and missing plugins. A style whose layout errors is said once in chat, and Daylight is drawn from then on. With your plugin off, frames draw Daylight and the player's pick is kept for when it's back. API.ShellStyles() lists them, Daylight first.

Motions, accents and sounds

Since 1.20. Each one is a new choice in a General menu that shows once a plugin adds one. With your plugin off, the player's pick is kept and Daylight UI's own is used until it's back.

Window motions

my.AddWindowMotion("swoop", {
    label = "Swoop",
    open = function(m, t) m:Alpha(t); m:Offset(-40 * (1 - t), 0) end,   -- t: 0 to 1, eased
    close = function(m, t) m:Alpha(1 - t); m:Offset(0, -12 * t) end,
})

Your motion joins Glide in General > Appearance > Motion. Picked, it moves Daylight UI's windows as they open and close, every frame of the move. t runs from 0 to 1 over Daylight UI's own times, so every window keeps one rhythm. m:Alpha(a) and m:Offset(dx, dy) (pixels from the window's spot, up to 200) are all you set, and the window always ends at full alpha on its own spot. Leave out open or close and that way is a plain fade. Windows that only fade (the bags, the options window) take your alpha but never move, because moving them each frame costs frame rate. Motion effects off still snaps everything, and a motion that errors goes back to Glide. API.WindowMotions() lists them, Glide first.

Accents

my.AddAccent("synth", { label = "Synth", stops = { { 1, 0, 0.8 }, { 0, 0.9, 1 } } })

Your accent joins the Accent color menu (General > Appearance > Color). Two to five colors make a gradient, drawn wherever the custom gradient is: lists, borders with Gradient window borders on, text along it. One color is a plain accent. Call it again with new colors to change them: everything repaints once, after any fight. It isn't for animation, because a repaint every frame would make the whole UI lag. With your plugin off, the default accent shows. API.Accents() lists every choice.

Sound sets

my.AddSoundSet("synth", { label = "Synth", sounds = {
    open = "Interface\\AddOns\\MyPlugin\\open.ogg", close = 567890, click = "lsm:Synth Click" } })

Your set joins each menu in General > Appearance > Sound, beside Soft. Picked, its sounds play in place of Daylight UI's soft ones, and the game's own stay muted as with Soft. sounds can hold open, close, click, toggle, dismiss, snap, spend, refund, apply, done and gone, each a file path, a file id, or "lsm:<name>" from LibSharedMedia. A sound you leave out, or a shared one that isn't there, plays Daylight UI's. API.SoundSets() lists them.

Themes

my.AddTheme("neon", {
    label = "Neon",
    desc = "Thin glowing borders and a synth accent.",        -- the card's tooltip
    preview = "Interface\\AddOns\\MyPlugin\\neon-card.tga",   -- optional: a picture for the card
    settings = {
        accent = "MyPlugin:synth", shellStyle = "MyPlugin:glow", windowMotion = "MyPlugin:swoop",
        font = "barlow", barTexture = "glass", borderPx = 1, cornerPx = 10, shadowPx = 8, heavyBorder = false,
        soundKinds = { windows = "MyPlugin:synth", clicks = "MyPlugin:synth" },
    },
})

Since 1.21. Your theme is a card in a Themes row at the top of General > Appearance, after Daylight's own card. The row shows once a plugin adds a theme. The card draws your look in small: a bar in the theme's accent, a power line and a window, each with its border sizes and shell style. Give preview to show a picture instead.

  • What happens when a player clicks your card. Daylight UI first asks them "Use the Neon look?". If they say yes, it copies your theme's settings into their own settings, one time. After that those are ordinary settings again: the player can change any of them in the options, and your theme never changes them back.
  • Which card shows as picked. A card gets the picked outline and tick while the player's settings still match it. Once they change one of those settings, no card shows as picked.
  • The Daylight card works the same way, but puts those settings back to how Daylight UI ships them.
  • settings are General's look settings under their own names: accent, accentColor, accentGradient, font, gameText, textOutline, textShadow, barTexture, barBack, windowBar, windowBack, shellStyle, windowMotion, buttonGlow, soundKinds (by kind: windows, clicks, toggles, snaps, confirms), and the border and shadow ones: heavyBorder, gradientBorder, borderPx, cornerPx, borderAlpha, shadowPx, shadowAlpha, windowAlpha, windowTint, windowTintColor, borderColor, borderCustom, shadowColor, shadowCustom.
  • Only the look. Anything else (a frame's spot, a module switch, a gameplay setting) is left out with one chat line, and so is a value of the wrong kind or a font Daylight UI doesn't know.
  • Your own pieces by their full key ("MyPlugin:glow"). With your plugin off they draw Daylight's own.
  • API.Themes() lists every theme, Daylight first. API.ApplyTheme(key) applies one at once ("daylight" for Daylight's own) for a button of your own. Ask the player first, as the Themes row does.

Whole-UI plugins

Since 1.23, for a plugin that redraws big parts of Daylight UI: a HUD, a raid frame of its own, a theme suite. A complete example to copy from is in Daylight UI's repository, examples/StarterPlugin: its own XP bar standing in for Daylight UI's, a frame style, a theme and a setup guide, in one short file.

Stand in for a piece

local h = my.StandIn("player")   -- call it as your addon loads
API.Off(h)                       -- gives the piece back

Says your plugin draws that piece itself. Daylight UI's turns off for as long as you hold it, and the game's own (which normally comes back whenever Daylight UI's is off) stays hidden too. Call it as your addon loads: the game's frames are only hidden while Daylight UI's frames are built. One plugin per piece.

SincePieces
1.23"player", "target", "targettarget", "pet", "focus", "focustarget", "party", "playerCastbar", "swing", "campfireCount" (the seconds over the campfire)
1.24"pettarget", "raid", "targetCastbar", "buffs", "debuffs" (each bar on its own, the weapon enchants with the buffs), "xpbar", "combattext"

API.STAND_INS lists them all. The buff and debuff bars step aside once a fight and the client's restrictions are over, since their icons are locked until then.

Hide one of the game's frames

Since 1.24. local h = my.HideGameFrame(frame) (the frame or its name) puts a game frame your plugin replaces out of sight, the way Daylight UI hides the game's own: under a hidden parent, never a hook on its methods. A protected frame waits for the fight to end, both ways. It's hidden again if the game moves it back as the world loads. API.Off(h) gives it back where it was. It's not for Daylight UI's own frames (they have switches, or StandIn), and it's one plugin per frame.

How long each plugin takes

Since 1.24. /dui plugintime [seconds] (30 by default) times every plugin while the player plays, then prints each one: the client's own measure of its time a frame, and the calls Daylight UI makes into it (settings reacting, event handlers, Paint, rows on Daylight UI's pages) with the slowest. Nothing is timed between runs.

The campfire

Events CampfireShown (isPreview) and CampfireHidden (snap). API.Campfire() is { state, timeLeft }: "idle", "sitting" or "resting", and the seconds left of the minute by the fire. my.HushWithCampfire(true) sends your fade areas away with the fire, as the action bars and unit frames go.

Fade, all at once

API.FadeAreas() lists every fading area, Daylight UI's and plugins': { key, scope, path, float } (its choices are API.GetSetting(scope, path .. ".mode") and so on). API.SetFadeAll(field, value) sets one choice on every area ("mode", "alpha", "mouseover", "target", "delay"), saved as the player's own, so call it only from a control the player uses.

Renamed your plugin?

DaylightUI:RegisterPlugin(name, { formerly = "OldName" }) (a name or a list): mover spots saved under the old name are copied to the new one at login, once.

Chat

my.FormatChat(function(text, info)
    if info.kind == "guild" and info.sender == "Bob" then return "|cffffd100*|r " .. text end
end)
local link = my.ChatLink("fish:42", "Show fish")   -- "[Show fish]" in the accent
my.OnChatLink(function(data) MyAddon:Show(data) end)

Since 1.7, for the Daylight UI chat box. Your function gets each line after Daylight UI's own touches: return a new text, false to leave the line out, or nothing to keep it. info has event, kind, sender, guid, body (what they typed), channel and line. Lines the game keeps secret never reach you. A click on a link made by my.ChatLink calls your OnChatLink.

Chat tabs

CallWhat it does
API.ChatTabs()Since 1.23. Every tab in order: { index, name, unread, picked, side, combat }. Empty while the chat is off or in its Classic look.
API.SelectChatTab(index)Opens a tab, as a click does.
my.HideChatTabs(true)The tabs leave the row. The strip keeps its room (API.GetFrame("chattabs")) so tabs of yours can sit there, and the header icons stay. false brings them back. One plugin at a time.
Event ChatTabsChangedA tab was picked, added, moved, or its unread count changed.

Fitting in around Daylight UI

Since 1.7. These help your frames dock to Daylight UI's, stay out of their way and borrow a setting for a while.

CallWhat it does
API.GetFrame(name)Daylight UI's big frames by a fixed name: "infopanel", "minimap", "meter", "threat", "databar", "chat", "questtracker", "bags", "bank", "afk", "npc", since 1.13 "rolls" (the loot roll cards' holder), since 1.16 "procs" (where the proc flares hang), since 1.17 "reminders" (the missing-buffs row), and since 1.23 "buffs", "debuffs" (the buff and debuff rows' holders), "zonetitle", "campfire" and "chattabs" (the strip along the top of the chat its tabs sit in). API.FRAME_NAMES lists them. nil while that part is off or not made yet.
API.GetMoverFrame(key)The frame placed under a mover key: "unitframes.player", "actionbars.main", "infopanel", or one of yours.
API.IsUnlocked()Unlock mode is on.
my.IsPreviewing(key)Your part should show its sample now: unlock mode, or test mode with its box ticked.
my.SuspendMover(key, true)Daylight UI stops placing your mover while you dock it to something. false gives it back.
API.MotionOn()The player lets Daylight UI animate.
API.Media(file)A file in Daylight UI's media folder, used where it is.
API.IsAfkScreen()The AFK screen is up. Listen to AfkScreenShown and AfkScreenHidden.
my.Override(scope, path, value)Changes one of Daylight UI's settings for a while, never saved. API.Off(handle), logging out or the player changing it puts theirs back. One plugin per setting. Since 1.23, my.Override(scope, { [path] = value, ... }) holds many with one handle and one redraw, and values may be tables (colors). Called before login or before the module is up, it waits and goes in before the module draws anything. A crash can't leave your value in the player's profile (it's put back at their next login), and the setting's row in the options says your plugin holds it.
my.FilterShop(fn)Return false from fn(item) to leave an item off the vendor window's shelf. API.RefreshShop() fills it again.

The FramePlaced(key) event says a frame was put on its spot by its mover, after a profile change or a move. Follow a frame there instead of hooking its SetPoint.

Auction House prices

Since 1.15. DaylightUI.AuctionPrices is what the Auction House module knows, for addons that price things: a profession planner, a spreadsheet, a shopping list.

CallWhat it gives
AuctionPrices.Item(id)price, seenAt: what one sells for, and when it was seen. The newest sighting's lowest buyout while it's fresh (12 hours), the usual market value after that.
AuctionPrices.Offer(id)price, seenAt, quantity: the same sighting, and how many were for sale.
AuctionPrices.ScannedAt()When anything was last seen at the Auction House, nil before the first scan.
AuctionPrices.Vendor(id)What a merchant sells one for, as last seen at one.
AuctionPrices.Soulbound(id)true for an item that can never be sold.
AuctionPrices.CUTThe house's share of a sale: 0.05.

Each call answers nil for an item never seen, and none of them makes a table. DaylightUI.On("AuctionPricesChanged", fn) says when a number moved. The table is absent while the Auction House module is off, or while DaylightMogul owns the Auction House: check once and stay quiet without it.

Profile packs

A pack is a ready-made setup, like ElvUI's UI packs. Set up the UI the way you like it, export your profile with /dui export and register the string:

DaylightUI.RegisterPack("MyPack", {
    label = "My UI",
    author = "You",
    version = "1.2",
    desc = "One line on what it is.",
    screen = { 1920, 1080 },   -- the screen size you made it on
    updates = "offer",         -- or "never" (the default)
    profiles = {
        { name = "My UI Healer", text = "!DUI1_...", sub = "One line.", role = "Healer" },
    },
})

Your pack shows up in the setup guide and on the Profiles page, credited to you. A profile is only made when the player picks it. Positions are pulled in to fit smaller screens. With updates = "offer", players get an Update button when your version goes up, and nothing changes unless they press it.

A pack can also set up other addons (Details, say) with extras. The player sees each one as a switch on the setup guide's last page.

  • From your plugin (1.23). API.RegisterPack(id, spec) is the same call. my.UsePack(profileName) switches this character to one of your pack's profiles, creating it the first time; the player's own profiles stay. It takes a reload, which Daylight UI asks for. It returns true, or false and why.
  • Profiles you hand out as text (1.24). API.OpenImport() opens Daylight UI's import box for the player to paste into. false before login or in a fight.

The game's rules still apply

WoW: Forever runs on the modern client with its addon restrictions on. A few rules bite plugins the most:

  • Secret values. In combat, in boss fights, PvP matches and some other places, many values (health, auras and more) come back as secrets. You can hand them to a font string, a status bar or a texture, but you can't compare them, do math on them or check if they're true. issecretvalue(x) tells you. Some, like UnitHealth, are secret all the time.
  • Protected frames. The Daylight UI unit frames and tiles are secure. You can't move, show, hide or resize them in combat. Draw on the Attach frame instead and leave the tile itself alone.
  • Don't hook the game's methods. On this client a hooksecurefunc on a game frame's method can break the game's own calls. Listen to events instead.
  • Only DaylightUI.API is promised. You may use everything else inside Daylight UI too, but it can change in any update and break your plugin. If the API is missing something you need, ask.

Versions

DaylightUI.API.major and .minor say which version is installed. This page describes 1.24, which added more stand-ins (the pet's target, raid, the target's cast bar, buffs, debuffs, the XP bar and combat text), HideGameFrame, InstallerSeen, OpenImport and /dui plugintime. 1.23 added stand-ins, chat tabs, the campfire, batch overrides, Get and Set, packs from a plugin, bar animations and the client's font. 1.22 added quest title slots, a mover's settings button, custom rows, page samples and a switch for each plugin skin. 1.21 added themes. 1.20 added shell styles, window motions, accents and sound sets. 1.19 added Paint on Daylight UI's windows, the game's windows it dresses, aura icons, the chat, the info panel, data texts, the XP bar and combat text. 1.18 added the window kit's pieces (tabs, links, chips, icons, money boxes, scroll pills, grips and more) and the cast button. 1.17 added missing buffs and XP orbs. 1.16 added Proc Alerts. 1.15 added the Auction House prices. 1.14 added the Cooldown Manager's state, its new events and WatchCooldown. 1.13 added the loot roll cards. 1.12 added the rich tooltip pieces and painting the Rich card. 1.11 added quest menu rows. 1.10 added a setup guide of your own. 1.9 added glow styles. 1.8 added frame styles, the portrait's parts on unit frames and the main button's glow. 1.7 added tooltips, the setup guide, the Cooldown Manager, bag groups, buff categories, aura filters on party and raid frames, chat, and ways to fit in around Daylight UI's frames. 1.6 added data texts of Daylight UI's own kind, data panels and the damage meter. 1.5 added Paint on action buttons, ButtonInfo and Glow. 1.4 added Paint on nameplates and their cast bars. 1.3 added Paint, cast bars, unit frame parts, the quest tracker, the bags, your own texts, hooks and settings. 1.2 added the vendor and profession windows and the font row. Ask for the version you use, like needs = { 1, 24 } for everything on this page, or the version that added the newest call you use.

  • The minor number goes up when something is added. Your plugin keeps working.
  • The major number only goes up when something promised changes or goes away. If a call gets renamed, the old name keeps working until then.
  • If your plugin needs a newer version than the player has, it stays off and tells them with one line in chat. It never throws an error at them.

Every Daylight UI update is tested against a fake plugin that uses every call on this page, so a change that breaks one gets caught before it ships.

Questions?

Come ask in the Discord. Say what you're building, especially if the API gets in your way.