32 lines
1 KiB
Rust
32 lines
1 KiB
Rust
/// A trait that is used by the gui handler as the target for input
|
|
use anyhow::Result;
|
|
use ecs::Commands;
|
|
|
|
use crate::prelude::GuiHandler;
|
|
|
|
pub trait TopGui: Send + Sync {
|
|
/// Decline method which is executed on `InputMap::B` press
|
|
fn decline(&self, commands: &mut Commands, gui_handler: &mut GuiHandler) -> Result<()>;
|
|
|
|
/// Method which is executed on `InputMap::RightButton` press
|
|
///
|
|
/// # Arguments
|
|
/// * `second_level` adds support for multiple tab layers, e.g. RB and RT press on controller
|
|
fn next_tab(
|
|
&self,
|
|
commands: &mut Commands,
|
|
gui_handler: &mut GuiHandler,
|
|
second_level: bool,
|
|
) -> Result<()>;
|
|
|
|
/// Method which is executed on `InputMap::LeftButton` press
|
|
/// ///
|
|
/// # Arguments
|
|
/// * `second_level` adds support for multiple tab layers, e.g. RB and RT press on controller
|
|
fn previous_tab(
|
|
&self,
|
|
commands: &mut Commands,
|
|
gui_handler: &mut GuiHandler,
|
|
second_level: bool,
|
|
) -> Result<()>;
|
|
}
|