From 71259431eb60c2be5a40c9635ab8da94ffb41a5d Mon Sep 17 00:00:00 2001 From: yuni Date: Mon, 18 Nov 2024 02:40:59 +0100 Subject: [PATCH] WIP time trial: added menu items --- src/menu.rs | 7 +++++++ src/var.rs | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/menu.rs b/src/menu.rs index dadce7c..3e8af28 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -66,6 +66,7 @@ pub enum DeathScreenEvent { pub const MENUDEF: &[(&str, MenuAction, MenuType)] = &[ ("✆ Phone", MenuAction::PhoneCall, MenuType::Always), + ("⊙ Time Trial", MenuAction::Race, MenuType::Always), ("✯ Map\n", MenuAction::ToggleMap, MenuType::Always), ("", MenuAction::ToggleAR, MenuType::Always), ("", MenuAction::ChangeARAvatar, MenuType::AROnly), @@ -98,6 +99,7 @@ pub enum MenuType { pub enum MenuAction { ToggleMap, ToggleAR, + Race, ChangeARAvatar, ChangePointer, ModLightAmp, @@ -784,6 +786,11 @@ pub fn handle_input( ew_game.send(GameEvent::SetMenu(Turn::Off)); ew_updatemenu.send(UpdateMenuEvent); } + MenuAction::Race => { + settings.race_active = true; + ew_game.send(GameEvent::SetMenu(Turn::Off)); + ew_updatemenu.send(UpdateMenuEvent); + } MenuAction::ResetSettings => { ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::PowerDown)); *settings = Settings::default(); diff --git a/src/var.rs b/src/var.rs index 7c5e7bb..f71a7b4 100644 --- a/src/var.rs +++ b/src/var.rs @@ -104,6 +104,7 @@ pub struct Settings { pub shadows_sun: bool, pub shadows_pointlights: bool, pub shadowmap_resolution: usize, + pub race_active: bool, pub large_moons: bool, pub key_selectobject: MouseButton, pub key_zoom: MouseButton, @@ -251,6 +252,7 @@ impl Default for Settings { shadows_sun: true, shadows_pointlights: false, shadowmap_resolution: 2048, + race_active: false, large_moons: false, key_selectobject: MouseButton::Left, key_zoom: MouseButton::Right,