Made the shopping list appear when merchant and bank windows are opened.
pschifferer [10-25-09 - 14:33]
Made the shopping list appear when merchant and bank windows are opened.
diff --git a/CauldronMain.lua b/CauldronMain.lua
index d26253e..1687d82 100644
--- a/CauldronMain.lua
+++ b/CauldronMain.lua
@@ -187,7 +187,7 @@ function Cauldron:OnEnable()
self:RegisterEvent("ADDON_LOADED", "OnAddonLoaded");
self:RegisterEvent("UNIT_PORTRAIT_UPDATE", "OnEvent");
self:RegisterEvent("UPDATE_TRADESKILL_RECAST", "OnTradeSkillRecast");
--- self:RegisterEvent("BANKFRAME_OPENED");
+ self:RegisterEvent("BANKFRAME_OPENED", "OnBankOpened");
-- self:RegisterEvent("BANKFRAME_CLOSED");
-- self:RegisterEvent("PLAYERBANKSLOTS_CHANGED");
-- self:RegisterEvent("PLAYERBANKBAGSLOTS_CHANGED");
@@ -477,6 +477,8 @@ function Cauldron:OnMerchantShow()
self:debug("OnMerchantShow enter");
--@end-alpha@
+ Cauldron:ShowShoppingList();
+
if Cauldron.db.realm.userdata[Cauldron.vars.playername].options.autoBuy then
CauldronShopping:AutoBuyShoppingItems(Cauldron.db.realm.shopping, Cauldron.vars.playername);
end
@@ -486,6 +488,18 @@ function Cauldron:OnMerchantShow()
--@end-alpha@
end
+function Cauldron:OnBankOpened()
+--@alpha@
+ self:debug("OnBankOpened enter");
+--@end-alpha@
+
+ Cauldron:ShowShoppingList();
+
+--@alpha@
+ self:debug("OnBankOpened exit");
+--@end-alpha@
+end
+
function Cauldron:OnError()
--@alpha@
self:debug("OnError enter");
diff --git a/CauldronMain.xml b/CauldronMain.xml
index e5cad25..0d34efa 100644
--- a/CauldronMain.xml
+++ b/CauldronMain.xml
@@ -571,9 +571,11 @@
movable="true" resizable="false" parent="UIParent" enableMouse="true"
hidden="true">
<TitleRegion setAllPoints="true" />
- <Size x="692" y="465" />
+ <Size>
+ <AbsDimension x="692" y="465" />
+ </Size>
<Anchors>
- <Anchor point="CENTER" />
+ <Anchor point="TOPLEFT" />
</Anchors>
<!-- Window border and background -->
@@ -1399,7 +1401,7 @@
self:SetBackdropColor(.05,.05,.05,.8);
self:SetBackdropBorderColor(.4,.4,.4,1);
-- tinsert(UISpecialFrames, self:GetName());
- CauldronFrameTitleText:SetText(Cauldron:LocaleString("Cauldron").." v"..Cauldron.version);
+ CauldronFrameTitleText:SetText(Cauldron:LocaleString("Cauldron").." "..Cauldron.version);
</OnLoad>
<OnShow>
PlaySound("igCharacterInfoOpen");
diff --git a/CauldronMainUI.lua b/CauldronMainUI.lua
index f68c7af..a9300a5 100644
--- a/CauldronMainUI.lua
+++ b/CauldronMainUI.lua
@@ -22,8 +22,12 @@ function Cauldron:Frame_Show()
self:debug("Frame_Show: show our frame");
--@end-alpha@
ShowUIPanel(CauldronFrame);
+-- tinsert(UISpecialFrames, CauldronFrame:GetName());
if TradeSkillFrame then
+ -- place our frame over the original frame
+-- CauldronFrame:SetPoint("TOPLEFT", TradeSkillFrame:GetLeft(), TradeSkillFrame:GetTop());
+
--@alpha@
self:debug("Frame_Show: hide the original tradeskill frame");
--@end-alpha@
@@ -33,15 +37,22 @@ function Cauldron:Frame_Show()
Cauldron.vars.origFrameLevel = TradeSkillFrame:GetFrameLevel();
TradeSkillFrame:SetAlpha(0);
--- TradeSkillFrame:ClearAllPoints();
--- TradeSkillFrame:SetPoint("TOPLEFT", 0, 900);
+ TradeSkillFrame:ClearAllPoints();
+ TradeSkillFrame:SetPoint("TOPLEFT", 0, 900);
TradeSkillFrame:SetFrameStrata("BACKGROUND");
TradeSkillFrame:SetFrameLevel(1);
- TradeSkillFrame:SetWidth(692);
+ -- set the tradeskill frame's width to match ours
+-- TradeSkillFrame:SetWidth(692);
-- remove the tradeskill frame from the special frame list
+ for i,t in ipairs(UISpecialFrames) do
+ if t == TradeSkillFrame:GetName() then
+ table.remove(UISpecialFrames, i);
+ break;
+ end
+ end
+-- table.remove(
- -- set the tradeskill frame's width to match ours
end
self:RegisterMessage("Cauldron_Update", "OnCauldronUpdate");