View Single Post
03-07-13, 01:46 PM   #9
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Here's how I did it, using non-Ace3 speak:
Lua Code:
  1. local MyAddOn = ...
  2. local eventFrame = CreateFrame("Frame")
  3. eventFrame:RegisterEvent("PLAYER_LOGIN")
  4. eventFrame:RegisterEvent("PLAYER_REGEN_ENABLED")
  5. eventFrame:RegiserEvent("PLAYER_REGEN_DISABLED")
  6.  
  7. function MyAddOn:SetBindings()
  8.     -- set your override bindings
  9. end
  10.  
  11. function MyAddOn:ClearBindings()
  12.     -- clear all overrides
  13. end
  14.  
  15. function MyAddOn:PLAYER_LOGIN()
  16.     self:SetBindings()
  17.     eventFrame:UnregisterEvent("PLAYER_LOGIN")
  18. end
  19.  
  20. function MyAddOn:PLAYER_REGEN_ENABLED()
  21.     self:SetBindings()
  22. end
  23.  
  24. function MyAddOn:PLAYER_REGEN_DISABLED()
  25.     self:ClearBindings()
  26. end
  Reply With Quote