Skip to content
Permalink
Browse files

Use default StaticPopupDialog for buy new bags.

  • Loading branch information...
Shestak committed Oct 18, 2014
1 parent b73edb9 commit f2ed9d03e91ae41991d898a9e56da999810deb41
@@ -145,7 +145,6 @@ L_ERRORFRAME_L = "点击查看错误."

-- Bags
L_BAG_BANK = "银行"
L_BAG_NO_SLOTS = "不能再购买更多的背包栏位!"
L_BAG_COSTS = "花费: %.2f 金"
L_BAG_BUY_SLOTS = "输入 /bags purchase yes 以购买银行背包栏位"
L_BAG_OPEN_BANK = "您需要先造访您的银行"
@@ -141,7 +141,6 @@ L_ERRORFRAME_L = "Click to view errors."

-- Bags
L_BAG_BANK = "Bank"
L_BAG_NO_SLOTS = "Can't buy anymore slots!"
L_BAG_COSTS = "Cost: %.2f gold"
L_BAG_BUY_SLOTS = "Buy new slot with /bags purchase yes"
L_BAG_OPEN_BANK = "You need to open your bank first."
@@ -145,7 +145,6 @@ L_ERRORFRAME_L = "Clic gauche pour afficher les erreurs."

-- Bags
L_BAG_BANK = "Banque"
L_BAG_NO_SLOTS = "Vous ne pouvez pas acheter plus d'emplacement !"
L_BAG_COSTS = "Prix: %.2f or"
L_BAG_BUY_SLOTS = "Acheter un nouvel emplacement avec /bags"
L_BAG_OPEN_BANK = "Vous devez d'abord ouvrir votre banque."
@@ -145,7 +145,6 @@ L_ERRORFRAME_L = "Klick um Fehler anzuzeigen."

-- Bags
L_BAG_BANK = "Bank"
L_BAG_NO_SLOTS = "Kann keine weiteren Taschenplätze kaufen!"
L_BAG_COSTS = "Kosten: %.2f Gold"
L_BAG_BUY_SLOTS = "Kaufe neuen Platz mit /bags purchase yes"
L_BAG_OPEN_BANK = "Du musst erst das Bankfach öffnen."
@@ -145,7 +145,6 @@ L_ERRORFRAME_L = "Clicca per vedere gli errori."

-- Bags
L_BAG_BANK = "Banca"
L_BAG_NO_SLOTS = "Non puoi comprare altri spazi!"
L_BAG_COSTS = "Costo in oro: %.2f"
L_BAG_BUY_SLOTS = "Compra nuovi spazi con /bags purchase yes"
L_BAG_OPEN_BANK = "Devi prima aprire la tua banca."
@@ -145,7 +145,6 @@ L_ERRORFRAME_L = "Щелкните, чтобы посмотреть ошибки

-- Bags
L_BAG_BANK = "Банк"
L_BAG_NO_SLOTS = "Невозможно купить еще ячеек!"
L_BAG_COSTS = "Цена: %.2f золотых"
L_BAG_BUY_SLOTS = "Купить новую ячейку командой /bags purchase yes"
L_BAG_OPEN_BANK = "Сначала откройте банк."
@@ -145,7 +145,6 @@ L_ERRORFRAME_L = "Click para ver errores."

-- Bags
L_BAG_BANK = "Banco"
L_BAG_NO_SLOTS = "¡No puedes comprar más espacios!"
L_BAG_COSTS = "Costo: %.2f oro"
L_BAG_BUY_SLOTS = "Compra un nuevo espacio mediante /bags purchase yes"
L_BAG_OPEN_BANK = "Necesitas abrir primero el banco."
@@ -145,7 +145,6 @@ L_ERRORFRAME_L = "點擊查看錯誤"

-- Bags
L_BAG_BANK = "銀行"
L_BAG_NO_SLOTS = "不能再購買更多的背包欄位!"
L_BAG_COSTS = "花費: %.2f 金"
L_BAG_BUY_SLOTS = "輸入 /bags purchase yes 以購買銀行背包欄位"
L_BAG_OPEN_BANK = "您需要先造訪您的銀行"
@@ -58,30 +58,6 @@ local function IsItemUnusable(...)
end
end

StaticPopupDialogs.BUY_BANK_SLOT = {
text = CONFIRM_BUY_BANK_SLOT,
button1 = YES,
button2 = NO,
OnAccept = function(self)
PurchaseSlot()
end,
OnShow = function(self)
MoneyFrame_Update(self.moneyFrame, GetBankSlotCost())
end,
hasMoneyFrame = 1,
timeout = 0,
hideOnEscape = 1,
preferredIndex = 5,
}

