Quantcast

Added PAC 5.0 "compatability". Reverted update logic to old system.

Daniel Yates [08-19-11 - 22:03]
Added PAC 5.0 "compatability". Reverted update logic to old system.
Filename
Core.lua
Modules/Buttons.lua
diff --git a/Core.lua b/Core.lua
index 8ee66b0..00d13f9 100644
--- a/Core.lua
+++ b/Core.lua
@@ -364,6 +364,14 @@ function CoreFrame:OnEvent(event, ...)
 	if(event == "ADDON_LOADED") then
 		-- Make sure we're the loaded one.
 		if(... == "PowerAurasButtons") then
+			-- Check: If PAC >= 5.0, bail.
+			if(PowaAuras and PowaAuras:VersionGreater(PowaAuras.VersionParts, {Major=4,Minor=99,Build=0,Revision=""})) then
+				self:Print("You're using Power Auras 5.0. Using my witty charms and general awesomeness, " ..
+					"this plugin has been integrated into Power Auras directly. /dance, /cheer and /lick. " ..
+					"Your settings have not been migrated, but you can do so by using the slash command " ..
+					"\"/powa pacb\". You do not need to keep this addon after migrating your settings.");
+				return;
+			end
 			-- Fix config first.
 			CoreFrame:FixSettings();
 			-- Create an epic event.
@@ -380,4 +388,4 @@ function CoreFrame:OnEvent(event, ...)
 	end
 end
 -- Register.
-CoreFrame:SetScript("OnEvent", CoreFrame.OnEvent);
\ No newline at end of file
+CoreFrame:SetScript("OnEvent", CoreFrame.OnEvent);
diff --git a/Modules/Buttons.lua b/Modules/Buttons.lua
index 6db4865..a3b4ff9 100644
--- a/Modules/Buttons.lua
+++ b/Modules/Buttons.lua
@@ -360,11 +360,11 @@ function ModuleFrame:OnInitialize()
 					ButtonsBySlot[button._state_action] = button;
 				end
 			end);
---			-- Add a button update hook.
---			LAB:RegisterCallback("OnButtonUpdate", function(_, button)
---				if(not button:IsShown()) then return; end
---				ModuleFrame:UpdateButton(button);
---			end);
+			-- Add a button update hook.
+			LAB:RegisterCallback("OnButtonUpdate", function(_, button)
+				if(not button:IsShown()) then return; end
+				ModuleFrame:UpdateButton(button);
+			end);
 		end
 	end
 	-- Odds are you're using the default buttons if you're not using Dominos/BT.
@@ -378,22 +378,22 @@ function ModuleFrame:OnInitialize()
 		ModuleFrame:RegisterButtons("MultiBarBottomRightButton");
 		ModuleFrame:RegisterButtons("MultiBarBottomLeftButton");
 	end
---	-- If you use Dominos or have the Blizzard buttons on, you need this.
---	if(Dominos or RazerNaga or CoreFrame:GetModuleSetting("Buttons", "RegisterBlizzardButtons")) then
---		-- Hook for button updates.
---		hooksecurefunc("ActionButton_Update", function(button)
---			if(not button:IsShown()) then return; end
---			ModuleFrame:UpdateButton(button);
---		end);
---	end
-	-- Update only if slot data changes.
-	CoreFrame:RegisterBlizzEventListener("ACTIONBAR_SLOT_CHANGED", ModuleFrame, function(self, id)
-		if(id == 0 or not ButtonsBySlot[id]) then
-			ModuleFrame:UpdateAllButtons();
-		else
-			ModuleFrame:UpdateButton(ButtonsBySlot[id]);
-		end
-	end);
+	-- If you use Dominos or have the Blizzard buttons on, you need this.
+	if(Dominos or RazerNaga or CoreFrame:GetModuleSetting("Buttons", "RegisterBlizzardButtons")) then
+		-- Hook for button updates.
+		hooksecurefunc("ActionButton_Update", function(button)
+			if(not button:IsShown()) then return; end
+			ModuleFrame:UpdateButton(button);
+		end);
+	end
+--	-- Update only if slot data changes.
+--	CoreFrame:RegisterBlizzEventListener("ACTIONBAR_SLOT_CHANGED", ModuleFrame, function(self, id)
+--		if(id == 0 or not ButtonsBySlot[id]) then
+--			ModuleFrame:UpdateAllButtons();
+--		else
+--			ModuleFrame:UpdateButton(ButtonsBySlot[id]);
+--		end
+--	end);
 	-- Create some events for modules to hook on to.
 	CoreFrame:RegisterModuleEvent("OnButtonUpdate");
 	CoreFrame:RegisterModuleEvent("OnButtonProcess");