Quantcast

It's now possible to select an item in the skill list.

Paul Schifferer [12-08-10 - 04:15]
It's now possible to select an item in the skill list.
Filter menu displays, but has issues.
Show Queue button works.
Added tooltips for reagent icons in skill list.
Filename
CauldronMain.lua
CauldronMain.xml
CauldronMainUI.lua
CauldronQueue.xml
CauldronTradeskill.lua
diff --git a/CauldronMain.lua b/CauldronMain.lua
index 38c4edd..3a3957d 100644
--- a/CauldronMain.lua
+++ b/CauldronMain.lua
@@ -678,8 +678,8 @@ function Cauldron:GetSelectedSkill()
 		return;
 	end

---	local selected = self.db.realm.userdata[self.vars.playername].skills[skillName].window.selected;
-	local selected = GetTradeSkillSelectionIndex();
+	local selected = self.db.realm.userdata[self.vars.playername].skills[skillName].window.selected;
+--	local selected = GetTradeSkillSelectionIndex();
 	if not selected then
 		return nil;
 	end
diff --git a/CauldronMain.xml b/CauldronMain.xml
index 277e23e..d1462be 100755
--- a/CauldronMain.xml
+++ b/CauldronMain.xml
@@ -86,11 +86,10 @@
 				-->
 			</Layer>
 		</Layers>
-		<!--
 		<Scripts>
 			<OnEnter>
 				GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
-				- - GameTooltip:SetHyperlink(self.link);
+				-- GameTooltip:SetHyperlink(self.link);
 				GameTooltip:SetTradeSkillItem(self.skillIndex, self.reagentIndex);
 				CursorUpdate(self);
 			</OnEnter>
@@ -105,7 +104,6 @@
 				HandleModifiedItemClick(self.link);
 			</OnClick>
 		</Scripts>
-		-->
 	</Button>

 	<!-- Template: Skill category header -->
@@ -393,6 +391,9 @@
 			</Frame>
 		</Frames>
 		<Scripts>
+			<OnClick>
+				Cauldron:SkillItem_OnClick(self, nil, nil);
+			</OnClick>
 		</Scripts>
     </Button>

@@ -938,9 +939,7 @@
 					</Button>
 					<Frame name="CauldronFilterDropDown" inherits="UIDropDownMenuTemplate">
 						<Scripts>
-							<!-- TODO: restore
 							<OnLoad function="CauldronFilterDropDown_OnLoad"/>
-							-->
 						</Scripts>
 					</Frame>
 				</Frames>
diff --git a/CauldronMainUI.lua b/CauldronMainUI.lua
index 1093fbd..f705669 100644
--- a/CauldronMainUI.lua
+++ b/CauldronMainUI.lua
@@ -35,6 +35,138 @@ function CauldronFrame_Show()
 	Cauldron:Frame_Show();
 end

