Compare commits

..

No commits in common. "6926a0f4f9d171ee1f691e4db164a1252d003441" and "48c20e7a0ecd10a35843d08fe52722085183b99b" have entirely different histories.

5 changed files with 52 additions and 82 deletions

View file

@ -14,7 +14,7 @@
- sound: phone - sound: phone
msg: Dialing... msg: Dialing...
- goto: travel - goto: travel
- "[Hang up]": - "[Cancel]":
- goto: EXIT - goto: EXIT
# --------------------------------------------------------- # ---------------------------------------------------------

View file

@ -399,7 +399,7 @@ actor 1000 20 300 monolith
density 300 density 300
rotationx 90 rotationx 90
wants maxrotation 0.01 wants maxrotation 0.01
wants lookat hideout wants lookat cultasteroid
angularmomentum 0.0 0.0 0.01 angularmomentum 0.0 0.0 0.01
thrust 0 0 0 30 1 thrust 0 0 0 30 1
collider mesh collider mesh
@ -411,7 +411,7 @@ actor 10000 2000 -3500 monolith
density 300 density 300
rotationx 90 rotationx 90
wants maxrotation 0.01 wants maxrotation 0.01
wants lookat hideout wants lookat cultasteroid
angularmomentum 0.0 0.0 0.01 angularmomentum 0.0 0.0 0.01
thrust 0 0 0 30 1 thrust 0 0 0 30 1
collider mesh collider mesh
@ -423,7 +423,7 @@ actor -8000 -1000 -100 monolith
density 300 density 300
rotationx 90 rotationx 90
wants maxrotation 0.01 wants maxrotation 0.01
wants lookat hideout wants lookat cultasteroid
angularmomentum 0.0 0.0 0.01 angularmomentum 0.0 0.0 0.01
thrust 0 0 0 30 1 thrust 0 0 0 30 1
collider mesh collider mesh

View file

