Mercurial > wow > skeletonkey
diff SkeletonKey/ActionTemplates.lua @ 34:daff39af0c6d
changeset logjam
author | Nenue |
---|---|
date | Tue, 16 Aug 2016 10:24:55 -0400 |
parents | b0e4d04d428a |
children | 9a9d7f2a7c07 |
line wrap: on
line diff
--- a/SkeletonKey/ActionTemplates.lua Tue Aug 16 10:22:48 2016 -0400 +++ b/SkeletonKey/ActionTemplates.lua Tue Aug 16 10:24:55 2016 -0400 @@ -14,7 +14,7 @@ local GetNumBindings, GetBinding = GetNumBindings, GetBinding local kb, print, wrap = LibStub('LibKraken').register(KeyBinder, 'Info') -local cprint = DEVIAN_WORKSPACE and function(...) _G.print('Cfg', ...) end or function() end +local cprint = (DEVIAN_PNAME == 'SkeletonKey') and function(...) _G.print('Cfg', ...) end or function() end local CLICK_KEYBINDER_MACRO = "CLICK KeyBinderMacro:" local CLICK_KEYBINDER_KEY = "CLICK KeyBinderKey:" @@ -302,6 +302,10 @@ kb.UpdatePetInfo = function() local hasPetSpells, petType = HasPetSpells() + + --kb.PetCache.specNum = GetSpecialization(nil, true) + --kb.PetCache.specID, kb.PetCache.specName = GetSpecializationInfo(petSpec, nil, true) + if PetHasSpellbook() then print('PET SPELLBOOK') local i = 1 @@ -318,6 +322,11 @@ print('|cFF00FF88spellslot['..spellName..']|r', '=>', i, subText) if subText then + -- make sure that pet specialization subtext maps correctly + --if match(subText, kb.PetCache.specName) then + -- subText = 'specialization' + --end + kb.PetCache.subtext[subText] = kb.PetCache.subtext[subText] or {} specialNum[subText] = (specialNum[subText] or 0) + 1 @@ -374,11 +383,15 @@ local n = GetNumBindings() for i=1, n do local command, key1, key2 = GetBinding(i) - if key1 then - kb.SystemBindings[key1] = command - end - if key2 then - kb.SystemBindings[key2] = command + if not command:match('ACTION.*%d+') then + if key1 then + kb.SystemBindings[key1] = command + end + if key2 then + kb.SystemBindings[key2] = command + end + else + print('ignoring action button binding', command) end end end @@ -394,8 +407,13 @@ kb.pendingAttributes = {} kb.SecureAttribute = function(target, name, value) if InCombatLockdown() then + if #kb.pendingAttributes == 0 then + kb:Print(kb.L('Key bindings will be applied when you exit combat.')) + end + tinsert(kb.pendingAttributes, {target, name, value}) kb:RegisterEvent('PLAYER_REGEN_ENABLED') + else print(target:GetName(), 'attribute', '"'.. tostring(name)..'" = "'..tostring(value)..'"')