Quantcast

Removed tooltip frame on skill list name and shopping list item.

pschifferer [11-17-09 - 03:03]
Removed tooltip frame on skill list name and shopping list item.
Made it so the view section header and compact item are available even when looking at linked tradeskills.
Filename
CauldronMain.lua
CauldronMain.xml
CauldronMainUI.lua
CauldronShoppingList.xml
CauldronShoppingListUI.lua
CauldronTradeskill.lua
diff --git a/CauldronMain.lua b/CauldronMain.lua
index 55fb071..ac0e6da 100644
--- a/CauldronMain.lua
+++ b/CauldronMain.lua
@@ -94,6 +94,14 @@ function Cauldron:OnInitialize()
 					end,
 			},
 			--@end-alpha@
+			--[[
+			forget = {
+				name = L["Forget"],
+				desc = L["Tells Cauldron to a fresh state"],
+				type = 'execute',
+				func = function() self:Forget() end,
+			},
+			--]]
 			reset = {
 				name = L["Reset"],
 				desc = L["Resets Cauldron to a fresh state"],
diff --git a/CauldronMain.xml b/CauldronMain.xml
index 47d9a96..845ac06 100644
--- a/CauldronMain.xml
+++ b/CauldronMain.xml
@@ -87,6 +87,39 @@
 			</Layer>
     	</Layers>
     	<Frames>
+    		<!--
+    		<Frame name="$parentSkillNameTooltipFrame">
+				<Size x="250" y="12"/>
+				<Anchors>
+					<Anchor point="TOPLEFT">
+						<Offset x="62" y="-4"/>
+					</Anchor>
+				</Anchors>
+				<Scripts>
+					<OnClick>
+						HandleModifiedItemClick(GetTradeSkillItemLink(self.skillIndex));
+						Cauldron:SkillItem_OnClick(self, button, down);
+					</OnClick>
+					<OnEnter>
+						GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
+						GameTooltip:SetTradeSkillItem(self.skillIndex);
+						CursorUpdate(self);
+					</OnEnter>
+					<OnLeave>
+						GameTooltip:Hide();
+						ResetCursor();
+					</OnLeave>
+					<OnUpdate>
+						if GameTooltip:IsOwned(self) then
+							GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
+							GameTooltip:SetTradeSkillItem(self.skillIndex);
+							CursorUpdate(self);
+						end
+						CursorOnUpdate(self);
+					</OnUpdate>
+				</Scripts>
+    		</Frame>
+    		-->
 			<Button name="$parentSkillIcon">
 				<Size x="37" y="37"/>
 				<Anchors>
diff --git a/CauldronMainUI.lua b/CauldronMainUI.lua
index ed34168..f3f160c 100644
--- a/CauldronMainUI.lua
+++ b/CauldronMainUI.lua
@@ -387,6 +387,9 @@ function Cauldron:UpdateSkillList()
 		frame:SetNormalTexture(skillInfo.icon);
 		frame.itemLink = skillInfo.link;
 		frame.skillIndex = skillInfo.index;
+
+		frame = _G["CauldronSkillItem"..i.."SkillNameTooltipFrame"];
+		frame.skillIndex = skillInfo.index;

 		-- set the craft count
 		frame = _G["CauldronSkillItem"..i.."SkillIconCount"];
@@ -1274,27 +1277,27 @@ function Cauldron:FilterDropDown_Initialize(level)
 		notClickable = true,
 	});

-	if not IsTradeSkillLinked() then
-		local miscTitle = {
-			text = L["View"],
-			isTitle = true,
-			tooltipTitle = "",
-			tooltipText = "",
-		};
-		UIDropDownMenu_AddButton(miscTitle);
-
-		-- compact
-		local compact = {
-			text = L["Compact"],
-			checked = Cauldron.db.realm.userdata[Cauldron.vars.playername].options.compactView,
-			tooltipTitle = L["Compact"],
-			tooltipText = L["Display a compacted view of the skill list"],
-			func = function(arg1, arg2) Cauldron.db.realm.userdata[Cauldron.vars.playername].options.compactView = not Cauldron.db.realm.userdata[Cauldron.vars.playername].options.compactView; Cauldron:UpdateSkillList(); end,
-			arg1 = "compact",
-			arg2 = "",
-		};
-		UIDropDownMenu_AddButton(compact);
+	local miscTitle = {
+		text = L["View"],
+		isTitle = true,
+		tooltipTitle = "",
+		tooltipText = "",
+	};
+	UIDropDownMenu_AddButton(miscTitle);
+
+	-- compact
+	local compact = {
+		text = L["Compact"],
+		checked = Cauldron.db.realm.userdata[Cauldron.vars.playername].options.compactView,
+		tooltipTitle = L["Compact"],
+		tooltipText = L["Display a compacted view of the skill list"],
+		func = function(arg1, arg2) Cauldron.db.realm.userdata[Cauldron.vars.playername].options.compactView = not Cauldron.db.realm.userdata[Cauldron.vars.playername].options.compactView; Cauldron:UpdateSkillList(); end,
+		arg1 = "compact",
+		arg2 = "",
+	};
+	UIDropDownMenu_AddButton(compact);

