make initial pause configurable

develop
Myk Taylor 2023-01-27 14:57:45 -08:00
parent f420b4b77e
commit 4c455224f9
No known key found for this signature in database
3 changed files with 15 additions and 3 deletions

@ -41,6 +41,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
## Misc Improvements
- A new cross-compile build script was added for building the Windows files from a Linux Docker builder (see the Compile instructions in the docs)
- You can now configure whether DFHack tool windows should pause the game by default
- `hotkeys`: clicking on the DFHack logo no longer closes the popup menu
- `gui/launcher`: sped up initialization time for faster load of the UI
- `orders`: orders plugin functionality is now offered via an overlay widget when the manager orders screen is open

@ -4182,9 +4182,12 @@ ZScreen provides the following functions:
ZScreen subclasses can set the following attributes:
* ``initial_pause`` (default: ``true``)
* ``initial_pause`` (default: ``DEFAULT_INITIAL_PAUSE``)
Whether to pause the game when the ZScreen is shown.
Whether to pause the game when the ZScreen is shown. ``DEFAULT_INITIAL_PAUSE``
defaults to ``true`` but can be set via running a command like::
:lua require('gui.widgets').DEFAULT_INITIAL_PAUSE = false
* ``force_pause`` (default: ``false``)

@ -693,17 +693,25 @@ end
-- Z-order swapping screen --
-----------------------------
DEFAULT_INITIAL_PAUSE = true
local zscreen_inhibit_mouse_l = false
ZScreen = defclass(ZScreen, Screen)
ZScreen.ATTRS{
initial_pause=true,
initial_pause=DEFAULT_NIL,
force_pause=false,
pass_pause=true,
pass_movement_keys=false,
pass_mouse_clicks=true,
}
function ZScreen:preinit(args)
if args.initial_pause == nil then
args.initial_pause = DEFAULT_INITIAL_PAUSE
end
end
function ZScreen:init()
self.saved_pause_state = df.global.pause_state
if self.initial_pause then