Merge pull request #3302 from myk002/myk_modal

add ZScreenModal class for modal dialogs
develop
Myk 2023-04-24 14:37:04 -07:00 committed by GitHub
commit dd5eab41fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 ## Lua
- ``widgets.RangeSlider``: new mouse-controlled two-headed slider widget - ``widgets.RangeSlider``: new mouse-controlled two-headed slider widget
- ``gui.ZScreenModal``: ZScreen subclass for modal dialogs
## Removed ## Removed
- `title-version`: replaced by an `overlay` widget - `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() 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 FramedScreen class
------------------ ------------------

@ -867,8 +867,17 @@ function ZScreen:onGetSelectedPlant()
return zscreen_get_any(self, 'Plant') return zscreen_get_any(self, 'Plant')
end end
-------------------------- -- convenience subclass for modal dialogs
-- Framed screen object -- 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. -- Plain grey-colored frame.