Skip to content

Commit

Permalink
visually indicate whether autoupdate is on
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Aug 30, 2023
1 parent 0d5b6e6 commit 478d023
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 6 additions & 3 deletions gui/gm-editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 478d023

Please sign in to comment.