Inspect mobile entity, also use horizontal scroll area for inspect area

This commit is contained in:
crumblingstatue 2023-04-07 01:13:09 +02:00
parent 1053216d1c
commit 3876ced7d8
2 changed files with 14 additions and 7 deletions

View file

@ -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 {