ui/src/gui_handler/gui/topgui.rs

33 lines
1 KiB
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-04-09 20:18:56 +00:00
use ecs::Commands;
2025-03-04 13:25:35 +00:00
2025-04-10 05:58:35 +00:00
use crate::prelude::GuiHandler;
2023-01-16 09:53:52 +00:00
pub trait TopGui: Send + Sync {
/// Decline method which is executed on `InputMap::B` press
2025-04-10 05:58:35 +00:00
fn decline(&self, commands: &mut Commands, gui_handler: &mut GuiHandler) -> 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-04-10 05:58:35 +00:00
fn next_tab(
&self,
commands: &mut Commands,
gui_handler: &mut GuiHandler,
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-04-10 05:58:35 +00:00
fn previous_tab(
&self,
commands: &mut Commands,
gui_handler: &mut GuiHandler,
second_level: bool,
) -> Result<()>;
2023-01-16 09:53:52 +00:00
}