mirror of
https://codeberg.org/schrottkatze/mgd2-tram-championships.git
synced 2025-07-02 01:27:39 +00:00
50 lines
1.5 KiB
Rust
50 lines
1.5 KiB
Rust
use bevy::{input::ButtonState, prelude::*};
|
|
use lib::{ItemPosition, Menu, MenuItemType, Menus, OnPressAction};
|
|
|
|
mod lib;
|
|
|
|
#[derive(States, Debug, Clone, PartialEq, Eq, Hash)]
|
|
enum CurrentMenu {
|
|
NotInMenus,
|
|
MainMenu,
|
|
Settings,
|
|
HighScores,
|
|
StartGame,
|
|
}
|
|
pub fn todo_meow() {
|
|
let plugin = Menus::<CurrentMenu>::new()
|
|
.add_menu(
|
|
CurrentMenu::MainMenu,
|
|
Menu::new().add_items(&[
|
|
&MenuItemType::Text(String::from("Hello, World!")),
|
|
&(
|
|
MenuItemType::Button(String::from("Start Game")),
|
|
OnPressAction::SampleAction,
|
|
),
|
|
&(
|
|
MenuItemType::Button(String::from("Settings")),
|
|
OnPressAction::NavigateTo(CurrentMenu::Settings),
|
|
),
|
|
]),
|
|
)
|
|
.add_menu(
|
|
CurrentMenu::Settings,
|
|
Menu::new()
|
|
.add_items(&[
|
|
&MenuItemType::Text(String::from("Hello, World!")),
|
|
&(
|
|
MenuItemType::Button(String::from("Sample setting")),
|
|
OnPressAction::SampleAction,
|
|
),
|
|
])
|
|
.add_items_positioned(
|
|
ItemPosition::SouthEast,
|
|
&[&(
|
|
MenuItemType::Button(String::from("Back")),
|
|
OnPressAction::NavigateTo(CurrentMenu::MainMenu),
|
|
)],
|
|
),
|
|
);
|
|
|
|
dbg!(plugin);
|
|
}
|