Compare commits

...

8 commits

7 changed files with 69 additions and 44 deletions

View file

@ -217,7 +217,17 @@ apart from the other characters. Let's outline the personalities/backstories:
- Good for some small talk - Good for some small talk
- Nerd about engineering, propulsion, rocket science - Nerd about engineering, propulsion, rocket science
- Rides a MeteorAceGT - Rides a MeteorAceGT
4. ??? @ pizzeria or workshop: 4. Sus @ pizzeria:
- A pig. ("Sus" is the genus of wild and domesticated pigs)
- Can communicate via neural implants and space suit
- Can manipulate the world through arms controlled by brain implants
- Grew up on earth. Misses the mud.
- Trained geologist (sparked by a love for mud and dirt)
- Came to space to study space rocks but is now way more excited about just flying around
- Some people still haven't quite accepted non-human animals among them
- Sus is easily annoyed/offended/angry if he suspects that you view him as a non-person
- Is not connected to the game Among Us, despite his appearance :D
5. ??? @ pizzeria or workshop:
- Engineer - Engineer
- ADHD - ADHD
- Deploys communications infrastructure across the rings - Deploys communications infrastructure across the rings
@ -226,24 +236,24 @@ apart from the other characters. Let's outline the personalities/backstories:
- Totally a furry - Totally a furry
- Has big plans for this area, but not enough time to implement everything - Has big plans for this area, but not enough time to implement everything
- Nerd about high energy communications technology - Nerd about high energy communications technology
5. ??? @ workshop: 6. ??? @ workshop:
- Mechanic - Mechanic
- Operates a workshop to craft and mod space vehicles - Operates a workshop to craft and mod space vehicles
- Nerd about space suits and vehicles - Nerd about space suits and vehicles
6. Ash @ hideout: 7. Ash @ hideout:
- Monk master of a cult of Buddhist origins - Monk master of a cult of Buddhist origins
- Uptight, self-disciplined, driven, wise - Uptight, self-disciplined, driven, wise
- Not very agreeable - Not very agreeable
- Operates a construction site for a meditation retreat in a hollowed-out asteroid - Operates a construction site for a meditation retreat in a hollowed-out asteroid
- Deep distrust of AIs, wants to construct the hideout by hand - Deep distrust of AIs, wants to construct the hideout by hand
- Not interested in small talk, but up for deep philosophical debates - Not interested in small talk, but up for deep philosophical debates
7. River @ hideout: 8. River @ hideout:
- Monk apprentice - Monk apprentice
- Open-minded - Open-minded
- Had everything in her life on one of the planets - Had everything in her life on one of the planets
- But ached for profoundness, desperate for a meaning of life - But ached for profoundness, desperate for a meaning of life
- Frustrated by the rigidity of Ash, she thinks she knows better how to run the place - Frustrated by the rigidity of Ash, she thinks she knows better how to run the place
8. Rain @ hideout: 9. Rain @ hideout:
- Engineer, tinkerer - Engineer, tinkerer
- Very shy, unsocial - Very shy, unsocial
- Helps the monks to construct the hideout - Helps the monks to construct the hideout
@ -271,6 +281,7 @@ Minor characters:
- Nox [he] - Nox [he]
- Rudy [he] - Rudy [he]
- Yuni [no pronoun] - Yuni [no pronoun]
- Sus [he]
- Ash [they] - Ash [they]
- River [she] - River [she]
- Rain [she] - Rain [she]

View file

