rewrite auto-assist feature using new secure state driver rather then ugly macrotext

This commit is contained in:
Hendrik Leppkes
2008-09-01 22:26:14 +00:00
parent 58f46c261e
commit eed9a681a5
2 changed files with 53 additions and 31 deletions
+17 -2
View File
@@ -115,8 +115,23 @@ function ActionBar:UpdateStates()
table_insert(statedriver, tostring(self:GetDefaultState() or 0))
RegisterStateDriver(self, "page", table_concat(statedriver, ";"))
--local newState = self:GetAttribute("state-page")
--self:SetAttribute("state", newState)
self:SetAttribute("_onstate-assist-help", [[
local state = (newstate ~= "nil") and newstate or nil
control:ChildUpdate("assist-help", state)
]])
self:SetAttribute("_onstate-assist-harm", [[
local state = (newstate ~= "nil") and newstate or nil
control:ChildUpdate("assist-harm", state)
]])
local pre = ""
if Bartender4.db.profile.selfcastmodifier then
pre = "[mod:"..GetModifiedClick("SELFCAST").."]player;"
end
-- TODO: fix rightclick selfcast
RegisterStateDriver(self, "assist-help", ("%s[help]nil; [target=targettarget, help]targettarget; nil"):format(pre))
RegisterStateDriver(self, "assist-harm", "[harm]nil; [target=targettarget, harm]targettarget; nil")
end
function ActionBar:GetStanceState(stance)