From 3998774497e9c37b4c1a76cff56c660c0ab0457b Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Thu, 30 Oct 2008 09:17:33 +0100 Subject: [PATCH] Fix enabling/disabling of selfcast/focuscast --- ActionBar.lua | 2 +- ActionButton.lua | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ActionBar.lua b/ActionBar.lua index 38281f7..794aa32 100644 --- a/ActionBar.lua +++ b/ActionBar.lua @@ -134,6 +134,6 @@ function ActionBar:GetHideHotkey() end function ActionBar:UpdateSelfCast() - self:ForAll("SetAttribute", "checkselfcast", Bartender4.db.profile.selfcastmodifier and true or nil) + self:ForAll("UpdateSelfCast") self:UpdateStates() end diff --git a/ActionButton.lua b/ActionButton.lua index a386dfe..8b2fa79 100644 --- a/ActionButton.lua +++ b/ActionButton.lua @@ -96,7 +96,8 @@ function Bartender4.Button:Create(id, parent) button:SetAttribute("type", "action") button:SetAttribute("action", absid) - button:SetAttribute("checkselfcast", true) + + button:UpdateSelfCast() --button:SetAttribute("useparent-unit", true) @@ -278,12 +279,13 @@ function Button:RefreshStateAction(state) self:UpdateRightClickSelfCast() end +function Button:UpdateSelfCast() + self:SetAttribute("checkselfcast", Bartender4.db.profile.selfcastmodifier and true or nil) + self:SetAttribute("checkfocuscast", Bartender4.db.profile.focuscastmodifier and true or nil) +end + function Button:UpdateRightClickSelfCast() - if Bartender4.db.profile.selfcastrightclick then - self:SetAttribute("unit2", "player") - else - self:SetAttribute("unit2", nil) - end + self:SetAttribute("unit2", Bartender4.db.profile.selfcastrightclick and "player" or nil) end function Button:CalculateAction()