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
ea398555ac
commit
fa77644b0d
11 changed files with 15 additions and 2811 deletions
13
egui-inspect-derive/Cargo.toml
Normal file
13
egui-inspect-derive/Cargo.toml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[package]
|
||||
name = "egui-inspect-derive"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
quote = "1.0.26"
|
||||
proc-macro2 = "1.0.56"
|
||||
15
egui-inspect-derive/src/lib.rs
Normal file
15
egui-inspect-derive/src/lib.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
use proc_macro::TokenStream;
|
||||
use quote::quote;
|
||||
|
||||
#[proc_macro_derive(Inspect)]
|
||||
pub fn derive_inspect(input: TokenStream) -> TokenStream {
|
||||
let expanded = quote! {
|
||||
impl Inspect for GameState {
|
||||
fn inspect_mut(&mut self) {
|
||||
output_mut(|o| o.copied_text = format!(""));
|
||||
output_mut(|o| o.copied_text = format!("{:?}", self.tile_db));
|
||||
}
|
||||
}
|
||||
};
|
||||
proc_macro::TokenStream::from(expanded)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue