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