From bed9bb75e8df5dcfe6789c98e4953c961fbb00c9 Mon Sep 17 00:00:00 2001 From: pschifferer Date: Thu, 22 Jan 2009 23:24:00 +0000 Subject: [PATCH] Restored some messed up "fixes." :'( --- Cauldron/Cauldron.toc | 4 ++++ Cauldron/CauldronMain.lua | 12 ++++++------ Cauldron/CauldronMain.xml | 6 +++--- Cauldron/CauldronMainUI.lua | 20 +++++++++++--------- Cauldron/CauldronQueue.lua | 11 +++++------ Cauldron/CauldronShoppingList.xml | 27 +++++++++++++++++++++------ 6 files changed, 50 insertions(+), 30 deletions(-) diff --git a/Cauldron/Cauldron.toc b/Cauldron/Cauldron.toc index 65f670f..2e67c8d 100755 --- a/Cauldron/Cauldron.toc +++ b/Cauldron/Cauldron.toc @@ -12,6 +12,10 @@ ## X-Category: Tradeskill ## X-eMail: dm AT critical DASH failure DOT org ## X-Curse-Packaged-Version: r220 +## X-Curse-Packaged-Version: r27 +## X-Curse-Project-Name: Cauldron +## X-Curse-Project-ID: cauldron +## X-Curse-Repository-ID: wow/cauldron/mainline embeds.xml diff --git a/Cauldron/CauldronMain.lua b/Cauldron/CauldronMain.lua index 3260313..8cbbfe8 100644 --- a/Cauldron/CauldronMain.lua +++ b/Cauldron/CauldronMain.lua @@ -97,9 +97,8 @@ function Cauldron:OnEnable() self:debug("OnEnable enter"); self:InitPlayer(); - self:RegisterEvent("TRADE_SKILL_SHOW", "OnTradeShow"); - self:RegisterEvent("TRADE_SKILL_UPDATE", "OnSkillUpdate"); + self:RegisterEvent("TRADE_SKILL_UPDATE", "OnTradeUpdate"); self:RegisterEvent("TRADE_SKILL_CLOSE", "OnTradeClose"); self:RegisterEvent("SKILL_LINES_CHANGED", "OnSkillUpdate"); self:RegisterEvent("ADDON_LOADED", "OnAddonLoaded"); @@ -118,6 +117,8 @@ function Cauldron:OnEnable() -- self:RegisterEvent("PLAYER_REGEN_ENABLED"); -- self:RegisterEvent("AUCTION_HOUSE_CLOSED"); -- self:RegisterEvent("AUCTION_HOUSE_SHOW"); + self:RegisterEvent("CRAFT_SHOW", "OnCraftShow"); + self:RegisterEvent("CRAFT_CLOSE", "OnCraftClose"); -- self:RegisterEvent("PLAYER_LOGOUT"); self:RegisterEvent("UI_ERROR_MESSAGE", "OnError"); self:HookTooltips(); @@ -579,8 +580,7 @@ end ["amount"] = , -- amount of this skill that must be executed ["priority"] = , -- priority of the skill, for ordering in the queue ["icon"] = "", -- the icon path of the skill, for display - ["skillIndex"] = , -- the index of the skill, for API call usage - ["reagentIndex"] = , -- the index of the reagent, for API call usage + ["index"] = , -- the index of the skill, for API call usage }, }, ["main"] = { @@ -590,7 +590,7 @@ end ["amount"] = , ["priority"] = , ["icon"] = "", - ["skillIndex"] = , + ["index"] = , }, }, ["reagents"] = { @@ -598,9 +598,9 @@ end ["tradeskill"] = "", ["name"] = "", ["amount"] = , + ["index"] = , -- the index of the reagent, for API call usage ["icon"] = "", ["skillIndex"] = , - ["reagentIndex"] = , -- the index of the reagent, for API call usage }, }, }, diff --git a/Cauldron/CauldronMain.xml b/Cauldron/CauldronMain.xml index 3351691..8daf935 100644 --- a/Cauldron/CauldronMain.xml +++ b/Cauldron/CauldronMain.xml @@ -30,7 +30,7 @@ GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT"); - GameTooltip:SetTradeSkillItem(self.skillIndex, self.reagentIndex); + GameTooltip:SetTradeSkillItem(self.skillIndex, self:GetID()); CursorUpdate(self); @@ -41,7 +41,7 @@ CursorOnUpdate(self); - HandleModifiedItemClick(GetTradeSkillReagentItemLink(self.skillIndex, self.reagentIndex)); + -- HandleModifiedItemClick(GetTradeSkillReagentItemLink(TradeSkillFrame.selectedSkill, self:GetID())); @@ -341,7 +341,7 @@ -- self.hasItem = 1; - HandleModifiedItemClick(GetTradeSkillItemLink(self.skillIndex, self.reagentIndex)); + -- HandleModifiedItemClick(GetTradeSkillItemLink(TradeSkillFrame.selectedSkill)); GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); diff --git a/Cauldron/CauldronMainUI.lua b/Cauldron/CauldronMainUI.lua index ce83b46..3836efa 100644 --- a/Cauldron/CauldronMainUI.lua +++ b/Cauldron/CauldronMainUI.lua @@ -186,7 +186,6 @@ function Cauldron:UpdateSkillList() skillFrame:SetID(i); skillFrame.skillIndex = skillInfo.index; - skillFrame.reagentIndex = nil; -- set selection if self.db.realm.userdata[self.vars.playername].skills[skillName].window.selected == skillInfo.index then @@ -303,8 +302,7 @@ function Cauldron:UpdateSkillList() local reagentInfo = skillInfo.reagents[j]; self:debug("UpdateSkillList: reagentInfo="..tostring(reagentInfo)); - reagentFrame.skillIndex = skillInfo.reagents[j].skillIndex; - reagentFrame.reagentIndex = skillInfo.reagents[j].index; + reagentFrame.skillIndex = skillInfo.index; if j > reagentCount then self:debug("UpdateSkillList: hide the reagent frame"); @@ -560,8 +558,9 @@ function Cauldron:UpdateQueue() -- set the icon frame = _G["CauldronQueueItem"..i.."Icon"]; frame:SetNormalTexture(queueInfo.icon); - frame.skillIndex = queueInfo.skillIndex; - frame.reagentIndex = nil; + if skillInfo then + frame.skillIndex = skillInfo.index; + end -- set the amount frame = _G["CauldronQueueItem"..i.."IconCount"]; @@ -694,8 +693,9 @@ function Cauldron:UpdateQueue() -- set the icon frame = _G["CauldronQueueIntItem"..i.."Icon"]; frame:SetNormalTexture(queueInfo.icon); - frame.skillIndex = queueInfo.skillIndex; - frame.reagentIndex = queueInfo.reagentIndex; + if skillInfo then + frame.skillIndex = skillInfo.index; + end -- set the amount frame = _G["CauldronQueueIntItem"..i.."IconCount"]; @@ -812,8 +812,10 @@ function Cauldron:UpdateQueue() -- set the icon frame = _G["CauldronQueueReagentItem"..i.."Icon"]; frame:SetNormalTexture(queueInfo.icon); - frame.skillIndex = queueInfo.skillIndex; - frame.reagentIndex = queueInfo.reagentIndex; + if skillInfo then + frame.skillIndex = queueInfo.skillIndex; + frame.reagentIndex = queueInfo.index; + end -- local playerReagentCount = 0; -- TODO -- if playerReagentCount < queueInfo.amount then -- frame:SetVertexColor(0.5, 0.5, 0.5, 1.0); diff --git a/Cauldron/CauldronQueue.lua b/Cauldron/CauldronQueue.lua index ee2573a..ec01e06 100644 --- a/Cauldron/CauldronQueue.lua +++ b/Cauldron/CauldronQueue.lua @@ -36,14 +36,13 @@ function CauldronQueue:NewQueue() return queue; end -function CauldronQueue:NewItem(name, icon, tradeskill, index, amount, priority, reagentIndex) +function CauldronQueue:NewItem(name, icon, tradeskill, index, amount, priority) local queueItem = { ["name"] = name or "", ["icon"] = icon or "", ["tradeskill"] = tradeskill or "", - ["skillIndex"] = index, - ["reagentIndex"] = reagentIndex, + ["index"] = index, ["amount"] = amount or 1, ["priority"] = priority or 0, }; @@ -51,7 +50,7 @@ function CauldronQueue:NewItem(name, icon, tradeskill, index, amount, priority, return queueItem; end -function CauldronQueue:NewReagent(name, icon, amount, tradeskill, reagentIndex, skillIndex) +function CauldronQueue:NewReagent(name, icon, amount, tradeskill, index, skillIndex) local reagent = { ["name"] = name or "", @@ -59,7 +58,7 @@ function CauldronQueue:NewReagent(name, icon, amount, tradeskill, reagentIndex, ["amount"] = amount or 1, ["tradeskill"] = tradeskill, ["skillIndex"] = skillIndex, - ["reagentIndex"] = reagentIndex, + ["index"] = index, }; return reagent; @@ -271,7 +270,7 @@ function CauldronQueue:AddIntermediate(queue, reagent, amount) local skillInfo = Cauldron:GetSkillInfoForItem(reagent.name); -- it's not there, so create a new instance - queue.intermediate[reagent.name] = CauldronQueue:NewItem(reagent.name, reagent.icon, skillInfo.tradeskill, skillInfo.index, amount, reagent.index); + queue.intermediate[reagent.name] = CauldronQueue:NewItem(reagent.name, reagent.icon, skillInfo.tradeskill, skillInfo.index, amount); end end diff --git a/Cauldron/CauldronShoppingList.xml b/Cauldron/CauldronShoppingList.xml index 08d1aac..e17dc5f 100644 --- a/Cauldron/CauldronShoppingList.xml +++ b/Cauldron/CauldronShoppingList.xml @@ -41,7 +41,9 @@