Enum PanelEvent
#[non_exhaustive]pub enum PanelEvent {
Clicked {
index: u32,
right: bool,
},
Search(String),
Key {
key: String,
stack: Stack,
},
SlotClicked {
recipe: u32,
slot: u32,
stack: Stack,
right: bool,
},
Action(u32),
Page(u32),
Back,
Tab(u32),
}Expand description
What the player did on a native mod’s panel (native_panel_event).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Clicked
A click on an item of the panel, by its index in
panel_items’ list.
Search(String)
The search box’s text, each time the player changes it.
Key
A physical key (key.keyboard.r) went down
while the pointer was on an item: a slot of the screen’s, or the
panel’s.
SlotClicked
A click on a slot of a recipe the panel shows: the recipe’s index in
native_panel_recipes’ list and the slot’s in it (the results come
after the slots), and the stack it showed then.
Fields
Action(u32)
The action button of the recipe at this index.
Page(u32)
The player turned the recipes’ page: the index of the first recipe now shown.
Back
The recipe page’s back button.
Tab(u32)
The player picked the tab at this index.
Trait Implementations§
§impl Clone for PanelEvent
impl Clone for PanelEvent
§fn clone(&self) -> PanelEvent
fn clone(&self) -> PanelEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for PanelEvent
impl Debug for PanelEvent
§impl PartialEq for PanelEvent
impl PartialEq for PanelEvent
impl StructuralPartialEq for PanelEvent
Auto Trait Implementations§
impl Freeze for PanelEvent
impl RefUnwindSafe for PanelEvent
impl Send for PanelEvent
impl Sync for PanelEvent
impl Unpin for PanelEvent
impl UnsafeUnpin for PanelEvent
impl UnwindSafe for PanelEvent
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
Mutably borrows from an owned value. Read more