ui/src/gui_handler/gui/topgui.rs

22 lines
847 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 13:25:35 +00:00
use crate::prelude::*;
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 13:25:35 +00:00
fn decline(&self, 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-03-04 13:25:35 +00:00
fn next_tab(&self, 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-03-04 13:25:35 +00:00
fn previous_tab(&self, gui_handler: &mut GuiHandler, second_level: bool) -> Result<()>;
2023-01-16 09:53:52 +00:00
}