From a2f0466e153821c354838952f5a4eeea7a341569 Mon Sep 17 00:00:00 2001 From: pschifferer Date: Wed, 28 Oct 2009 03:36:12 +0000 Subject: [PATCH] Starting to re-enable auto-buy code. It's not ready yet, so don't try it. :-P --- CauldronMain.xml | 1 + CauldronMainUI.lua | 26 ++++++++++++++++++++------ CauldronShoppingList.lua | 8 ++++---- CauldronShoppingList.xml | 2 -- CauldronUtil.lua | 10 ++++++++++ 5 files changed, 35 insertions(+), 12 deletions(-) diff --git a/CauldronMain.xml b/CauldronMain.xml index 0d34efa..e855c9e 100644 --- a/CauldronMain.xml +++ b/CauldronMain.xml @@ -115,6 +115,7 @@ GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); GameTooltip:SetTradeSkillItem(self.skillIndex); + Cauldron:AppendToTooltip(GameTooltip, self.skillIndex); CursorUpdate(self); diff --git a/CauldronMainUI.lua b/CauldronMainUI.lua index 1fb665f..8036528 100644 --- a/CauldronMainUI.lua +++ b/CauldronMainUI.lua @@ -246,9 +246,9 @@ function Cauldron:UpdateFilterDropDowns() end function Cauldron:UpdateSkillList() ---@alpha@ + --@alpha@ self:debug("UpdateSkillList enter"); ---@end-alpha@ + --@end-alpha@ local skillName = CURRENT_TRADESKILL; if IsTradeSkillLinked() then @@ -259,17 +259,17 @@ function Cauldron:UpdateSkillList() if not skillList then return; end ---@alpha@ + --@alpha@ self:debug("UpdateSkillList: skillList="..#skillList); ---@end-alpha@ + --@end-alpha@ local height = 0; -- iterate over the list of skills for i, skillInfo in ipairs(skillList) do ---@alpha@ + --@alpha@ self:debug("UpdateSkillList: i="..i); ---@end-alpha@ + --@end-alpha@ local skillFrame = _G["CauldronSkillItem"..i]; @@ -334,6 +334,9 @@ function Cauldron:UpdateSkillList() elseif skillInfo.available > 0 then nameText = nameText.." ["..skillInfo.available.."]"; end + if Cauldron:GetAchievementsForSkill(skillInfo) then + nameText = nameText.." [A]"; + end frame:SetText(nameText); if TradeSkillTypeColor then local color = TradeSkillTypeColor[skillInfo.difficulty]; @@ -2193,3 +2196,14 @@ function Cauldron:ConfirmDialog(title, message, okayBtn, okayBtnCB, cancelBtn, c f:Show(); end + +function Cauldron:AppendToTooltip(tooltip, skillIndex) + if not tooltip then + return; + end + if not skillIndex then + return; + end + + +end diff --git a/CauldronShoppingList.lua b/CauldronShoppingList.lua index 41ac79e..0e8596d 100644 --- a/CauldronShoppingList.lua +++ b/CauldronShoppingList.lua @@ -3,6 +3,8 @@ CauldronShopping = {}; +local L = LibStub("AceLocale-3.0"):GetLocale("Cauldron") + --[[ list = { [""] = { @@ -174,16 +176,14 @@ function CauldronShopping:AutoBuyShoppingItems(list, requestor) end -- iterate over shopping list - --[[ - for r, _ in pairs(list) do - for item, amount in pairs(r) do + if list[requestor] then + for item, amount in pairs(list[requestor]) do -- check if the merchant has the item and it can be purchased if merchant[item] then CauldronShopping:BuyItem(item, merchant[item], amount); end end end - --]] end diff --git a/CauldronShoppingList.xml b/CauldronShoppingList.xml index d96194d..fc48411 100644 --- a/CauldronShoppingList.xml +++ b/CauldronShoppingList.xml @@ -190,7 +190,6 @@ - diff --git a/CauldronUtil.lua b/CauldronUtil.lua index 656bfa9..d631566 100644 --- a/CauldronUtil.lua +++ b/CauldronUtil.lua @@ -248,3 +248,13 @@ function Cauldron:SortTableIndices(t) return a; end +function Cauldron:GetAchievementsForSkill(skillInfo) + + if not skillInfo then + return nil; + end + + -- TODO + + return nil; +end -- 1.7.9.5