add ZScreenModal class for modal dialogs

develop
Myk Taylor 2023-04-24 14:32:33 -07:00
parent 73b5e37f67
commit 65d7b290a3
No known key found for this signature in database
3 changed files with 19 additions and 2 deletions

@ -55,6 +55,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
## Lua
- ``widgets.RangeSlider``: new mouse-controlled two-headed slider widget
- ``gui.ZScreenModal``: ZScreen subclass for modal dialogs
## Removed
- `title-version`: replaced by an `overlay` widget

@ -4323,6 +4323,13 @@ Here is an example skeleton for a ZScreen tool window::
view = view and view:raise() or MyScreen{}:show()
ZScreenModal class
------------------
A ZScreen convenience subclass that sets the attributes to something
appropriate for modal dialogs. The game is force paused, and no input is passed
through to the underlying viewscreens.
FramedScreen class
------------------

@ -867,8 +867,17 @@ function ZScreen:onGetSelectedPlant()
return zscreen_get_any(self, 'Plant')
end
--------------------------
-- Framed screen object --
-- convenience subclass for modal dialogs
ZScreenModal = defclass(ZScreenModal, ZScreen)
ZScreenModal.ATTRS{
defocusable = false,
force_pause = true,
pass_pause = false,
pass_movement_keys = false,
pass_mouse_clicks = false,
}
-- Framed screen object
--------------------------
-- Plain grey-colored frame.