Quantcast

Queue items now have tooltips that tell the user what they can do with the item, i.e., re-prioritize, adjust count, and add to shopping list are now enabled.

Paul Schifferer [12-17-10 - 06:21]
Queue items now have tooltips that tell the user what they can do with the item, i.e., re-prioritize, adjust count, and add to shopping list are now enabled.
Filename
CauldronQueue.xml
CauldronQueueUI.lua
Locale/Cauldron-enUS.lua
diff --git a/CauldronQueue.xml b/CauldronQueue.xml
index 215f003..103f33b 100644
--- a/CauldronQueue.xml
+++ b/CauldronQueue.xml
@@ -298,34 +298,54 @@
 			-->
     	</Frames>
     	<Scripts>
-    		<OnClick>
-				HandleModifiedItemClick(self.link);
-    		</OnClick>
-    		<!--
     		<OnEnter>
-    			if self.removeable then
-    				_G[self:GetName().."RemoveItem"]:Show();
-    				_G[self:GetName().."DecreasePriority"]:Show();
-    				_G[self:GetName().."IncreasePriority"]:Show();
-    				_G[self:GetName().."DecrementCount"]:Show();
-    				_G[self:GetName().."IncrementCount"]:Show();
-    				_G[self:GetName().."IncrementCount"]:SetScale(0.75);
-    			end
-    			if self.shoppable then
-    				_G[self:GetName().."AddToShoppingList"]:Show();
+    			local itemId = self:GetID();
+    			if itemId &lt; 100 then
+					GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
+					GameTooltip:ClearLines();
+					GameTooltip:AddLine(self.itemName);
+					GameTooltip:AddLine(Cauldron:LocaleString("Click to increase crafted amount"));
+					GameTooltip:AddLine(Cauldron:LocaleString("Shift-click to decrease crafted amount"));
+					GameTooltip:AddLine(Cauldron:LocaleString("Control-click to move to top of queue"));
+					GameTooltip:Show();
+					CursorUpdate(self);
+    			elseif itemId &gt;= 200 then
+					GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
+					GameTooltip:ClearLines();
+					GameTooltip:AddLine(self.itemName);
+					GameTooltip:AddLine(Cauldron:LocaleString("Double-click to add needed amount to shopping list"));
+					GameTooltip:Show();
+					CursorUpdate(self);
     			end
     		</OnEnter>
-    		<OnLeave>
-    			if not self.inHoverButtons then
-					_G[self:GetName().."RemoveItem"]:Hide();
-    				_G[self:GetName().."DecreasePriority"]:Hide();
-    				_G[self:GetName().."IncreasePriority"]:Hide();
-    				_G[self:GetName().."DecrementCount"]:Hide();
-    				_G[self:GetName().."IncrementCount"]:Hide();
-    				_G[self:GetName().."AddToShoppingList"]:Hide();
-				end
-    		</OnLeave>
-    		-->
+			<OnLeave>
+				GameTooltip:Hide();
+				ResetCursor();
+			</OnLeave>
+    		<OnClick>
+    			local itemId = self:GetID();
+    			local button = GetMouseButtonClicked();
+    			if (button == "LeftButton") and (itemId &lt; 100) then
+    				if IsControlKeyDown() then
+    					Cauldron:IncreaseItemPriority(self.itemName, true);
+    				elseif IsShiftKeyDown() then
+						Cauldron:DecreaseItemCount(self.itemName);
+    				else
+						Cauldron:IncreaseItemCount(self.itemName);
+    				end
+					Cauldron:UpdateQueue();
+					Cauldron:UpdateButtons();
+    			end
+    		</OnClick>
+    		<OnDoubleClick>
+    			local itemId = self:GetID();
+    			local button = GetMouseButtonClicked();
+    			if (button == "LeftButton") and (itemId &gt;= 200) then
+    				if self.needAmount &lt; 1 then
+						Cauldron:AddItemToShoppingList(self.itemName, self.needAmount);
+					end
+    			end
+    		</OnDoubleClick>
     	</Scripts>
     </Button>

@@ -521,46 +541,10 @@
 								</Frames>
 							</Frame>
 						</ScrollChild>
-						<!--
-						<Frames>
-							<Slider name="$parentScrollBar" inherits="MinimalHybridScrollBarTemplate">
-								<Anchors>
-									<Anchor point="TOPRIGHT" relativeTo="CauldronQueueFrame" relativePoint="TOPRIGHT">
-										<Offset>
-											<AbsDimension x="-47" y="-114"/>
-										</Offset>
-									</Anchor>
-									<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT">
-										<Offset>
-											<AbsDimension x="6" y="14"/>
-										</Offset>
-									</Anchor>
-								</Anchors>
-							</Slider>
-						</Frames>
-						-->
 					</ScrollFrame>
                 </Frames>
             </Frame>

-            <!-- Close button -->
-            <!--
-            <Button name="CauldronQueueWindowFrameCloseButton" inherits="UIPanelCloseButton">
-                <Anchors>
-                    <Anchor point="TOPRIGHT" relativeTo="CauldronQueueWindowFrame" relativePoint="TOPRIGHT">
-                        <Offset x="4" y="-8"/>
-                    </Anchor>
-                </Anchors>
-                <Scripts>
-                    <OnClick>
-                        HideUIPanel(CauldronQueueWindowFrame);
-                        - - TODO: record that queue is closed
-						PlaySound("igCharacterInfoClose");
-                    </OnClick>
-                </Scripts>
-            </Button>
-            -->
-
             <!-- Buttons frame -->
             <Frame name="CauldronQueueButtonsFrame">
                 <Size x="330" y="25" />
diff --git a/CauldronQueueUI.lua b/CauldronQueueUI.lua
index 2621997..ec5b2ae 100644
--- a/CauldronQueueUI.lua
+++ b/CauldronQueueUI.lua
@@ -475,3 +475,7 @@ function Cauldron:UpdateQueue()

 end

+function Cauldron:QueueItem_OnDoubleClick(frame)
+	Cauldron:AddItemToShoppingList(frame.itemName, frame.needAmount);
+end
+
diff --git a/Locale/Cauldron-enUS.lua b/Locale/Cauldron-enUS.lua
index cab7117..291b000 100644
--- a/Locale/Cauldron-enUS.lua
+++ b/Locale/Cauldron-enUS.lua
@@ -168,6 +168,11 @@ L["Needed for leveling:"] = true

 L["Showing %1$d - %2$d of %3$d items."] = true

+L["Click to increase crafted amount"] = true
+L["Shift-click to decrease crafted amount"] = true
+L["Control-click to move to top of queue"] = true
+L["Double-click to add needed amount to shopping list"] = true
+
 L["Oh. Smells like barbecued dog hair."] = true

 -- LSW strings