From d817a8c26006e5412599e221cb35c83c216e85f6 Mon Sep 17 00:00:00 2001 From: pschifferer Date: Sun, 1 Feb 2009 23:09:54 +0000 Subject: [PATCH] Added alpha markers for debugging statements. --- CauldronMain.lua | 132 ++++++++++++++++++++++++++++++- CauldronMainUI.lua | 222 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 353 insertions(+), 1 deletion(-) diff --git a/CauldronMain.lua b/CauldronMain.lua index b1068ce..8fa5c2e 100644 --- a/CauldronMain.lua +++ b/CauldronMain.lua @@ -89,8 +89,10 @@ function Cauldron:OnInitialize() end function Cauldron:InitPlayer() +--@alpha@ self:debug("InitPlayer enter"); - +--@end-alpha@ + if not self.vars.playername then self.vars.playername = UnitName("player"); if not self.db.realm.userdata[self.vars.playername] then @@ -110,11 +112,15 @@ function Cauldron:InitPlayer() end end +--@alpha@ self:debug("InitPlayer exit"); +--@end-alpha@ end function Cauldron:OnEnable() +--@alpha@ self:debug("OnEnable enter"); +--@end-alpha@ self:InitPlayer(); self:RegisterEvent("TRADE_SKILL_SHOW", "OnTradeShow"); @@ -143,17 +149,25 @@ function Cauldron:OnEnable() self:RegisterEvent("UI_ERROR_MESSAGE", "OnError"); self:HookTooltips(); +--@alpha@ self:debug("OnEnable exit"); +--@end-alpha@ end function Cauldron:OnDisable() +--@alpha@ self:debug("OnDisable enter"); +--@end-alpha@ +--@alpha@ self:debug("OnDisable exit"); +--@end-alpha@ end function Cauldron:OnAddonLoaded(event, addon) +--@alpha@ self:debug("OnAddonLoaded enter"); +--@end-alpha@ -- show the shopping list? if self.db.profile.showShoppingList then @@ -164,11 +178,15 @@ function Cauldron:OnAddonLoaded(event, addon) end end +--@alpha@ self:debug("OnAddonLoaded exit"); +--@end-alpha@ end function Cauldron:OnEvent(event, ...) +--@alpha@ self:debug("OnEvent enter"); +--@end-alpha@ if ( event == "UNIT_PORTRAIT_UPDATE" ) then local arg1 = ...; @@ -177,41 +195,61 @@ function Cauldron:OnEvent(event, ...) end end +--@alpha@ self:debug("OnEvent exit"); +--@end-alpha@ end function Cauldron:OnTradeShow() +--@alpha@ self:debug("OnTradeShow enter"); +--@end-alpha@ -- update our known skills +--@alpha@ self:debug("OnTradeShow: update known skills"); +--@end-alpha@ self:UpdateSkills(); -- show the UI frame +--@alpha@ self:debug("OnTradeShow: show the UI"); +--@end-alpha@ self:Frame_Show(); +--@alpha@ self:debug("OnTradeShow exit"); +--@end-alpha@ end function Cauldron:OnTradeUpdate() +--@alpha@ self:debug("OnTradeUpdate enter"); +--@end-alpha@ -- TODO +--@alpha@ self:debug("OnTradeUpdate exit"); +--@end-alpha@ end function Cauldron:OnTradeClose() +--@alpha@ self:debug("OnTradeClose enter"); +--@end-alpha@ self:Frame_Hide(); +--@alpha@ self:debug("OnTradeClose exit"); +--@end-alpha@ end function Cauldron:OnSkillUpdate() +--@alpha@ self:debug("OnSkillUpdate enter"); +--@end-alpha@ -- self:UpdateSkills(); -- self:UpdateSpecializations(); @@ -235,11 +273,15 @@ function Cauldron:OnSkillUpdate() self:Frame_Update(); +--@alpha@ self:debug("OnSkillUpdate exit"); +--@end-alpha@ end function Cauldron:OnTradeSkillRecast() +--@alpha@ self:debug("OnTradeSkillRecast enter"); +--@end-alpha@ self:UpdateSkills(); @@ -247,11 +289,15 @@ function Cauldron:OnTradeSkillRecast() self:Frame_Update(); +--@alpha@ self:debug("OnTradeSkillRecast exit"); +--@end-alpha@ end function Cauldron:OnBagUpdate(event, bagid) +--@alpha@ self:debug("OnBagUpdate enter"); +--@end-alpha@ if (not CauldronFrame) or (not CauldronFrame:IsShown()) then return; @@ -275,13 +321,19 @@ function Cauldron:OnBagUpdate(event, bagid) -- check if we were making something, and then update the queue if self.makingItem then +--@alpha@ self:debug("OnBagUpdate: self.makingItem="..self.makingItem); +--@end-alpha@ local count = GetItemCount(self.makingItem); +--@alpha@ self:debug("OnBagUpdate: count="..count); self:debug("OnBagUpdate: self.itemCurrentCount="..self.itemCurrentCount); +--@end-alpha@ if count ~= self.itemCurrentCount then local delta = self.itemCurrentCount - count; -- TODO: is this necessary? +--@alpha@ self:debug("OnBagUpdate: delta="..delta); +--@end-alpha@ CauldronQueue:AdjustItemCount(Cauldron:GetQueue(), self.queueInfo.name, -1); self.itemCurrentCount = count; end @@ -293,43 +345,63 @@ function Cauldron:OnBagUpdate(event, bagid) self:Frame_Update(); +--@alpha@ self:debug("OnBagUpdate exit"); +--@end-alpha@ end function Cauldron:OnCraftShow() +--@alpha@ self:debug("OnCraftShow enter"); +--@end-alpha@ -- TODO +--@alpha@ self:debug("OnCraftShow exit"); +--@end-alpha@ end function Cauldron:OnCraftClose() +--@alpha@ self:debug("OnCraftClose enter"); +--@end-alpha@ -- TODO +--@alpha@ self:debug("OnCraftClose exit"); +--@end-alpha@ end function Cauldron:OnError() +--@alpha@ self:debug("OnError enter"); +--@end-alpha@ -- TODO +--@alpha@ self:debug("OnError exit"); +--@end-alpha@ end function Cauldron:TradeSkillFrame_SetSelection(id) +--@alpha@ self:debug("TradeSkillFrame_SetSelection enter"); +--@end-alpha@ -- TODO +--@alpha@ self:debug("TradeSkillFrame_SetSelection exit"); +--@end-alpha@ end function Cauldron:GetSelectedSkill() +--@alpha@ self:debug("GetSelectedSkill enter"); +--@end-alpha@ local skillName = CURRENT_TRADESKILL; if IsTradeSkillLinked() then @@ -344,13 +416,17 @@ function Cauldron:GetSelectedSkill() end end +--@alpha@ self:debug("GetSelectedSkill exit"); +--@end-alpha@ return nil; end function Cauldron:QueueAllTradeSkillItem() +--@alpha@ self:debug("QueueAllTradeSkillItem enter"); +--@end-alpha@ local skillInfo = Cauldron:GetSelectedSkill(); @@ -365,11 +441,15 @@ function Cauldron:QueueAllTradeSkillItem() end end +--@alpha@ self:debug("QueueAllTradeSkillItem exit"); +--@end-alpha@ end function Cauldron:QueueTradeSkillItem() +--@alpha@ self:debug("QueueTradeSkillItem enter"); +--@end-alpha@ local skillInfo = Cauldron:GetSelectedSkill(); @@ -381,11 +461,15 @@ function Cauldron:QueueTradeSkillItem() CauldronQueue:AddItem(self.db.realm.userdata[self.vars.playername].queue, skillInfo, amount); end +--@alpha@ self:debug("QueueTradeSkillItem exit"); +--@end-alpha@ end function Cauldron:CreateAllTradeSkillItem() +--@alpha@ self:debug("CreateAllTradeSkillItem enter"); +--@end-alpha@ if ( (not PartialPlayTime()) and (not NoPlayTime()) ) then CauldronAmountInputBox:ClearFocus(); @@ -397,11 +481,15 @@ function Cauldron:CreateAllTradeSkillItem() DoTradeSkill(skillInfo.index, skillInfo.available); end +--@alpha@ self:debug("CreateAllTradeSkillItem exit"); +--@end-alpha@ end function Cauldron:CreateTradeSkillItem() +--@alpha@ self:debug("CreateTradeSkillItem enter"); +--@end-alpha@ if ( (not PartialPlayTime()) and (not NoPlayTime()) ) then CauldronAmountInputBox:ClearFocus(); @@ -412,11 +500,15 @@ function Cauldron:CreateTradeSkillItem() DoTradeSkill(skillInfo.index, amount); end +--@alpha@ self:debug("CreateTradeSkillItem exit"); +--@end-alpha@ end function Cauldron:ProcessQueue() +--@alpha@ self:debug("ProcessQueue enter"); +--@end-alpha@ if IsTradeSkillLinked() then self:error("Can't process queue for linked tradeskill!"); @@ -425,34 +517,52 @@ function Cauldron:ProcessQueue() -- find intermediate items that need to be crafted local intQueue = CauldronQueue:GetIntermediates(self.db.realm.userdata[self.vars.playername].queue); +--@alpha@ self:debug("ProcessQueue: intQueue="..#intQueue); +--@end-alpha@ local queueInfo = nil; local skillInfo = nil; if #intQueue > 0 then +--@alpha@ self:debug("ProcessQueue: processing intermediate queue items"); +--@end-alpha@ queueInfo = intQueue[1]; +--@alpha@ self:debug("ProcessQueue: queueInfo="..queueInfo.name); +--@end-alpha@ skillInfo = Cauldron:GetSkillInfo(queueInfo.tradeskill, queueInfo.name); +--@alpha@ self:debug("ProcessQueue: skillInfo="..tostring(skillInfo)); +--@end-alpha@ else local queue = CauldronQueue:GetItems(self.db.realm.userdata[self.vars.playername].queue); +--@alpha@ self:debug("ProcessQueue: queue="..#queue); +--@end-alpha@ if #queue > 0 then +--@alpha@ self:debug("ProcessQueue: processing main queue items"); +--@end-alpha@ queueInfo = queue[1]; +--@alpha@ self:debug("ProcessQueue: queueInfo="..queueInfo.name); +--@end-alpha@ skillInfo = Cauldron:GetSkillInfo(queueInfo.tradeskill, queueInfo.name); +--@alpha@ self:debug("ProcessQueue: skillInfo="..tostring(skillInfo)); +--@end-alpha@ end end if queueInfo and skillInfo then +--@alpha@ self:debug("ProcessQueue: queueInfo="..queueInfo.name); +--@end-alpha@ if queueInfo.tradeskill ~= CURRENT_TRADESKILL then local msg = string.format(L["Crafting %1$s requires the %2$s skill."], queueInfo.name, queueInfo.tradeskill); @@ -460,7 +570,9 @@ function Cauldron:ProcessQueue() return; end +--@alpha@ self:debug("ProcessQueue: process item: "..queueInfo.name); +--@end-alpha@ Cauldron:ProcessItem(skillInfo, queueInfo, queueInfo.amount); else if not queueInfo then @@ -471,12 +583,16 @@ function Cauldron:ProcessQueue() end end +--@alpha@ self:debug("ProcessQueue exit"); +--@end-alpha@ end function Cauldron:ProcessItem(skillInfo, queueInfo, amount) +--@alpha@ self:debug("ProcessItem enter"); +--@end-alpha@ if (not skillInfo) or (amount < 1) then self:error("ProcessItem: Missing skill info!"); @@ -486,9 +602,13 @@ function Cauldron:ProcessItem(skillInfo, queueInfo, amount) if ((not PartialPlayTime()) and (not NoPlayTime())) then -- record the item we're making self.makingItem, _ = GetItemInfo(skillInfo.itemLink); +--@alpha@ self:debug("ProcessItem: self.makingItem="..self.makingItem); +--@end-alpha@ self.itemCurrentCount = GetItemCount(skillInfo.itemLink); +--@alpha@ self:debug("ProcessItem: self.itemCurrentCount="..self.itemCurrentCount); +--@end-alpha@ self.queueInfo = queueInfo; -- tell the user what we're doing @@ -500,7 +620,9 @@ function Cauldron:ProcessItem(skillInfo, queueInfo, amount) -- TODO: notify player? end +--@alpha@ self:debug("ProcessItem exit"); +--@end-alpha@ end function Cauldron:RemoveQueueItem(name) @@ -520,7 +642,9 @@ function Cauldron:DecreaseItemCount(name) end function Cauldron:GetQueue(player) +--@alpha@ self:debug("GetQueue enter"); +--@end-alpha@ if not player then player = self.vars.playername; @@ -532,7 +656,9 @@ function Cauldron:GetQueue(player) self.db.realm.userdata[player].queue = queue; end +--@alpha@ self:debug("GetQueue enter"); +--@end-alpha@ return queue; end @@ -563,7 +689,9 @@ end ---------------------------------------------------------------- function Cauldron:HookTooltips() +--@alpha@ self:debug("HookTooltips enter"); +--@end-alpha@ -- self:SecureHook(GameTooltip, "SetBagItem"); -- self:SecureHook(GameTooltip, "SetInventoryItem"); @@ -576,7 +704,9 @@ function Cauldron:HookTooltips() -- self:SecureHook(GameTooltip, "SetGuildBankItem"); -- self:SecureHook("SetItemRef"); +--@alpha@ self:debug("HookTooltips exit"); +--@end-alpha@ end ---------------------------------------------------------------------- diff --git a/CauldronMainUI.lua b/CauldronMainUI.lua index 97c8811..f5bafab 100644 --- a/CauldronMainUI.lua +++ b/CauldronMainUI.lua @@ -6,19 +6,27 @@ local L = LibStub("AceLocale-3.0"):GetLocale("Cauldron") -- CauldronUI = LibStub("AceAddon-3.0"):NewAddon("CauldronUI", "AceEvent-3.0", "AceConsole-3.0", "LibDebugLog-1.0") function Cauldron:Frame_Show() +--@alpha@ self:debug("Frame_Show enter"); +--@end-alpha@ +--@alpha@ self:debug("Frame_Show: close dropdown menus"); +--@end-alpha@ CloseDropDownMenus(); -- self:UpdateFramePosition(); -- self:UpdateFrameStrata(); +--@alpha@ self:debug("Frame_Show: show our frame"); +--@end-alpha@ ShowUIPanel(CauldronFrame); if TradeSkillFrame then +--@alpha@ self:debug("Frame_Show: hide the original tradeskill frame"); +--@end-alpha@ -- hide the original tradeskill frame TradeSkillFrame:SetAlpha(0); @@ -29,43 +37,65 @@ function Cauldron:Frame_Show() self:RegisterMessage("Cauldron_Update", "OnCauldronUpdate"); +--@alpha@ self:debug("Frame_Show: call Frame_Update()"); +--@end-alpha@ self:Frame_Update(); +--@alpha@ self:debug("Frame_Show exit"); +--@end-alpha@ end function Cauldron:Frame_Hide() +--@alpha@ self:debug("Frame_Hide enter"); +--@end-alpha@ self:UnregisterEvent("Cauldron_Update") HideUIPanel(CauldronFrame); +--@alpha@ self:debug("Frame_Hide exit"); +--@end-alpha@ end function Cauldron:Frame_Toggle() +--@alpha@ self:debug("Frame_Toggle enter"); +--@end-alpha@ if CauldronFrame:IsVisible() then +--@alpha@ self:debug("Frame_Toggle: call Frame_Hide()"); +--@end-alpha@ Cauldron:Frame_Hide(); else +--@alpha@ self:debug("Frame_Toggle: call Frame_Show()"); +--@end-alpha@ Cauldron:Frame_Show(); end +--@alpha@ self:debug("Frame_Toggle exit"); +--@end-alpha@ end function Cauldron:Frame_Update() +--@alpha@ self:debug("Frame_Update enter"); +--@end-alpha@ local numTradeSkills = GetNumTradeSkills(); +--@alpha@ self:debug("Frame_Update numTradeSkills: ",numTradeSkills); +--@end-alpha@ -- local skillOffset = FauxScrollFrame_GetOffset(TradeSkillListScrollFrame); local name, rank, maxRank = GetTradeSkillLine(); +--@alpha@ self:debug("Frame_Update name: ",name,"; rank: ",rank,"; maxRank: ",maxRank); +--@end-alpha@ if name == "UNKNOWN" then return; @@ -74,7 +104,9 @@ function Cauldron:Frame_Update() Cauldron:UpdateSkills(); if CURRENT_TRADESKILL ~= name then +--@alpha@ self:debug("Frame_Update: current skill changed"); +--@end-alpha@ StopTradeSkillRepeat(); @@ -95,34 +127,50 @@ function Cauldron:Frame_Update() CauldronFrame:SetWidth(692); -- display skill name, level/progress +--@alpha@ self:debug("Frame_Update: display skill level/progress"); +--@end-alpha@ self:UpdateSkillInfo(name, rank, maxRank); -- update search text box +--@alpha@ self:debug("Frame_Update: display search text"); +--@end-alpha@ self:UpdateSearchText(); -- TODO: update dropdowns +--@alpha@ self:debug("Frame_Update: update dropdowns"); +--@end-alpha@ self:UpdateFilterDropDowns(); -- display list of matching skills +--@alpha@ self:debug("Frame_Update: display list of skills"); +--@end-alpha@ self:UpdateSkillList(); -- display queue +--@alpha@ self:debug("Frame_Update: display queue"); +--@end-alpha@ self:UpdateQueue(); -- update buttons +--@alpha@ self:debug("Frame_Update: update buttons"); +--@end-alpha@ self:UpdateButtons(); +--@alpha@ self:debug("Frame_Update exit"); +--@end-alpha@ end function Cauldron:UpdateSkillInfo(skillName, rank, maxRank) +--@alpha@ self:debug("UpdateSkillInfo enter"); +--@end-alpha@ CauldronRankFrameSkillName:SetText(skillName); @@ -132,11 +180,15 @@ function Cauldron:UpdateSkillInfo(skillName, rank, maxRank) CauldronRankFrame:SetValue(rank); CauldronRankFrameSkillRank:SetText(rank.."/"..maxRank); +--@alpha@ self:debug("UpdateSkillInfo exit"); +--@end-alpha@ end function Cauldron:UpdateSearchText() +--@alpha@ self:debug("UpdateSearchText enter"); +--@end-alpha@ local skillName = CURRENT_TRADESKILL; if IsTradeSkillLinked() then @@ -149,17 +201,25 @@ function Cauldron:UpdateSearchText() end CauldronFiltersSearchEditBox:SetText(searchText); +--@alpha@ self:debug("UpdateSearchText exit"); +--@end-alpha@ end function Cauldron:UpdateFilterDropDowns() +--@alpha@ self:debug("UpdateFilterDropDowns enter"); +--@end-alpha@ +--@alpha@ self:debug("UpdateFilterDropDowns exit"); +--@end-alpha@ end function Cauldron:UpdateSkillList() +--@alpha@ self:debug("UpdateSkillList enter"); +--@end-alpha@ local skillName = CURRENT_TRADESKILL; if IsTradeSkillLinked() then @@ -167,13 +227,17 @@ function Cauldron:UpdateSkillList() end local skillList = Cauldron:GetSkillList(self.vars.playername, skillName); +--@alpha@ self:debug("UpdateSkillList: skillList="..#skillList); +--@end-alpha@ local height = 0; -- iterate over the list of skills for i, skillInfo in ipairs(skillList) do +--@alpha@ self:debug("UpdateSkillList: i="..i); +--@end-alpha@ local skillFrame = _G["CauldronSkillItem"..i]; @@ -272,9 +336,13 @@ function Cauldron:UpdateSkillList() -- set the disclosure button texture frame = _G["CauldronSkillItem"..i.."DiscloseButton"]; frame.skillInfo = skillInfo; +--@alpha@ self:debug("UpdateSkillList: skillInfo.name="..skillInfo.name); +--@end-alpha@ local reagentsExpanded = self.db.realm.userdata[self.vars.playername].skills[skillName].window.skills[skillInfo.name].expanded; +--@alpha@ self:debug("UpdateSkillList: reagentsExpanded="..tostring(reagentsExpanded)); +--@end-alpha@ if reagentsExpanded then frame:SetNormalTexture("Interface\\Buttons\\UI-MinusButton-Up"); @@ -284,13 +352,17 @@ function Cauldron:UpdateSkillList() local spellFocus = BuildColoredListString(GetTradeSkillTools(skillInfo.index)); local toolsFrame = _G["CauldronSkillItem"..i.."ReagentsToolsInfo"]; if spellFocus then +--@alpha@ self:debug("UpdateSkillList: skill has a spell focus"); +--@end-alpha@ toolsFrame:Show(); toolsFrame:SetText(L["Requires"]..": "..spellFocus); toolsFrame:SetHeight(15); else +--@alpha@ self:debug("UpdateSkillList: skill doesn't have a spell focus"); +--@end-alpha@ toolsFrame:Hide(); toolsFrame:SetText(""); @@ -353,21 +425,29 @@ function Cauldron:UpdateSkillList() -- place the frame in the scroll view if i > 1 then -- anchor to the frame above +--@alpha@ self:debug("UpdateSkillList: anchor frame to top left of frame above"); +--@end-alpha@ skillFrame:SetPoint("TOPLEFT", _G["CauldronSkillItem"..(i-1)], "BOTTOMLEFT", 0, -2); else -- anchor to the parent +--@alpha@ self:debug("UpdateSkillList: anchor frame to parent"); +--@end-alpha@ skillFrame:SetPoint("TOPLEFT", 0, 0); end -- adjust the scroll child size height = height + skillFrame:GetHeight(); +--@alpha@ self:debug("UpdateSkillList: height="..height); +--@end-alpha@ CauldronSkillListFrameScrollFrameScrollChild:SetHeight(height); -- show the frame +--@alpha@ self:debug("UpdateSkillList: show the frame"); +--@end-alpha@ skillFrame:Show(); end @@ -385,11 +465,15 @@ function Cauldron:UpdateSkillList() j = j + 1; end +--@alpha@ self:debug("UpdateSkillList exit"); +--@end-alpha@ end function Cauldron:UpdateButtons() +--@alpha@ self:debug("UpdateButtons enter"); +--@end-alpha@ if IsTradeSkillLinked() then CauldronQueueAllButton:Hide(); @@ -449,11 +533,15 @@ function Cauldron:UpdateButtons() CauldronClearQueueButton:Disable(); end +--@alpha@ self:debug("UpdateButtons exit"); +--@end-alpha@ end function Cauldron:UpdateQueue() +--@alpha@ self:debug("UpdateQueue enter"); +--@end-alpha@ if not CauldronFrame:IsShown() then return; @@ -468,7 +556,9 @@ function Cauldron:UpdateQueue() end if #itemQueue == 0 then +--@alpha@ self:debug("UpdateQueue: display empty queue"); +--@end-alpha@ -- queue is empty, display the empty message CauldronQueueFrameQueueEmpty:Show(); @@ -483,7 +573,9 @@ function Cauldron:UpdateQueue() return; end +--@alpha@ self:debug("UpdateQueue: display queue"); +--@end-alpha@ -- queue has items, show them CauldronQueueFrameQueueEmpty:Hide(); @@ -567,11 +659,15 @@ function Cauldron:UpdateQueue() -- place the frame in the scroll view if i > 1 then -- anchor to the frame above +--@alpha@ self:debug("UpdateQueue: anchor frame to top left of frame above"); +--@end-alpha@ queueItemFrame:SetPoint("TOPLEFT", _G["CauldronQueueItem"..(i-1)], "BOTTOMLEFT", 0, 0); else -- anchor to the parent +--@alpha@ self:debug("UpdateQueue: anchor frame to parent"); +--@end-alpha@ queueItemFrame:SetPoint("TOPLEFT", CauldronQueueFrameScrollFrameQueueSectionsMainItems, "TOPLEFT", 0, 0); end @@ -579,7 +675,9 @@ function Cauldron:UpdateQueue() -- self:debug("UpdateQueue: height="..height); -- show the frame +--@alpha@ self:debug("UpdateQueue: show the frame"); +--@end-alpha@ queueItemFrame:Show(); end @@ -608,7 +706,9 @@ function Cauldron:UpdateQueue() -- display intermediate queue, maybe if #intQueue == 0 then +--@alpha@ self:debug("UpdateQueue: intermediate queue is empty, hide header and item frames"); +--@end-alpha@ CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeader:SetHeight(1); CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeaderText:SetText(""); CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems:SetHeight(1); @@ -706,11 +806,15 @@ function Cauldron:UpdateQueue() -- place the frame in the scroll view if i > 1 then -- anchor to the frame above +--@alpha@ self:debug("UpdateQueue: anchor frame to top left of frame above"); +--@end-alpha@ queueItemFrame:SetPoint("TOPLEFT", _G["CauldronQueueIntItem"..(i-1)], "BOTTOMLEFT", 0, 0); else -- anchor to the parent +--@alpha@ self:debug("UpdateQueue: anchor frame to parent"); +--@end-alpha@ queueItemFrame:SetPoint("TOPLEFT", CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems, "TOPLEFT", 0, 0); end @@ -720,7 +824,9 @@ function Cauldron:UpdateQueue() -- CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems:SetHeight(intHeight); -- show the frame +--@alpha@ self:debug("UpdateQueue: show the frame"); +--@end-alpha@ queueItemFrame:Show(); end end @@ -834,11 +940,15 @@ function Cauldron:UpdateQueue() -- place the frame in the scroll view if i > 1 then -- anchor to the frame above +--@alpha@ self:debug("UpdateQueue: anchor frame to top left of frame above"); +--@end-alpha@ queueItemFrame:SetPoint("TOPLEFT", _G["CauldronQueueReagentItem"..(i-1)], "BOTTOMLEFT", 0, 0); else -- anchor to the parent +--@alpha@ self:debug("UpdateQueue: anchor frame to parent"); +--@end-alpha@ queueItemFrame:SetPoint("TOPLEFT", CauldronQueueFrameScrollFrameQueueSectionsReagents, "TOPLEFT", 0, 0); end @@ -848,7 +958,9 @@ function Cauldron:UpdateQueue() -- CauldronQueueFrameScrollFrameQueueSectionsReagents:SetHeight(reagentHeight); -- show the frame +--@alpha@ self:debug("UpdateQueue: show the frame"); +--@end-alpha@ queueItemFrame:Show(); end @@ -878,19 +990,27 @@ function Cauldron:UpdateQueue() CauldronQueueFrameScrollFrameQueueSections:SetHeight(h); CauldronQueueFrameScrollFrame:UpdateScrollChildRect(); +--@alpha@ self:debug("UpdateQueue exit"); +--@end-alpha@ end function Cauldron:SaveFramePosition() +--@alpha@ self:debug("SaveFramePosition enter"); +--@end-alpha@ -- TODO +--@alpha@ self:debug("SaveFramePosition exit"); +--@end-alpha@ end function Cauldron:OnCauldronUpdate() +--@alpha@ self:debug("OnCauldronUpdate enter"); +--@end-alpha@ -- self:Search(); local selectionIndex @@ -900,11 +1020,15 @@ function Cauldron:OnCauldronUpdate() selectionIndex = self.vars.selectionIndex; end +--@alpha@ self:debug("OnCauldronUpdate exit"); +--@end-alpha@ end function Cauldron:FilterDropDown_OnLoad(dropdown) +--@alpha@ self:debug("FilterDropDown_OnLoad enter"); +--@end-alpha@ --[[ if CURRENT_TRADESKILL == "" or CURRENT_TRADESKILL == "UNKNOWN" then @@ -915,11 +1039,15 @@ function Cauldron:FilterDropDown_OnLoad(dropdown) UIDropDownMenu_Initialize(dropdown, Cauldron.FilterDropDown_Initialize); UIDropDownMenu_SetText(CauldronFiltersFilterDropDown, L["Filters"]); +--@alpha@ self:debug("FilterDropDown_OnLoad exit"); +--@end-alpha@ end function Cauldron:InvSlotDropDown_OnLoad(dropdown) +--@alpha@ self:debug("InvSlotDropDown_OnLoad enter"); +--@end-alpha@ --[[ if CURRENT_TRADESKILL == "" or CURRENT_TRADESKILL == "UNKNOWN" then @@ -930,11 +1058,15 @@ function Cauldron:InvSlotDropDown_OnLoad(dropdown) UIDropDownMenu_Initialize(dropdown, Cauldron.InvSlotDropDown_Initialize); UIDropDownMenu_SetText(CauldronFiltersInvSlotDropDown, L["Slots"]); +--@alpha@ self:debug("InvSlotDropDown_OnLoad exit"); +--@end-alpha@ end function Cauldron:CategoryDropDown_OnLoad(dropdown) +--@alpha@ self:debug("CategoryDropDown_OnLoad enter"); +--@end-alpha@ --[[ if CURRENT_TRADESKILL == "" or CURRENT_TRADESKILL == "UNKNOWN" then @@ -945,11 +1077,15 @@ function Cauldron:CategoryDropDown_OnLoad(dropdown) UIDropDownMenu_Initialize(dropdown, Cauldron.CategoryDropDown_Initialize); UIDropDownMenu_SetText(CauldronFiltersCategoryDropDown, L["Categories"]); +--@alpha@ self:debug("CategoryDropDown_OnLoad exit"); +--@end-alpha@ end function Cauldron:FilterDropDown_Initialize(level) +--@alpha@ Cauldron:debug("FilterDropDown_Initialize enter"); +--@end-alpha@ --[[ if CURRENT_TRADESKILL == "" or CURRENT_TRADESKILL == "UNKNOWN" then @@ -1190,11 +1326,15 @@ function Cauldron:FilterDropDown_Initialize(level) end +--@alpha@ Cauldron:debug("FilterDropDown_Initialize exit"); +--@end-alpha@ end function Cauldron:FilterDropDown_SetSort(info) +--@alpha@ self:debug("FilterDropDown_SetSort enter"); +--@end-alpha@ local sort = info.arg1; @@ -1215,11 +1355,15 @@ function Cauldron:FilterDropDown_SetSort(info) -- update the UI Cauldron:UpdateSkillList(); +--@alpha@ self:debug("FilterDropDown_SetSort exit"); +--@end-alpha@ end function Cauldron:ReagentsFilterNormalCheck() +--@alpha@ self:debug("ReagentsFilterNormalCheck enter"); +--@end-alpha@ local skillName = CURRENT_TRADESKILL; if IsTradeSkillLinked() then @@ -1234,13 +1378,17 @@ function Cauldron:ReagentsFilterNormalCheck() checked = false; end +--@alpha@ self:debug("ReagentsFilterNormalCheck exit"); +--@end-alpha@ return checked; end function Cauldron:FilterDropDown_SetReagentFilter(info) +--@alpha@ self:debug("FilterDropDown_SetReagentFilter enter"); +--@end-alpha@ local skillName = CURRENT_TRADESKILL; if IsTradeSkillLinked() then @@ -1270,22 +1418,30 @@ function Cauldron:FilterDropDown_SetReagentFilter(info) -- update the UI Cauldron:UpdateSkillList(); +--@alpha@ self:debug("FilterDropDown_SetReagentFilter exit"); +--@end-alpha@ end function Cauldron:FilterDropDown_ToggleDifficulty(info) +--@alpha@ self:debug("FilterDropDown_ToggleDifficulty enter"); +--@end-alpha@ Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[CURRENT_TRADESKILL].window.filter[info.arg1] = not Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[CURRENT_TRADESKILL].window.filter[info.arg1]; -- update the UI Cauldron:UpdateSkillList(); +--@alpha@ self:debug("FilterDropDown_ToggleDifficulty exit"); +--@end-alpha@ end function Cauldron:InvSlotDropDown_Initialize(level) +--@alpha@ Cauldron:debug("InvSlotDropDown_Initialize enter"); +--@end-alpha@ --[[ if CURRENT_TRADESKILL == "" or CURRENT_TRADESKILL == "UNKNOWN" then @@ -1336,11 +1492,15 @@ function Cauldron:InvSlotDropDown_Initialize(level) end end +--@alpha@ Cauldron:debug("InvSlotDropDown_Initialize exit"); +--@end-alpha@ end function Cauldron:SlotsFilterAllCheck() +--@alpha@ self:debug("SlotsFilterAllCheck enter"); +--@end-alpha@ local skillName = CURRENT_TRADESKILL; if IsTradeSkillLinked() then @@ -1358,30 +1518,42 @@ function Cauldron:SlotsFilterAllCheck() end end +--@alpha@ self:debug("SlotsFilterAllCheck exit"); +--@end-alpha@ return checked; end function Cauldron:InvSlotDropDown_SetSlot(info) +--@alpha@ self:debug("InvSlotDropDown_SetSlot enter"); +--@end-alpha@ local skillName = CURRENT_TRADESKILL; if IsTradeSkillLinked() then skillName = "Linked-"..skillName; end +--@alpha@ self:debug("InvSlotDropDown_SetSlot: info.arg1="..info.arg1); +--@end-alpha@ if info.arg1 == "all" then +--@alpha@ self:debug("InvSlotDropDown_SetSlot: selecting all slots..."); +--@end-alpha@ Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName].window.slots["(none)"] = true; for name, _ in pairs(Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName].window.slots) do +--@alpha@ self:debug("InvSlotDropDown_SetSlot: name="..name); +--@end-alpha@ Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName].window.slots[name] = true; end elseif info.arg1 == "none" then +--@alpha@ self:debug("InvSlotDropDown_SetSlot: selecting special 'none' slot..."); +--@end-alpha@ local slotName = "(none)"; if not Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName].window.slots[slotName] then Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName].window.slots[slotName] = true; @@ -1397,11 +1569,15 @@ function Cauldron:InvSlotDropDown_SetSlot(info) end end +--@alpha@ self:debug("InvSlotDropDown_SetSlot exit"); +--@end-alpha@ end function Cauldron:CategoryDropDown_Initialize(level) +--@alpha@ Cauldron:debug("CategoryDropDown_Initialize enter"); +--@end-alpha@ --[[ if CURRENT_TRADESKILL == "" or CURRENT_TRADESKILL == "UNKNOWN" then @@ -1458,7 +1634,9 @@ function Cauldron:CategoryDropDown_Initialize(level) UIDropDownMenu_AddButton(category); end +--@alpha@ Cauldron:debug("CategoryDropDown_Initialize exit"); +--@end-alpha@ end --[[ @@ -1486,7 +1664,9 @@ end --]] function Cauldron:CategoryDropDown_SetCategory(info) +--@alpha@ self:debug("CategoryDropDown_SetCategory enter"); +--@end-alpha@ local skillName = CURRENT_TRADESKILL; if IsTradeSkillLinked() then @@ -1515,11 +1695,15 @@ function Cauldron:CategoryDropDown_SetCategory(info) -- update the UI Cauldron:UpdateSkillList(); +--@alpha@ self:debug("CategoryDropDown_SetCategory exit"); +--@end-alpha@ end function Cauldron:CollapseAllButton_OnClick(button) +--@alpha@ self:debug("CollapseAllButton_OnClick enter"); +--@end-alpha@ local skillName = CURRENT_TRADESKILL; if IsTradeSkillLinked() then @@ -1537,11 +1721,15 @@ function Cauldron:CollapseAllButton_OnClick(button) -- update the UI Cauldron:UpdateSkillList(); +--@alpha@ self:debug("CollapseAllButton_OnClick exit"); +--@end-alpha@ end function Cauldron:CollapseItemButton_OnClick(button) +--@alpha@ self:debug("CollapseItemButton_OnClick enter"); +--@end-alpha@ local skillName = CURRENT_TRADESKILL; if IsTradeSkillLinked() then @@ -1556,14 +1744,20 @@ function Cauldron:CollapseItemButton_OnClick(button) -- update the UI Cauldron:UpdateSkillList(); +--@alpha@ self:debug("CollapseItemButton_OnClick exit"); +--@end-alpha@ end function Cauldron:SkillItem_OnEnter(frame) +--@alpha@ self:debug("SkillItem_OnEnter enter"); +--@end-alpha@ local id = frame:GetID(); +--@alpha@ self:debug("SkillItem_OnEnter: id="..id); +--@end-alpha@ local name = _G["CauldronSkillItem"..id.."SkillName"]; if name then @@ -1572,25 +1766,35 @@ function Cauldron:SkillItem_OnEnter(frame) -- TODO +--@alpha@ self:debug("SkillItem_OnEnter exit"); +--@end-alpha@ end function Cauldron:SkillItem_OnLeave(frame) +--@alpha@ self:debug("SkillItem_OnLeave enter"); +--@end-alpha@ +--@alpha@ self:debug("SkillItem_OnLeave exit"); +--@end-alpha@ end function Cauldron:SkillItem_OnClick(frame, button, down) +--@alpha@ self:debug("SkillItem_OnClick enter"); +--@end-alpha@ local skillName = CURRENT_TRADESKILL; if IsTradeSkillLinked() then skillName = "Linked-"..skillName; end +--@alpha@ self:debug("SkillItem_OnClick: skillName="..skillName); +--@end-alpha@ -- select this frame Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName].window.selected = frame.skillIndex; @@ -1599,11 +1803,15 @@ function Cauldron:SkillItem_OnClick(frame, button, down) Cauldron:UpdateSkillList(); Cauldron:UpdateButtons(); +--@alpha@ self:debug("SkillItem_OnClick exit"); +--@end-alpha@ end function Cauldron:TradeSkillFilter_OnTextChanged(frame) +--@alpha@ self:debug("TradeSkillFilter_OnTextChanged enter"); +--@end-alpha@ local skillName = CURRENT_TRADESKILL; if IsTradeSkillLinked() then @@ -1620,31 +1828,43 @@ function Cauldron:TradeSkillFilter_OnTextChanged(frame) -- update the UI Cauldron:UpdateSkillList(); +--@alpha@ self:debug("TradeSkillFilter_OnTextChanged exit"); +--@end-alpha@ end function Cauldron:AmountDecrement_OnClick() +--@alpha@ self:debug("AmountDecrement_OnClick enter"); +--@end-alpha@ local num = CauldronAmountInputBox:GetNumber(); num = math.max(1, num - 1); CauldronAmountInputBox:SetNumber(num); +--@alpha@ self:debug("AmountDecrement_OnClick exit"); +--@end-alpha@ end function Cauldron:AmountIncrement_OnClick() +--@alpha@ self:debug("AmountIncrement_OnClick enter"); +--@end-alpha@ local num = CauldronAmountInputBox:GetNumber(); num = math.min(999, num + 1); CauldronAmountInputBox:SetNumber(num); +--@alpha@ self:debug("AmountIncrement_OnClick exit"); +--@end-alpha@ end function Cauldron:FavoriteItemButton_OnClick(button) +--@alpha@ self:debug("FavoriteItemButton_OnClick enter"); +--@end-alpha@ local skillName = CURRENT_TRADESKILL; if IsTradeSkillLinked() then @@ -1655,5 +1875,7 @@ function Cauldron:FavoriteItemButton_OnClick(button) Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName].window.skills[skillInfo.name].favorite = button:GetChecked(); +--@alpha@ self:debug("FavoriteItemButton_OnClick exit"); +--@end-alpha@ end -- 1.7.9.5