Quantcast

Forgot about bank open/close. >.<

pschifferer [10-30-09 - 03:43]
Forgot about bank open/close. >.<
Filename
CauldronMain.lua
diff --git a/CauldronMain.lua b/CauldronMain.lua
index f3e6673..29d1ff1 100644
--- a/CauldronMain.lua
+++ b/CauldronMain.lua
@@ -188,7 +188,7 @@ function Cauldron:OnEnable()
 	self:RegisterEvent("UNIT_PORTRAIT_UPDATE", "OnEvent");
 	self:RegisterEvent("UPDATE_TRADESKILL_RECAST", "OnTradeSkillRecast");
 	self:RegisterEvent("BANKFRAME_OPENED", "OnBankOpened");
---	self:RegisterEvent("BANKFRAME_CLOSED");
+	self:RegisterEvent("BANKFRAME_CLOSED", "OnBankClosed");
 --	self:RegisterEvent("PLAYERBANKSLOTS_CHANGED");
 --	self:RegisterEvent("PLAYERBANKBAGSLOTS_CHANGED");
 	self:RegisterEvent("MERCHANT_SHOW", "OnMerchantShow");
@@ -510,13 +510,30 @@ function Cauldron:OnBankOpened()
 	self:debug("OnBankOpened enter");
 --@end-alpha@

-	Cauldron:ShowShoppingList();
-
+	-- check if there's anything in the shopping list
+	if CauldronShopping:ContainsItems(Cauldron.db.realm.shopping) then
+		Cauldron:ShowShoppingList();
+	end
+
 --@alpha@
 	self:debug("OnBankOpened exit");
 --@end-alpha@
 end

+function Cauldron:OnBankClosed()
+--@alpha@
+	self:debug("OnBankClosed enter");
+--@end-alpha@
+
+	if not CauldronShopping:ContainsItems(Cauldron.db.realm.shopping) then
+		Cauldron:HideShoppingList();
+	end
+
+--@alpha@
+	self:debug("OnBankClosed exit");
+--@end-alpha@
+end
+
 function Cauldron:OnError()
 --@alpha@
 	self:debug("OnError enter");