mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-17 04:45:02 +01:00
more
This commit is contained in:
parent
ab7d587217
commit
a6a0db08f9
1 changed files with 1 additions and 27 deletions
|
|
@ -1,39 +1,13 @@
|
||||||
use egui::Ui;
|
use egui::Ui;
|
||||||
#[cfg(feature = "derive")]
|
#[cfg(feature = "derive")]
|
||||||
pub use egui_inspect_derive as derive;
|
pub use egui_inspect_derive as derive;
|
||||||
use std::{
|
use std::fmt::Debug;
|
||||||
collections::{HashMap, HashSet},
|
|
||||||
ffi::OsString,
|
|
||||||
fmt::Debug,
|
|
||||||
marker::PhantomData,
|
|
||||||
};
|
|
||||||
pub trait Inspect: Debug {
|
pub trait Inspect: Debug {
|
||||||
fn inspect(&self, ui: &mut Ui, id_source: u64);
|
fn inspect(&self, ui: &mut Ui, id_source: u64);
|
||||||
fn inspect_mut(&mut self, ui: &mut Ui, id_source: u64) {
|
fn inspect_mut(&mut self, ui: &mut Ui, id_source: u64) {
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! impl_num_inspect {
|
|
||||||
($($ty:ty),*) => {
|
|
||||||
$(impl Inspect for $ty { fn inspect_mut(& mut self, ui : & mut Ui, _id_source :
|
|
||||||
u64) { ui.add(egui::DragValue::new(self)); } fn inspect(& self, ui : & mut Ui,
|
|
||||||
_id_source : u64) { ui.label(self.to_string()); } })*
|
|
||||||
};
|
|
||||||
}
|
|
||||||
impl_num_inspect!(i8, u8, i16, u16, i32, u32, i64, u64, f32, f64, usize, isize);
|
|
||||||
impl<T, U> Inspect for (T, U)
|
|
||||||
where
|
|
||||||
T: Inspect,
|
|
||||||
U: Inspect,
|
|
||||||
{
|
|
||||||
fn inspect_mut(&mut self, ui: &mut Ui, id_source: u64) {
|
|
||||||
loop {}
|
|
||||||
}
|
|
||||||
fn inspect(&self, ui: &mut Ui, id_source: u64) {
|
|
||||||
loop {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pub trait UiExt {
|
pub trait UiExt {
|
||||||
fn inspect<T: Inspect>(&mut self, what: &T, id_source: &mut u64);
|
fn inspect<T: Inspect>(&mut self, what: &T, id_source: &mut u64);
|
||||||
fn inspect_iter_with<'a, I, T, F>(
|
fn inspect_iter_with<'a, I, T, F>(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue