cleanup bloom code in hud
This commit is contained in:
parent
2eb00d025d
commit
ee58302156
|
@ -1,7 +1,6 @@
|
||||||
use crate::{settings, actor, audio, nature};
|
use crate::{settings, actor, audio, nature};
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use bevy::diagnostic::{DiagnosticsStore, FrameTimeDiagnosticsPlugin};
|
use bevy::diagnostic::{DiagnosticsStore, FrameTimeDiagnosticsPlugin};
|
||||||
//use bevy::core_pipeline::bloom::{BloomCompositeMode, BloomSettings};
|
|
||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
use std::time::SystemTime;
|
use std::time::SystemTime;
|
||||||
|
|
||||||
|
@ -445,7 +444,6 @@ fn handle_input(
|
||||||
keyboard_input: Res<ButtonInput<KeyCode>>,
|
keyboard_input: Res<ButtonInput<KeyCode>>,
|
||||||
mut settings: ResMut<settings::Settings>,
|
mut settings: ResMut<settings::Settings>,
|
||||||
mut q_hud: Query<&mut Visibility, With<ToggleableHudElement>>,
|
mut q_hud: Query<&mut Visibility, With<ToggleableHudElement>>,
|
||||||
//mut q_bloomsettings: Query<&mut BloomSettings>,
|
|
||||||
q_choices: Query<&ChoiceAvailable>,
|
q_choices: Query<&ChoiceAvailable>,
|
||||||
mut evwriter_sendmsg: EventWriter<actor::SendMessageEvent>,
|
mut evwriter_sendmsg: EventWriter<actor::SendMessageEvent>,
|
||||||
mut evwriter_sfx: EventWriter<audio::PlaySfxEvent>,
|
mut evwriter_sfx: EventWriter<audio::PlaySfxEvent>,
|
||||||
|
@ -453,14 +451,12 @@ fn handle_input(
|
||||||
mut ambient_light: ResMut<AmbientLight>,
|
mut ambient_light: ResMut<AmbientLight>,
|
||||||
) {
|
) {
|
||||||
if keyboard_input.just_pressed(settings.key_togglehud) {
|
if keyboard_input.just_pressed(settings.key_togglehud) {
|
||||||
//if let Ok(mut bloomsettings) = q_bloomsettings.get_single_mut() {
|
|
||||||
if settings.hud_active {
|
if settings.hud_active {
|
||||||
for mut hudelement_visibility in q_hud.iter_mut() {
|
for mut hudelement_visibility in q_hud.iter_mut() {
|
||||||
*hudelement_visibility = Visibility::Hidden;
|
*hudelement_visibility = Visibility::Hidden;
|
||||||
}
|
}
|
||||||
settings.hud_active = false;
|
settings.hud_active = false;
|
||||||
ambient_light.brightness = AMBIENT_LIGHT;
|
ambient_light.brightness = AMBIENT_LIGHT;
|
||||||
//bloomsettings.composite_mode = BloomCompositeMode::EnergyConserving;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for mut hudelement_visibility in q_hud.iter_mut() {
|
for mut hudelement_visibility in q_hud.iter_mut() {
|
||||||
|
@ -468,8 +464,6 @@ fn handle_input(
|
||||||
}
|
}
|
||||||
settings.hud_active = true;
|
settings.hud_active = true;
|
||||||
ambient_light.brightness = AMBIENT_LIGHT_AR;
|
ambient_light.brightness = AMBIENT_LIGHT_AR;
|
||||||
//bloomsettings.composite_mode = BloomCompositeMode::EnergyConserving;
|
|
||||||
//bloomsettings.composite_mode = BloomCompositeMode::Additive;
|
|
||||||
}
|
}
|
||||||
evwriter_sfx.send(audio::PlaySfxEvent(audio::Sfx::Switch));
|
evwriter_sfx.send(audio::PlaySfxEvent(audio::Sfx::Switch));
|
||||||
evwriter_togglemusic.send(audio::ToggleMusicEvent());
|
evwriter_togglemusic.send(audio::ToggleMusicEvent());
|
||||||
|
|
Loading…
Reference in a new issue