aclysma / imgui-inspect

An inspector UI using imgui in Rust
Apache License 2.0
70 stars 9 forks source link

Q. `enum` support? #14

Open toyboot4e opened 3 years ago

toyboot4e commented 3 years ago

Is enum not supported yet?

Example:

use imgui_inspect_derive::Inspect;

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Inspect)]
pub enum ShadowConfig {
    Blur,
    Raw,
    None,
}

cargo build:

error: proc-macro derive panicked
 --> crates/grue2d/src/game/cfg.rs:7:51
  |
7 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Inspect)]
  |                                                   ^^^^^^^
  |
  = help: message: not implemented

Thank you :)

aclysma commented 3 years ago

It sounds like a good thing to add. I'm not sure how the UX would work. I'm too busy with other projects to do it myself, but if someone wanted to PR it I'd be happy to take a look. (I would expect enum support to allow setting values within enum variants).