StaticPopupDialogs.CANNOT_BUY_BANK_SLOT = {
text = L_BAG_NO_SLOTS,
button1 = ACCEPT,
timeout = 0,
whileDead = 1,
preferredIndex = 5,
}

-- Hide bags options in default interface
InterfaceOptionsDisplayPanelShowFreeBagSpace:Hide()

@@ -540,33 +516,15 @@ function Stuffing:CreateBagFrame(w)
end

if w == "Bank" then
-- Buy button
f.b_purchase = CreateFrame("Button", "Stuffing_PurchaseButton"..w, f)
f.b_purchase:SetSize(80, 20)
f.b_purchase:SetPoint("TOPLEFT", 10, -4)
f.b_purchase:RegisterForClicks("AnyUp")
f.b_purchase:SkinButton()
f.b_purchase:SetScript("OnClick", function(self, btn)
local _, full = GetNumBankSlots()
if not full then
StaticPopup_Show("BUY_BANK_SLOT")
else
StaticPopup_Show("CANNOT_BUY_BANK_SLOT")
end
end)
f.b_purchase:FontString("text", C.font.bags_font, C.font.bags_font_size, C.font.bags_font_style)
f.b_purchase.text:SetPoint("CENTER")
f.b_purchase.text:SetText(BANKSLOTPURCHASE)
f.b_purchase:SetFontString(f.b_purchase.text)

-- Reagent button
f.b_reagent = CreateFrame("Button", "Stuffing_ReagentButton"..w, f)
f.b_reagent:SetSize(105, 20)
f.b_reagent:SetPoint("TOPLEFT", f.b_purchase, "TOPRIGHT", 3, 0)
f.b_reagent:SetPoint("TOPLEFT", 10, -4)
f.b_reagent:RegisterForClicks("AnyUp")
f.b_reagent:SkinButton()
f.b_reagent:SetScript("OnClick", function()
BankFrame_ShowPanel(BANK_PANELS[2].name)
PlaySound("igBackPackOpen")
if not ReagentBankFrame.isMade then
CreateReagentContainer()
ReagentBankFrame.isMade = true
@@ -578,6 +536,24 @@ function Stuffing:CreateBagFrame(w)
f.b_reagent.text:SetPoint("CENTER")
f.b_reagent.text:SetText(REAGENT_BANK)
f.b_reagent:SetFontString(f.b_reagent.text)

-- Buy button
f.b_purchase = CreateFrame("Button", "Stuffing_PurchaseButton"..w, f)
f.b_purchase:SetSize(80, 20)
f.b_purchase:SetPoint("TOPLEFT", f.b_reagent, "TOPRIGHT", 3, 0)
f.b_purchase:RegisterForClicks("AnyUp")
f.b_purchase:SkinButton()
f.b_purchase:SetScript("OnClick", function(self) StaticPopup_Show("CONFIRM_BUY_BANK_SLOT") end)
f.b_purchase:FontString("text", C.font.bags_font, C.font.bags_font_size, C.font.bags_font_style)
f.b_purchase.text:SetPoint("CENTER")
f.b_purchase.text:SetText(BANKSLOTPURCHASE)
f.b_purchase:SetFontString(f.b_purchase.text)
local _, full = GetNumBankSlots()
if full then
f.b_purchase:Hide()
else
f.b_purchase:Show()
end
end

-- Close button
@@ -878,6 +854,7 @@ function Stuffing:ADDON_LOADED(addon)
self:RegisterEvent("GUILDBANKFRAME_OPENED")
self:RegisterEvent("GUILDBANKFRAME_CLOSED")
self:RegisterEvent("PLAYERBANKSLOTS_CHANGED")
self:RegisterEvent("PLAYERBANKBAGSLOTS_CHANGED")
self:RegisterEvent("BAG_CLOSED")
self:RegisterEvent("BAG_UPDATE_COOLDOWN")
self:RegisterEvent("REAGENTBANK_UPDATE")
@@ -1008,6 +985,15 @@ function Stuffing:BAG_UPDATE_COOLDOWN()
end
end

function Stuffing:PLAYERBANKBAGSLOTS_CHANGED()
local _, full = GetNumBankSlots()
if full then
Stuffing_PurchaseButtonBank:Hide()
else
Stuffing_PurchaseButtonBank:Show()
end
end

function Stuffing.Menu(self, level)
if not level then return end

0 comments on commit f2ed9d0

Please sign in to comment.
You can’t perform that action at this time.