Skip to content
Open
Changes from all commits
Commits
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
11 changes: 11 additions & 0 deletions test/overlay/notes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ config = {

local map_points_backup = nil
local was_overlay_enabled = overlay.isEnabled()
local was_paused = nil

local function install_notes_overlay(options)
options = options or {}

-- the overlay does not draw note pins in text mode unless the game is
-- paused, so don't depend on whatever pause state the test harness left
was_paused = dfhack.world.ReadPauseState()
dfhack.world.SetPauseState(true)

map_points_backup = utils.clone(map_points)
map_points:resize(0)

Expand Down Expand Up @@ -51,6 +57,11 @@ local function cleanup(notes_overlay)
end
map_points_backup = nil

if was_paused ~= nil then
dfhack.world.SetPauseState(was_paused)
was_paused = nil
end

reload_notes()

overlay.setEnabled(was_overlay_enabled)
Expand Down
Loading