ui/src/gui_handler/gui/topgui.rs

21 lines
806 B
Rust
Raw Normal View History

2023-01-16 09:53:52 +00:00
/// A trait that is used by the gui handler as the target for input
use anyhow::Result;
2025-03-04 17:18:08 +00:00
use ecs::World;
2025-03-04 13:25:35 +00:00
2023-01-16 09:53:52 +00:00
pub trait TopGui: Send + Sync {
/// Decline method which is executed on `InputMap::B` press
2025-03-04 17:18:08 +00:00
fn decline(&self, world: &mut World) -> Result<()>;
2023-01-16 09:53:52 +00:00
/// 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
2025-03-04 17:18:08 +00:00
fn next_tab(&self, world: &mut World, second_level: bool) -> Result<()>;
2023-01-16 09:53:52 +00:00
/// 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
2025-03-04 17:18:08 +00:00
fn previous_tab(&self, world: &mut World, second_level: bool) -> Result<()>;
2023-01-16 09:53:52 +00:00
}