local name, addon = ... |
local db |
local bagButtons = { |
'CharacterBag3Slot', |
'CharacterBag2Slot', |
'CharacterBag1Slot', |
'CharacterBag0Slot', |
'MainMenuBarBackpackButton', |
} |
local buttons = {} |
local function init() -- Bags |
db = addon['updateDB'](addon['db']['profile']) |
local f = CreateFrame("Frame", name.."BagBar", UIParent) |
f['maxslots'] = 5 |
f['sbuttons'] = {} |
addon['addDrag'](f) |
for i = 1, #bagButtons do |
local btn = _G[bagButtons[i]] |
if(btn) then |
f['sbuttons'][#f['sbuttons'] + 1] = btn |
end |
end |
addon['applySettings'](name.."BagBar") |
end |
local function init2() -- MicroMenu |
db = addon['updateDB'](addon['db']['profile']) |
local f = _G[name.."MicroMenu"] or CreateFrame("Frame", name.."MicroMenu", UIParent) |
f['maxslots'] = #MICRO_BUTTONS |
f['sbuttons'] = {} |
f['skipMasque'] = true |
addon['addDrag'](f) |
for _, bname in pairs(MICRO_BUTTONS) do |
local btn = _G[bname] |
if(btn) then |
if(not InCombatLockdown()) then |
UIPARENT_MANAGED_FRAME_POSITIONS[btn:GetName()] = nil |
f['sbuttons'][#f['sbuttons'] + 1] = btn |
end |
end |
end |
addon['applySettings'](name.."MicroMenu",36) |
end |
addon['preloads'][#addon['preloads'] + 1] = init |
addon['preloads'][#addon['preloads'] + 1] = init2 |