yog_event/ui.rs
1//! Mods' screens: the host's actions.
2
3use yog_ids as ids;
4
5actions! {
6 /// Opens screen `ui_id`; `modal` blocks the game's input, `pause` pauses singleplayer.
7 Open { ui_id: String, modal: bool, pause: bool } -> bool = ids::service_ui::OPEN, "YogUiActions.openUI";
8 /// Opens screen `ui_id` with [`flags`] bits.
9 OpenWithFlags { ui_id: String, flags: i32 } -> bool = ids::service_ui::OPEN_WITH_FLAGS, "YogClientApi.openUI";
10 /// Closes screen `ui_id` if it's the one open.
11 Close { ui_id: String } -> bool = ids::service_ui::CLOSE, "YogUiActions.closeUI";
12}
13
14/// Flag bits for [`OpenWithFlags`].
15pub mod flags {
16 /// Blocks game input (what [`super::Open`]'s `modal` does).
17 pub const MODAL: u32 = 1;
18 /// Pauses a singleplayer game.
19 pub const PAUSE: u32 = 1 << 1;
20 /// Draws no background behind the screen: the world stays visible.
21 pub const NO_BACKGROUND: u32 = 1 << 2;
22}