view Events.lua @ 72:c48913c5924c

- Dynamic bindings properly update between talent choices, and the hotkey text is also correctly reflected.
author Nenue
date Sat, 07 Jan 2017 12:47:41 -0500
parents 131d9190db6b
children 9824d524a661
line wrap: on
line source
-- KrakTool
-- Events.lua
-- Created: 7/24/2016 11:10 PM
-- %file-revision%
-- Event handlers, and the init block that sets them up; nothing else should be here

local _, kb = ...
local print = (DEVIAN_PNAME == 'SkeletonKey') and function(...) _G.print('SkeletonKey', ...) end or function() end


kb.PLAYER_LOGIN = function(_, _, addon)

end

kb.PLAYER_REGEN_DISABLED = function()
  SkeletonKey:SetShown(false)
end

kb.UNIT_PORTRAIT_UPDATE = function()
  SkeletonKey:Update()
end

kb.PLAYER_REGEN_ENABLED = function()
  SkeletonKey:Update()
end

kb.PLAYER_SPECIALIZATION_CHANGED =  function(...)

  kb.UpdateSpecInfo()
  kb.UpdateTalentInfo()

  kb.SelectProfileSet(kb.profileName)
  kb.ApplyAllBindings()
  SkeletonKey:Update(true)
end
kb.PLAYER_TALENT_UPDATE = function()
  --kb.UpdateTalentInfo()
  --kb.SelectProfileSet(kb.profileName)
  --kb.ApplyAllBindings()
  --SkeletonKey:Update()
end
kb.ACTIONBAR_SLOT_CHANGED = function(self, event, slot)
  --kb.HotKeyText(slot)
  return true
end

-- only need to respond to this for pet actions
kb.SPELLS_CHANGED = function(self, event, unit)
  print('|cFFFF0088'.. event..'|r', unit)
  kb.UpdatePetInfo()
end

kb.UPDATE_MACROS = function()
  kb.UpdateMacroInfo()
end

kb.UPDATE_BINDINGS = function()
  kb.UpdateSystemBinds()
end