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 [UiAction]
const ALL: &'static [UiAction]
Source§fn is_rebindable(self) -> bool
fn is_rebindable(self) -> bool
Source§fn fixed_keys() -> &'static [(Chord, UiAction)]
fn fixed_keys() -> &'static [(Chord, UiAction)]
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 &[].impl Copy for UiAction
impl Eq for UiAction
Source§impl Ord for UiAction
impl Ord for UiAction
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for UiAction
impl PartialOrd for UiAction
impl StructuralPartialEq for UiAction
Auto Trait Implementations§
impl Freeze for UiAction
impl RefUnwindSafe for UiAction
impl Send for UiAction
impl Sync for UiAction
impl Unpin for UiAction
impl UnsafeUnpin for UiAction
impl UnwindSafe for UiAction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.