Skip to content

Commit

Permalink
Merge pull request #809 from myk002/myk_autoupdate
Browse files Browse the repository at this point in the history
[gui/gm-editor] visually indicate whether autoupdate is on
  • Loading branch information
myk002 authored Aug 31, 2023
2 parents b1e21bc + 478d023 commit 7b6ed83
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 @@ -51,6 +51,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 @@ -536,6 +536,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 @@ -604,17 +605,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 7b6ed83

Please sign in to comment.