Quantcast

Added checking for the UI to handle Enchanting and other skills with "casting" versus "creating."

pschifferer [01-22-09 - 18:51]
Added checking for the UI to handle Enchanting and other skills with "casting" versus "creating."
Filename
Cauldron/CauldronMain.lua
Cauldron/CauldronMain.xml
Cauldron/CauldronMainUI.lua
Cauldron/CauldronTradeskill.lua
diff --git a/Cauldron/CauldronMain.lua b/Cauldron/CauldronMain.lua
index 62965cb..e1f6709 100644
--- a/Cauldron/CauldronMain.lua
+++ b/Cauldron/CauldronMain.lua
@@ -216,6 +216,8 @@ function Cauldron:OnTradeSkillRecast()
 	self:debug("OnTradeSkillRecast enter");

 	self:UpdateSkills();
+
+	CauldronAmountInputBox:SetNumber(GetTradeskillRepeatCount());

 	self:Frame_Update();

@@ -641,6 +643,7 @@ end
 							["name"] = "<skill>",
 							["link"] = "<link>",
 							["icon"] = "<icon>",
+							["verb"] = "<verb>", -- this is present for skills that cast, like enchantments
 							["tradeskill"] = "<tradeskill>",
 							["difficulty"] = "<difficulty>",
 							["available"] = <available>,
diff --git a/Cauldron/CauldronMain.xml b/Cauldron/CauldronMain.xml
index 7483d0b..911fd4f 100644
--- a/Cauldron/CauldronMain.xml
+++ b/Cauldron/CauldronMain.xml
@@ -158,7 +158,7 @@
 				</Anchors>
 				<Scripts>
 					<OnLoad>
-						self:SetScale(0.5);
+						self:SetScale(0.75);
 						getglobal(self:GetName()):SetText("");
 					</OnLoad>
                 	<OnEnter>
diff --git a/Cauldron/CauldronMainUI.lua b/Cauldron/CauldronMainUI.lua
index e4af4ec..9371649 100644
--- a/Cauldron/CauldronMainUI.lua
+++ b/Cauldron/CauldronMainUI.lua
@@ -391,15 +391,42 @@ end
 function Cauldron:UpdateButtons()
 	self:debug("UpdateButtons enter");

+	if IsTradeSkillLinked() then
+		CauldronQueueAllButton:Hide();
+		CauldronQueueButton:Hide();
+		CauldronCreateAllButton:Hide();
+		CauldronCreateButton:Hide();
+		CauldronProcessButton:Hide();
+		CauldronClearQueueButton:Hide();
+		return;
+	else
+		CauldronQueueAllButton:Show();
+		CauldronQueueButton:Show();
+		CauldronCreateAllButton:Show();
+		CauldronCreateButton:Show();
+		CauldronProcessButton:Show();
+		CauldronClearQueueButton:Show();
+	end
+
 	local skillInfo = Cauldron:GetSelectedSkill();

 	if skillInfo then
-		CauldronQueueAllButton:Enable();
-		CauldronQueueButton:Enable();
-
-		if skillInfo.available then
-			CauldronCreateAllButton:Enable();
+		if skillInfo.verb then
+			CauldronQueueAllButton:Disable();
+			CauldronQueueButton:Disable();
+			CauldronCreateAllButton:Disable();
+
 			CauldronCreateButton:Enable();
+			CauldronCreateButton:SetText(skillInfo.verb or CREATE);
+		else
+			CauldronQueueAllButton:Enable();
+			CauldronQueueButton:Enable();
+
+			if skillInfo.available then
+				CauldronCreateAllButton:Enable();
+				CauldronCreateButton:Enable();
+				CauldronCreateButton:SetText(CREATE);
+			end
 		end
 	else
 		CauldronQueueAllButton:Disable();
diff --git a/Cauldron/CauldronTradeskill.lua b/Cauldron/CauldronTradeskill.lua
index 34a96f0..1cd13ca 100644
--- a/Cauldron/CauldronTradeskill.lua
+++ b/Cauldron/CauldronTradeskill.lua
@@ -55,7 +55,7 @@ function Cauldron:UpdateSkills()
 	local category = "";

 	for i=1,GetNumTradeSkills() do
-		local name, difficulty, avail, expanded = GetTradeSkillInfo(i);
+		local name, difficulty, avail, expanded, verb = GetTradeSkillInfo(i);
 --		self:debug("UpdateSkills: name="..name.."; difficulty="..difficulty.."; avail="..avail);

 		if name and difficulty ~= "header" then
@@ -82,6 +82,9 @@ function Cauldron:UpdateSkills()
 				['defaultCategory'] = category,
 			};

+			-- set the action verb for this skill
+			skillDB.recipes[name].verb = verb;
+
 			-- make sure the skill window info is initialized
 			if not skillDB.window.skills[name] then
 				skillDB.window.skills[name] = {