Quantcast

Made the disclosure button select the skill when it's clicked.

pschifferer [01-22-09 - 04:01]
Made the disclosure button select the skill when it's clicked.
Made clicking the skill icon select the skill.
Filename
Cauldron/CauldronMain.xml
Cauldron/CauldronMainUI.lua
diff --git a/Cauldron/CauldronMain.xml b/Cauldron/CauldronMain.xml
index 75ba2c4..65c3456 100644
--- a/Cauldron/CauldronMain.xml
+++ b/Cauldron/CauldronMain.xml
@@ -110,6 +110,7 @@
 					</OnLoad>
 					<OnClick>
 						HandleModifiedItemClick(GetTradeSkillItemLink(self.skillIndex));
+						Cauldron:SkillItem_OnClick(self, button, down);
 					</OnClick>
 					<OnEnter>
 						if self.skillIndex then
diff --git a/Cauldron/CauldronMainUI.lua b/Cauldron/CauldronMainUI.lua
index d3bea9e..69cda87 100644
--- a/Cauldron/CauldronMainUI.lua
+++ b/Cauldron/CauldronMainUI.lua
@@ -261,6 +261,7 @@ function Cauldron:UpdateSkillList()
 		-- set the disclosure button texture
 		frame = _G["CauldronSkillItem"..i.."DiscloseButton"];
 		frame.skillInfo = skillInfo;
+		frame.skillIndex = i;
 		local reagentsExpanded = self.db.realm.userdata[self.vars.playername].skills[skillName].window.skills[skillInfo.name].expanded;
 		self:debug("UpdateSkillList: reagentsExpanded="..tostring(reagentsExpanded));
 		if reagentsExpanded then
@@ -560,7 +561,6 @@ function Cauldron:UpdateQueue()
 		j = j + 1;
 	end

-	-- display intermediate queue, maybe
 	local intQueue = CauldronQueue:GetIntermediates(queue);
 	local reagentList = CauldronQueue:GetReagents(queue);

@@ -568,7 +568,9 @@ function Cauldron:UpdateQueue()
 --	self.db.realm.userdata[self.vars.playername].intQueue = intQueue;
 --	self.db.realm.userdata[self.vars.playername].reagentList = reagentList;

+	-- display intermediate queue, maybe
 	if #intQueue == 0 then
+		self:debug("UpdateQueue: intermediate queue is empty, hide header and item frames");
 		CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeader:SetHeight(1);
 		CauldronQueueFrameScrollFrameQueueSectionsSecondaryItemsHeaderText:SetText("");
 		CauldronQueueFrameScrollFrameQueueSectionsSecondaryItems:SetHeight(1);
@@ -1426,6 +1428,9 @@ function Cauldron:CollapseAllButton_OnClick(button)
 		info.expanded = false;
 	end

+	-- unselect the selected skill
+	Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName].window.selected = 0;
+
 	-- update the UI
 	Cauldron:UpdateSkillList();

@@ -1443,6 +1448,7 @@ function Cauldron:CollapseItemButton_OnClick(button)
 	local skillInfo = button.skillInfo;

 	Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName].window.skills[skillInfo.name].expanded = not Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName].window.skills[skillInfo.name].expanded;
+	Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName].window.selected = button.skillIndex;

 	-- update the UI
 	Cauldron:UpdateSkillList();