dfhack
dfhack copied to clipboard
Imtui
Hello! This is a branch to potentially use the imtui fork of ImGui for DFHack scripts, so that they can have a nice modern UI behind them. Myk002 asked me to file a PR for this to keep a record
So far its all gone surprisingly smoothly:
On a technical note, each viewscreen has its own imgui context, which means that every view is fully independent of every other view. The other alternative would be to have one global imgui context (which would allow different viewscreens to have interacting windows, for eg drag + drop), but this adds more complexity
Todo:
- [X] Basic Text Rendering
- [X] Colour internally
- [X] Reference mechanism for APIs that take pointers
Basic widgets functionality:
- [X] Button
- [X] Checkbox
- [X] PushStyleColor/PopStyleColor (necessary for eg coloured buttons)
- [x] Selectable (necessary for full width buttons)
- [x] Input boxes (for search)
- [x] Rework current colour system to reuse existing lua constants
Tedious but easy widget functionality:
- [x] IsItem* + IsWindow*
More difficult
- [x] Keyboard Controls. ImGui has this built in, so I'm hopeful that we can piggyback off this
Things that will inherently never work:
- [ ] Anything involving colour, like ColorPicker3
Technical Questions:
- [x] Is one context per viewscreen the right approach?
- [x] Overlay interop
- [x] Non lua plugins