+function CauldronFilterDropDown_OnLoad(self)
+	UIDropDownMenu_Initialize(self, CauldronFilterDropDown_Initialize, "MENU");
+	CauldronFilterDropDownText:SetJustifyH("CENTER");
+	CauldronFilterDropDownButton:Show();
+end
+
+function CauldronFilterDropDown_Initialize(self, level)
+
+	local skillName = CURRENT_TRADESKILL;
+	if IsTradeSkillLinked() then
+		skillName = "Linked-"..skillName;
+	end
+
+	local info = UIDropDownMenu_CreateInfo();
+
+	if level == 1 then
+
+		if not IsTradeSkillLinked() then
+			-- favorites
+			info.text = L["Favorites"];
+			info.checked = Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName].window.filter.favorites or false;
+			info.isNotRadio = true;
+			info.keepShownOnClick = true;
+			-- tooltipTitle = L["Favorites"],
+			-- tooltipText = L["Display only favorite skills"],
+			info.func = function()
+				Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName].window.filter.favorites = not Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName].window.filter.favorites;
+				Cauldron:UpdateSkillList();
+			end;
+			-- arg1 = "favorite",
+			-- arg2 = "",
+			UIDropDownMenu_AddButton(info);
+
+			-- achievements
+			info.text = L["Achievements"];
+			info.checked = Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName].window.filter.achievements or false;
+			info.isNotRadio = true;
+			info.keepShownOnClick = true;
+			-- tooltipTitle = L["Achievements"],
+			-- tooltipText = L["Display only skills for achievements"],
+			info.func = function()
+				Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName].window.filter.achievements = not Cauldron.db.realm.userdata[Cauldron.vars.playername].skills[skillName].window.filter.achievements;
+				Cauldron:UpdateSkillList();
+			end;
+			-- arg1 = "achievement",
+			-- arg2 = "",
+			UIDropDownMenu_AddButton(info);
+		end
+
+	--[==[
+		info.text = CRAFT_IS_MAKEABLE
+		info.func = 	function()
+							TradeSkillFrame.filterTbl.hasMaterials  = not TradeSkillFrame.filterTbl.hasMaterials;
+							TradeSkillOnlyShowMakeable(TradeSkillFrame.filterTbl.hasMaterials);
+							TradeSkillUpdateFilterBar();
+						end
+		info.keepShownOnClick = true;
+		info.checked = 	TradeSkillFrame.filterTbl.hasMaterials
+		info.isNotRadio = true;
+		UIDropDownMenu_AddButton(info, level)
+
+		if ( not IsTradeSkillGuild() ) then
+			info.text = TRADESKILL_FILTER_HAS_SKILL_UP;
+			info.func = 	function()
+								TradeSkillFrame.filterTbl.hasSkillUp  = not TradeSkillFrame.filterTbl.hasSkillUp;
+								TradeSkillOnlyShowSkillUps(TradeSkillFrame.filterTbl.hasSkillUp);
+								TradeSkillUpdateFilterBar();
+							end
+			info.keepShownOnClick = true;
+			info.checked = 	TradeSkillFrame.filterTbl.hasSkillUp;
+			info.isNotRadio = true;
+			UIDropDownMenu_AddButton(info, level);
+		end
+	--]==]
+
+		info.checked = 	nil;
+		info.isNotRadio = nil;
+
+		info.text = TRADESKILL_FILTER_SLOTS
+		info.func =  nil;
+		info.notCheckable = true;
+		info.keepShownOnClick = false;
+		info.hasArrow = true;
+		info.value = 1;
+		UIDropDownMenu_AddButton(info, level)
+
+		info.text = TRADESKILL_FILTER_SUBCLASS
+		info.func =  nil;
+		info.notCheckable = true;
+		info.keepShownOnClick = false;
+		info.hasArrow = true;
+		info.value = 2;
+		UIDropDownMenu_AddButton(info, level)
+
+	elseif level == 2 then
+		if UIDROPDOWNMENU_MENU_VALUE == 1 then
+			local slots = { GetTradeSkillSubClassFilteredSlots(0) };
+			local subslots = {};
+			for i,slot in pairs(slots) do
+				info.text = slot;
+				info.func =  function() --[[ TradeSkillSetFilter(0, i, "", slots[i]); --]] end;
+				info.notCheckable = true;
+				info.hasArrow = false;
+				UIDropDownMenu_AddButton(info, level);
+			end
+		elseif UIDROPDOWNMENU_MENU_VALUE == 2 then
+			local subClasses = { GetTradeSkillSubClasses() };
+			local subslots = {};
+			for i,subClass in pairs(subClasses) do
+				info.text = subClass;
+				info.func =  function() --[[ TradeSkillSetFilter(i, 0, subClasses[i], ""); --]] end
+				info.notCheckable = true;
+				subslots  = { GetTradeSkillSubClassFilteredSlots(i) };
+				info.hasArrow = #subslots > 1;
+				info.value = i;
+				UIDropDownMenu_AddButton(info, level);
+			end
+		end
+	elseif level == 3 then
+		local subClasses = { GetTradeSkillSubClasses() };
+		local subslots  = { GetTradeSkillSubClassFilteredSlots(UIDROPDOWNMENU_MENU_VALUE) };
+		for i,slot in pairs(subslots) do
+			info.text = slot;
+			info.func =  function() --[[ TradeSkillSetFilter(UIDROPDOWNMENU_MENU_VALUE, i, subClasses[UIDROPDOWNMENU_MENU_VALUE], subslots[i]); --]] end
+			info.notCheckable = true;
+			info.value = {UIDROPDOWNMENU_MENU_VALUE, i};
+			UIDropDownMenu_AddButton(info, level);
+		end
+	end
+
+end
+
 --[==[
 function CauldronQueueWindowFrame_UpdateQueue()
 end
@@ -702,6 +834,12 @@ function Cauldron:UpdateButtons()
 			CauldronClearQueueButton:Disable();
 		end
 	end
+
+	if CauldronQueueWindowFrame:IsShown() then
+		CauldronShowQueueButton:Hide();
+	else
+		CauldronShowQueueButton:Show();
+	end

 end

@@ -1566,6 +1704,7 @@ function Cauldron:SkillItem_OnLeave(frame)
 end

 function Cauldron:SkillItem_OnClick(frame, button, down)
+	Cauldron:info("skill item click: frame="..tostring(frame)..", button="..tostring(button)..", down="..tostring(down));

 	local skillName = CURRENT_TRADESKILL;
 	if IsTradeSkillLinked() then
diff --git a/CauldronQueue.xml b/CauldronQueue.xml
index 17d0a67..097e9f4 100644
--- a/CauldronQueue.xml
+++ b/CauldronQueue.xml
@@ -674,6 +674,7 @@
             <OnHide>
                 --HideUIPanel(CauldronFrame);
                 PlaySound("igCharacterInfoClose");
+                Cauldron:UpdateButtons();
             </OnHide>
             <OnMouseWheel>
                 return;
diff --git a/CauldronTradeskill.lua b/CauldronTradeskill.lua
index 9efcb7a..a73beec 100644
--- a/CauldronTradeskill.lua
+++ b/CauldronTradeskill.lua
@@ -185,8 +185,8 @@ function Cauldron:UpdateSkills()
 					end
 				else
 					if rescan then
-						local msg = string.format(L["Rescanning recipe: %1$s..."], name);
-						Cauldron:Print(msg);
+						-- local msg = string.format(L["Rescanning recipe: %1$s..."], name);
+						-- Cauldron:Print(msg);

 						-- remove it from the list (we're optimistic!)
 						skillDB.rescan.failedRecipes[name] = nil;