Skip to content

Commit ffa84e6

Browse files
committed
fix tooltip sometimes not showing in ItemsTab on dropdown items
1 parent 14a0aae commit ffa84e6

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/Classes/ItemSlotControl.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ local ItemSlotClass = newClass("ItemSlotControl", "DropDownControl", function(se
4747
self.tooltipFunc = function(tooltip, mode, index, itemId)
4848
local item = itemsTab.items[self.items[index]]
4949
if main.popups[1] or mode == "OUT" or not item or (not self.dropped and itemsTab.selControl and itemsTab.selControl ~= self.controls.activate) then
50-
tooltip:Clear()
50+
tooltip:Clear(true)
5151
elseif tooltip:CheckForUpdate(item, launch.devModeAlt, itemsTab.build.outputRevision) then
5252
itemsTab:AddItemTooltip(tooltip, item, self)
5353
end

src/Classes/Tooltip.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,16 @@ end
4343
local TooltipClass = newClass("Tooltip", function(self)
4444
self.lines = { }
4545
self.blocks = { }
46+
self.iterate = 0
4647
self:Clear()
4748
end)
4849

49-
function TooltipClass:Clear()
50+
function TooltipClass:Clear(clearUpdateParams)
5051
wipeTable(self.lines)
5152
wipeTable(self.blocks)
53+
if self.updateParams and clearUpdateParams then
54+
wipeTable(self.updateParams)
55+
end
5256
self.tooltipHeader = false
5357
self.titleYOffset = 0
5458
self.recipe = nil
@@ -74,6 +78,8 @@ function TooltipClass:CheckForUpdate(...)
7478
if doUpdate or self.updateParams.notSupportedModTooltips ~= main.notSupportedModTooltips then
7579
self.updateParams.notSupportedModTooltips = main.notSupportedModTooltips
7680
self:Clear()
81+
self.iterate = self.iterate + 1
82+
ConPrintf("Iteration count: "..self.iterate)
7783
return true
7884
end
7985
end

0 commit comments

Comments
 (0)