change visibility driver to hide pet-bar when possessing, as blizzard doesn't give you a pet-bar either when in a vehicle, for example.
This commit is contained in:
@@ -323,8 +323,7 @@ end
|
|||||||
function Bar:ApplyVisibilityDriver()
|
function Bar:ApplyVisibilityDriver()
|
||||||
if self.unlocked then return end
|
if self.unlocked then return end
|
||||||
-- default state is shown
|
-- default state is shown
|
||||||
self:RegisterVisibilityCondition("show")
|
RegisterStateDriver(self, "visibility", table_concat(self.hidedriver, ";") .. ";show")
|
||||||
RegisterStateDriver(self, "visibility", table_concat(self.hidedriver, ";"))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function Bar:DisableVisibilityDriver()
|
function Bar:DisableVisibilityDriver()
|
||||||
|
|||||||
+9
-14
@@ -35,12 +35,10 @@ function PetBarMod:OnEnable()
|
|||||||
|
|
||||||
self.bar:SetScript("OnEvent", PetBar.OnEvent)
|
self.bar:SetScript("OnEvent", PetBar.OnEvent)
|
||||||
|
|
||||||
self.bar:SetAttribute("unit", "pet")
|
--self.bar:SetAttribute("unit", "pet")
|
||||||
end
|
end
|
||||||
self.bar:Enable()
|
self.bar:Enable()
|
||||||
|
|
||||||
RegisterUnitWatch(self.bar, false)
|
|
||||||
|
|
||||||
self.bar:RegisterEvent("PLAYER_CONTROL_LOST")
|
self.bar:RegisterEvent("PLAYER_CONTROL_LOST")
|
||||||
self.bar:RegisterEvent("PLAYER_CONTROL_GAINED")
|
self.bar:RegisterEvent("PLAYER_CONTROL_GAINED")
|
||||||
self.bar:RegisterEvent("PLAYER_FARSIGHT_FOCUS_CHANGED")
|
self.bar:RegisterEvent("PLAYER_FARSIGHT_FOCUS_CHANGED")
|
||||||
@@ -62,7 +60,9 @@ end
|
|||||||
function PetBarMod:OnDisable()
|
function PetBarMod:OnDisable()
|
||||||
if not self.bar then return end
|
if not self.bar then return end
|
||||||
|
|
||||||
UnregisterUnitWatch(self.bar)
|
UnregisterStateDriver(self.bar)
|
||||||
|
self:SetAttribute("state-visibility", nil)
|
||||||
|
self.bar:Hide()
|
||||||
|
|
||||||
self.bar:Disable()
|
self.bar:Disable()
|
||||||
self:ToggleOptions()
|
self:ToggleOptions()
|
||||||
@@ -108,16 +108,11 @@ end
|
|||||||
function PetBar:ApplyConfig(config)
|
function PetBar:ApplyConfig(config)
|
||||||
ButtonBar.ApplyConfig(self, config)
|
ButtonBar.ApplyConfig(self, config)
|
||||||
self:UpdateButtonLayout()
|
self:UpdateButtonLayout()
|
||||||
|
self:InitVisibilityDriver()
|
||||||
|
self:RegisterVisibilityCondition("[bonusbar:5]hide")
|
||||||
|
self:RegisterVisibilityCondition("[pet]show")
|
||||||
|
self:RegisterVisibilityCondition("hide")
|
||||||
|
self:ApplyVisibilityDriver()
|
||||||
self:ForAll("Update")
|
self:ForAll("Update")
|
||||||
self:ForAll("ApplyStyle", self.config.style)
|
self:ForAll("ApplyStyle", self.config.style)
|
||||||
end
|
end
|
||||||
|
|
||||||
function PetBar:Unlock()
|
|
||||||
UnregisterUnitWatch(self)
|
|
||||||
ButtonBar.Unlock(self)
|
|
||||||
end
|
|
||||||
|
|
||||||
function PetBar:Lock()
|
|
||||||
ButtonBar.Lock(self)
|
|
||||||
RegisterUnitWatch(self, false)
|
|
||||||
end
|
|
||||||
|
|||||||
Reference in New Issue
Block a user