diff --git a/gui/notes.lua b/gui/notes.lua index 4d8eee7d4..9ad4d8f82 100644 --- a/gui/notes.lua +++ b/gui/notes.lua @@ -361,8 +361,7 @@ function main() qerror('notes requires a fortress map to be loaded') end - view = view and view:raise() or NotesScreen{ - }:show() + view = view and view:raise() or NotesScreen{}:show() end if not dfhack_flags.module then diff --git a/test/gui/notes.lua b/test/gui/notes.lua index 9bb1c7ac7..815ba7bfa 100644 --- a/test/gui/notes.lua +++ b/test/gui/notes.lua @@ -39,21 +39,21 @@ end local function arrange_gui_notes(options) options = options or {} + -- running tests removes all overlays because of IN_TEST reloading. + -- rescan so we can load the gui/notes widget for these tests + overlay.rescan() + arrange_notes(options.notes) gui_notes.main() - local gui_notes = gui_notes.view - gui_notes.enable_selector_blink = false + local view = gui_notes.view + view.enable_selector_blink = false - gui_notes:updateLayout() - gui_notes:onRender() - - -- for some reasons running tests remove all overlays, - -- but there are need for gui/notes tests - overlay.rescan() + view:updateLayout() + view:onRender() - return gui_notes, gui_notes.subviews.notes_window + return view, view.subviews.notes_window end local function cleanup(gui_notes)