mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-14 19:55:02 +01:00
more
This commit is contained in:
parent
8f651d1553
commit
9df90445ef
1 changed files with 3 additions and 7 deletions
|
|
@ -32,16 +32,12 @@ pub fn derive_inspect(input: TokenStream) -> TokenStream {
|
|||
Data::Struct(s) => {
|
||||
let mut exprs = Vec::new();
|
||||
for (i, f) in s.fields.iter().enumerate() {
|
||||
let memb = match &f.ident {
|
||||
Some(ident) => Member::from(ident.clone()),
|
||||
None => Member::from(i),
|
||||
};
|
||||
|
||||
let ident = &f.ident;
|
||||
exprs.push(quote! {
|
||||
if ui.add(::egui::Label::new(stringify!(#f)).sense(::egui::Sense::click())).clicked() {
|
||||
ui.output_mut(|o| o.copied_text = format!("{:?}", self.#memb));
|
||||
ui.output_mut(|o| o.copied_text = format!("{:?}", self.#ident));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
quote! {
|
||||
::egui::CollapsingHeader::new(stringify!(#ty_ident)).id_source(id_source).show(ui, |ui| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue