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
Current state: the high level integration is mostly (entirely?) done, barring any bugs or unknown unknowns. ImGui windows respect viewscreen sorting, and the technical/architectural work is mostly done. So the current state is that there are a couple of minor local bugfixes, and lots of widgets to add. And the code needs a lot of cleanup
I've been more thoroughly keeping track of what I'm working on over here in case anyone wants more detail of what's to be done generally
https://trello.com/b/zW9Oc48o/df
saving this work in DFHack/dfhack/imtui