mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-14 19:55:02 +01:00
Inspect mobile entity, also use horizontal scroll area for inspect area
This commit is contained in:
parent
1053216d1c
commit
3876ced7d8
2 changed files with 14 additions and 7 deletions
|
|
@ -307,10 +307,6 @@ fn debug_panel_ui(
|
|||
LengthDisp(co.x as f32 - WorldPos::CENTER as f32)
|
||||
));
|
||||
} else {
|
||||
ui.label("Player x");
|
||||
ui.add(egui::DragValue::new(&mut game.player.col_en.en.pos.x));
|
||||
ui.label("Player y");
|
||||
ui.add(egui::DragValue::new(&mut game.player.col_en.en.pos.y));
|
||||
let tp = game.player.center_tp();
|
||||
imm_dbg!(tp);
|
||||
ui.label(format!(
|
||||
|
|
@ -337,9 +333,10 @@ fn debug_panel_ui(
|
|||
ui.add(egui::DragValue::new(&mut vol));
|
||||
res.surf_music.set_volume(vol);
|
||||
ui.separator();
|
||||
egui::ScrollArea::vertical()
|
||||
egui::ScrollArea::both()
|
||||
.id_source("insp_scroll")
|
||||
.max_height(240.)
|
||||
.max_width(340.0)
|
||||
.show(ui, |ui| {
|
||||
inspect! {
|
||||
ui,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use egui_inspect::derive::Inspect;
|
||||
use egui_inspect::{derive::Inspect, inspect};
|
||||
use s2dc::{vec2, MobileEntity};
|
||||
|
||||
use crate::{
|
||||
|
|
@ -8,13 +8,23 @@ use crate::{
|
|||
|
||||
#[derive(Debug, Inspect)]
|
||||
pub struct Player {
|
||||
#[opaque]
|
||||
#[inspect_with(inspect_mobile_entity)]
|
||||
pub col_en: MobileEntity,
|
||||
pub vspeed: f32,
|
||||
pub hspeed: f32,
|
||||
pub jumps_left: u8,
|
||||
}
|
||||
|
||||
fn inspect_mobile_entity(en: &mut MobileEntity, ui: &mut egui::Ui, _id_src: u64) {
|
||||
inspect! {
|
||||
ui,
|
||||
en.en.pos.x,
|
||||
en.en.pos.y,
|
||||
en.en.bb.x,
|
||||
en.en.bb.y
|
||||
}
|
||||
}
|
||||
|
||||
impl Player {
|
||||
pub fn new_at(pos: WorldPos) -> Self {
|
||||
Self {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue