Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion gui/tooltips.lua
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ local function GetUnitNameAndJob(unit)
end

local function GetTooltipText(pos)
if not pos then return end

local txt = {}
local units = dfhack.units.getUnitsInBox(pos, pos) or {} -- todo: maybe (optionally) use filter parameter here?

Expand Down Expand Up @@ -267,7 +269,7 @@ function MouseTooltip:render(dc)

local pos = dfhack.gui.getMousePos()
local text = GetTooltipText(pos)
if #text == 0 then return end
if not text or #text == 0 then return end
Comment thread
TimurKelman marked this conversation as resolved.
Outdated
self.label:setText(text)

local sw, sh = dfhack.screen.getWindowSize()
Expand Down