From 478d0237a3452cbc5ad88c2d6e329b41506f7173 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Wed, 30 Aug 2023 02:19:51 -0700 Subject: [PATCH] visually indicate whether autoupdate is on --- changelog.txt | 1 + gui/gm-editor.lua | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index 68e2b3d29b..73ad700756 100644 --- a/changelog.txt +++ b/changelog.txt @@ -48,6 +48,7 @@ Template for new versions: - `quickfort`: linked stockpiles and workshops can now be specified by ID instead of only by name. this is mostly useful when dynamically generating blueprints and applying them via the `quickfort` API - `suspendmanager`: display a different color for jobs suspended by suspendmanager - `caravan`: optionally display items within bins in bring goods to depot screen +- `gui/gm-editor`: display in the title bar whether the editor window is scanning for live updates ## Removed diff --git a/gui/gm-editor.lua b/gui/gm-editor.lua index fa65a76280..231dc8ef11 100644 --- a/gui/gm-editor.lua +++ b/gui/gm-editor.lua @@ -533,6 +533,7 @@ function GmEditorUi:onInput(keys) return true elseif keys[keybindings.autoupdate.key] then self.autoupdate = not self.autoupdate + self:updateTitles() return true elseif keys[keybindings.offset.key] then local trg=self:currentTarget() @@ -601,17 +602,19 @@ end function GmEditorUi:updateTitles() local title = "GameMaster's Editor" if self.read_only then - title = title.." (Read Only)" + title = title.." (Read only)" end for view,_ in pairs(views) do - view.subviews[1].frame_title = title + local window = view.subviews[1] + window.read_only = self.read_only + window.frame_title = title .. (window.autoupdate and ' (Live updates)' or '') end - self.frame_title = title save_config({read_only = self.read_only}) end function GmEditorUi:updateTarget(preserve_pos,reindex) self:verifyStack() local trg=self:currentTarget() + if not trg then return end local filter=self.subviews.filter_input.text:lower() if reindex then