Commit 9f8d9aea authored by Simpy's avatar Simpy 🐹

12.14

parents 3961d781 cfde87dc
......@@ -190,6 +190,7 @@ function E:SetupTheme(theme, noDisplayMsg)
E.db.unitframe.colors.auraBarBuff = E:GetColor(.31, .31, .31)
E.db.unitframe.colors.castColor = E:GetColor(.31, .31, .31)
E.db.unitframe.colors.castClassColor = false
E.db.chat.tabSelectorColor = {r = 0.09, g = 0.51, b = 0.82}
elseif theme == 'class' then
classColor = E:ClassColor(E.myclass, true)
......@@ -200,6 +201,7 @@ function E:SetupTheme(theme, noDisplayMsg)
E.db.unitframe.colors.auraBarBuff = E:GetColor(classColor.r, classColor.g, classColor.b)
E.db.unitframe.colors.healthclass = true
E.db.unitframe.colors.castClassColor = true
E.db.chat.tabSelectorColor = E:GetColor(classColor.r, classColor.g, classColor.b)
else
E.db.general.bordercolor = (E.PixelMode and E:GetColor(0, 0, 0) or E:GetColor(.1, .1, .1))
E.db.general.backdropcolor = E:GetColor(.1, .1, .1)
......@@ -210,6 +212,7 @@ function E:SetupTheme(theme, noDisplayMsg)
E.db.unitframe.colors.health = E:GetColor(.1, .1, .1)
E.db.unitframe.colors.castColor = E:GetColor(.1, .1, .1)
E.db.unitframe.colors.castClassColor = false
E.db.chat.tabSelectorColor = {r = 0.09, g = 0.51, b = 0.82}
end
--Value Color
......@@ -272,14 +275,26 @@ function E:SetupLayout(layout, noDataReset, noDisplayMsg)
E.db.bags.bankWidth = 474
E.db.bags.itemLevelCustomColorEnable = true
E.db.bags.scrapIcon = true
E.db.bags.split.bag1 = true
E.db.bags.split.bag2 = true
E.db.bags.split.bag3 = true
E.db.bags.split.bag4 = true
E.db.bags.split.bagSpacing = 7
E.db.bags.split.player = true
--Chat
E.db.chat.fontSize = 10
E.db.chat.separateSizes = false
E.db.chat.panelHeight = 236
E.db.chat.panelWidth = 472
E.db.chat.tabFontSize = 10
E.db.chat.tabFontSize = 12
E.db.chat.copyChatLines = true
--DataTexts
E.db.datatexts.panels.LeftChatDataPanel[3] = 'QuickJoin'
--DataBars
E.db.databars.threat.height = 24
E.db.databars.threat.width = 472
E.db.databars.azerite.enable = false
E.db.databars.reputation.enable = true
--General
E.db.general.bonusObjectivePosition = 'AUTO'
E.db.general.minimap.size = 220
......@@ -288,7 +303,8 @@ function E:SetupLayout(layout, noDataReset, noDisplayMsg)
E.db.general.totems.growthDirection = 'HORIZONTAL'
E.db.general.totems.size = 50
E.db.general.totems.spacing = 8
E.db.general.autoTrackReputation = true
E.db.general.bonusObjectivePosition = "AUTO"
--Movers
for mover, position in pairs(E.LayoutMoverPositions.ALL) do
E.db.movers[mover] = position
......@@ -297,6 +313,29 @@ function E:SetupLayout(layout, noDataReset, noDisplayMsg)
--Tooltip
E.db.tooltip.healthBar.fontOutline = 'MONOCHROMEOUTLINE'
E.db.tooltip.healthBar.height = 12
E.db.movers.TooltipMover = nil --ensure that this mover gets completely reset.. yes E:ResetMover call above doesn't work.
E.db.tooltip.healthBar.font = "PT Sans Narrow"
E.db.tooltip.healthBar.fontOutline = "NONE"
E.db.tooltip.healthBar.fontSize = 12
--Nameplates
E.db.nameplates.colors.castNoInterruptColor = {r = 0.78, g=0.25, b=0.25}
E.db.nameplates.colors.reactions.good = {r = 0.30, g=0.67, b=0.29}
E.db.nameplates.colors.reactions.neutral = {r = 0.85, g=0.76, b=0.36}
E.db.nameplates.colors.selection[0] = {r = 0.78, g=0.25, b=0.25}
E.db.nameplates.colors.selection[2] = {r = 0.85, g=0.76, b=0.36}
E.db.nameplates.colors.selection[3] = {r = 0.29, g=0.67, b=0.30}
E.db.nameplates.colors.threat.badColor = {r = 0.78, g=0.25, b=0.25}
E.db.nameplates.colors.threat.goodColor = {r = 0.29, g=0.67, b=0.30}
E.db.nameplates.colors.threat.goodTransition = {r = 0.85, g=0.76, b=0.36}
E.db.nameplates.units.ENEMY_NPC.health.text.format = ""
E.db.nameplates.units.ENEMY_PLAYER.health.text.format = ""
E.db.nameplates.units.ENEMY_PLAYER.portrait.classicon = false
E.db.nameplates.units.ENEMY_PLAYER.portrait.enable = true
E.db.nameplates.units.ENEMY_PLAYER.portrait.position = "LEFT"
E.db.nameplates.units.ENEMY_PLAYER.portrait.xOffset = 0
E.db.nameplates.units.ENEMY_PLAYER.portrait.yOffset = 0
--UnitFrames
E.db.unitframe.smoothbars = true
E.db.unitframe.thinBorders = true
......@@ -353,7 +392,6 @@ function E:SetupLayout(layout, noDataReset, noDisplayMsg)
--Pet
E.db.unitframe.units.pet.castbar.iconSize = 32
E.db.unitframe.units.pet.castbar.width = 270
E.db.unitframe.units.pet.debuffs.anchorPoint = 'TOPRIGHT'
E.db.unitframe.units.pet.debuffs.enable = true
E.db.unitframe.units.pet.disableTargetGlow = false
E.db.unitframe.units.pet.infoPanel.height = 14
......
......@@ -188,27 +188,43 @@ local function SetTemplate(frame, template, glossTex, ignoreUpdates, forcePixelM
end
end
local function CreateBackdrop(frame, template, glossTex, ignoreUpdates, forcePixelMode, isUnitFrameElement, isNamePlateElement)
local function CreateBackdrop(frame, template, glossTex, ignoreUpdates, forcePixelMode, isUnitFrameElement, isNamePlateElement, allPoints, frameLevel)
local parent = (frame.IsObjectType and frame:IsObjectType('Texture') and frame:GetParent()) or frame
local backdrop = frame.backdrop or CreateFrame('Frame', nil, parent, 'BackdropTemplate')
if not frame.backdrop then frame.backdrop = backdrop end
backdrop:SetTemplate(template, glossTex, ignoreUpdates, forcePixelMode, isUnitFrameElement, isNamePlateElement)
if allPoints then
if allPoints == true then
backdrop:SetAllPoints()
else
backdrop:SetAllPoints(allPoints)
end
else
if forcePixelMode then
backdrop:SetOutside(frame, E.twoPixelsPlease and 2 or 1, E.twoPixelsPlease and 2 or 1)
else
local border = (isUnitFrameElement and UF.BORDER) or (isNamePlateElement and NP.BORDER)
backdrop:SetOutside(frame, border, border)
end
end
backdrop:SetTemplate(template, glossTex, ignoreUpdates, forcePixelMode, isUnitFrameElement, isNamePlateElement)
local frameLevel = parent.GetFrameLevel and parent:GetFrameLevel()
local frameLevelMinusOne = frameLevel and (frameLevel - 1)
if frameLevelMinusOne and (frameLevelMinusOne >= 0) then
backdrop:SetFrameLevel(frameLevelMinusOne)
if frameLevel then
if frameLevel == true then
backdrop:SetFrameLevel(parent:GetFrameLevel())
else
backdrop:SetFrameLevel(frameLevel)
end
else
local level = parent:GetFrameLevel()
local minus = level and (level - 1)
if minus and (minus >= 0) then
backdrop:SetFrameLevel(minus)
else
backdrop:SetFrameLevel(0)
end
end
end
local function CreateShadow(frame, size, pass)
......
## Interface: 90002
## Author: Elv, Simpy
## Version: 12.13
## Version: 12.14
## Title: |cff1784d1ElvUI|r
## Notes: User Interface replacement AddOn for World of Warcraft.
## SavedVariables: ElvDB, ElvPrivateDB
......
......@@ -299,9 +299,8 @@ function LO:CreateChatPanels()
lchat:SetFrameLevel(300)
lchat:Size(100, 100)
lchat:Point('BOTTOMLEFT', E.UIParent, 4, 4)
lchat:CreateBackdrop('Transparent')
lchat:CreateBackdrop('Transparent', nil, nil, nil, nil, nil, true)
lchat.backdrop.callbackBackdropColor = CH.Panel_ColorUpdate
lchat.backdrop:SetAllPoints()
lchat.FadeObject = {finishedFunc = finishFade, finishedArg1 = lchat, finishedFuncKeep = true}
E:CreateMover(lchat, 'LeftChatMover', L["Left Chat"], nil, nil, LO.ResaveChatPosition, nil, nil, 'chat,general', nil, true)
......@@ -349,9 +348,8 @@ function LO:CreateChatPanels()
rchat:SetFrameLevel(300)
rchat:Size(100, 100)
rchat:Point('BOTTOMRIGHT', E.UIParent, -4, 4)
rchat:CreateBackdrop('Transparent')
rchat:CreateBackdrop('Transparent', nil, nil, nil, nil, nil, true)
rchat.backdrop.callbackBackdropColor = CH.Panel_ColorUpdate
rchat.backdrop:SetAllPoints()
rchat.FadeObject = {finishedFunc = finishFade, finishedArg1 = rchat, finishedFuncKeep = true}
E:CreateMover(rchat, 'RightChatMover', L["Right Chat"], nil, nil, LO.ResaveChatPosition, nil, nil, 'chat,general', nil, true)
......
......@@ -29,7 +29,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]
local MAJOR_VERSION = "LibActionButton-1.0-ElvUI"
local MINOR_VERSION = 22 -- the real minor version is 79
local MINOR_VERSION = 23 -- the real minor version is 79
if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end
local lib, oldversion = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION)
......@@ -985,6 +985,7 @@ function UpdateRange(self, force) -- Sezz: moved from OnUpdate
hotkey:SetVertexColor(unpack(self.config.colors.usable))
end
end
lib.callbacks:Fire("OnUpdateRange", self)
end
end
......
......@@ -371,8 +371,7 @@ function AB:CreateBar(id)
bar:SetFrameStrata('LOW')
bar.id = id
bar:CreateBackdrop(AB.db.transparent and 'Transparent')
bar.backdrop:SetFrameLevel(0)
bar:CreateBackdrop(AB.db.transparent and 'Transparent', nil, nil, nil, nil, nil, nil, 0)
bar.buttons = {}
bar.bindButtons = defaults.bindButtons
......@@ -635,7 +634,6 @@ function AB:StyleButton(button, noBackdrop, useMasque, ignoreNormal)
if normal and not ignoreNormal then normal:SetTexture(); normal:Hide(); normal:SetAlpha(0) end
if normal2 then normal2:SetTexture(); normal2:Hide(); normal2:SetAlpha(0) end
if border and not button.useMasque then border:Kill() end
if count then
count:ClearAllPoints()
......@@ -647,19 +645,21 @@ function AB:StyleButton(button, noBackdrop, useMasque, ignoreNormal)
count:FontTemplate(LSM:Fetch('font', AB.db.font), AB.db.fontSize, AB.db.fontOutline)
end
count:SetTextColor(color.r, color.g, color.b)
local c = db and db.useCountColor and db.countColor or color
count:SetTextColor(c.r, c.g, c.b)
end
if macroText then
macroText:ClearAllPoints()
macroText:Point('BOTTOM', 0, 1)
macroText:FontTemplate(LSM:Fetch('font', AB.db.font), AB.db.fontSize, AB.db.fontOutline)
macroText:SetTextColor(color.r, color.g, color.b)
local c = db and db.useMacroColor and db.macroColor or color
macroText:SetTextColor(c.r, c.g, c.b)
end
if not button.noBackdrop and not button.backdrop and not button.useMasque then
button:CreateBackdrop(AB.db.transparent and 'Transparent', true)
button.backdrop:SetAllPoints()
button:CreateBackdrop(AB.db.transparent and 'Transparent', true, nil, nil, nil, nil, true)
end
if flash then
......@@ -694,9 +694,7 @@ function AB:StyleButton(button, noBackdrop, useMasque, ignoreNormal)
hotkey:FontTemplate(LSM:Fetch('font', AB.db.font), AB.db.fontSize, AB.db.fontOutline)
end
if button.config and (button.config.outOfRangeColoring ~= 'hotkey') then
button.HotKey:SetTextColor(color.r, color.g, color.b)
end
AB:UpdateHotkeyColor(button)
end
--Extra Action Button
......@@ -722,6 +720,14 @@ function AB:StyleButton(button, noBackdrop, useMasque, ignoreNormal)
end
end
function AB:UpdateHotkeyColor(button)
if button.config and not button.outOfRange then
local db = button.db
local c = db and db.useHotkeyColor and db.hotkeyColor or AB.db.fontColor
button.HotKey:SetVertexColor(c.r, c.g, c.b)
end
end
function AB:ColorSwipeTexture(cooldown)
if not cooldown then return end
......@@ -1041,10 +1047,11 @@ function AB:UpdateButtonConfig(bar, buttonName)
return
end
local barDB = AB.db['bar'..bar.id]
if not bar.buttonConfig then bar.buttonConfig = { hideElements = {}, colors = {} } end
bar.buttonConfig.hideElements.macro = not AB.db.macrotext
bar.buttonConfig.hideElements.hotkey = not AB.db.hotkeytext
bar.buttonConfig.showGrid = AB.db['bar'..bar.id].showGrid
bar.buttonConfig.hideElements.hotkey = not AB.db.hotkeytext or barDB.hideHotkey
bar.buttonConfig.showGrid = barDB.showGrid
bar.buttonConfig.clickOnDown = AB.db.keyDown
bar.buttonConfig.outOfRangeColoring = (AB.db.useRangeColorText and 'hotkey') or 'button'
bar.buttonConfig.colors.range = E:SetColorTable(bar.buttonConfig.colors.range, AB.db.noRangeColor)
......@@ -1297,9 +1304,11 @@ end
function AB:LAB_ButtonUpdate(button)
local color = AB.db.fontColor
local db = button.db
do
local color = db and db.useCountColor and db.countColor or color
button.Count:SetTextColor(color.r, color.g, color.b)
if button.config and (button.config.outOfRangeColoring ~= 'hotkey') then
button.HotKey:SetTextColor(color.r, color.g, color.b)
end
if button.backdrop then
......@@ -1308,6 +1317,10 @@ function AB:LAB_ButtonUpdate(button)
end
end
function AB:LAB_UpdateRange(button)
AB:UpdateHotkeyColor(button)
end
function AB:LAB_CooldownDone(button)
AB:SetButtonDesaturation(button, 0)
end
......@@ -1334,6 +1347,7 @@ function AB:Initialize()
AB.Initialized = true
LAB.RegisterCallback(AB, 'OnButtonUpdate', AB.LAB_ButtonUpdate)
LAB.RegisterCallback(AB, 'OnUpdateRange', AB.LAB_UpdateRange)
LAB.RegisterCallback(AB, 'OnButtonCreated', AB.LAB_ButtonCreated)
LAB.RegisterCallback(AB, 'OnChargeCreated', AB.LAB_ChargeCreated)
LAB.RegisterCallback(AB, 'OnCooldownUpdate', AB.LAB_CooldownUpdate)
......
......@@ -387,11 +387,7 @@ function AB:LoadKeyBinder()
Popup.discard:Point('BOTTOMLEFT', 14, 10)
Skins:HandleCheckBox(Popup.perCharCheck)
Skins:HandleButton(Popup.discard)
Skins:HandleButton(Popup.header)
Skins:HandleButton(Popup.save)
Popup.discard.backdrop:SetFrameLevel(Popup.discard:GetFrameLevel())
Popup.header.backdrop:SetFrameLevel(Popup.header:GetFrameLevel())
Popup.save.backdrop:SetFrameLevel(Popup.save:GetFrameLevel())
Skins:HandleButton(Popup.discard, nil, nil, nil, nil, nil, nil, nil, true)
Skins:HandleButton(Popup.header, nil, nil, nil, nil, nil, nil, nil, true)
Skins:HandleButton(Popup.save, nil, nil, nil, nil, nil, nil, nil, true)
end
......@@ -118,8 +118,7 @@ function AB:SetupExtraButton()
spellButton.NormalTexture:SetAlpha(0)
spellButton:GetHighlightTexture():SetColorTexture(1, 1, 1, .25)
spellButton:StyleButton(nil, true)
spellButton:CreateBackdrop()
spellButton.backdrop:SetAllPoints()
spellButton:CreateBackdrop(nil, nil, nil, nil, nil, nil, true)
spellButton.Icon:SetDrawLayer('ARTWORK')
spellButton.Icon:SetTexCoord(unpack(E.TexCoords))
spellButton.Icon:SetInside()
......@@ -151,9 +150,7 @@ function AB:SetupExtraButton()
self:StyleButton(button, true) -- registers cooldown too
button.icon:SetDrawLayer('ARTWORK')
button:CreateBackdrop()
button.backdrop:SetAllPoints()
button.backdrop:SetFrameLevel(button:GetFrameLevel())
button:CreateBackdrop(nil, nil, nil, nil, nil, nil, true, true)
AB:ExtraButtons_BossStyle(button)
......
......@@ -66,8 +66,7 @@ function AB:HandleMicroButton(button)
local normal = button:GetNormalTexture()
local disabled = button:GetDisabledTexture()
button:CreateBackdrop()
button.backdrop:SetAllPoints()
button:CreateBackdrop(nil, nil, nil, nil, nil, nil, true)
button:SetParent(microBar)
button:GetHighlightTexture():Kill()
......@@ -188,9 +187,7 @@ function AB:UpdateMicroButtons()
end
function AB:SetupMicroBar()
microBar:CreateBackdrop(AB.db.transparent and 'Transparent')
microBar.backdrop:SetFrameLevel(0)
microBar:CreateBackdrop(AB.db.transparent and 'Transparent', nil, nil, nil, nil, nil, nil, 0)
microBar:Point('TOPLEFT', E.UIParent, 'TOPLEFT', 4, -48)
microBar:EnableMouse(false)
......
......@@ -184,13 +184,16 @@ end
function AB:UpdatePetBindings()
for i = 1, NUM_PET_ACTION_SLOTS do
if AB.db.hotkeytext then
local button = _G['PetActionButton'..i]
if not button then break end
if AB.db.hotkeytext and not (button.db and button.db.hideHotkey) then
local key = GetBindingKey('BONUSACTIONBUTTON'..i)
_G['PetActionButton'..i..'HotKey']:Show()
_G['PetActionButton'..i..'HotKey']:SetText(key)
AB:FixKeybindText(_G['PetActionButton'..i])
button.HotKey:Show()
button.HotKey:SetText(key)
AB:FixKeybindText(button)
else
_G['PetActionButton'..i..'HotKey']:Hide()
button.HotKey:Hide()
end
end
end
......
......@@ -240,7 +240,7 @@ function AB:UpdateStanceBindings()
local button = _G['ElvUI_StanceBarButton'..i]
if not button then break end
if AB.db.hotkeytext then
if AB.db.hotkeytext and not (button.db and button.db.hideHotkey) then
button.HotKey:Show()
button.HotKey:SetText(GetBindingKey('SHAPESHIFTBUTTON'..i))
......@@ -252,8 +252,7 @@ function AB:UpdateStanceBindings()
end
function AB:CreateBarShapeShift()
bar:CreateBackdrop(AB.db.transparent and 'Transparent')
bar.backdrop:SetFrameLevel(0)
bar:CreateBackdrop(AB.db.transparent and 'Transparent', nil, nil, nil, nil, nil, nil, 0)
bar:Point('TOPLEFT', E.UIParent, 'BOTTOMLEFT', 4, -769)
......
......@@ -6,6 +6,7 @@ local ipairs = ipairs
local unpack = unpack
local tinsert = tinsert
local CreateFrame = CreateFrame
local GetCVarBool = GetCVarBool
local GetBagSlotFlag = GetBagSlotFlag
local RegisterStateDriver = RegisterStateDriver
local NUM_BAG_FRAMES = NUM_BAG_FRAMES
......@@ -27,10 +28,9 @@ function B:SkinBag(bag)
bag.oldTex = icon:GetTexture()
bag:StripTextures()
bag:CreateBackdrop()
bag:CreateBackdrop(nil, nil, nil, nil, nil, nil, true)
bag:StyleButton(true)
bag.IconBorder:Kill()
bag.backdrop:SetAllPoints()
icon:SetInside()
icon:SetTexture(bag.oldTex)
......@@ -38,15 +38,16 @@ function B:SkinBag(bag)
end
function B:SizeAndPositionBagBar()
if not B.BagBar then return; end
if not B.BagBar then return end
local buttonSpacing = E.db.bags.bagBar.spacing
local backdropSpacing = E.db.bags.bagBar.backdropSpacing
local bagBarSize = E.db.bags.bagBar.size
local showBackdrop = E.db.bags.bagBar.showBackdrop
local buttonSpacing = E.db.bags.bagBar.spacing
local growthDirection = E.db.bags.bagBar.growthDirection
local sortDirection = E.db.bags.bagBar.sortDirection
local showBackdrop = E.db.bags.bagBar.showBackdrop
local backdropSpacing = not showBackdrop and 0 or E.db.bags.bagBar.backdropSpacing
local visibility = E.db.bags.bagBar.visibility
if visibility and visibility:match('[\n\r]') then
visibility = visibility:gsub('[\n\r]','')
......@@ -54,39 +55,44 @@ function B:SizeAndPositionBagBar()
RegisterStateDriver(B.BagBar, 'visibility', visibility)
B.BagBar:SetAlpha(E.db.bags.bagBar.mouseover and 0 or 1)
B.BagBar.backdrop:SetShown(showBackdrop)
local bdpSpacing = (showBackdrop and backdropSpacing + E.Border) or 0
local btnSpacing = (buttonSpacing + E.Border)
local firstButton, lastButton
for i, button in ipairs(B.BagBar.buttons) do
local prevButton = B.BagBar.buttons[i-1]
button:Size(bagBarSize, bagBarSize)
button.ElvUIFilterIcon.FilterBackdrop:Size(bagBarSize / 2)
button:Size(bagBarSize)
button:ClearAllPoints()
button.Count:SetShown(GetCVarBool('displayFreeBagSlots'))
if sortDirection == 'ASCENDING'then
if i == 1 then firstButton = button else lastButton = button end
else
if i == 1 then lastButton = button else firstButton = button end
end
if growthDirection == 'HORIZONTAL' and sortDirection == 'ASCENDING' then
if i == 1 then
button:Point('LEFT', B.BagBar, 'LEFT', bdpSpacing, 0)
button:Point('LEFT', B.BagBar, 'LEFT', backdropSpacing, 0)
elseif prevButton then
button:Point('LEFT', prevButton, 'RIGHT', btnSpacing, 0)
button:Point('LEFT', prevButton, 'RIGHT', buttonSpacing, 0)
end
elseif growthDirection == 'VERTICAL' and sortDirection == 'ASCENDING' then
if i == 1 then
button:Point('TOP', B.BagBar, 'TOP', 0, -bdpSpacing)
button:Point('TOP', B.BagBar, 'TOP', 0, -backdropSpacing)
elseif prevButton then
button:Point('TOP', prevButton, 'BOTTOM', 0, -btnSpacing)
button:Point('TOP', prevButton, 'BOTTOM', 0, -buttonSpacing)
end
elseif growthDirection == 'HORIZONTAL' and sortDirection == 'DESCENDING' then
if i == 1 then
button:Point('RIGHT', B.BagBar, 'RIGHT', -bdpSpacing, 0)
button:Point('RIGHT', B.BagBar, 'RIGHT', -backdropSpacing, 0)
elseif prevButton then
button:Point('RIGHT', prevButton, 'LEFT', -btnSpacing, 0)
button:Point('RIGHT', prevButton, 'LEFT', -buttonSpacing, 0)
end
else
if i == 1 then
button:Point('BOTTOM', B.BagBar, 'BOTTOM', 0, bdpSpacing)
button:Point('BOTTOM', B.BagBar, 'BOTTOM', 0, backdropSpacing)
elseif prevButton then
button:Point('BOTTOM', prevButton, 'TOP', 0, btnSpacing)
button:Point('BOTTOM', prevButton, 'TOP', 0, buttonSpacing)
end
end
for j = LE_BAG_FILTER_FLAG_EQUIPMENT, NUM_LE_BAG_FILTER_FLAGS do
......@@ -110,16 +116,21 @@ function B:SizeAndPositionBagBar()
end
local btnSize = bagBarSize * (NUM_BAG_FRAMES + 1)
local btnSpace = btnSpacing * NUM_BAG_FRAMES
local bdpDoubled = bdpSpacing * 2
local btnSpace = buttonSpacing * NUM_BAG_FRAMES
local bdpDoubled = backdropSpacing * 2
B.BagBar.backdrop:ClearAllPoints()
B.BagBar.backdrop:Point('TOPLEFT', firstButton, 'TOPLEFT', -backdropSpacing, backdropSpacing)
B.BagBar.backdrop:Point('BOTTOMRIGHT', lastButton, 'BOTTOMRIGHT', backdropSpacing, -backdropSpacing)
B.BagBar.backdrop:SetShown(showBackdrop)
if growthDirection == 'HORIZONTAL' then
B.BagBar:Width(btnSize + btnSpace + bdpDoubled)
B.BagBar:Height(bagBarSize + bdpDoubled)
B.BagBar:Size(btnSize + btnSpace + bdpDoubled, bagBarSize + bdpDoubled)
else
B.BagBar:Height(btnSize + btnSpace + bdpDoubled)
B.BagBar:Width(bagBarSize + bdpDoubled)
B.BagBar:Size(bagBarSize + bdpDoubled, btnSize + btnSpace + bdpDoubled)
end
B.BagBar.mover:SetSize(B.BagBar.backdrop:GetSize())
end
function B:LoadBagBar()
......@@ -127,12 +138,11 @@ function B:LoadBagBar()
B.BagBar = CreateFrame('Frame', 'ElvUIBags', E.UIParent)
B.BagBar:Point('TOPRIGHT', _G.RightChatPanel, 'TOPLEFT', -4, 0)
B.BagBar.buttons = {}
B.BagBar:CreateBackdrop(E.db.bags.transparent and 'Transparent')
B.BagBar.backdrop:SetAllPoints()
B.BagBar:EnableMouse(true)
B.BagBar:CreateBackdrop(E.db.bags.transparent and 'Transparent', nil, nil, nil, nil, nil, true)
B.BagBar:SetScript('OnEnter', OnEnter)
B.BagBar:SetScript('OnLeave', OnLeave)
B.BagBar:EnableMouse(true)
B.BagBar.buttons = {}
_G.MainMenuBarBackpackButton:SetParent(B.BagBar)
_G.MainMenuBarBackpackButton:ClearAllPoints()
......@@ -152,6 +162,7 @@ function B:LoadBagBar()
b:HookScript('OnLeave', OnLeave)
B:SkinBag(b)
tinsert(B.BagBar.buttons, b)
end
......@@ -174,7 +185,8 @@ function B:LoadBagBar()