yog_event/client/ui.rs
1//! Screens opened and closed.
2
3use yog_data::Schema;
4
5/// Fired when a GUI screen opens.
6#[derive(Debug, Clone, Schema)]
7pub struct Open {
8 /// Simple class name of the screen, e.g. `"InventoryScreen"`, `"ChestScreen"`.
9 pub screen_class: String,
10}
11
12/// Fired when a GUI screen closes.
13#[derive(Debug, Clone, Schema)]
14pub struct Close {
15 /// Simple class name of the screen.
16 pub screen_class: String,
17}
18
19/// Input on a mod's screen; keyed by the screen's id. `event` is
20/// `click:X:Y`, `drag:X:Y`, `release:X:Y`, `scroll:DY`, `key:KEY:MODS`
21/// (GLFW key code and modifier bits, on press and repeat) or
22/// `char:CODEPOINT`. Before: a handler that used a `key:`/`char:` cancels
23/// it — the host then skips its own handling (Esc closing the screen).
24#[derive(Debug, Clone, Schema)]
25pub struct Input {
26 pub ui_id: String,
27 pub event: String,
28}