@ -45,7 +45,7 @@ pub const DASHBOARD_DEF: &[(Dashboard, &str)] = &[
// Player avatars: [(Avatar, model name, scale, in-game name)] // Player avatars: [(Avatar, model name, scale, in-game name)]
pub const PLAYER_AR_AVATARS: &[(Avatar, &str, f32, &str)] = &[ pub const PLAYER_AR_AVATARS: &[(Avatar, &str, f32, &str)] = &[
(Avatar::None, "", 1.0, "Off"), (Avatar::None, "", 1.0, "No Avatar"),
(Avatar::ChefHat, "suit_ar_chefhat", 1.0, "Chef Hat"), (Avatar::ChefHat, "suit_ar_chefhat", 1.0, "Chef Hat"),
(Avatar::Hoodie, "suit_ar_hoodie", 1.0, "Hoodie"), (Avatar::Hoodie, "suit_ar_hoodie", 1.0, "Hoodie"),
(Avatar::HoodieUp, "suit_ar_hoodie_up", 1.0, "Hoodie Up"), (Avatar::HoodieUp, "suit_ar_hoodie_up", 1.0, "Hoodie Up"),
@ -65,7 +65,7 @@ pub const PLAYER_AR_AVATARS: &[(Avatar, &str, f32, &str)] = &[
pub const POINTERS: &[(Pointer, Option<&str>, &str)] = &[ pub const POINTERS: &[(Pointer, Option<&str>, &str)] = &[
(Pointer::None, None, "Off"), (Pointer::None, None, "Off"),
(Pointer::Tri, Some("sprites/pointer_tri.png"), "On"), (Pointer::Tri, Some("sprites/pointer_tri.png"), "Default"),
(Pointer::Dot, Some("sprites/pointer_dot.png"), "Dot"), (Pointer::Dot, Some("sprites/pointer_dot.png"), "Dot"),
]; ];

View file

@ -64,36 +64,26 @@ pub enum DeathScreenEvent {
Hide, Hide,
} }
pub const MENUDEF: &[(&str, MenuAction, MenuType)] = &[ pub const MENUDEF: &[(&str, MenuAction)] = &[
("✆ Phone", MenuAction::PhoneCall, MenuType::Always), ("✆ Phone", MenuAction::PhoneCall),
("✯ Map\n", MenuAction::ToggleMap, MenuType::Always), ("✯ Map\n", MenuAction::ToggleMap),
("", MenuAction::ToggleAR, MenuType::Always), ("", MenuAction::ToggleAR),
("", MenuAction::ChangeARAvatar, MenuType::AROnly), ("", MenuAction::ChangeARAvatar),
("", MenuAction::ChangePointer, MenuType::AROnly), ("", MenuAction::ChangePointer),
("", MenuAction::ModLightAmp, MenuType::AROnly), ("", MenuAction::ModLightAmp),
("", MenuAction::ModFlashlightPower, MenuType::Always), ("", MenuAction::ModFlashlightPower),
("", MenuAction::ModThrusterBoost, MenuType::SuitOnly), ("", MenuAction::ModThrusterBoost),
("", MenuAction::ModReactor, MenuType::SuitOnly), ("", MenuAction::ModReactor),
("", MenuAction::ToggleSound, MenuType::Always), ("", MenuAction::ToggleSound),
("", MenuAction::ToggleMusic, MenuType::Always), ("", MenuAction::ToggleMusic),
//("", MenuAction::ToggleCamera), ("", MenuAction::ToggleCamera),
("", MenuAction::ToggleShadows, MenuType::Always), ("", MenuAction::ToggleShadows),
//("Fullscreen [F11]", MenuAction::ToggleFullscreen), ("Fullscreen [F11]", MenuAction::ToggleFullscreen),
( ("⚠ FACTORY RESET ⚠", MenuAction::ResetSettings),
"⚠ FACTORY RESET ⚠", ("⚠ Take Off Helmet ⚠", MenuAction::Restart),
MenuAction::ResetSettings, ("Quit", MenuAction::Quit),
MenuType::Always,
),
("⚠ Take Off Helmet ⚠", MenuAction::Restart, MenuType::Always),
("Quit", MenuAction::Quit, MenuType::Always),
]; ];
pub enum MenuType {
Always,
AROnly,
SuitOnly,
}
#[derive(Component)] #[derive(Component)]
pub enum MenuAction { pub enum MenuAction {
ToggleMap, ToggleMap,
@ -205,7 +195,7 @@ pub fn setup(
let sections: Vec<TextSection> = Vec::from_iter( let sections: Vec<TextSection> = Vec::from_iter(
MENUDEF MENUDEF
.iter() .iter()
.map(|(label, _, _)| TextSection::new(label.to_string() + "\n", style_menu.clone())), .map(|(label, _)| TextSection::new(label.to_string() + "\n", style_menu.clone())),
); );
commands.spawn(( commands.spawn((
@ -462,7 +452,6 @@ pub fn update_menu(
), ),
>, >,
mut q_vis: Query<&mut Visibility, With<menu::MenuElement>>, mut q_vis: Query<&mut Visibility, With<menu::MenuElement>>,
q_bike: Query<&actor::PlayerDrivesThis>,
id2pos: Res<game::Id2Pos>, id2pos: Res<game::Id2Pos>,
achievement_tracker: Res<var::AchievementTracker>, achievement_tracker: Res<var::AchievementTracker>,
menustate: Res<MenuState>, menustate: Res<MenuState>,
@ -472,6 +461,9 @@ pub fn update_menu(
for mut vis in &mut q_vis { for mut vis in &mut q_vis {
*vis = bool2vis(settings.menu_active); *vis = bool2vis(settings.menu_active);
} }
fn bool2string(boolean: bool) -> String {
if boolean { "On" } else { "Off" }.to_string()
}
// Footer // Footer
if let (Ok(mut text), Some(player_pos), Some(jupiter_pos)) = ( if let (Ok(mut text), Some(player_pos), Some(jupiter_pos)) = (
@ -515,18 +507,10 @@ pub fn update_menu(
// Menu // Menu
if let Ok(mut text) = q_text.get_single_mut() { if let Ok(mut text) = q_text.get_single_mut() {
for i in 0..text.sections.len() { for i in 0..text.sections.len() {
let active = match MENUDEF[i].2 {
MenuType::SuitOnly => q_bike.is_empty(),
MenuType::AROnly => settings.hud_active,
_ => true,
};
if menustate.cursor == i { if menustate.cursor == i {
text.sections[i].style.color = settings.hud_color_menu_selected; text.sections[i].style.color = settings.hud_color_subtitles;
} else if active {
text.sections[i].style.color = settings.hud_color_menu_active;
} else { } else {
text.sections[i].style.color = settings.hud_color_menu_inactive; text.sections[i].style.color = settings.hud_color;
} }
match MENUDEF[i].1 { match MENUDEF[i].1 {
@ -539,7 +523,7 @@ pub fn update_menu(
} else { } else {
&settings.noise_cancellation_modes[0].0 &settings.noise_cancellation_modes[0].0
}; };
text.sections[i].value = format!("\nSound: {noisecancel}\n"); text.sections[i].value = format!("\nNoise Cancellation: {noisecancel}\n");
} }
MenuAction::ToggleMusic => { MenuAction::ToggleMusic => {
let station = let station =
@ -548,63 +532,59 @@ pub fn update_menu(
} else { } else {
&settings.radio_modes[0] &settings.radio_modes[0]
}; };
text.sections[i].value = format!("Stereo: {station}\n"); text.sections[i].value = format!("Speakers: {station}\n");
} }
MenuAction::ToggleAR => { MenuAction::ToggleAR => {
let onoff = bool2string(settings.hud_active);
let p = if settings.hud_active { let p = if settings.hud_active {
actor::POWER_DRAIN_AR actor::POWER_DRAIN_AR
} else { } else {
0.0 0.0
}; };
let w = if p > 0.0 { let w = if p > 0.0 {
format!("{p}W") format!(" ({p}W)")
} else { } else {
String::from("Off") String::from("")
}; };
text.sections[i].value = format!("Augmented Reality: {w}\n"); text.sections[i].value = format!("Augmented Reality: {onoff}{w} [TAB]\n");
} }
MenuAction::ModLightAmp => { MenuAction::ModLightAmp => {
let p = actor::POWER_DRAIN_LIGHTAMP[prefs.light_amp]; let p = actor::POWER_DRAIN_LIGHTAMP[prefs.light_amp];
let w = if p > 0.0 { text.sections[i].value = format!("\nLight Amplification: {p}W\n");
format!("{p}W")
} else {
String::from("Off")
};
text.sections[i].value = format!("Night Vision: {w}\n");
} }
MenuAction::ModFlashlightPower => { MenuAction::ModFlashlightPower => {
let p = actor::POWER_DRAIN_FLASHLIGHT[prefs.flashlight_power]; let p = actor::POWER_DRAIN_FLASHLIGHT[prefs.flashlight_power];
text.sections[i].value = format!("Flashlight: {p}W\n"); text.sections[i].value = format!("Flashlight Power: {p}W\n");
} }
MenuAction::ModThrusterBoost => { MenuAction::ModThrusterBoost => {
let state = match prefs.thruster_boost { let state = match prefs.thruster_boost {
0 => " (when slowing)", 0 => "For braking",
1 => " (always)", 1 => "Always",
2 => "Off", 2 => "Off",
_ => "ERROR", _ => "ERROR",
}; };
let p = actor::POWER_DRAIN_THRUSTER[prefs.thruster_boost]; let p = actor::POWER_DRAIN_THRUSTER[prefs.thruster_boost];
let w = if p > 0.0 { let w = if p > 0.0 {
format!(" {p}W") format!(" ({p}W)")
} else { } else {
String::from("") String::from("")
}; };
text.sections[i].value = format!("Nitro: {w}{state}\n"); text.sections[i].value = format!("Thruster Boost: {state}{w}\n");
} }
MenuAction::ModReactor => { MenuAction::ModReactor => {
let state = match settings.reactor_state { let state = match settings.reactor_state {
0 => "Off", 0 => "Off",
1 => "", 1 => "On",
2 => "OVERLOAD", 2 => "OVERLOAD",
_ => "ERROR", _ => "ERROR",
}; };
let p = actor::POWER_GAIN_REACTOR[settings.reactor_state]; let p = actor::POWER_GAIN_REACTOR[settings.reactor_state];
let w = if p > 0.0 { let w = if p > 0.0 {
format!("+{p}W") format!(" (+{p}W)")
} else { } else {
String::from("") String::from("")
}; };
text.sections[i].value = format!("Reactor: {w}{state}\n"); text.sections[i].value = format!("Reactor: {state}{w}\n");
} }
MenuAction::ChangeARAvatar => { MenuAction::ChangeARAvatar => {
if let Some(ava) = hud::PLAYER_AR_AVATARS.get(settings.ar_avatar) { if let Some(ava) = hud::PLAYER_AR_AVATARS.get(settings.ar_avatar) {
@ -629,12 +609,8 @@ pub fn update_menu(
text.sections[i].value = format!("\nCamera: {onoff} [C]\n"); text.sections[i].value = format!("\nCamera: {onoff} [C]\n");
} }
MenuAction::ToggleShadows => { MenuAction::ToggleShadows => {
let onoff = if settings.shadows_sun { let onoff = if settings.shadows_sun { "High" } else { "Low" };
"On" text.sections[i].value = format!("Shadows: {onoff}\n");
} else {
"Simplified"
};
text.sections[i].value = format!("\nShadows: {onoff}\n");
} }
_ => {} _ => {}
} }

View file

@ -80,9 +80,6 @@ pub struct Settings {
pub hud_color_deathpoem: Color, pub hud_color_deathpoem: Color,
pub hud_color_achievement: Color, pub hud_color_achievement: Color,
pub hud_color_achievement_header: Color, pub hud_color_achievement_header: Color,
pub hud_color_menu_active: Color,
pub hud_color_menu_inactive: Color,
pub hud_color_menu_selected: Color,
pub hud_color_achievement_accomplished: Color, pub hud_color_achievement_accomplished: Color,
pub hud_color_death: Color, pub hud_color_death: Color,
pub hud_color_death_achievements: Color, pub hud_color_death_achievements: Color,
@ -179,10 +176,10 @@ impl Default for Settings {
mute_sfx: false, mute_sfx: false,
noise_cancellation_mode: 0, noise_cancellation_mode: 0,
noise_cancellation_modes: vec![ noise_cancellation_modes: vec![
("On".to_string(), 1.0), ("Off".to_string(), 1.0),
("66%".to_string(), 0.66), ("33%".to_string(), 0.66),
("33%".to_string(), 0.33), ("66%".to_string(), 0.33),
("Off".to_string(), 0.0), ("100%".to_string(), 0.0),
], ],
radio_mode: 1, radio_mode: 1,
radio_modes: vec![ radio_modes: vec![
@ -228,9 +225,6 @@ impl Default for Settings {
hud_color_achievement: Srgba::hex(COLOR_DIM).unwrap().into(), hud_color_achievement: Srgba::hex(COLOR_DIM).unwrap().into(),
hud_color_achievement_accomplished: Srgba::hex(COLOR_SUCCESS).unwrap().into(), hud_color_achievement_accomplished: Srgba::hex(COLOR_SUCCESS).unwrap().into(),
hud_color_achievement_header: Srgba::hex(COLOR_PRIMARY).unwrap().into(), hud_color_achievement_header: Srgba::hex(COLOR_PRIMARY).unwrap().into(),
hud_color_menu_active: Srgba::hex(COLOR_PRIMARY).unwrap().into(),
hud_color_menu_inactive: Srgba::hex(COLOR_DIM).unwrap().into(),
hud_color_menu_selected: Srgba::hex(COLOR_SECONDARY).unwrap().into(),
hud_color_death: Srgba::hex(COLOR_SECONDARY).unwrap().into(), hud_color_death: Srgba::hex(COLOR_SECONDARY).unwrap().into(),
hud_color_death_achievements: Srgba::hex(COLOR_SECONDARY).unwrap().into(), hud_color_death_achievements: Srgba::hex(COLOR_SECONDARY).unwrap().into(),
hud_color_keybindings: Srgba::hex(COLOR_DIM).unwrap().into(), hud_color_keybindings: Srgba::hex(COLOR_DIM).unwrap().into(),