bags: fix amount of bankslots in tbc

This commit is contained in:
shagu
2019-11-07 22:11:23 +01:00
parent 4e0610afaf
commit 1335624c65
3 changed files with 6 additions and 6 deletions
+1
View File
@@ -26,6 +26,7 @@ COOLDOWN_FRAME_TYPE = "Cooldown"
LOOT_BUTTON_FRAME_TYPE = "Button" LOOT_BUTTON_FRAME_TYPE = "Button"
PLAYER_BUFF_START_ID = 0 PLAYER_BUFF_START_ID = 0
MAX_BANK_SLOTS = 6
ACTIONBAR_SECURE_TEMPLATE_BAR = "SecureStateHeaderTemplate" ACTIONBAR_SECURE_TEMPLATE_BAR = "SecureStateHeaderTemplate"
ACTIONBAR_SECURE_TEMPLATE_BUTTON = "SecureActionButtonTemplate" ACTIONBAR_SECURE_TEMPLATE_BUTTON = "SecureActionButtonTemplate"
+1
View File
@@ -26,6 +26,7 @@ COOLDOWN_FRAME_TYPE = "Model"
LOOT_BUTTON_FRAME_TYPE = "LootButton" LOOT_BUTTON_FRAME_TYPE = "LootButton"
PLAYER_BUFF_START_ID = -1 PLAYER_BUFF_START_ID = -1
MAX_BANK_SLOTS = 6
ACTIONBAR_SECURE_TEMPLATE_BAR = nil ACTIONBAR_SECURE_TEMPLATE_BAR = nil
ACTIONBAR_SECURE_TEMPLATE_BUTTON = nil ACTIONBAR_SECURE_TEMPLATE_BUTTON = nil
+4 -6
View File
@@ -442,7 +442,7 @@ pfUI:RegisterModule("bags", "vanilla:tbc", function ()
local position = "RIGHT" local position = "RIGHT"
if frame == pfUI.bag.left then if frame == pfUI.bag.left then
min, max = 1, math.min(6, (GetNumBankSlots() or 0)) min, max = 1, math.min(MAX_BANK_SLOTS, (GetNumBankSlots() or 0))
tpl = "BankItemButtonBagTemplate" tpl = "BankItemButtonBagTemplate"
name, append = "pfUIBankBBag", "" name, append = "pfUIBankBBag", ""
position = "LEFT" position = "LEFT"
@@ -453,7 +453,7 @@ pfUI:RegisterModule("bags", "vanilla:tbc", function ()
CreateBackdropShadow(frame.bagslots) CreateBackdropShadow(frame.bagslots)
local extra = 0 local extra = 0
if frame == pfUI.bag.left and GetNumBankSlots() < 6 then extra = 1 end if frame == pfUI.bag.left and GetNumBankSlots() < MAX_BANK_SLOTS then extra = 1 end
local width = (frame.button_size/5*4 + default_border*2) * (max-min+1+extra) 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) local height = default_border + (frame.button_size/5*4 + default_border)
@@ -505,12 +505,10 @@ pfUI:RegisterModule("bags", "vanilla:tbc", function ()
frame.bagslots.slots[slot].frame:SetHeight(frame.button_size/5*4) frame.bagslots.slots[slot].frame:SetHeight(frame.button_size/5*4)
frame.bagslots.slots[slot].frame:SetWidth(frame.button_size/5*4) frame.bagslots.slots[slot].frame:SetWidth(frame.button_size/5*4)
local id, texture = GetInventorySlotInfo("Bag" .. slot .. append)
CreateBackdrop(frame.bagslots.slots[slot].frame, default_border) CreateBackdrop(frame.bagslots.slots[slot].frame, default_border)
frame.bagslots.slots[slot].frame:Show() frame.bagslots.slots[slot].frame:Show()
local numSlots, full = GetNumBankSlots() if ( slot <= GetNumBankSlots() ) then
if ( slot <= numSlots ) then
frame.bagslots.slots[slot].frame.tooltipText = BANK_BAG frame.bagslots.slots[slot].frame.tooltipText = BANK_BAG
else else
frame.bagslots.slots[slot].frame.tooltipText = BANK_BAG_PURCHASE frame.bagslots.slots[slot].frame.tooltipText = BANK_BAG_PURCHASE
@@ -518,7 +516,7 @@ pfUI:RegisterModule("bags", "vanilla:tbc", function ()
end end
if frame == pfUI.bag.left then if frame == pfUI.bag.left then
if GetNumBankSlots() < 6 then if GetNumBankSlots() < MAX_BANK_SLOTS then
if not frame.bagslots.buy then if not frame.bagslots.buy then
frame.bagslots.buy = CreateFrame("Button", "pfBagSlotBuy", frame.bagslots) frame.bagslots.buy = CreateFrame("Button", "pfBagSlotBuy", frame.bagslots)
end end