This commit is contained in:
nora 2023-04-17 20:11:37 +02:00
parent 59c63ab233
commit e662cc9172
2 changed files with 3 additions and 46 deletions

View file

@ -31,50 +31,7 @@ fn debug_panel_ui(
.show( .show(
ctx, ctx,
|ui| { |ui| {
if debug.freecam {
ui.label("Cam x");
ui.add(egui::DragValue::new(&mut game.camera_offset.x));
ui.label("Cam y");
ui.add(egui::DragValue::new(&mut game.camera_offset.y));
let co = game.camera_offset;
ui.label(
format!(
"Cam Depth: {}", LengthDisp(co.y as f32 - WorldPos::SURFACE
as f32)
),
);
ui.label(
format!(
"Cam offset from center: {}", LengthDisp(co.x as f32 -
WorldPos::CENTER as f32)
),
);
} else {
ui.label(
format!(
"Player Depth: {}", LengthDisp(game.world.player.feet_y() as
f32 - WorldPos::SURFACE as f32)
),
);
ui.label(
format!(
"Player offset from center: {}", LengthDisp(game.world.player
.col_en.en.pos.x as f32 - WorldPos::CENTER as f32)
),
);
ui.label(
format!(
"Hspeed: {} ({} km/h)", game.world.player.hspeed,
px_per_frame_to_km_h(game.world.player.hspeed)
),
);
ui.label(
format!(
"Vspeed: {} ({} km/h)", game.world.player.vspeed,
px_per_frame_to_km_h(game.world.player.vspeed)
),
);
}
ui.label("Music volume"); ui.label("Music volume");
let mut vol = res.surf_music.volume(); let mut vol = res.surf_music.volume();
ui.add(egui::DragValue::new(&mut vol)); ui.add(egui::DragValue::new(&mut vol));

View file

@ -22,13 +22,13 @@ impl<Layer> Clone for TileId<Layer> {
} }
impl<Layer> Debug for TileId<Layer> { impl<Layer> Debug for TileId<Layer> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_tuple("TileId").field(&self.0).finish() loop {}
} }
} }
impl<Layer> TileId<Layer> { impl<Layer> TileId<Layer> {
pub fn empty(&self) -> bool { pub fn empty(&self) -> bool {
self.0 == 0 loop {}
} }
pub const EMPTY: Self = Self(0, PhantomData); pub const EMPTY: Self = Self(0, PhantomData);
} }