WIP time trial: added menu items

This commit is contained in:
yuni 2024-11-18 02:40:59 +01:00
parent 624de181ce
commit 71259431eb
2 changed files with 9 additions and 0 deletions

View file

@ -66,6 +66,7 @@ pub enum DeathScreenEvent {
pub const MENUDEF: &[(&str, MenuAction, MenuType)] = &[ pub const MENUDEF: &[(&str, MenuAction, MenuType)] = &[
("✆ Phone", MenuAction::PhoneCall, MenuType::Always), ("✆ Phone", MenuAction::PhoneCall, MenuType::Always),
("⊙ Time Trial", MenuAction::Race, MenuType::Always),
("✯ Map\n", MenuAction::ToggleMap, MenuType::Always), ("✯ Map\n", MenuAction::ToggleMap, MenuType::Always),
("", MenuAction::ToggleAR, MenuType::Always), ("", MenuAction::ToggleAR, MenuType::Always),
("", MenuAction::ChangeARAvatar, MenuType::AROnly), ("", MenuAction::ChangeARAvatar, MenuType::AROnly),
@ -98,6 +99,7 @@ pub enum MenuType {
pub enum MenuAction { pub enum MenuAction {
ToggleMap, ToggleMap,
ToggleAR, ToggleAR,
Race,
ChangeARAvatar, ChangeARAvatar,
ChangePointer, ChangePointer,
ModLightAmp, ModLightAmp,
@ -784,6 +786,11 @@ pub fn handle_input(
ew_game.send(GameEvent::SetMenu(Turn::Off)); ew_game.send(GameEvent::SetMenu(Turn::Off));
ew_updatemenu.send(UpdateMenuEvent); ew_updatemenu.send(UpdateMenuEvent);
} }
MenuAction::Race => {
settings.race_active = true;
ew_game.send(GameEvent::SetMenu(Turn::Off));
ew_updatemenu.send(UpdateMenuEvent);
}
MenuAction::ResetSettings => { MenuAction::ResetSettings => {
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::PowerDown)); ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::PowerDown));
*settings = Settings::default(); *settings = Settings::default();

View file

@ -104,6 +104,7 @@ pub struct Settings {
pub shadows_sun: bool, pub shadows_sun: bool,
pub shadows_pointlights: bool, pub shadows_pointlights: bool,
pub shadowmap_resolution: usize, pub shadowmap_resolution: usize,
pub race_active: bool,
pub large_moons: bool, pub large_moons: bool,
pub key_selectobject: MouseButton, pub key_selectobject: MouseButton,
pub key_zoom: MouseButton, pub key_zoom: MouseButton,
@ -251,6 +252,7 @@ impl Default for Settings {
shadows_sun: true, shadows_sun: true,
shadows_pointlights: false, shadows_pointlights: false,
shadowmap_resolution: 2048, shadowmap_resolution: 2048,
race_active: false,
large_moons: false, large_moons: false,
key_selectobject: MouseButton::Left, key_selectobject: MouseButton::Left,
key_zoom: MouseButton::Right, key_zoom: MouseButton::Right,