Quantcast

Use 2nd arg of RegisterEvent() instead of creating new event handlers.

Johnny C. Lam [03-11-13 - 03:51]
Use 2nd arg of RegisterEvent() instead of creating new event handlers.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@747 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleActionBar.lua
diff --git a/OvaleActionBar.lua b/OvaleActionBar.lua
index 088deed..6e262f7 100644
--- a/OvaleActionBar.lua
+++ b/OvaleActionBar.lua
@@ -28,10 +28,10 @@ OvaleActionBar.shortCut = {}
 --<public-static-methods>
 function OvaleActionBar:OnEnable()
 	self:RegisterEvent("ACTIONBAR_SLOT_CHANGED")
-	self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
-	self:RegisterEvent("PLAYER_ENTERING_WORLD")
-	self:RegisterEvent("PLAYER_TALENT_UPDATE")
-	self:RegisterEvent("UPDATE_BINDINGS")
+	self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED", "FillActionIndexes")
+	self:RegisterEvent("PLAYER_ENTERING_WORLD", "FillActionIndexes")
+	self:RegisterEvent("PLAYER_TALENT_UPDATE", "FillActionIndexes")
+	self:RegisterEvent("UPDATE_BINDINGS", "FillActionIndexes")
 end

 function OvaleActionBar:OnDisable()
@@ -52,23 +52,6 @@ function OvaleActionBar:ACTIONBAR_SLOT_CHANGED(event, slot, unknown)
 	end
 end

-function OvaleActionBar:ACTIVE_TALENT_GROUP_CHANGED(event)
-	self:FillActionIndexes(event)
-end
-
-function OvaleActionBar:PLAYER_ENTERING_WORLD(event)
-	self:FillActionIndexes(event)
-end
-
-function OvaleActionBar:PLAYER_TALENT_UPDATE(event)
-	self:FillActionIndexes(event)
-end
-
---Called when the user changed his key bindings
-function OvaleActionBar:UPDATE_BINDINGS(event)
-	self:FillActionIndexes(event)
-end
-
 function OvaleActionBar:FillActionIndexes(event)
 	Ovale:debugPrint("action_bar", "Mapping buttons to spells/macros for " ..event)
 	self.actionSort = {}