add new sound for established chats
This commit is contained in:
parent
d63ad5b0d7
commit
51bd6d3867
|
@ -7,7 +7,7 @@
|
||||||
id: "hialien",
|
id: "hialien",
|
||||||
name: "Icarus",
|
name: "Icarus",
|
||||||
label: "INIT",
|
label: "INIT",
|
||||||
delay: 3.0,
|
delay: 2.0,
|
||||||
sound: "ping",
|
sound: "ping",
|
||||||
reply: "Requesting permission to communicate...",
|
reply: "Requesting permission to communicate...",
|
||||||
goto: "requested",
|
goto: "requested",
|
||||||
|
@ -20,27 +20,41 @@
|
||||||
id: "hialien",
|
id: "hialien",
|
||||||
name: "Icarus",
|
name: "Icarus",
|
||||||
label: "requested",
|
label: "requested",
|
||||||
delay: 8.0,
|
delay: 4.0,
|
||||||
sound: "chat",
|
sound: "connect",
|
||||||
reply: "Oh hey there, didn't even notice you! Was playing some VR game! What's up?",
|
reply: "Oh hey there!",
|
||||||
goto: "reply1",
|
goto: "sup",
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
4294967298: (
|
4294967298: (
|
||||||
|
components: {
|
||||||
|
"outfly::actor::ChatBranch": (
|
||||||
|
id: "hialien",
|
||||||
|
name: "Icarus",
|
||||||
|
label: "sup",
|
||||||
|
delay: 8.0,
|
||||||
|
sound: "chat",
|
||||||
|
reply: "Didn't even notice you! Was playing some VR game! What's up?",
|
||||||
|
goto: "reply1",
|
||||||
|
),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
|
||||||
|
4294967299: (
|
||||||
components: {
|
components: {
|
||||||
"outfly::actor::ChatBranch": (
|
"outfly::actor::ChatBranch": (
|
||||||
id: "hialien",
|
id: "hialien",
|
||||||
name: "Icarus",
|
name: "Icarus",
|
||||||
label: "reply1",
|
label: "reply1",
|
||||||
delay: 1.0,
|
delay: 1.5,
|
||||||
sound: "chat",
|
sound: "chat",
|
||||||
reply: "Not so chatty, huh? That's ok. See you around.",
|
reply: "Not so chatty, huh? That's ok. See you around.",
|
||||||
goto: "disco",
|
goto: "disco",
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
4294967299: (
|
4294967300: (
|
||||||
components: {
|
components: {
|
||||||
"outfly::actor::ChatBranch": (
|
"outfly::actor::ChatBranch": (
|
||||||
id: "hialien",
|
id: "hialien",
|
||||||
|
|
|
@ -243,9 +243,7 @@ pub fn handle_conversations(
|
||||||
let sfx = audio::str2sfx(branch.sound.as_str());
|
let sfx = audio::str2sfx(branch.sound.as_str());
|
||||||
ew_sfx.send(audio::PlaySfxEvent(sfx));
|
ew_sfx.send(audio::PlaySfxEvent(sfx));
|
||||||
}
|
}
|
||||||
info!("<chat.timer={:.2}, branch.delay={:.2}, epoch={:.2}", chat.timer, branch.delay, now);
|
|
||||||
chat.timer = now + branch.delay;
|
chat.timer = now + branch.delay;
|
||||||
info!(">chat.timer={:.2}, branch.delay={:.2}, epoch={:.2}", chat.timer, branch.delay, now);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ const ASSET_CLICK: &str = "sounds/click-button-140881-crop.ogg";
|
||||||
const ASSET_SWITCH: &str = "sounds/typosonic-typing-192811-crop.ogg";
|
const ASSET_SWITCH: &str = "sounds/typosonic-typing-192811-crop.ogg";
|
||||||
const ASSET_INCOMING_MESSAGE: &str = "tmp/beep-6-96243.ogg";
|
const ASSET_INCOMING_MESSAGE: &str = "tmp/beep-6-96243.ogg";
|
||||||
const ASSET_PING: &str = "tmp/glitch-sound-fx-pack-04-118236.ogg";
|
const ASSET_PING: &str = "tmp/glitch-sound-fx-pack-04-118236.ogg";
|
||||||
|
const ASSET_CONNECT: &str = "tmp/friend-request-14878.ogg";
|
||||||
const ASSET_RADIO: &str = "tmp/LP - Girls Go Wild (Official Music Video)-M7XRN0oHGIM.ogg";
|
const ASSET_RADIO: &str = "tmp/LP - Girls Go Wild (Official Music Video)-M7XRN0oHGIM.ogg";
|
||||||
const ASSET_BGM: &str = "tmp/FTL - Faster Than Light (2012) OST - 12 - Void (Explore)-edQw2yYXQJM.ogg";
|
const ASSET_BGM: &str = "tmp/FTL - Faster Than Light (2012) OST - 12 - Void (Explore)-edQw2yYXQJM.ogg";
|
||||||
|
|
||||||
|
@ -26,6 +27,7 @@ pub enum Sfx {
|
||||||
Click,
|
Click,
|
||||||
Switch,
|
Switch,
|
||||||
Ping,
|
Ping,
|
||||||
|
Connect,
|
||||||
None,
|
None,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,6 +42,7 @@ pub enum Sfx {
|
||||||
#[derive(Resource)] pub struct SoundSwitch(Handle<AudioSource>);
|
#[derive(Resource)] pub struct SoundSwitch(Handle<AudioSource>);
|
||||||
#[derive(Resource)] pub struct SoundIncomingMessage(Handle<AudioSource>);
|
#[derive(Resource)] pub struct SoundIncomingMessage(Handle<AudioSource>);
|
||||||
#[derive(Resource)] pub struct SoundPing(Handle<AudioSource>);
|
#[derive(Resource)] pub struct SoundPing(Handle<AudioSource>);
|
||||||
|
#[derive(Resource)] pub struct SoundConnect(Handle<AudioSource>);
|
||||||
|
|
||||||
pub fn setup(
|
pub fn setup(
|
||||||
mut commands: Commands,
|
mut commands: Commands,
|
||||||
|
@ -91,6 +94,7 @@ pub fn setup(
|
||||||
commands.insert_resource(SoundSwitch(asset_server.load(ASSET_SWITCH)));
|
commands.insert_resource(SoundSwitch(asset_server.load(ASSET_SWITCH)));
|
||||||
commands.insert_resource(SoundIncomingMessage(asset_server.load(ASSET_INCOMING_MESSAGE)));
|
commands.insert_resource(SoundIncomingMessage(asset_server.load(ASSET_INCOMING_MESSAGE)));
|
||||||
commands.insert_resource(SoundPing(asset_server.load(ASSET_PING)));
|
commands.insert_resource(SoundPing(asset_server.load(ASSET_PING)));
|
||||||
|
commands.insert_resource(SoundConnect(asset_server.load(ASSET_CONNECT)));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn toggle_bgm(
|
pub fn toggle_bgm(
|
||||||
|
@ -119,6 +123,7 @@ pub fn play_sfx(
|
||||||
sound_switch: Res<SoundSwitch>,
|
sound_switch: Res<SoundSwitch>,
|
||||||
sound_incoming_message: Res<SoundIncomingMessage>,
|
sound_incoming_message: Res<SoundIncomingMessage>,
|
||||||
sound_ping: Res<SoundPing>,
|
sound_ping: Res<SoundPing>,
|
||||||
|
sound_connect: Res<SoundConnect>,
|
||||||
) {
|
) {
|
||||||
if settings.mute_sfx && !events_sfx.is_empty() {
|
if settings.mute_sfx && !events_sfx.is_empty() {
|
||||||
events_sfx.clear();
|
events_sfx.clear();
|
||||||
|
@ -130,6 +135,7 @@ pub fn play_sfx(
|
||||||
Sfx::Click => sound_click.0.clone(),
|
Sfx::Click => sound_click.0.clone(),
|
||||||
Sfx::IncomingChatMessage => sound_incoming_message.0.clone(),
|
Sfx::IncomingChatMessage => sound_incoming_message.0.clone(),
|
||||||
Sfx::Ping => sound_ping.0.clone(),
|
Sfx::Ping => sound_ping.0.clone(),
|
||||||
|
Sfx::Connect => sound_connect.0.clone(),
|
||||||
Sfx::None => sound_ping.0.clone(),
|
Sfx::None => sound_ping.0.clone(),
|
||||||
},
|
},
|
||||||
settings: PlaybackSettings::DESPAWN,
|
settings: PlaybackSettings::DESPAWN,
|
||||||
|
@ -143,6 +149,7 @@ pub fn str2sfx(sfx_label: &str) -> Sfx {
|
||||||
"click" => Sfx::Click,
|
"click" => Sfx::Click,
|
||||||
"chat" => Sfx::IncomingChatMessage,
|
"chat" => Sfx::IncomingChatMessage,
|
||||||
"ping" => Sfx::Ping,
|
"ping" => Sfx::Ping,
|
||||||
|
"connect" => Sfx::Connect,
|
||||||
_ => Sfx::None,
|
_ => Sfx::None,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,7 +227,7 @@ fn setup(
|
||||||
// Add Chat Box
|
// Add Chat Box
|
||||||
let bundle_chatbox = TextBundle::from_sections([
|
let bundle_chatbox = TextBundle::from_sections([
|
||||||
TextSection::new(
|
TextSection::new(
|
||||||
"Hello World!\nThis Is Cool, right?",
|
"Warning: System Log Uninitialized",
|
||||||
TextStyle {
|
TextStyle {
|
||||||
font: asset_server.load(FONT),
|
font: asset_server.load(FONT),
|
||||||
font_size: settings.font_size_hud,
|
font_size: settings.font_size_hud,
|
||||||
|
|
Loading…
Reference in a new issue