Compare commits

...

4 commits

5 changed files with 58 additions and 11 deletions

View file

@ -27,6 +27,8 @@ pub const CHATS: &[&str] = &[
];
pub const CONTACTS: &[&str] = &["icarus", "travel", "luna", "nox"];
pub const CONTACTS_PRETTY: &[&str] = &["Icarus", "FASTravel", "Luna", "Nox"];
pub const CONTACTS_UNKNOWN: &str = "[Unknown]";
pub const TEXT_CONTINUE: &str = "Continue...";
@ -1000,7 +1002,7 @@ pub fn handle_chat_scripts(
"cryofadeout" => {
ew_effect.send(visual::SpawnEffectEvent {
class: visual::Effects::FadeOut(css::AQUA.into()),
duration: 5.1,
duration: 2.1,
});
}
"drinkpizza" => {

View file

@ -76,21 +76,21 @@
Take me to Farview Station, please.:
- FASTravel wishes you a pleasant journey.
- script: cryofadeout
- sleep: 5
- sleep: 2
- script: cryotrip farview
- goto: EXIT
- if: $busstop != metis
Take me to Metis Prime Station, please.:
- FASTravel wishes you a pleasant journey.
- script: cryofadeout
- sleep: 5
- sleep: 2
- script: cryotrip metisprime
- goto: EXIT
- if: $busstop != serenity
Take me to Serenity Station, please.:
- FASTravel wishes you a pleasant journey.
- script: cryofadeout
- sleep: 5
- sleep: 2
- script: cryotrip serenity
- goto: EXIT
- Can you please fill up my oxygen tank without taking me anywhere?:

View file

@ -1,3 +1,13 @@
# ▄████████▄ + ███ + ▄█████████ ███ +
# ███▀ ▀███ + + ███ ███▀ + ███ + +
# ███ + ███ ███ ███ █████████ ███ ███ ███ ███
# ███ +███ ███ ███ ███ ███▐██████ ███ ███ ███
# ███ + ███ ███+ ███ +███ ███ + ███ ███ + ███
# ███▄ ▄███ ███▄ ███ ███ + ███ + ███ ███▄ ███
# ▀████████▀ + ▀███████ ███▄ ███▄ ▀████ ▀███████
# + + + ███
# + ▀████████████████████████████████████████████████████▀
- chat: phone
- if ~phone$any:
- "Error: Phonebook empty."
@ -19,7 +29,7 @@
- Ok! Activate cryofreeze and we'll be right there.
- "[Activate Cryofreeze]":
- script: cryofadeout
- sleep: 5
- sleep: 2
- script: cryotrip serenity
- goto: EXIT
- I changed my mind.:
@ -29,7 +39,7 @@
- Ok! Activate cryofreeze and we'll be right there.
- "[Activate Cryofreeze]":
- script: cryofadeout
- sleep: 5
- sleep: 2
- script: cryotrip metisprime
- goto: EXIT
- I changed my mind.:
@ -39,7 +49,7 @@
- Ok! Activate cryofreeze and we'll be right there.
- "[Activate Cryofreeze]":
- script: cryofadeout
- sleep: 5
- sleep: 2
- script: cryotrip farview
- goto: EXIT
- I changed my mind.:

View file

@ -274,6 +274,16 @@ pub fn setup(
sections.extend(Vec::from_iter(
(0..achievement_count).map(|_| TextSection::new("", style_achievement.clone())),
));
sections.push(TextSection::new(
"\nPhonebook\n",
style_achievement_header.clone(),
));
sections.extend(Vec::from_iter((0..chat::CONTACTS.len()).map(|_| {
TextSection::new(
chat::CONTACTS_UNKNOWN.to_string() + "\n",
style_achievement.clone(),
)
})));
builder.spawn((
MenuAchievements,
TextBundle {
@ -463,8 +473,7 @@ pub fn update_menu(
if boolean { "On" } else { "Off" }.to_string()
}
let bools = achievement_tracker.to_bool_vec();
let rendered = achievement_tracker.to_textsections();
// Footer
if let (Ok(mut text), Some(player_pos), Some(jupiter_pos)) = (
q_footer.get_single_mut(),
id2pos.0.get(cmd::ID_PLAYER),
@ -480,16 +489,38 @@ pub fn update_menu(
settings.version.as_str()
);
}
// Achievements
let achievement_bools = achievement_tracker.to_bool_vec();
let rendered = achievement_tracker.to_textsections();
if let Ok(mut text) = q_achievement_text.get_single_mut() {
for i in 0..text.sections.len() - 1 {
text.sections[i + 1].style.color = if bools[i] {
for i in 0..achievement_bools.len() - 1 {
text.sections[i + 1].style.color = if achievement_bools[i] {
settings.hud_color_achievement_accomplished
} else {
settings.hud_color_achievement
};
text.sections[i + 1].value = rendered[i].clone();
}
// Phonebook
for (i, contact) in chat::CONTACTS.iter().enumerate() {
let text_index = i + achievement_bools.len() + 2;
let registered = prefs.contacts.contains(&contact.to_string());
text.sections[text_index].style.color = if registered {
settings.hud_color_phonebook_unlocked
} else {
settings.hud_color_phonebook_locked
};
text.sections[text_index].value = if registered {
chat::CONTACTS_PRETTY[i].to_string() + "\n"
} else {
String::from(chat::CONTACTS_UNKNOWN.to_string() + "\n")
}
}
}
// Menu
if let Ok(mut text) = q_text.get_single_mut() {
for i in 0..text.sections.len() {
if menustate.cursor == i {

View file

@ -80,6 +80,8 @@ pub struct Settings {
pub hud_color_achievement: Color,
pub hud_color_achievement_header: Color,
pub hud_color_achievement_accomplished: Color,
pub hud_color_phonebook_locked: Color,
pub hud_color_phonebook_unlocked: Color,
pub hud_color_death: Color,
pub hud_color_death_achievements: Color,
pub hud_color_keybindings: Color,
@ -222,6 +224,8 @@ 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_phonebook_locked: Srgba::hex(COLOR_DIM).unwrap().into(),
hud_color_phonebook_unlocked: 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(),