Skip to content
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

Merged
merged 1,100 commits into from
May 2, 2024
Merged

Imtui #2505

Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
1100 commits
Select commit Hold shift + click to select a range
58be8cf
support offset text in graphics mode for pens
myk002 Feb 2, 2023
d594bc2
Merge pull request #2767 from myk002/myk_unbreak_tile
myk002 Feb 2, 2023
6513b59
Merge pull request #2768 from myk002/myk_textures
myk002 Feb 2, 2023
7468170
Merge pull request #2771 from myk002/myk_seedwatch
myk002 Feb 2, 2023
c312a88
Merge pull request #2773 from myk002/myk_nestboxes
myk002 Feb 2, 2023
21f9317
Merge pull request #2778 from myk002/myk_halfsies
myk002 Feb 2, 2023
7fbd958
Merge branch 'develop' into myk_pause_forced
myk002 Feb 2, 2023
1debea5
Merge branch 'develop' into myk_non_defocusable
myk002 Feb 2, 2023
79d5ade
Merge pull request #2776 from myk002/myk_pause_forced
myk002 Feb 2, 2023
a3f32e6
Merge pull request #2775 from myk002/myk_non_defocusable
myk002 Feb 2, 2023
648f264
Auto-update submodules
DFHack-Urist Feb 2, 2023
ca2078c
Auto-update submodules
DFHack-Urist Feb 2, 2023
5a1c3c7
remove unused vars copypastad from seedwatch
myk002 Feb 2, 2023
75bb67c
Auto-update submodules
DFHack-Urist Feb 2, 2023
7d05a68
clean up changelog, update refs
myk002 Feb 2, 2023
ea22a23
Clean up autoclothing for release.
RosaryMala Feb 2, 2023
7d304db
Update autoclothing docs.
RosaryMala Feb 2, 2023
840f728
Merge remote-tracking branch 'DFHack/develop' into Autoclothing
RosaryMala Feb 2, 2023
9c8903d
Update docs/plugins/autoclothing.rst
RosaryMala Feb 2, 2023
b36e5e1
Update plugins/autoclothing.cpp
RosaryMala Feb 2, 2023
6e200b8
Update plugins/autoclothing.cpp
RosaryMala Feb 2, 2023
e1c0781
Merge pull request #2784 from RosaryMala/Autoclothing
myk002 Feb 2, 2023
d780dc6
reenable autolabor for testing
ab9rf Jan 30, 2023
16e6114
autolabor: realign labors, improve tick handling
ab9rf Jan 30, 2023
4df7898
link autolabor to lua for the overlay
myk002 Feb 1, 2023
987597e
add autolabor warning overlay widget
myk002 Feb 1, 2023
c6d63a5
update autolabor documentation
ab9rf Feb 2, 2023
9579f11
autolabor: improve docs
ab9rf Feb 2, 2023
2a8578c
Update docs/plugins/autolabor.rst
myk002 Feb 3, 2023
b514d9b
Merge pull request #2757 from ab9rf/5005-autolabor
myk002 Feb 3, 2023
aa2339d
add cxxrandom back to the build
myk002 Feb 3, 2023
2cf985b
don't lose List scroll position when dragging
myk002 Feb 3, 2023
bfc2760
use Ctrl-Shift-S instead of tilde for gui/control-panel
myk002 Feb 3, 2023
bb6824e
Auto-update submodules
DFHack-Urist Feb 3, 2023
f991593
Auto-update submodules
DFHack-Urist Feb 3, 2023
8c7be9a
don't use negative plant indices
myk002 Feb 3, 2023
49246a6
properly cast for unsigned comparisons
myk002 Feb 3, 2023
76712a5
move control panel hotkey again to Ctrl-Shift-E
myk002 Feb 3, 2023
6831b1a
reset the saved frame counter on new world
myk002 Feb 3, 2023
2316615
react to double clicks on list items
myk002 Feb 3, 2023
345b7d7
pass attributes through FilteredList
myk002 Feb 3, 2023
f9376d6
Merge pull request #2786 from myk002/myk_list_double_click
myk002 Feb 3, 2023
d1a7789
Merge pull request #2787 from myk002/myk_reset_reload
myk002 Feb 3, 2023
8696260
Auto-update submodules
DFHack-Urist Feb 3, 2023
cddcf78
cross compile: build stonesense as well
kelvie Feb 1, 2023
04f586b
move stonesense flag to the cross compile action
myk002 Feb 3, 2023
d980c7b
actually expand EXTRA_CMAKE_ARGS in the command
myk002 Feb 3, 2023
9db9d06
Merge pull request #2759 from CoreyJ87/patch-1
myk002 Feb 3, 2023
5b4e3bd
Merge branch 'develop' into build-stonesense
myk002 Feb 3, 2023
1140148
Merge pull request #2788 from kelvie/build-stonesense
myk002 Feb 3, 2023
e2095f9
restore the file mode to executable
myk002 Feb 3, 2023
81abd52
include TRACE messages in the build
myk002 Feb 3, 2023
972df67
add more instrumentation to autochop
myk002 Feb 3, 2023
f2521c4
protect against bad tree data
myk002 Feb 3, 2023
5a4ab97
update changelog
myk002 Feb 3, 2023
667851d
Auto-update submodules
DFHack-Urist Feb 3, 2023
1e904cf
GHA: use declarative env
kelvie Feb 3, 2023
4a21b08
bump to 50.05-alpha3
myk002 Feb 3, 2023
43d1a15
fix param parsing for setting targets
myk002 Feb 3, 2023
ce16aef
update changelog
myk002 Feb 3, 2023
29f56a6
Merge pull request #2792 from myk002/myk_seedwatch
myk002 Feb 3, 2023
71deeb7
bump version to 50.05-alpha3.1
myk002 Feb 3, 2023
de04cf0
wrong scrollbar sprites mapping fix (issue #2777)
TaxiService Feb 4, 2023
1365e4b
Merge pull request #2800 from kelvie/build-stonesense
myk002 Feb 4, 2023
2daf1ce
make automelt resistent to morphed building ids
myk002 Feb 4, 2023
11e3362
Merge pull request #2799 from TaxiService/patch-1
myk002 Feb 5, 2023
c345acd
Update Units::isFortControlled
Bumber64 Feb 5, 2023
0f78509
agitated_wilderness_creature is in unit->flags4
Bumber64 Feb 5, 2023
1eb67ab
Update Gui::resetDwarfmodeView
Bumber64 Feb 5, 2023
427b90c
Merge pull request #2802 from myk002/myk_automelt
myk002 Feb 5, 2023
90860f0
Merge pull request #2808 from Bumber64/patch-2
myk002 Feb 5, 2023
8c79ca5
Auto-update submodules
DFHack-Urist Feb 5, 2023
30a1f2f
de-hardcoding scrollbar spritesheet definitions
TaxiService Feb 5, 2023
b6196e9
increase min scrollbar height to 2 (from 1)
TaxiService Feb 5, 2023
08d90de
Merge branch 'DFHack:develop' into patch-1
Bumber64 Feb 5, 2023
35c87df
Update changelog.txt
Bumber64 Feb 5, 2023
8253505
Update changelog.txt
Bumber64 Feb 5, 2023
87931d9
Merge pull request #2810 from TaxiService/patch-2
myk002 Feb 5, 2023
3ca2521
Merge pull request #2807 from Bumber64/patch-1
myk002 Feb 5, 2023
a770a4c
WIP
robob27 Jan 27, 2023
6e442a2
More WIP
robob27 Feb 1, 2023
085a308
Remove/readd comments
robob27 Feb 1, 2023
4a0d542
Add more confirms
robob27 Feb 2, 2023
2cb9830
Fix default mouse_button value
robob27 Feb 2, 2023
dc40f71
Fix warning
robob27 Feb 2, 2023
59db67e
Remove unnecessary invalidate
robob27 Feb 2, 2023
3da1964
Fix another warning, test force_full_display_count
robob27 Feb 2, 2023
86b5738
fixup unnecessary changes, remove unnecessary stuff
robob27 Feb 2, 2023
e049bfe
Fixup docs
robob27 Feb 2, 2023
0c80eff
Remove unnecessary using
robob27 Feb 2, 2023
8f32f1e
Fixup focusStrings->focusString
robob27 Feb 2, 2023
a14de11
Clean up artifacts during render
robob27 Feb 2, 2023
576fcfb
Clean up some nesting
robob27 Feb 2, 2023
fdbe91e
Add the rest of the bottom modes
robob27 Feb 2, 2023
a5de0fb
Add stockpile removal confirm
robob27 Feb 2, 2023
f7df515
More focus strings, correct docs
robob27 Feb 2, 2023
14f1e4b
Per confirm pause maybe?
robob27 Feb 3, 2023
1c08b56
Proper prefix matching in hotkeys?
robob27 Feb 3, 2023
cece0bf
Remove unnecessary comment
robob27 Feb 3, 2023
36e4bba
Fixup prefix matching
robob27 Feb 3, 2023
2bf9b86
Fix getCurFocus lua, use where appropriate in c++
robob27 Feb 3, 2023
6657fb5
Fix pausing and warnings
robob27 Feb 3, 2023
d5ada27
Remove unused variable
robob27 Feb 3, 2023
717b133
Move unpause detection back to feed
robob27 Feb 3, 2023
c8d672e
Remove duplicate SquadEquipment entry
robob27 Feb 3, 2023
8a08878
Less messy pause display
robob27 Feb 4, 2023
c621c33
Initialize paused to false, cleanup comments
robob27 Feb 4, 2023
4e57464
Single line debug message
robob27 Feb 4, 2023
edbc930
Remove unused function
robob27 Feb 4, 2023
b5e6da3
Remove unused import
robob27 Feb 4, 2023
89761bc
Remove unnecessary screen params
robob27 Feb 4, 2023
2c817ec
Enable confirm by default
robob27 Feb 4, 2023
3006927
Add missing ;
robob27 Feb 4, 2023
c09690b
Remove newline in debug
robob27 Feb 5, 2023
23fa38a
Update confirm docs
robob27 Feb 5, 2023
52fed5d
Update options command
robob27 Feb 6, 2023
a3c03a8
Update docs/plugins/confirm.rst
robob27 Feb 6, 2023
443fe5d
Update library/Core.cpp
robob27 Feb 6, 2023
a7b5ce4
Merge pull request #2721 from robob27/enable-confirm
myk002 Feb 6, 2023
526d7c1
allow focus string generation to fall through unfocuses ZScreens
myk002 Feb 6, 2023
09e7c14
hide DFHack logo when it's in the way
myk002 Feb 6, 2023
4ab3629
Merge pull request #2813 from myk002/myk_zscreen_focus_fallthrough
myk002 Feb 6, 2023
d6c4d44
Add dig to the build
myk002 Feb 6, 2023
bc0eedd
Merge pull request #2821 from DFHack/myk_dig
myk002 Feb 6, 2023
032b62d
Auto-update submodules
DFHack-Urist Feb 6, 2023
2ddd23e
prevent rclick from bleeding through (again)
myk002 Feb 6, 2023
9e31884
implement some Gui module hotkey guards
myk002 Feb 6, 2023
5747e9f
set up some keybindings that are ready to go
myk002 Feb 6, 2023
bf91ffb
support focus paths for overlay widgets
myk002 Feb 6, 2023
397a64c
don't print out how many items there are in the world
myk002 Feb 6, 2023
e285ee3
tweak defaults, load initial races immediately
myk002 Feb 6, 2023
6dbf7b8
update auto plugin example, use new best practices
myk002 Feb 6, 2023
d7d6c5a
Backwards options for cycle hotkey working
johncosker Feb 6, 2023
36b76d7
Update documentation for CycleHotkeyLabel
johncosker Feb 6, 2023
4e36679
Changelog/documentation for key_back
johncosker Feb 6, 2023
99f84fa
Merge pull request #2811 from TaxiService/patch-3
myk002 Feb 6, 2023
c0cd37f
protect against NULLs and invalid stockpiles
myk002 Feb 6, 2023
795b637
Merge pull request #2830 from myk002/myk_automelt
myk002 Feb 6, 2023
1e03582
Merge pull request #2828 from myk002/myk_best_practices
myk002 Feb 6, 2023
6933306
Merge pull request #2827 from myk002/myk_autobutcher
myk002 Feb 6, 2023
408e14d
Merge pull request #2826 from myk002/myk_cleanowned
myk002 Feb 6, 2023
0fc7341
Merge pull request #2825 from myk002/myk_focus_strings
myk002 Feb 6, 2023
149d7f7
Merge branch 'develop' into myk_keybindings
myk002 Feb 6, 2023
6880225
Merge pull request #2824 from myk002/myk_keybindings
myk002 Feb 6, 2023
448598e
Merge pull request #2823 from myk002/myk_hotkey_guards
myk002 Feb 6, 2023
041909d
Merge pull request #2822 from myk002/myk_rclick
myk002 Feb 6, 2023
190b500
Merge branch 'develop' into myk_logo_hide
myk002 Feb 6, 2023
a9ef171
Merge pull request #2816 from myk002/myk_logo_hide
myk002 Feb 6, 2023
d09f855
Delete makeown.lua
ElsaTheHobo Feb 6, 2023
f602548
Merge pull request #2831 from ElsaTheHobo/develop
myk002 Feb 6, 2023
e1f74ab
Tweak to completely nil the key_back table for setText if not set
johncosker Feb 6, 2023
39dc0cc
Cleanup
johncosker Feb 6, 2023
0769afc
Merge branch 'develop' into cycle-hotkey-rev
johncosker Feb 6, 2023
36391af
More cleanup
johncosker Feb 6, 2023
fdf1d38
Merge branch 'cycle-hotkey-rev' of https://github.com/johncosker/dfha…
johncosker Feb 6, 2023
0ed4a1c
Add documentation to cycle() for new parameter
johncosker Feb 6, 2023
f91555d
Add brackets to indicate optional param
johncosker Feb 6, 2023
0b9b258
ensure scrollable lists are centered in the visible viewport
myk002 Feb 6, 2023
cd9972c
Merge pull request #2832 from johncosker/cycle-hotkey-rev
myk002 Feb 6, 2023
c0358d6
Merge pull request #2833 from myk002/myk_list_recenter
myk002 Feb 6, 2023
a38246a
Update logic for zone type checks
TealSeer Feb 6, 2023
0043e05
enable autonestbox
TealSeer Feb 6, 2023
ca5a17a
explanatory comment for magic number
TealSeer Feb 7, 2023
826f918
remove isHospital as hospitals are no longer civzones
TealSeer Feb 7, 2023
26e57a9
Merge pull request #2834 from TealSeer/zonecheckfixes
myk002 Feb 7, 2023
bc1adc0
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Feb 7, 2023
d126cbe
Merge pull request #2836 from DFHack/pre-commit-ci-update-config
myk002 Feb 7, 2023
df5184d
Auto-update submodules
DFHack-Urist Feb 7, 2023
b2ecb8a
Auto-update submodules
DFHack-Urist Feb 7, 2023
ef81a91
only realign out-of-alignment list positions
myk002 Feb 7, 2023
468e987
Update DFHack version to 50.07-alpha0, update xml
lethosor Feb 8, 2023
057d2d8
Update scripts (hermit)
lethosor Feb 8, 2023
8ee05af
update logo to crisper version provided by TaxiService
myk002 Feb 7, 2023
0a91166
add light AA
myk002 Feb 7, 2023
be0cec9
Current attempt to fix lua stack smashing
eamondo2 Feb 8, 2023
9925aba
Merge branch 'develop' into automelt
eamondo2 Feb 8, 2023
585b8da
Auto-update submodules
DFHack-Urist Feb 8, 2023
d0b4b1a
Auto-update submodules
DFHack-Urist Feb 8, 2023
c1b9de8
Add case_sensitive attr to FilteredList
robob27 Feb 7, 2023
13440d1
Add case_sensitive to FilteredList docs
robob27 Feb 7, 2023
54560bc
Don't duplicate regex
robob27 Feb 8, 2023
dd10451
Remove library/military silver crossbow work-order
dawnmist Feb 8, 2023
24827ea
Remove checks for silver from library/military for crossbows.
dawnmist Feb 8, 2023
1f38b29
Add note in changelog about silver crossbows
dawnmist Feb 8, 2023
5002427
Merge branch 'develop' into automelt
eamondo2 Feb 8, 2023
22b31bd
Update changelog
robob27 Feb 8, 2023
b950b56
Add methods to HotkeyLabel
robob27 Feb 8, 2023
02a249f
Fixes the lua stack smashing issue
eamondo2 Feb 8, 2023
bf0b3f8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 8, 2023
201fec6
Merge pull request #2837 from robob27/case-insensitive-filterlist
myk002 Feb 8, 2023
ccf57fd
Merge pull request #2845 from dawnmist/orders/remove-silver-crossbow-…
myk002 Feb 8, 2023
cfc5226
Merge branch 'develop' into myk_logo
myk002 Feb 8, 2023
26e1d18
Merge pull request #2842 from myk002/myk_logo
myk002 Feb 8, 2023
5d8d378
Implements plugin: channel-safely v1.2.3
cppcooper Feb 8, 2023
caeb6d2
Updates changelog
cppcooper Feb 8, 2023
cd12f95
add const & to Push overloads; remove circular def
myk002 Feb 8, 2023
6f25fe3
Merge pull request #2851 from myk002/myk_no_circles
myk002 Feb 8, 2023
1787d24
Merge branch 'develop' into hotkeylabel-enhancements
myk002 Feb 8, 2023
44428bc
Merge pull request #2844 from cppcooper/channel-safely
myk002 Feb 8, 2023
d74f00f
Merge pull request #2847 from robob27/hotkeylabel-enhancements
myk002 Feb 8, 2023
1e4a730
Apply suggestions from code review
eamondo2 Feb 8, 2023
07fd4b2
Merge branch 'develop' into automelt-autochop-lua-stack-fix
eamondo2 Feb 8, 2023
5a5fcbd
Add changes to changelog.txt
eamondo2 Feb 8, 2023
5113823
Merge pull request #2848 from eamondo2/automelt-autochop-lua-stack-fix
myk002 Feb 8, 2023
9f76d64
update misery; persist state
myk002 Feb 8, 2023
6a04b57
update changelog
myk002 Feb 8, 2023
5c84d18
update tailor, persist state, use best practices
myk002 Feb 7, 2023
4d4e94c
convert index
myk002 Feb 8, 2023
8bd9853
make gcc happy
myk002 Feb 8, 2023
8c046b0
Merge pull request #2843 from myk002/myk_tailor
myk002 Feb 8, 2023
90767b8
Merge pull request #2852 from myk002/myk_misery
myk002 Feb 8, 2023
252a05b
Auto-update submodules
DFHack-Urist Feb 9, 2023
a41afb8
remove in-progress jobs when protecting fert eggs
myk002 Feb 9, 2023
5e09a1c
Change autoslab to use slab's "topic" field to compare historical id …
johncosker Feb 9, 2023
1fd807f
Mark as dev-only changes: #2848, #2842, #2816, #2792
lethosor Feb 9, 2023
fed3b4d
Hopefully fix CI linux build
johncosker Feb 9, 2023
cf51054
Merge branch 'develop' into fix-autoslab
johncosker Feb 9, 2023
27ff6c9
Remove debug logging
johncosker Feb 9, 2023
d27041e
Remove debug logging
johncosker Feb 9, 2023
7cc3c08
Auto-update submodules
DFHack-Urist Feb 9, 2023
dad05a9
Merge branch 'develop' into myk_nestboxes_job
myk002 Feb 9, 2023
30ad6c9
Merge pull request #2853 from myk002/myk_nestboxes_job
myk002 Feb 9, 2023
6795a4a
Further simplify check for engraved slabs
johncosker Feb 9, 2023
99aa4c5
Merge branch 'fix-autoslab' of https://github.com/johncosker/dfhack i…
johncosker Feb 9, 2023
f6ab163
Cleanup
johncosker Feb 9, 2023
497d8e1
Merge pull request #2854 from johncosker/fix-autoslab
myk002 Feb 9, 2023
991c6d8
Fix annotation parse error
vallode Feb 9, 2023
0e8d7a4
Merge pull request #2857 from vallode/annotation-parse-error-fix
myk002 Feb 10, 2023
e160bd0
Auto-update submodules
DFHack-Urist Feb 10, 2023
533ccee
Detect manual save
robob27 Feb 10, 2023
960bfac
fix annotation parsing
myk002 Feb 10, 2023
13f96b9
increase frequency of nestbox scanning
myk002 Feb 10, 2023
c8b5f66
Merge branch 'develop' into detect-manual-save
myk002 Feb 10, 2023
1c8b662
Merge pull request #2860 from robob27/detect-manual-save
myk002 Feb 10, 2023
823e7e3
dev-ify changelog
myk002 Feb 10, 2023
ee10aa9
sync tags from spreadsheet
myk002 Feb 10, 2023
588df3e
Update stonesense, changelog for dfhack/stonesense#97
lethosor Feb 10, 2023
dd925f7
Un-dev-ify two changes that appear to be new to end-users since 0.47.…
lethosor Feb 10, 2023
616d8d1
Auto-update submodules
DFHack-Urist Feb 10, 2023
5100a7e
bump to 50.07-alpha1
myk002 Feb 10, 2023
ad78427
mark autolabor as tested and update scripts
myk002 Feb 10, 2023
ecce87e
Update authors (changes since 50.05-alpha0)
lethosor Feb 10, 2023
9434cd3
Fix and detect duplicates in Authors.rst
lethosor Feb 10, 2023
1390e72
nestboxes: avoid forbidding non-eggs
lethosor Feb 11, 2023
de1a4fb
Update changelog
lethosor Feb 11, 2023
c89b61a
Merge remote-tracking branch 'lethosor/nestboxes-fix-forbid' into dev…
lethosor Feb 11, 2023
3fb172f
Auto-update submodules
DFHack-Urist Feb 11, 2023
3756d59
copy edit overlay dev guide and update examples
myk002 Feb 11, 2023
1d32059
Merge remote-tracking branch 'remotes/dfhack/develop' into imtui
20k Feb 11, 2023
ac44bb8
Merge remote-tracking branch 'origin/v0.47.05' into HEAD
myk002 May 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@
[submodule "depends/googletest"]
path = depends/googletest
url = ../../google/googletest.git
[submodule "depends/imtui"]
path = depends/imtui
url = https://github.com/ggerganov/imtui.git
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)

