Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

Frame:SetManyAttributes

Last wiki revision 2007-05-26

Small function to be attached to secure frames to allow for setting many attributes in a single call.

local function SetManyAttributes(self, ...) for i=1,select("#", ...),2 do local att,val = select(i, ...) if not att then return end self:SetAttribute(att,val) end end

local frames = {} for i=1,12 do frames[i] = CreateFrame("Button", nil, UIParent, "SecureActionButtonTemplate") frames[i].SetManyAttributes = SetManyAttributes end frames[1]:SetManyAttributes("type1", "macro", "macrotext", "/equip Hydrocane") frames[2]:SetManyAttributes("type1", "spell", "spell", "Greater Heal")

Or to just use the function on a random frame: SetManyAttributes(someFrame, "type1", "macro", "macrotext", "/equip Hydrocane");

Source

https://warcraft.wiki.gg/wiki/Frame:SetManyAttributes · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.