pub enum UiAction {
Up,
Down,
Left,
Right,
Confirm,
Cancel,
Debug,
}Expand description
What the generic widgets (a menu), the Key bindings screen and the debug
hook react to. A game maps some of its actions onto these with
ActionSet::ui; the rest are its own business.
Variants§
Up
Move up (a menu’s focus, a cursor).
Down
Move down.
Left
Move left.
Right
Move right.
Confirm
Confirm / select.
Cancel
Cancel / back.
Debug
Open the developer’s debug screens.
Trait Implementations§
Source§impl ActionSet for UiAction
The ready-made action set of a game that plays with the six moves: its
keymap file names Up, Down, Left, Right, Confirm and Cancel,
every one required and rebindable. UiAction::Debug is no action of
the set: a game with a debug key writes its own action enum. A
UiAction added later stays out of ALL too, so no
game’s keymap file must name it (ADR-0036).
impl ActionSet for UiAction
The ready-made action set of a game that plays with the six moves: its
keymap file names Up, Down, Left, Right, Confirm and Cancel,
every one required and rebindable. UiAction::Debug is no action of
the set: a game with a debug key writes its own action enum. A
UiAction added later stays out of ALL too, so no
game’s keymap file must name it (ADR-0036).
Source§fn is_repeatable(self) -> bool
fn is_repeatable(self) -> bool
The four moves repeat while held.
Source§fn is_required(self) -> bool
fn is_required(self) -> bool
The six must keep a key: the game can’t be played without one.
Source§const ALL: &'static [Self]
const ALL: &'static [Self]
Source§fn is_rebindable(self) -> bool
fn is_rebindable(self) -> bool
Source§fn fixed_keys() -> &'static [(Chord, Self)]
fn fixed_keys() -> &'static [(Chord, Self)]
Escape cancels).
Shown after an action’s own keys in help text, but never counted as
a key of its own. A game with none returns &[].