bags: use already existing constant for max bags

This commit is contained in:
shagu
2019-11-08 15:58:21 +01:00
parent 1335624c65
commit cf3bff92b2
3 changed files with 3 additions and 7 deletions
-1
View File
@@ -26,7 +26,6 @@ COOLDOWN_FRAME_TYPE = "Cooldown"
LOOT_BUTTON_FRAME_TYPE = "Button"
PLAYER_BUFF_START_ID = 0
MAX_BANK_SLOTS = 6
ACTIONBAR_SECURE_TEMPLATE_BAR = "SecureStateHeaderTemplate"
ACTIONBAR_SECURE_TEMPLATE_BUTTON = "SecureActionButtonTemplate"
-1
View File
@@ -26,7 +26,6 @@ COOLDOWN_FRAME_TYPE = "Model"
LOOT_BUTTON_FRAME_TYPE = "LootButton"
PLAYER_BUFF_START_ID = -1
MAX_BANK_SLOTS = 6
ACTIONBAR_SECURE_TEMPLATE_BAR = nil
ACTIONBAR_SECURE_TEMPLATE_BUTTON = nil
+3 -5
View File
@@ -442,7 +442,7 @@ pfUI:RegisterModule("bags", "vanilla:tbc", function ()
local position = "RIGHT"
if frame == pfUI.bag.left then
min, max = 1, math.min(MAX_BANK_SLOTS, (GetNumBankSlots() or 0))
min, max = 1, math.min(NUM_BANKBAGSLOTS, (GetNumBankSlots() or 0))
tpl = "BankItemButtonBagTemplate"
name, append = "pfUIBankBBag", ""
position = "LEFT"
@@ -452,14 +452,12 @@ pfUI:RegisterModule("bags", "vanilla:tbc", function ()
CreateBackdrop(frame.bagslots, default_border)
CreateBackdropShadow(frame.bagslots)
local extra = 0
if frame == pfUI.bag.left and GetNumBankSlots() < MAX_BANK_SLOTS then extra = 1 end
local extra = frame == pfUI.bag.left and GetNumBankSlots() < NUM_BANKBAGSLOTS and 1 or 0
local width = (frame.button_size/5*4 + default_border*2) * (max-min+1+extra)
local height = default_border + (frame.button_size/5*4 + default_border)
frame.bagslots:SetWidth(width)
frame.bagslots:SetHeight(height)
for slot=min, max do
if not frame.bagslots.slots[slot] then
frame.bagslots.slots[slot] = {}
@@ -516,7 +514,7 @@ pfUI:RegisterModule("bags", "vanilla:tbc", function ()
end
if frame == pfUI.bag.left then
if GetNumBankSlots() < MAX_BANK_SLOTS then
if GetNumBankSlots() < NUM_BANKBAGSLOTS then
if not frame.bagslots.buy then
frame.bagslots.buy = CreateFrame("Button", "pfBagSlotBuy", frame.bagslots)
end