Skip to content

Commit

Permalink
make the map overlay blink in text mode
Browse files Browse the repository at this point in the history
Other minor changes

Co-authored-by: Myk <[email protected]>
  • Loading branch information
TymurGubayev and myk002 authored May 20, 2023
1 parent 1065275 commit fc38f83
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion gui/biomes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ local function gatherBiomeInfo(z)
local maxX, maxY, maxZ = dfhack.maps.getTileSize()
maxX = maxX - 1; maxY = maxY - 1; maxZ = maxZ - 1

local z = z or df.global.window_z
z = z or df.global.window_z

--for z = 0, maxZ do
for y = 0, maxY do
Expand Down Expand Up @@ -274,6 +274,10 @@ local function add_field_text(lines, biome, field_name)
end

local function get_tooltip_text(option)
if not option then
return ""
end

local text = {}
text[#text+1] = ("type: %s"):format(df.biome_type[option.biomeTypeId])
text[#text+1] = NEWLINE
Expand Down Expand Up @@ -335,6 +339,10 @@ end
function BiomeVisualizer:onRenderFrame(dc, rect)
BiomeVisualizer.super.onRenderFrame(self, dc, rect)

if not dfhack.screen.inGraphicsMode() and not gui.blink_visible(500) then
return
end

local z = df.global.window_z
if not biomesMap[z] then
gatherBiomeInfo(z)
Expand Down

0 comments on commit fc38f83

Please sign in to comment.