New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Imtui #2505
Imtui #2505
Conversation
library/LuaApi.cpp
Outdated
ImGui::Text("%s", str.c_str()); | ||
} | ||
|
||
static bool imgui_button(std::string name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that simple intermediate functions like this are not necessary. You could just WRAPM the module API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha ok! I'll keep this in mind for simple stuff - things like buttons do have default arguments that I'll add down the line
dfoverlay.webmLots more progress, putting together a basic overlay config example |
overlayintegrations.webmCurrent 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 |
@@ -31,3 +31,6 @@ | |||
[submodule "depends/googletest"] | |||
path = depends/googletest | |||
url = ../../google/googletest.git | |||
[submodule "depends/imgui"] | |||
path = depends/imgui | |||
url = https://github.com/20k/dfhack-imgui.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
be sure to use a relative path so the submodule uses the same transport mechanism as the parent fork.
also, before we merge this, we'll want to fork imgui into the DFHack org like most of the dependencies in this file
@@ -419,6 +419,7 @@ include_directories(depends/tthread) | |||
include_directories(${ZLIB_INCLUDE_DIRS}) | |||
include_directories(depends/clsocket/src) | |||
include_directories(depends/xlsxio/include) | |||
include_directories(depends/imgui) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will plugin code be using this API directly, or will it just be through the DFHack module? If the latter, we should probably restrict the include to target that directly depend on it. Something like:
target_include_directories(imgui INTERFACE depends/imgui)
(this would have to appear below the add_subdirectory(imgui)
line below so the target exists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spent a while fixing up the C++ support, so the current design should directly allow for plugins to use ImGui directly without many restrictions. I do need to add some testing, but yes ImGui itself would be directly available to any plugins as long as they also decorate their render/feed code correctly from the module itself
@@ -129,6 +129,7 @@ set(MODULE_HEADERS | |||
include/modules/Graphic.h | |||
include/modules/Gui.h | |||
include/modules/GuiHooks.h | |||
include/modules/ImTuiImpl.h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a module name, I'd suggest something like Widgets.h or UI.h
allow tile in Label tokens to be either pen or id
add textures used by new gui/control-panel
update seedwatch
[nestboxes] update and simplify; persist state
support offset text in graphics mode for pens
display PAUSE FORCED instead of a pause icon
add defocusable attribute to ZScreen
scripts: master
scripts: master
scripts: master
# Conflicts: # docs/changelog.txt
Co-authored-by: Myk <myk.taylor@gmail.com>
Co-authored-by: Myk <myk.taylor@gmail.com>
Co-authored-by: Myk <myk.taylor@gmail.com>
Autoclothing
minimum required to make work: * realign the job table * add code to flip/flop the work detail enable flag
autoslab: Improve check for existing engraved slab.
Fix annotation parse error
library/xml: master scripts: master
Detect manual save when persisting data
scripts: master
The rewrite in DFHack#2773 introduced a bug (identified by KMFrench on Discord) where nestboxes themselves would be forbidden, which prevents egglaying citizens from using them since the nestboxes would be claimed before use. The previous version of the plugin handled this by skipping the first item in `contained_items`, which is the building material (in this case, the nestbox). This fix limits the `forbid` flag manipulation to egg items only, which should be a reasonable limitation that still allows the plugin to serve its purpose.
scripts: master
saving this work in DFHack/dfhack/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:
button.webm
multiwin.webm
colourswork.webm
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:
Basic widgets functionality:
Tedious but easy widget functionality:
More difficult
Things that will inherently never work:
Technical Questions: