Skip to content

Commit 6ede9c8

Browse files
committed
show tooltips for watcher's eye search. either against all jewels or against an equipped eye
1 parent abfef51 commit 6ede9c8

3 files changed

Lines changed: 382 additions & 336 deletions

File tree

src/Classes/TradeQuery.lua

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -888,10 +888,8 @@ function TradeQueryClass:findValidSlotForWatchersEye()
888888
end
889889
end
890890
for _,v in pairs(self.itemsTab.sockets) do
891-
if not v.inactive then
892-
if self.itemsTab:IsItemValidForSlot(tmpWE,v.slotName,self.itemsTab.activeItemSet) then
893-
return self.itemsTab.sockets[v.nodeId]
894-
end
891+
if not v.inactive and self.itemsTab:IsItemValidForSlot(tmpWE,v.slotName,self.itemsTab.activeItemSet) then
892+
return self.itemsTab.sockets[v.nodeId]
895893
end
896894
end
897895
end
@@ -1042,7 +1040,16 @@ function TradeQueryClass:PriceItemRowDisplay(row_idx, top_pane_alignment_ref, ro
10421040
local result = self.resultTbl[row_idx][pb_index]
10431041
local item = new("Item", result.item_string)
10441042
tooltip:Clear()
1045-
self.itemsTab:AddItemTooltip(tooltip, item, slotTbl)
1043+
if slotTbl.slotName == "Watcher's Eye" then
1044+
local firstValidSlot = self:findValidSlotForWatchersEye()
1045+
local currentItem = firstValidSlot.selItemId ~= 0 and self.itemsTab.items[firstValidSlot.selItemId]
1046+
local eyeEquipped = currentItem and currentItem.name:find("Watcher's Eye")
1047+
-- for watcher's eye we can compare to an already existing one, or
1048+
-- default to comparing with all active sockets
1049+
self.itemsTab:AddItemTooltip(tooltip, item, eyeEquipped and firstValidSlot or nil)
1050+
else
1051+
self.itemsTab:AddItemTooltip(tooltip, item, slotTbl)
1052+
end
10461053
addMegalomaniacCompareToTooltipIfApplicable(tooltip, pb_index)
10471054
tooltip:AddSeparator(10)
10481055
tooltip:AddLine(16, string.format("^7Price: %s %s", result.amount, result.currency))
@@ -1070,7 +1077,18 @@ function TradeQueryClass:PriceItemRowDisplay(row_idx, top_pane_alignment_ref, ro
10701077
-- item.baseName is nil and throws error in the following AddItemTooltip func
10711078
-- if the item is unidentified
10721079
local item = new("Item", item_string)
1073-
self.itemsTab:AddItemTooltip(tooltip, item, slotTbl, true)
1080+
-- for watcher's eye we can compare to an already existing one, or
1081+
-- default to comparing with all active sockets
1082+
if slotTbl.slotName == "Watcher's Eye" then
1083+
local firstValidSlot = self:findValidSlotForWatchersEye()
1084+
local currentItem = firstValidSlot.selItemId ~= 0 and self.itemsTab.items[firstValidSlot.selItemId]
1085+
local eyeEquipped = currentItem and currentItem.name:find("Watcher's Eye")
1086+
-- for watcher's eye we can compare to an already existing one, or
1087+
-- default to comparing with all active sockets
1088+
self.itemsTab:AddItemTooltip(tooltip, item, eyeEquipped and firstValidSlot or nil, true)
1089+
else
1090+
self.itemsTab:AddItemTooltip(tooltip, item, slotTbl, true)
1091+
end
10741092
addMegalomaniacCompareToTooltipIfApplicable(tooltip, selected_result_index)
10751093
end
10761094
end

src/Classes/TradeQueryGenerator.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ function TradeQueryGeneratorClass:RequestQuery(slot, context, statWeights, callb
12911291

12921292
if context.slotTbl.slotName == "Watcher's Eye" then
12931293
controls.includeAllWEMods = new("CheckBoxControl", {"TOPRIGHT",lastItemAnchor,"BOTTOMRIGHT"}, {0, 5, 18}, "Include all Watcher's Eye mods:", function(state) end)
1294-
controls.includeAllWEMods.tooltipText = "Include all Watcher's Eye mods in the generated query for which weights couldn't be calculated"
1294+
controls.includeAllWEMods.tooltipText = "Include mods that could not have a weight calculated for them at weight 0."
12951295
lastItemAnchor = controls.includeAllWEMods
12961296
popupHeight = popupHeight + 23
12971297
end

0 commit comments

Comments
 (0)