cleanup bloom code in hud

This commit is contained in:
yuni 2024-03-28 20:47:41 +01:00
parent 2eb00d025d
commit ee58302156

View file

@ -1,7 +1,6 @@
use crate::{settings, actor, audio, nature};
use bevy::prelude::*;
use bevy::diagnostic::{DiagnosticsStore, FrameTimeDiagnosticsPlugin};
//use bevy::core_pipeline::bloom::{BloomCompositeMode, BloomSettings};
use std::collections::VecDeque;
use std::time::SystemTime;
@ -445,7 +444,6 @@ fn handle_input(
keyboard_input: Res<ButtonInput<KeyCode>>,
mut settings: ResMut<settings::Settings>,
mut q_hud: Query<&mut Visibility, With<ToggleableHudElement>>,
//mut q_bloomsettings: Query<&mut BloomSettings>,
q_choices: Query<&ChoiceAvailable>,
mut evwriter_sendmsg: EventWriter<actor::SendMessageEvent>,
mut evwriter_sfx: EventWriter<audio::PlaySfxEvent>,
@ -453,14 +451,12 @@ fn handle_input(
mut ambient_light: ResMut<AmbientLight>,
) {
if keyboard_input.just_pressed(settings.key_togglehud) {
//if let Ok(mut bloomsettings) = q_bloomsettings.get_single_mut() {
if settings.hud_active {
for mut hudelement_visibility in q_hud.iter_mut() {
*hudelement_visibility = Visibility::Hidden;
}
settings.hud_active = false;
ambient_light.brightness = AMBIENT_LIGHT;
//bloomsettings.composite_mode = BloomCompositeMode::EnergyConserving;
}
else {
for mut hudelement_visibility in q_hud.iter_mut() {
@ -468,8 +464,6 @@ fn handle_input(
}
settings.hud_active = true;
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_togglemusic.send(audio::ToggleMusicEvent());