What I've been working on:
https://gist.github.com/fc52a4369833ec30e03f
lua Code:
local addon = CreateFrame('Frame')
addon:RegisterEvent('PLAYER_LOGIN')
addon:SetScript('OnEvent', function(self, event) self[event](ExtraActionBarFrame, event) end)
function addon:PLAYER_LOGIN()
if(UIPARENT_MANAGED_FRAME_POSITIONS.ExtraActionBarFrame) then
UIPARENT_MANAGED_FRAME_POSITIONS.ExtraActionBarFrame = nil
end
self:SetParent(UIParent)
self:SetMovable(true)
self:EnableMouse(true)
self:RegisterForDrag('LeftButton')
self:ClearAllPoints()
if(ExtraBarPosition) then
local point, x, y = string.split('\031', ExtraBarPosition)
self:SetPoint(point, UIParent, point, x, y)
else
ExtraBarPosition = 'LEFT\03140\0310'
self:SetPoint('LEFT', 40, 0)
end
self:SetScript('OnDragStart', function(self)
if(IsAltKeyDown()) then
self:StartMoving()
end
end)
self:SetScript('OnDragStop', function(self)
self:StopMovingOrSizing()
local point, _, _, x, y = self:GetPoint()
ExtraBarPosition = string.format('%s\031%d\031%d', point, x, y)
if(InCombatLockdown()) then
self:ClearAllPoints()
self:SetPoint(point, UIParent, point, x, y)
else
addon:RegisterEvent('PLAYER_REGEN_ENABLED')
end
end)
end
function addon:PLAYER_REGEN_ENABLED(event)
addon:UnregisterEvent(event)
local point, x, y = string.split('\031', ExtraBarPosition)
self:ClearAllPoints()
self:SetPoint(point, UIParent, point, x, y)
end