bevy14: upgrade color palette usage

This commit is contained in:
yuni 2024-07-09 02:28:55 +02:00
parent b1ff21aec4
commit 3165cfd754
2 changed files with 7 additions and 5 deletions

View file

@ -12,6 +12,7 @@
// and manages the flow of conversations.
use crate::prelude::*;
use bevy::color::palettes::css;
use bevy::prelude::*;
use bevy_xpbd_3d::prelude::*;
use serde::Deserialize;
@ -926,14 +927,14 @@ pub fn handle_chat_scripts(
}
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::WakeUp));
ew_effect.send(visual::SpawnEffectEvent {
class: visual::Effects::FadeIn(Color::CYAN),
class: visual::Effects::FadeIn(css::AQUA.into()),
duration: 1.0,
});
}
}
"cryofadeout" => {
ew_effect.send(visual::SpawnEffectEvent {
class: visual::Effects::FadeOut(Color::CYAN),
class: visual::Effects::FadeOut(css::AQUA.into()),
duration: 5.1,
});
}

View file

@ -11,6 +11,7 @@
// This module handles player input, and coordinates interplay between other modules
use crate::prelude::*;
use bevy::color::palettes::css;
use bevy::pbr::ExtendedMaterial;
use bevy::prelude::*;
use bevy::scene::SceneInstance;
@ -304,21 +305,21 @@ fn handle_player_death(
actor::DamageType::Trauma => {
settings.death_cause = "Trauma".to_string();
ew_effect.send(visual::SpawnEffectEvent {
class: visual::Effects::FadeIn(Color::MAROON),
class: visual::Effects::FadeIn(css::MAROON.into()),
duration: 1.0,
});
}
actor::DamageType::GForce => {
settings.death_cause = "Trauma from excessive g forces".to_string();
ew_effect.send(visual::SpawnEffectEvent {
class: visual::Effects::FadeIn(Color::MAROON),
class: visual::Effects::FadeIn(css::MAROON.into()),
duration: 1.0,
});
}
_ => {
settings.death_cause = "Unknown".to_string();
ew_effect.send(visual::SpawnEffectEvent {
class: visual::Effects::FadeIn(Color::MAROON),
class: visual::Effects::FadeIn(css::MAROON.into()),
duration: 1.0,
});
}