Originally Posted by
PMAarun
I recently returned to WoW and have started using ElvUI, particularly that with the Affinitii presets. Prior to installing the addon, I was just running the base WoW UI and was enjoying how new abilities were placed on my toolbar as I leveled up. With the ElvUI, this is no longer the case. I was wondering if there was any way I could change this?
Let me know if there are any bugs with this:
In Interface/Addons create a new folder "ElvUI_PushToActionBar". In that folder, create blank text files "ElvUI_PushToActionBar.toc" and "core.lua" (NOT .txt files). Then open those files in Notepad or other text editor and paste the respective code chunks here:
ElvUI_PushToActionBar.toc
Code:
## Interface: 50300
## Title: |cff1784d1ElvUI|r PushToActionBar
## Author: pnutbutter
## Notes: Re-enables the animation and auto-placing to the ActionBar upon learning a new spell.
## RequiredDeps: ElvUI
core.lua
core.lua
Code:
local E = unpack(ElvUI)
local AB = E.ActionBars
local function undoElvDisable()
IconIntroTracker:SetParent(UIParent)
IconIntroTracker:Show()
IconIntroTracker:RegisterEvent("SPELL_PUSHED_TO_ACTIONBAR")
IconIntroTracker:SetScript("OnEvent",IconIntroTracker_OnEvent)
end
AB.orig_DisableBlizzard=AB.DisableBlizzard
AB.DisableBlizzard=function(self)
self:orig_DisableBlizzard()
undoElvDisable()
end
local function pushSpellToActionBar(self,spellID,slotIndex,slotPos)
local _, _, icon = GetSpellInfo(spellID);
local freeIcon;
for a,b in pairs(self.iconList) do
if b.isFree then
freeIcon = b;
end
end
if not freeIcon then -- Make a new one
freeIcon = CreateFrame("FRAME", self:GetName().."Icon"..(#self.iconList+1), UIParent, "IconIntroTemplate");
self.iconList[#self.iconList+1] = freeIcon;
end
freeIcon.icon.icon:SetTexture(icon);
freeIcon.icon.slot = slotIndex;
freeIcon:ClearAllPoints();
freeIcon:SetPoint("CENTER", _G["ElvUI_Bar1Button"..slotPos], 0, 0);
freeIcon:SetFrameLevel(_G["ElvUI_Bar1Button"..slotPos]:GetFrameLevel()+1);
freeIcon.icon.flyin:Play(1);
freeIcon.isFree = false;
if not HasAction(slotPos) then
PickupSpell(spellID)
PlaceAction(slotPos)
end
end
IconIntroTracker_OnEvent=function(self, event, ...)
print("IconIntroTracker_OnEvent fired")
if event == "SPELL_PUSHED_TO_ACTIONBAR" or event=="COMBAT_LOG_EVENT_UNFILTERED" then
if InCombatLockdown() then
if not self.queue then
self.queue={}
end
local spellID, slotIndex, slotPos = ...;
tinsert(self.queue,{spellID,slotIndex,slotPos})
self:RegisterEvent("PLAYER_REGEN_ENABLED")
else
pushSpellToActionBar(self,...)
end
elseif event == "PLAYER_REGEN_ENABLED" then
for i=1,#self.queue do
pushSpellToActionBar(self,unpack(self.queue[i]))
end
wipe(self.queue)
self:UnregisterEvent("PLAYER_REGEN_ENABLED")
end
end
undoElvDisable()