diff --git a/actionBar/States.lua b/actionBar/States.lua index b526814..1c27d46 100644 --- a/actionBar/States.lua +++ b/actionBar/States.lua @@ -129,11 +129,13 @@ function ActionBar:UpdateStates() table_insert(statedriver, tostring(self:GetDefaultState() or 0)) RegisterStateDriver(self, "page", table_concat(statedriver, ";")) - self:SetAttribute("statemap-page", "$input") self:ApplyStateButton() - SecureStateHeader_Refresh(self) + self:SetAttribute("_onstate-page", [[ + self:SetAttribute("state", newstate) + return true + ]]) local newState = self:GetAttribute("state-page") self:SetAttribute("state", newState) diff --git a/barPrototype/Prototype.lua b/barPrototype/Prototype.lua index 52f1089..f4db92e 100644 --- a/barPrototype/Prototype.lua +++ b/barPrototype/Prototype.lua @@ -69,7 +69,7 @@ function Bartender4.Bar:Create(id, config, name) id = tostring(id) assert(not barregistry[id], "duplicated entry in barregistry.") - local bar = setmetatable(CreateFrame("Frame", ("BT4Bar%s"):format(id), UIParent, "SecureStateHeaderTemplate"), Bar_MT) + local bar = setmetatable(CreateFrame("Frame", ("BT4Bar%s"):format(id), UIParent, "SecureHandlerStateTemplate"), Bar_MT) barregistry[id] = bar bar.id = id bar.name = name or id diff --git a/buttonPrototypes/ActionButton.lua b/buttonPrototypes/ActionButton.lua index 7cb42bc..ed1b888 100644 --- a/buttonPrototypes/ActionButton.lua +++ b/buttonPrototypes/ActionButton.lua @@ -85,8 +85,6 @@ function Bartender4.Button:Create(id, parent) button.textureCache.pushed = button.pushedTexture:GetTexture() button.textureCache.highlight = button.highlightTexture:GetTexture() - parent:SetAttribute("addchild", button) - button:SetAttribute("type", "action") button:SetAttribute("action", absid) @@ -94,6 +92,12 @@ function Bartender4.Button:Create(id, parent) button:SetAttribute("useparent-statebutton", true) --button:SetAttribute("hidestates", "-1") + parent:SetAttribute('_adopt', button) + button:SetAttribute('_childupdate', [[ + self:SetAttribute("state",) + ]] + ) + button:RegisterForDrag("LeftButton", "RightButton") button:RegisterForClicks("AnyUp") @@ -222,7 +226,7 @@ function Button:RefreshStateAction(state) if self.parent.config.autoassist then local type, id, subtype = GetActionInfo(action) - if type == "spell" then + if type == "spell" and id > 0 then local spellName, spellRank = GetSpellInfo(id, subtype) local macroText