if(MSVC)
# increase warning level and treat warnings as errors
add_compile_options("/WX")
#add_compile_options("/WX")
20k marked this conversation as resolved.
Show resolved Hide resolved
add_compile_options("/W3")

# disable C4819 code-page warning
Expand Down Expand Up @@ -419,6 +419,8 @@ include_directories(depends/tthread)
include_directories(${ZLIB_INCLUDE_DIRS})
include_directories(depends/clsocket/src)
include_directories(depends/xlsxio/include)
include_directories(depends/imtui/include)
include_directories(depends/imtui/third-party/imgui)
add_subdirectory(depends)

# Testing with CTest
Expand Down
4 changes: 4 additions & 0 deletions depends/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,7 @@ if(MSVC)
target_compile_options(xlsxio_read_STATIC PRIVATE /wd4013 /wd4244)
target_compile_options(xlsxio_write_STATIC PRIVATE /wd4013 /wd4244)
endif()

set(IMTUI_SUPPORT_NCURSES OFF CACHE BOOL "")
set(IMTUI_SUPPORT_CURL OFF CACHE BOOL "")
add_subdirectory(imtui)
1 change: 1 addition & 0 deletions depends/imtui
Submodule imtui added at f366b7
4 changes: 3 additions & 1 deletion library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ set(MODULE_HEADERS
include/modules/Graphic.h
include/modules/Gui.h
include/modules/GuiHooks.h
include/modules/ImTuiImpl.h
Copy link
Member

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

include/modules/Items.h
include/modules/Job.h
include/modules/Kitchen.h
Expand All @@ -154,6 +155,7 @@ set(MODULE_SOURCES
modules/Filesystem.cpp
modules/Graphic.cpp
modules/Gui.cpp
modules/ImTuiImpl.cpp
modules/Items.cpp
modules/Job.cpp
modules/Kitchen.cpp
Expand Down Expand Up @@ -399,7 +401,7 @@ if(APPLE)
set_target_properties(dfhack PROPERTIES SOVERSION 1.0.0)
endif()

target_link_libraries(dfhack protobuf-lite clsocket lua jsoncpp_static dfhack-version ${PROJECT_LIBS})
target_link_libraries(dfhack protobuf-lite clsocket lua jsoncpp_static dfhack-version imtui ${PROJECT_LIBS})
set_target_properties(dfhack PROPERTIES INTERFACE_LINK_LIBRARIES "")

target_link_libraries(dfhack-client protobuf-lite clsocket jsoncpp_static)
Expand Down
13 changes: 13 additions & 0 deletions library/LuaApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,18 @@ static int dfhack_persistent_deleteTilemask(lua_State *state)
return 1;
}

static int debug_ImGui(lua_State* state)
{
ImGui::Begin("Hello");

ImGui::Text("Hello there!");

ImGui::End();

lua_pushboolean(state, true);
return 1;
}

static const luaL_Reg dfhack_persistent_funcs[] = {
{ "get", dfhack_persistent_get },
{ "delete", dfhack_persistent_delete },
Expand Down Expand Up @@ -3340,6 +3352,7 @@ static const luaL_Reg dfhack_internal_funcs[] = {
{ "getCommandDescription", internal_getCommandDescription },
{ "threadid", internal_threadid },
{ "md5File", internal_md5file },
{ "debugImGui", debug_ImGui },
{ NULL, NULL }
};

Expand Down
38 changes: 38 additions & 0 deletions library/include/modules/ImTuiImpl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#pragma once

#include "imtui/imtui.h"

struct ImGuiContext;

namespace ImTuiInterop
{
namespace impl
{
void init_current_context();

void new_frame();

void draw_frame();

void shutdown();
}

struct ui_state
{
ImGuiContext* last_context;
ImGuiContext* ctx;

ui_state();

void activate();

void new_frame();

void draw_frame();

void deactivate();
};

//returns an inactive imgui context system
ui_state make_ui_system();
}
2 changes: 2 additions & 0 deletions library/include/modules/Screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ distribution.
#include "df/zoom_commands.h"

#include "modules/GuiHooks.h"
#include "modules/ImTuiImpl.h"

namespace df
{
Expand Down Expand Up @@ -355,6 +356,7 @@ namespace DFHack
};

class DFHACK_EXPORT dfhack_lua_viewscreen : public dfhack_viewscreen {
ImTuiInterop::ui_state st;
std::string focus;

void update_focus(lua_State *L, int idx);
Expand Down