mirror of
https://github.com/fuffc/WeakestAuras.git
synced 2026-11-10 20:07:35 +00:00
Model region, Empty region and improved WeakAuras imports Model displays - Ported missing "Model" display type: a 3D model with rotation, zoom, scale and alpha, and a model browser with a live preview. - Creature models can only render textured for creatures your client has seen. Empty Region - Ported missing "Empty" display type: displays nothing by itself; attach sub-regions (text, border, glow) to give it content. "multi" unit token - An aura trigger on unit "multi" tracks your debuff on every mob it lands on. One timer per mob, including mobs you never targeted. Improved WA2 imports - Retail icon numbers now resolve to this client's own icons instead of the missing-texture block where possible. - A lot of custom Lua written for retail now runs thanks to ClassicAPI 5.1 Lua transpilation efforts. - Some WA_ group helpers and retail aura getters have been added to a compatibility layer. - Retail event names such as UNIT_POWER_UPDATE now work as written: a trigger listing one is fed by the matching classic events, and custom code checking the retail name sees it. - Far more conditions carry over: variables a custom trigger declares, an aura trigger's group-wide match count and total stacks, a cast's spell name, and unit death. - Class-and-spec load rules become class rules; Instance Size matches by raid head-count (estimated). - Added fonts used frequently in aura packs: Accidental Presidency, Expressway, Bazooka, FORCED SQUARE and Cabin. - Improved the import report to only list what is lost or substituted, at a fraction of its former length. Imported code using Lua 5.1 syntax and string methods needs ClassicAPI 1.11.0 or newer. A pack imported before this release whose custom code checks retail event names should be re-imported to benefit from these changes. Triggers - Weapon Enchant can show while an enchant is missing, or always. - Power reads the power type you picked: a druid's mana display stays up in cat or bear form. - Cooldown Progress (Equipment Slot) gains "Is Usable"; Power gains "Only if Primary". - A cooldown trigger for a spell your character has not learned no longer reads as permanently ready. Dynamic groups - Ported missing custom grow: your own Lua function positions the children. - Children slide to their new slots as clones come and go, instead of snapping. - A per-unit-anchored group's offset controls nudge each clone off its nameplate or unit frame. Fixes - Auras anchored to nameplates that only had the GUID and no valid unit token now land on their own mob's plate instead of the target's. - Equipment-slot trigger icons survive /reload instead of showing a bag placeholder until the next import.
68 lines
2.5 KiB
Lua
68 lines
2.5 KiB
Lua
-- WeakestAuras -- the "subbackground" sub-region: the region's own art, given a
|
|
-- row in the Display Effects list. Mirrors WA2's Background (§8).
|
|
-- Upstream section refs (§N) point at design/architecture/weakauras2-reference.md
|
|
--
|
|
-- Draws nothing, and is not a backdrop despite the name. Draw order comes off an
|
|
-- entry's position in data.subRegions, so without a row standing for the region
|
|
-- itself there is no way to say "below the icon" -- every effect would sit above
|
|
-- it forever. This row's SetFrameLevel retargets the parent region, which is
|
|
-- what moving it up or down the list actually does.
|
|
--
|
|
-- `enforced`: MergeDefaults keeps exactly one on every aura that supports it,
|
|
-- and the options list offers neither add, delete nor duplicate. Upstream
|
|
-- expresses the same thing as supportsAdd = false plus an options block with no
|
|
-- __delete/__duplicate and a __notcollapsable.
|
|
|
|
if WeakestAuras.disabled then return end
|
|
|
|
local WA = WeakestAuras
|
|
|
|
WA.RegisterSubRegionType("subbackground", {
|
|
displayName = "Background",
|
|
supports = function(regionType)
|
|
return regionType ~= "group" and regionType ~= "dynamicgroup"
|
|
end,
|
|
enforced = true,
|
|
default = { type = "subbackground" },
|
|
create = function(parent)
|
|
local region = { parent = parent }
|
|
function region:SetFrameLevel(level) self.parent:SetFrameLevel(level) end
|
|
return region
|
|
end,
|
|
modify = function(parent, region)
|
|
region.parent = parent
|
|
end,
|
|
-- A header and nothing under it. The arrows live on the header, which the
|
|
-- options list paints for every effect.
|
|
options = function()
|
|
return {}
|
|
end,
|
|
})
|
|
|
|
-- The bar's fill and icon as their own row, mirroring WA2's Foreground: the
|
|
-- level retargets the two frames the progressbar stacks above its own base, so
|
|
-- moving the row decides whether effects draw above or below the fill. Not
|
|
-- `enforced` -- imports carry it in the author's position, and stamping one
|
|
-- onto every saved progressbar would reorder frame levels users already have.
|
|
WA.RegisterSubRegionType("subforeground", {
|
|
displayName = "Foreground",
|
|
supports = function(regionType)
|
|
return regionType == "progressbar"
|
|
end,
|
|
default = { type = "subforeground" },
|
|
create = function(parent)
|
|
local region = { parent = parent }
|
|
function region:SetFrameLevel(level)
|
|
if self.parent.bar then self.parent.bar:SetFrameLevel(level) end
|
|
if self.parent.iconFrame then self.parent.iconFrame:SetFrameLevel(level + 1) end
|
|
end
|
|
return region
|
|
end,
|
|
modify = function(parent, region)
|
|
region.parent = parent
|
|
end,
|
|
options = function()
|
|
return {}
|
|
end,
|
|
})
|