mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-14 11:45:01 +01:00
more
This commit is contained in:
parent
e8e276eae2
commit
8f651d1553
2 changed files with 8 additions and 13 deletions
|
|
@ -24,7 +24,7 @@ fn inspect_kind(attrs: &[Attribute]) -> FieldInspectKind {
|
||||||
FieldInspectKind::Auto
|
FieldInspectKind::Auto
|
||||||
}
|
}
|
||||||
|
|
||||||
#[proc_macro_derive(Inspect, attributes(opaque, inspect_with))]
|
#[proc_macro_derive(Inspect)]
|
||||||
pub fn derive_inspect(input: TokenStream) -> TokenStream {
|
pub fn derive_inspect(input: TokenStream) -> TokenStream {
|
||||||
let input = parse_macro_input!(input as DeriveInput);
|
let input = parse_macro_input!(input as DeriveInput);
|
||||||
let ty_ident = input.ident;
|
let ty_ident = input.ident;
|
||||||
|
|
@ -36,19 +36,12 @@ pub fn derive_inspect(input: TokenStream) -> TokenStream {
|
||||||
Some(ident) => Member::from(ident.clone()),
|
Some(ident) => Member::from(ident.clone()),
|
||||||
None => Member::from(i),
|
None => Member::from(i),
|
||||||
};
|
};
|
||||||
match inspect_kind(&f.attrs) {
|
|
||||||
FieldInspectKind::Auto => {
|
exprs.push(quote! {
|
||||||
exprs.push(quote! {
|
if ui.add(::egui::Label::new(stringify!(#f)).sense(::egui::Sense::click())).clicked() {
|
||||||
ui.horizontal(|ui| {
|
ui.output_mut(|o| o.copied_text = format!("{:?}", self.#memb));
|
||||||
if ui.add(::egui::Label::new(stringify!(#f)).sense(::egui::Sense::click())).clicked() {
|
}
|
||||||
ui.output_mut(|o| o.copied_text = format!("{:?}", self.#memb));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
FieldInspectKind::Opaque => {}
|
|
||||||
FieldInspectKind::WithFn(_) => {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
quote! {
|
quote! {
|
||||||
::egui::CollapsingHeader::new(stringify!(#ty_ident)).id_source(id_source).show(ui, |ui| {
|
::egui::CollapsingHeader::new(stringify!(#ty_ident)).id_source(id_source).show(ui, |ui| {
|
||||||
|
|
|
||||||
2
repro.sh
2
repro.sh
|
|
@ -1,5 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
export RUSTFLAGS='-Zincremental-verify-ich'
|
||||||
|
|
||||||
cp tiles.rs src/tiles.rs
|
cp tiles.rs src/tiles.rs
|
||||||
cargo clean -p mantle-diver
|
cargo clean -p mantle-diver
|
||||||
cargo build
|
cargo build
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue