Alterations to initialize queue frames properly.
pschifferer [02-24-09 - 05:07]
Alterations to initialize queue frames properly.
diff --git a/CauldronMainUI.lua b/CauldronMainUI.lua
index 4303d3e..6e6bb3a 100644
--- a/CauldronMainUI.lua
+++ b/CauldronMainUI.lua
@@ -595,17 +595,25 @@ function Cauldron:UpdateQueue()
self:debug("queueInfo: name="..queueInfo.name);
--@end-alpha@
--- local queueItemFrame = _G["CauldronQueueItem"..i];
+ local queueItemFrame = _G["CauldronQueueItem"..i];
-- check if we have a frame for this position
--- if not queueItemFrame then
+ if not queueItemFrame then
-- create a new frame for the skill information
-local queueItemFrame = CreateFrame("Button",
+ queueItemFrame = CreateFrame("Button",
"CauldronQueueItem"..i,
CauldronQueueFrameScrollFrameQueueSectionsMainItems,
"CauldronQueueItemFrameTemplate");
--- end
+ else
+ -- set the frame's parent
+ queueItemFrame:SetParent(CauldronQueueFrameScrollFrameQueueSectionsMainItems);
+ end
+
+ -- initialize the frame
+ queueItemFrame:SetAlpha(1.0);
+ queueItemFrame:SetHeight(itemFrameHeight);
+ -- set some basic properties
queueItemFrame:SetID(i);
queueItemFrame.itemName = queueInfo.name;
queueItemFrame.removeable = true;
@@ -697,6 +705,8 @@ local queueItemFrame = CreateFrame("Button",
_G["CauldronQueueItem"..j] = nil;
+ frame:SetParent(nil);
+ frame:SetAlpha(0.0);
frame:Hide();
frame:SetHeight(0);
@@ -733,16 +743,16 @@ local queueItemFrame = CreateFrame("Button",
self:debug("intQueue: name="..queueInfo.name);
--@end-alpha@
--- local queueItemFrame = _G["CauldronQueueIntItem"..i];
+ local queueItemFrame = _G["CauldronQueueIntItem"..i];
-- check if we have a frame for this position
--- if not queueItemFrame then
+ if not queueItemFrame then
-- create a new frame for the skill information
-local queueItemFrame = CreateFrame("Button",
+ queueItemFrame = CreateFrame("Button",
"CauldronQueueIntItem"..i,
CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems,
"CauldronQueueItemFrameTemplate");
--- end
+ end
queueItemFrame:SetID(i);
queueItemFrame.itemName = queueInfo.name;
@@ -873,16 +883,16 @@ local queueItemFrame = CreateFrame("Button",
self:debug("reagentList: "..queueInfo.name);
--@end-alpha@
--- local queueItemFrame = _G["CauldronQueueReagentItem"..i];
+ local queueItemFrame = _G["CauldronQueueReagentItem"..i];
-- check if we have a frame for this position
--- if not queueItemFrame then
+ if not queueItemFrame then
-- create a new frame for the skill information
-local queueItemFrame = CreateFrame("Button",
+ queueItemFrame = CreateFrame("Button",
"CauldronQueueReagentItem"..i,
CauldronQueueFrameScrollFrameQueueSectionsReagents,
"CauldronQueueItemFrameTemplate");
--- end
+ end
local countInfo = Cauldron:ReagentCount(queueInfo.name);
local need = math.max(0, queueInfo.amount - countInfo.has);
diff --git a/CauldronUtil.lua b/CauldronUtil.lua
index 309e9b6..99e7420 100644
--- a/CauldronUtil.lua
+++ b/CauldronUtil.lua
@@ -24,9 +24,10 @@ function Cauldron:GetPotentialCraftCount(skillInfo)
count = makeable;
end
end
+--]]
self:debug("GetPotentialCraftCount exit");
---]]
+
return count;
end
@@ -52,9 +53,11 @@ function Cauldron:ReagentCount(reagent)
-- total up
count.total = count.has + count.bank + count.guildBank + count.mail;
+ --[[
for alt,altCount in pairs(count.altHas) do
count.total = count.total + altCount;
end
+ --]]
return count;
end