Compare commits
No commits in common. "6926a0f4f9d171ee1f691e4db164a1252d003441" and "48c20e7a0ecd10a35843d08fe52722085183b99b" have entirely different histories.
6926a0f4f9
...
48c20e7a0e
|
@ -14,7 +14,7 @@
|
|||
- sound: phone
|
||||
msg: Dialing...
|
||||
- goto: travel
|
||||
- "[Hang up]":
|
||||
- "[Cancel]":
|
||||
- goto: EXIT
|
||||
|
||||
# ---------------------------------------------------------
|
||||
|
|
|
@ -399,7 +399,7 @@ actor 1000 20 300 monolith
|
|||
density 300
|
||||
rotationx 90
|
||||
wants maxrotation 0.01
|
||||
wants lookat hideout
|
||||
wants lookat cultasteroid
|
||||
angularmomentum 0.0 0.0 0.01
|
||||
thrust 0 0 0 30 1
|
||||
collider mesh
|
||||
|
@ -411,7 +411,7 @@ actor 10000 2000 -3500 monolith
|
|||
density 300
|
||||
rotationx 90
|
||||
wants maxrotation 0.01
|
||||
wants lookat hideout
|
||||
wants lookat cultasteroid
|
||||
angularmomentum 0.0 0.0 0.01
|
||||
thrust 0 0 0 30 1
|
||||
collider mesh
|
||||
|
@ -423,7 +423,7 @@ actor -8000 -1000 -100 monolith
|
|||
density 300
|
||||
rotationx 90
|
||||
wants maxrotation 0.01
|
||||
wants lookat hideout
|
||||
wants lookat cultasteroid
|
||||
angularmomentum 0.0 0.0 0.01
|
||||
thrust 0 0 0 30 1
|
||||
collider mesh
|
||||
|
|
|
@ -45,7 +45,7 @@ pub const DASHBOARD_DEF: &[(Dashboard, &str)] = &[
|
|||
|
||||
// Player avatars: [(Avatar, model name, scale, in-game name)]
|
||||
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::Hoodie, "suit_ar_hoodie", 1.0, "Hoodie"),
|
||||
(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)] = &[
|
||||
(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"),
|
||||
];
|
||||
|
||||
|
|
108
src/menu.rs
108
src/menu.rs
|
@ -64,36 +64,26 @@ pub enum DeathScreenEvent {
|
|||
Hide,
|
||||
}
|
||||
|
||||
pub const MENUDEF: &[(&str, MenuAction, MenuType)] = &[
|
||||
("✆ Phone", MenuAction::PhoneCall, MenuType::Always),
|
||||
("✯ Map\n", MenuAction::ToggleMap, MenuType::Always),
|
||||
("", MenuAction::ToggleAR, MenuType::Always),
|
||||
("", MenuAction::ChangeARAvatar, MenuType::AROnly),
|
||||
("", MenuAction::ChangePointer, MenuType::AROnly),
|
||||
("", MenuAction::ModLightAmp, MenuType::AROnly),
|
||||
("", MenuAction::ModFlashlightPower, MenuType::Always),
|
||||
("", MenuAction::ModThrusterBoost, MenuType::SuitOnly),
|
||||
("", MenuAction::ModReactor, MenuType::SuitOnly),
|
||||
("", MenuAction::ToggleSound, MenuType::Always),
|
||||
("", MenuAction::ToggleMusic, MenuType::Always),
|
||||
//("", MenuAction::ToggleCamera),
|
||||
("", MenuAction::ToggleShadows, MenuType::Always),
|
||||
//("Fullscreen [F11]", MenuAction::ToggleFullscreen),
|
||||
(
|
||||
"⚠ FACTORY RESET ⚠",
|
||||
MenuAction::ResetSettings,
|
||||
MenuType::Always,
|
||||
),
|
||||
("⚠ Take Off Helmet ⚠", MenuAction::Restart, MenuType::Always),
|
||||
("Quit", MenuAction::Quit, MenuType::Always),
|
||||
pub const MENUDEF: &[(&str, MenuAction)] = &[
|
||||
("✆ Phone", MenuAction::PhoneCall),
|
||||
("✯ Map\n", MenuAction::ToggleMap),
|
||||
("", MenuAction::ToggleAR),
|
||||
("", MenuAction::ChangeARAvatar),
|
||||
("", MenuAction::ChangePointer),
|
||||
("", MenuAction::ModLightAmp),
|
||||
("", MenuAction::ModFlashlightPower),
|
||||
("", MenuAction::ModThrusterBoost),
|
||||
("", MenuAction::ModReactor),
|
||||
("", MenuAction::ToggleSound),
|
||||
("", MenuAction::ToggleMusic),
|
||||
("", MenuAction::ToggleCamera),
|
||||
("", MenuAction::ToggleShadows),
|
||||
("Fullscreen [F11]", MenuAction::ToggleFullscreen),
|
||||
("⚠ FACTORY RESET ⚠", MenuAction::ResetSettings),
|
||||
("⚠ Take Off Helmet ⚠", MenuAction::Restart),
|
||||
("Quit", MenuAction::Quit),
|
||||
];
|
||||
|
||||
pub enum MenuType {
|
||||
Always,
|
||||
AROnly,
|
||||
SuitOnly,
|
||||
}
|
||||
|
||||
#[derive(Component)]
|
||||
pub enum MenuAction {
|
||||
ToggleMap,
|
||||
|
@ -205,7 +195,7 @@ pub fn setup(
|
|||
let sections: Vec<TextSection> = Vec::from_iter(
|
||||
MENUDEF
|
||||
.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((
|
||||
|
@ -462,7 +452,6 @@ pub fn update_menu(
|
|||
),
|
||||
>,
|
||||
mut q_vis: Query<&mut Visibility, With<menu::MenuElement>>,
|
||||
q_bike: Query<&actor::PlayerDrivesThis>,
|
||||
id2pos: Res<game::Id2Pos>,
|
||||
achievement_tracker: Res<var::AchievementTracker>,
|
||||
menustate: Res<MenuState>,
|
||||
|
@ -472,6 +461,9 @@ pub fn update_menu(
|
|||
for mut vis in &mut q_vis {
|
||||
*vis = bool2vis(settings.menu_active);
|
||||
}
|
||||
fn bool2string(boolean: bool) -> String {
|
||||
if boolean { "On" } else { "Off" }.to_string()
|
||||
}
|
||||
|
||||
// Footer
|
||||
if let (Ok(mut text), Some(player_pos), Some(jupiter_pos)) = (
|
||||
|
@ -515,18 +507,10 @@ pub fn update_menu(
|
|||
// Menu
|
||||
if let Ok(mut text) = q_text.get_single_mut() {
|
||||
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 {
|
||||
text.sections[i].style.color = settings.hud_color_menu_selected;
|
||||
} else if active {
|
||||
text.sections[i].style.color = settings.hud_color_menu_active;
|
||||
text.sections[i].style.color = settings.hud_color_subtitles;
|
||||
} else {
|
||||
text.sections[i].style.color = settings.hud_color_menu_inactive;
|
||||
text.sections[i].style.color = settings.hud_color;
|
||||
}
|
||||
|
||||
match MENUDEF[i].1 {
|
||||
|
@ -539,7 +523,7 @@ pub fn update_menu(
|
|||
} else {
|
||||
&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 => {
|
||||
let station =
|
||||
|
@ -548,63 +532,59 @@ pub fn update_menu(
|
|||
} else {
|
||||
&settings.radio_modes[0]
|
||||
};
|
||||
text.sections[i].value = format!("Stereo: {station}\n");
|
||||
text.sections[i].value = format!("Speakers: {station}\n");
|
||||
}
|
||||
MenuAction::ToggleAR => {
|
||||
let onoff = bool2string(settings.hud_active);
|
||||
let p = if settings.hud_active {
|
||||
actor::POWER_DRAIN_AR
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
let w = if p > 0.0 {
|
||||
format!("{p}W")
|
||||
format!(" ({p}W)")
|
||||
} 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 => {
|
||||
let p = actor::POWER_DRAIN_LIGHTAMP[prefs.light_amp];
|
||||
let w = if p > 0.0 {
|
||||
format!("{p}W")
|
||||
} else {
|
||||
String::from("Off")
|
||||
};
|
||||
text.sections[i].value = format!("Night Vision: {w}\n");
|
||||
text.sections[i].value = format!("\nLight Amplification: {p}W\n");
|
||||
}
|
||||
MenuAction::ModFlashlightPower => {
|
||||
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 => {
|
||||
let state = match prefs.thruster_boost {
|
||||
0 => " (when slowing)",
|
||||
1 => " (always)",
|
||||
0 => "For braking",
|
||||
1 => "Always",
|
||||
2 => "Off",
|
||||
_ => "ERROR",
|
||||
};
|
||||
let p = actor::POWER_DRAIN_THRUSTER[prefs.thruster_boost];
|
||||
let w = if p > 0.0 {
|
||||
format!(" {p}W")
|
||||
format!(" ({p}W)")
|
||||
} else {
|
||||
String::from("")
|
||||
};
|
||||
text.sections[i].value = format!("Nitro: {w}{state}\n");
|
||||
text.sections[i].value = format!("Thruster Boost: {state}{w}\n");
|
||||
}
|
||||
MenuAction::ModReactor => {
|
||||
let state = match settings.reactor_state {
|
||||
0 => "Off",
|
||||
1 => "",
|
||||
2 => " ☢ OVERLOAD",
|
||||
1 => "On",
|
||||
2 => "OVERLOAD ☢",
|
||||
_ => "ERROR",
|
||||
};
|
||||
let p = actor::POWER_GAIN_REACTOR[settings.reactor_state];
|
||||
let w = if p > 0.0 {
|
||||
format!("+{p}W")
|
||||
format!(" (+{p}W)")
|
||||
} else {
|
||||
String::from("")
|
||||
};
|
||||
text.sections[i].value = format!("Reactor: {w}{state}\n");
|
||||
text.sections[i].value = format!("Reactor: {state}{w}\n");
|
||||
}
|
||||
MenuAction::ChangeARAvatar => {
|
||||
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");
|
||||
}
|
||||
MenuAction::ToggleShadows => {
|
||||
let onoff = if settings.shadows_sun {
|
||||
"On"
|
||||
} else {
|
||||
"Simplified"
|
||||
};
|
||||
text.sections[i].value = format!("\nShadows: {onoff}\n");
|
||||
let onoff = if settings.shadows_sun { "High" } else { "Low" };
|
||||
text.sections[i].value = format!("Shadows: {onoff}\n");
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
|
14
src/var.rs
14
src/var.rs
|
@ -80,9 +80,6 @@ pub struct Settings {
|
|||
pub hud_color_deathpoem: Color,
|
||||
pub hud_color_achievement: 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_death: Color,
|
||||
pub hud_color_death_achievements: Color,
|
||||
|
@ -179,10 +176,10 @@ impl Default for Settings {
|
|||
mute_sfx: false,
|
||||
noise_cancellation_mode: 0,
|
||||
noise_cancellation_modes: vec![
|
||||
("On".to_string(), 1.0),
|
||||
("66%".to_string(), 0.66),
|
||||
("33%".to_string(), 0.33),
|
||||
("Off".to_string(), 0.0),
|
||||
("Off".to_string(), 1.0),
|
||||
("33%".to_string(), 0.66),
|
||||
("66%".to_string(), 0.33),
|
||||
("100%".to_string(), 0.0),
|
||||
],
|
||||
radio_mode: 1,
|
||||
radio_modes: vec![
|
||||
|
@ -228,9 +225,6 @@ impl Default for Settings {
|
|||
hud_color_achievement: Srgba::hex(COLOR_DIM).unwrap().into(),
|
||||
hud_color_achievement_accomplished: Srgba::hex(COLOR_SUCCESS).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_achievements: Srgba::hex(COLOR_SECONDARY).unwrap().into(),
|
||||
hud_color_keybindings: Srgba::hex(COLOR_DIM).unwrap().into(),
|
||||
|
|
Loading…
Reference in a new issue