+	if not IsTradeSkillLinked() then
 		-- favorites
 		local faves = {
 			text = L["Favorites"],
diff --git a/CauldronShoppingList.xml b/CauldronShoppingList.xml
index fc48411..7e66af2 100644
--- a/CauldronShoppingList.xml
+++ b/CauldronShoppingList.xml
@@ -38,6 +38,42 @@
 			</Layer>
     	</Layers>
     	<Frames>
+    		<!--
+    		<Frame name="$parentItemTooltipFrame" enableMouse="true">
+				<Size x="200" y="12"/>
+				<Anchors>
+					<Anchor point="TOPLEFT">
+						<Offset x="10" y="0"/>
+					</Anchor>
+				</Anchors>
+				<Scripts>
+					<OnClick>
+						if self.itemLink then
+							HandleModifiedItemClick(self.itemLink);
+						end
+					</OnClick>
+					<OnEnter>
+						if self.itemLink then
+							GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
+							GameTooltip:SetHyperlink(self.itemLink);
+							CursorUpdate(self);
+						end
+					</OnEnter>
+					<OnLeave>
+						GameTooltip:Hide();
+						ResetCursor();
+					</OnLeave>
+					<OnUpdate>
+						if self.itemLink and GameTooltip:IsOwned(self) then
+							GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
+							GameTooltip:SetHyperlink(self.itemLink);
+							CursorUpdate(self);
+						end
+						CursorOnUpdate(self);
+					</OnUpdate>
+				</Scripts>
+    		</Frame>
+    		-->
             <Button name="$parentCloseButton" inherits="UIPanelCloseButton">
                 <Anchors>
                     <Anchor point="RIGHT">
diff --git a/CauldronShoppingListUI.lua b/CauldronShoppingListUI.lua
index fc4cdd0..e721922 100644
--- a/CauldronShoppingListUI.lua
+++ b/CauldronShoppingListUI.lua
@@ -126,15 +126,19 @@ function Cauldron:UpdateShoppingList()
 												   "CauldronShoppingListItemTemplate");
 				end

+				local _,link,_,_,_,_,_,_,_,_ = GetItemInfo(item);
 				local str = string.format("%s, %d", item, amount);

 				shoppingListItem.itemName = item;
 				shoppingListItem.requestor = requestor;
-
+
 				_G["CauldronShoppingListItem"..itemIndex.."Item"]:SetText(str);
 				_G["CauldronShoppingListItem"..itemIndex.."Item"]:SetWidth(width - 25);

 				_G["CauldronShoppingListItem"..itemIndex]:SetWidth(width - 25);
+
+				local frame = _G["CauldronShoppingListItem"..itemIndex.."ItemTooltipFrame"];
+				frame.itemLink = link;

 				-- place the frame in the scroll view
 				if frameAbove then
diff --git a/CauldronTradeskill.lua b/CauldronTradeskill.lua
index 22d0bde..d415267 100644
--- a/CauldronTradeskill.lua
+++ b/CauldronTradeskill.lua
@@ -171,6 +171,14 @@ function Cauldron:UpdateSkills()
 					local key = not Cauldron:IsVendorItem(rItemId);

 					if (not rName) or (not rIcon) or (not rLink) then
+						Cauldron:debug("First attempt to get reagent info failed.  Trying again.  (skill: "..name..", reagentIndex: "..j..", name: "..tostring(rName)..", icon: "..tostring(rIcon)..", link: "..tostring(rLink)..")");
+						-- be persisent about getting the info
+						rName, rIcon, _, _ = GetTradeSkillReagentInfo(i, j);
+						rLink = GetTradeSkillReagentItemLink(i, j);
+					end
+
+					if (not rName) or (not rIcon) or (not rLink) then
+						-- be persisent about getting the info
 						Cauldron:error("Can't get name/icon/link for reagent! (skill: "..name..", reagentIndex: "..j..", name: "..tostring(rName)..", icon: "..tostring(rIcon)..", link: "..tostring(rLink)..")");
 					end