# HG changeset patch # User Flick # Date 1231524672 0 # Node ID 77bb68eb402ba0f3c140391d83c683efe79c295e # Parent a66595385917eb0a83eb98a18bbc05e40e8d7be1 Fixed bug with mindcontrol actions: simplified action attributes diff -r a66595385917 -r 77bb68eb402b modules/Action.lua --- a/modules/Action.lua Fri Jan 09 18:10:47 2009 +0000 +++ b/modules/Action.lua Fri Jan 09 18:11:12 2009 +0000 @@ -936,23 +936,26 @@ self.border = _G[name.."Border"] f:SetAttribute("action", config.actionID) + f:SetAttribute("default-action", config.actionID) -- install mind control actions for all buttons just for simplicity if self.idx <= 12 then - f:SetAttribute("*action-mc", 120 + self.idx) + f:SetAttribute("mindcontrol-action", 120 + self.idx) end -- set a _childupdate handler, called within the header's context f:SetAttribute("_childupdate", -- function _childupdate(self, snippetid, message) [[ - local action = "action" + local action = "default-action" if doMindControl and GetBonusBarOffset() == 5 then - action = "*action-mc" + action = "mindcontrol-action" elseif page and state and page[state] then - action = "*action-"..page[state] + action = "action-"..page[state] end local value = self:GetAttribute(action) - self:SetAttribute("action",value) + if value then + self:SetAttribute("action",value) + end ]]) -- install drag wrappers to lock buttons @@ -1059,7 +1062,7 @@ end self.config.pageactions[page] = id IDAlloc:Acquire(self.config.pageactions[page]) - self.frame:SetAttribute(("*action-page%d"):format(page),id) + self.frame:SetAttribute(("action-page%d"):format(page),id) else IDAlloc:Release(self.config.actionID) self.config.actionID = id @@ -1067,7 +1070,7 @@ self.frame:SetAttribute("action",id) if self.config.pageactions then self.config.pageactions[1] = id - self.frame:SetAttribute("*action-page1",id) + self.frame:SetAttribute("action-page1",id) end end end @@ -1087,12 +1090,12 @@ else c[i] = self.config.actionID -- page 1 is the same as the base actionID end - f:SetAttribute(("*action-page%d"):format(i),c[i]) + f:SetAttribute(("action-page%d"):format(i),c[i]) end for i = nPages+1, #c do IDAlloc:Release(c[i]) c[i] = nil - f:SetAttribute(("*action-page%d"):format(i),nil) + f:SetAttribute(("action-page%d"):format(i),nil) end self.nPages = nPages end