|
7 | 7 | local m_random = math.random |
8 | 8 | local t_concat = table.concat |
9 | 9 |
|
10 | | -local TimelessJewelListControlClass = newClass("TimelessJewelListControl", "ListControl", function(self, anchor, x, y, width, height, build, list, sharedList, hideHoverControl) |
11 | | - self.list = list or { } |
12 | | - self.ListControl(anchor, x, y, width, height, 16, true, false, self.list) |
| 10 | +local TimelessJewelListControlClass = newClass("TimelessJewelListControl", "ListControl", function(self, anchor, x, y, width, height, build) |
13 | 11 | self.build = build |
14 | | - self.sharedList = sharedList |
15 | | - self.hideHoverControl = hideHoverControl |
| 12 | + self.sharedList = self.build.timelessData.sharedResults or { } |
| 13 | + self.list = self.build.timelessData.searchResults or { } |
| 14 | + self.ListControl(anchor, x, y, width, height, 16, true, false, self.list) |
16 | 15 | self.selIndex = nil |
17 | 16 | end) |
18 | 17 |
|
19 | | -function TimelessJewelListControlClass:Draw(viewPort) |
| 18 | +function TimelessJewelListControlClass:Draw(viewPort, noTooltip) |
| 19 | + self.noTooltip = noTooltip |
20 | 20 | self.ListControl.Draw(self, viewPort) |
21 | 21 | end |
22 | 22 |
|
|
28 | 28 |
|
29 | 29 | function TimelessJewelListControlClass:AddValueTooltip(tooltip, index, data) |
30 | 30 | tooltip:Clear() |
31 | | - if not self.hideHoverControl:IsMouseOver() then |
| 31 | + if not self.noTooltip then |
32 | 32 | if self.list[index].label:match("B2B2B2") == nil then |
33 | 33 | tooltip:AddLine(16, "^7Double click to add this jewel to your build.") |
34 | 34 | else |
35 | 35 | tooltip:AddLine(16, "^7" .. self.sharedList.type.label .. " " .. data.seed .. " was successfully added to your build.") |
36 | 36 | end |
37 | 37 | local treeData = self.build.spec.tree |
38 | 38 | local sortedNodeLists = { } |
39 | | - for _, desiredNode in pairs(self.sharedList.desiredNodes) do |
40 | | - if self.list[index][desiredNode.nodeId] and self.list[index][desiredNode.nodeId].targetNodeNames and #self.list[index][desiredNode.nodeId].targetNodeNames > 0 then |
41 | | - sortedNodeLists[desiredNode.desiredIdx] = " " .. desiredNode.displayName .. ":\n " .. t_concat(self.list[index][desiredNode.nodeId].targetNodeNames, "\n ") |
| 39 | + for legionId, desiredNode in pairs(self.sharedList.desiredNodes) do |
| 40 | + if self.list[index][legionId] and self.list[index][legionId].targetNodeNames and #self.list[index][legionId].targetNodeNames > 0 then |
| 41 | + sortedNodeLists[desiredNode.desiredIdx] = "^7 " .. desiredNode.displayName .. ":\n^8 " .. t_concat(self.list[index][legionId].targetNodeNames, "\n ") |
42 | 42 | end |
43 | 43 | end |
44 | 44 | if sortedNodeLists then |
45 | 45 | tooltip:AddLine(16, "Node List:") |
46 | 46 | for _, sortedNodeList in pairs(sortedNodeLists) do |
47 | 47 | tooltip:AddLine(16, sortedNodeList) |
48 | 48 | end |
49 | | - tooltip:AddLine(16, "Combined Node Weight: " .. data.total) |
| 49 | + tooltip:AddLine(16, "^7Combined Node Weight: " .. data.total) |
50 | 50 | end |
51 | 51 | end |
52 | 52 | end |
|
0 commit comments