notifications and SFX on phone registry and luna's backup software install
This commit is contained in:
parent
989b6cfb17
commit
6f4d44febc
13
src/chat.rs
13
src/chat.rs
|
@ -902,6 +902,7 @@ pub fn handle_chat_scripts(
|
|||
mut ew_sfx: EventWriter<audio::PlaySfxEvent>,
|
||||
mut ew_effect: EventWriter<visual::SpawnEffectEvent>,
|
||||
mut ew_achievement: EventWriter<game::AchievementEvent>,
|
||||
mut log: ResMut<hud::Log>,
|
||||
id2pos: Res<game::Id2Pos>,
|
||||
id2v: Res<game::Id2V>,
|
||||
mut prefs: ResMut<Preferences>,
|
||||
|
@ -1045,6 +1046,17 @@ pub fn handle_chat_scripts(
|
|||
if CONTACTS.contains(¶m1) {
|
||||
let param1_string = param1.to_string();
|
||||
if !prefs.contacts.contains(¶m1_string) {
|
||||
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Achieve));
|
||||
let name = if let Some(index) = CONTACTS.iter().position(|&x| x == param1) {
|
||||
CONTACTS_PRETTY[index]
|
||||
} else {
|
||||
"ERROR"
|
||||
};
|
||||
log.add(
|
||||
format!("Unlocked phone number: {name}!"),
|
||||
"".to_string(),
|
||||
hud::LogLevel::Achievement,
|
||||
);
|
||||
prefs.contacts.push(param1_string);
|
||||
prefs.save();
|
||||
}
|
||||
|
@ -1053,6 +1065,7 @@ pub fn handle_chat_scripts(
|
|||
}
|
||||
}
|
||||
"installlunabackup" => {
|
||||
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Achieve));
|
||||
prefs.luna_backup = true;
|
||||
prefs.save()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue