mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-17 21:05:01 +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
|
|
@ -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