Closed marpe closed 1 year ago
Hello, thank you for the kind words and for the report!
Short version:
I'm pretty swamped right now so a proper fix will have to come later, but I've pushed a workaround for now as https://github.com/MochiLibraries/Mochi.DearImGui/commit/6bf59cb79eb491f8071324adb781473cc453e9dc
I put a prerelease package on NuGet.org
(This package should be fine, but I'm labeling it as prerelease since I didn't test it as thoroughly as I typically would.)
As for the long version, there's actually two issues here:
ImGuiKey_0
vs ImGuiKey_1
: Turns out I'm not handling forward declarations of enums correctly (they aren't common at all since you can't even use them with the bare enum Name {...};
syntax.)ImGuiKey_
: Removing the prefixes is handled by ImGuiEnumTransformation
, which identifies candidate enums based on the typedef int ImGuiEnumName;
...enum ImGuiEnumName_
pattern Omar usually uses, but 1.89 broke this convention for ImGuiKey
as an experiment.The proper fix for the first one will have to happen in Biohazrd. For now I just special-cased identifying the useless forward declaration and deleting it.
The proper fix for the second one will depend on whether Omar decides to go through with propagating that pattern change to other enums in Dear ImGui. (As that commit notes, this is an experiment to see if it causes any problems.) For now I just special-cased renaming constants in that enum alone.
Thanks for the prompt response! I'll look try out the workaround
Just realized I forgot to loop back on this, the workaround works fine, thank you! 👍🏻
The generated bindings for the latest version of ImGui (9964740a47fda96ee937cfea272ccac85dc6a500) results in duplicate ImGuiKey enums.
One that's empty,
ImGuiKey_0
, andImGuiKey_1
which contains the expected values except the names are prefixed with yet anotherImGuiKey_
. So the full name of a key is e.gImGuiKey_1.ImGuiKey_PrintScreen
. It works, but I'd prefer the old naming.What are your thoughts?
Really appreciate the work you've done, thank you!