fix border
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 3.8 KiB |
@@ -531,10 +531,8 @@ impl GameLevel {
|
||||
let end_node = self.nodes.get_mut(&self.end_node).unwrap();
|
||||
if self.end_node.1 >= self.end_node.0 {
|
||||
end_node.north = Side::Connection;
|
||||
end_node.south = Side::Connection;
|
||||
} else {
|
||||
end_node.east = Side::Connection;
|
||||
end_node.west = Side::Connection;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ pub fn plugin(app: &mut App) {
|
||||
handle_input,
|
||||
apply_head_bob,
|
||||
on_resize_system,
|
||||
handle_flashlight,
|
||||
(handle_flashlight, handle_spotlight).chain(),
|
||||
(update_flashlight_button_animation, update_flashlight_charge, update_flashlight_sprite).chain(),
|
||||
)
|
||||
.run_if(in_state(GameState::Playing)),
|
||||
@@ -405,7 +405,7 @@ pub fn apply_head_bob(
|
||||
}
|
||||
pub fn handle_flashlight(
|
||||
player_query: Query<&PlayerAction, With<Player>>,
|
||||
mut flashlight_query: Query<&mut SpotLight, With<SpotlightFlashlight>>,
|
||||
mut flashlight_query: Query<&mut Flashlight>,
|
||||
mut flashlight_sprite_query: Query<&mut FlashlightButtonAnimation>,
|
||||
audio_assets: Res<AudioAssets>,
|
||||
audio: Res<Audio>,
|
||||
@@ -413,17 +413,30 @@ pub fn handle_flashlight(
|
||||
let Ok(action) = player_query.get_single() else {
|
||||
return;
|
||||
};
|
||||
if *action != PlayerAction::ToggleFlashlight {
|
||||
if *action != PlayerAction::ToggleFlashlight {
|
||||
return;
|
||||
}
|
||||
if let Ok(flashlight) = flashlight_query.get_single() {
|
||||
if flashlight.charge < 1.0 {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if let Ok(mut animation) = flashlight_sprite_query.get_single_mut() {
|
||||
animation.is_pressed = true;
|
||||
animation.timer.reset();
|
||||
}
|
||||
if let Ok(mut spotlight) = flashlight_query.get_single_mut() {
|
||||
if let Ok(mut flashlight) = flashlight_query.get_single_mut() {
|
||||
audio.play(audio_assets.flash_click.clone());
|
||||
flashlight.is_on = !flashlight.is_on;
|
||||
}
|
||||
}
|
||||
|
||||
spotlight.intensity = if spotlight.intensity > 0.0 {
|
||||
pub fn handle_spotlight(
|
||||
mut spotlight_query: Query<&mut SpotLight, With<SpotlightFlashlight>>,
|
||||
mut flashlight_query: Query<&mut Flashlight>,
|
||||
) {
|
||||
if let (Ok(mut spotlight), Ok(flashlight)) = (spotlight_query.get_single_mut(), flashlight_query.get_single_mut()) {
|
||||
spotlight.intensity = if !flashlight.is_on {
|
||||
0.0
|
||||
} else {
|
||||
320_000.0
|
||||
@@ -468,9 +481,7 @@ pub fn update_flashlight_sprite(
|
||||
flashlights: Res<FlashlightAssets>,
|
||||
){
|
||||
for (animation, mut image, flashlight) in query.iter_mut() {
|
||||
println!("charge: {}", flashlight.charge);
|
||||
let charge = flashlight.charge.ceil() as i32;
|
||||
println!("charge: {}", charge);
|
||||
let charge = flashlight.charge.round() as i32;
|
||||
let sprite_image = match (charge, animation.is_pressed) {
|
||||
(4, true) => flashlights.flash_hold_4_pressed.clone(),
|
||||
(4, false) => flashlights.flash_hold_4.clone(),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use bevy::prelude::*;
|
||||
use bevy_egui::{EguiContexts, egui};
|
||||
use bevy_egui::{egui::{self, Shadow, Stroke}, EguiContexts};
|
||||
use std::default::Default;
|
||||
|
||||
use crate::{GameState, interaction::Interact, util::single};
|
||||
@@ -54,12 +54,14 @@ fn bottom_panel(
|
||||
});
|
||||
|
||||
egui::TopBottomPanel::bottom("inventory_toolbar")
|
||||
.show_separator_line(false)
|
||||
.frame(egui::Frame {
|
||||
fill: egui::Color32::from_rgba_premultiplied(0, 0, 0, 0),
|
||||
// Removed the stroke/border by setting it to none
|
||||
stroke: egui::Stroke::NONE,
|
||||
outer_margin: egui::epaint::Margin::same(0),
|
||||
inner_margin: egui::epaint::Margin::same(0),
|
||||
shadow: Shadow::NONE,
|
||||
..Default::default()
|
||||
})
|
||||
.show(egui_ctx.ctx_mut(), |ui| {
|
||||
@@ -71,8 +73,8 @@ fn bottom_panel(
|
||||
|
||||
// Create a frame for the slot
|
||||
let slot_frame = egui::Frame {
|
||||
fill: egui::Color32::from_rgba_premultiplied(75, 75, 75, 100),
|
||||
stroke: egui::Stroke::new(2.0, egui::Color32::WHITE),
|
||||
fill: egui::Color32::from_rgba_premultiplied(10, 10, 10, 100),
|
||||
stroke: Stroke::NONE,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
@@ -88,15 +90,15 @@ fn bottom_panel(
|
||||
));
|
||||
}
|
||||
None => {
|
||||
ui.label(egui::RichText::new("Empty").size(12.0));
|
||||
// ui.label(egui::RichText::new("Empty").size(12.0));
|
||||
return;
|
||||
}
|
||||
}
|
||||
ui.label(
|
||||
egui::RichText::new(name)
|
||||
.color(egui::Color32::WHITE)
|
||||
.size(12.0),
|
||||
);
|
||||
// ui.label(
|
||||
// egui::RichText::new(name)
|
||||
// .color(egui::Color32::WHITE)
|
||||
// .size(12.0),
|
||||
// );
|
||||
});
|
||||
});
|
||||
ui.allocate_response(ui.available_size(), egui::Sense::click())
|
||||
|
||||
Reference in New Issue
Block a user