@ -271,7 +271,7 @@ pub fn update_power(
let d = time.delta_seconds(); let d = time.delta_seconds();
for (mut battery, player) in &mut q_battery { for (mut battery, player) in &mut q_battery {
if player.is_some() && settings.flashlight_active { if player.is_some() && settings.flashlight_active {
battery.power -= 4000000.0 * d; battery.power -= 2400000.0 * d;
if battery.power <= 0.0 { if battery.power <= 0.0 {
settings.flashlight_active = false; settings.flashlight_active = false;
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Switch)); ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Switch));
@ -474,6 +474,7 @@ pub fn handle_vehicle_enter_exit(
commands.entity(driver).remove::<PlayerCamera>(); commands.entity(driver).remove::<PlayerCamera>();
commands.entity(driver).remove::<Collider>(); commands.entity(driver).remove::<Collider>();
commands.entity(driver).insert(JustNowEnteredVehicle); commands.entity(driver).insert(JustNowEnteredVehicle);
commands.entity(vehicle).remove::<hud::IsTargeted>();
commands.entity(vehicle).insert(PlayerCamera); commands.entity(vehicle).insert(PlayerCamera);
commands.entity(vehicle).insert(PlayerDrivesThis); commands.entity(vehicle).insert(PlayerDrivesThis);
if let Ok(mut flashlight_vis) = q_playerflashlight.get_single_mut() { if let Ok(mut flashlight_vis) = q_playerflashlight.get_single_mut() {

View file

@ -147,6 +147,7 @@ pub fn setup(mut settings: ResMut<Settings>, prefs: Res<var::Preferences>) {
settings.set_noise_cancellation_mode(prefs.noise_cancellation_mode); settings.set_noise_cancellation_mode(prefs.noise_cancellation_mode);
settings.third_person = prefs.third_person; settings.third_person = prefs.third_person;
settings.shadows_sun = prefs.shadows_sun; settings.shadows_sun = prefs.shadows_sun;
settings.ar_avatar = prefs.avatar;
} }
pub fn handle_game_event( pub fn handle_game_event(
@ -184,7 +185,10 @@ pub fn handle_game_event(
prefs.save(); prefs.save();
} }
GameEvent::SetSound(cycle) => { GameEvent::SetSound(cycle) => {
match cycle.to_index(settings.noise_cancellation_mode, &settings.noise_cancellation_modes) { match cycle.to_index(
settings.noise_cancellation_mode,
&settings.noise_cancellation_modes,
) {
Some(mode) => { Some(mode) => {
settings.set_noise_cancellation_mode(mode); settings.set_noise_cancellation_mode(mode);
} }

View file

@ -442,6 +442,7 @@ pub fn setup(
}, },
gauge.clone(), gauge.clone(),
GaugeLength(bar_length), GaugeLength(bar_length),
ToggleableHudElement,
)); ));
}); });
@ -465,7 +466,8 @@ pub fn setup(
)) ))
.with_children(|builder| { .with_children(|builder| {
// The gauge symbol // The gauge symbol
builder.spawn((ImageBundle { builder.spawn((
ImageBundle {
image: UiImage::new(asset_server.load(sprite.to_string())), image: UiImage::new(asset_server.load(sprite.to_string())),
style: Style { style: Style {
width: Val::Px(icon_size), width: Val::Px(icon_size),
@ -474,9 +476,12 @@ pub fn setup(
}, },
visibility, visibility,
..Default::default() ..Default::default()
},)); },
ToggleableHudElement,
));
// The gauge bar border // The gauge bar border
builder.spawn((ImageBundle { builder.spawn((
ImageBundle {
image: UiImage::new(gauges_handle.clone()), image: UiImage::new(gauges_handle.clone()),
style: Style { style: Style {
width: Val::Px(bar_length), width: Val::Px(bar_length),
@ -487,7 +492,9 @@ pub fn setup(
}, },
visibility, visibility,
..Default::default() ..Default::default()
},)); },
ToggleableHudElement,
));
}); });
} }
@ -1281,6 +1288,7 @@ fn update_overlay_visibility(
fn update_avatar( fn update_avatar(
mut commands: Commands, mut commands: Commands,
mut settings: ResMut<Settings>, mut settings: ResMut<Settings>,
mut prefs: ResMut<var::Preferences>,
asset_server: Res<AssetServer>, asset_server: Res<AssetServer>,
q_avatar: Query<(Entity, &SceneInstance), With<PlayerAvatar>>, q_avatar: Query<(Entity, &SceneInstance), With<PlayerAvatar>>,
q_player: Query<Entity, With<actor::Player>>, q_player: Query<Entity, With<actor::Player>>,
@ -1289,6 +1297,9 @@ fn update_avatar(
if settings.ar_avatar >= PLAYER_AR_AVATARS.len() { if settings.ar_avatar >= PLAYER_AR_AVATARS.len() {
settings.ar_avatar = settings.ar_avatar % PLAYER_AR_AVATARS.len(); settings.ar_avatar = settings.ar_avatar % PLAYER_AR_AVATARS.len();
} }
prefs.avatar = settings.ar_avatar;
prefs.save();
let ava = if let Some(ava) = PLAYER_AR_AVATARS.get(settings.ar_avatar) { let ava = if let Some(ava) = PLAYER_AR_AVATARS.get(settings.ar_avatar) {
ava ava
} else { } else {

View file

@ -34,8 +34,8 @@ pub mod prelude {
pub use crate::{ pub use crate::{
actor, audio, camera, chat, cmd, common, game, hud, load, menu, nature, var, visual, world, actor, audio, camera, chat, cmd, common, game, hud, load, menu, nature, var, visual, world,
}; };
pub use game::Turn::Toggle;
pub use game::Cycle::Next; pub use game::Cycle::Next;
pub use game::Turn::Toggle;
pub use game::{GameEvent, Turn}; pub use game::{GameEvent, Turn};
} }

View file

@ -458,9 +458,9 @@ pub fn update_menu(
match MENUDEF[i].1 { match MENUDEF[i].1 {
MenuAction::ToggleSound => { MenuAction::ToggleSound => {
let noisecancel = let noisecancel = if let Some(noisecancel) = settings
if let Some(noisecancel) = .noise_cancellation_modes
settings.noise_cancellation_modes.get(settings.noise_cancellation_mode) .get(settings.noise_cancellation_mode)
{ {
noisecancel noisecancel
} else { } else {

View file

@ -456,6 +456,7 @@ pub struct Preferences {
pub noise_cancellation_mode: usize, pub noise_cancellation_mode: usize,
pub third_person: bool, pub third_person: bool,
pub shadows_sun: bool, pub shadows_sun: bool,
pub avatar: usize,
#[serde(skip)] #[serde(skip)]
pub source_file: Option<String>, pub source_file: Option<String>,
@ -482,17 +483,14 @@ impl Preferences {
pub fn save(&self) { pub fn save(&self) {
if let Some(path) = get_prefs_path() { if let Some(path) = get_prefs_path() {
match toml_edit::ser::to_document::<Preferences>(self) { match toml_edit::ser::to_document::<Preferences>(self) {
Ok(doc) => { Ok(doc) => match fs::write(path.clone(), doc.to_string()) {
dbg!(&doc);
match fs::write(path.clone(), doc.to_string()) {
Ok(_) => { Ok(_) => {
info!("Saved preferences to {path}."); info!("Saved preferences to {path}.");
} }
Err(error) => { Err(error) => {
error!("Error while writing preferences: {:?}", error); error!("Error while writing preferences: {:?}", error);
} }
} },
}
Err(error) => { Err(error) => {
error!("Error while writing preferences: {:?}", error); error!("Error while writing preferences: {:?}", error);
} }