From a7121a2f80252155f94f56a4befd7d4aed47c3cb Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sun, 10 Sep 2023 04:26:02 -0700 Subject: [PATCH 01/32] revert the temporary linux structures override now that the windows and linux structures are aligned again --- .github/workflows/build-linux.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 16f75118c..aa5571e0b 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -92,13 +92,6 @@ jobs: repository: ${{ inputs.structures_ref && github.repository || 'DFHack/df-structures' }} ref: ${{ inputs.structures_ref }} path: library/xml - - name: Clone structures (temporary override) - if: '!inputs.structures_ref' - uses: actions/checkout@v3 - with: - repository: DFHack/df-structures - ref: refs/heads/linux - path: library/xml - name: Fetch ccache if: inputs.platform-files uses: actions/cache/restore@v3 From 2e11c91a103c784e5e16d5e4295ac9fe7cedc7c3 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sun, 10 Sep 2023 03:00:42 -0700 Subject: [PATCH 02/32] format string didn't match my system; generalizing --- library/Process-linux.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Process-linux.cpp b/library/Process-linux.cpp index e50750015..0509f5710 100644 --- a/library/Process-linux.cpp +++ b/library/Process-linux.cpp @@ -138,7 +138,7 @@ void Process::getMemRanges( vector & ranges ) { t_memrange temp; temp.name[0] = 0; - sscanf(buffer, "%zx-%zx %s %zx %2zx:%2zx %zu %[^\n]", + sscanf(buffer, "%zx-%zx %s %zx %zx:%zx %zu %[^\n]", &start, &end, (char*)&permissions, From 905438be9694ba1c098c797d31e773996d6a1f6b Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Mon, 11 Sep 2023 23:21:55 -0700 Subject: [PATCH 03/32] update xml ref to 5010-testing --- library/xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xml b/library/xml index 4097a59a4..2ff6363ac 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 4097a59a467b497d4d97c640e6b96b7d90b69dee +Subproject commit 2ff6363ac748deec3bb5a024e22792716003fc9b From 22f68223a195ca1683660591a1abde79e653e6af Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Tue, 12 Sep 2023 01:03:36 -0700 Subject: [PATCH 04/32] update structures ref --- library/xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xml b/library/xml index 2ff6363ac..11e6d859a 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 2ff6363ac748deec3bb5a024e22792716003fc9b +Subproject commit 11e6d859a03e3530d67514aa9305c7be73442e67 From a829358af095933b68b9dc9e3f2a1eeb7e69da7c Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Tue, 12 Sep 2023 15:57:04 -0500 Subject: [PATCH 05/32] update structures --- library/xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xml b/library/xml index 11e6d859a..7cc3ffe35 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 11e6d859a03e3530d67514aa9305c7be73442e67 +Subproject commit 7cc3ffe3542a7736ae5fa458f2d5382eeeb6ead5 From f8b2297ddc2210649e36e73cb64282b7fb083f23 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Tue, 12 Sep 2023 18:41:50 -0700 Subject: [PATCH 06/32] update xml ref --- library/xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xml b/library/xml index 7cc3ffe35..7c2a6fc6f 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 7cc3ffe3542a7736ae5fa458f2d5382eeeb6ead5 +Subproject commit 7c2a6fc6f94de4512c25fffb6937e81987a84c92 From 8b1b413195a742071f21e1b06c766fc855b94b2d Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Tue, 12 Sep 2023 21:34:57 -0500 Subject: [PATCH 07/32] update version spec --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bb5cab7a..a6d1b7c41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,9 +7,9 @@ cmake_policy(SET CMP0074 NEW) project(dfhack) # set up versioning. -set(DF_VERSION "50.09") -set(DFHACK_RELEASE "r3") -set(DFHACK_PRERELEASE FALSE) +set(DF_VERSION "50.10") +set(DFHACK_RELEASE "beta1") +set(DFHACK_PRERELEASE TRUE) set(DFHACK_VERSION "${DF_VERSION}-${DFHACK_RELEASE}") set(DFHACK_ABI_VERSION 1) From 673d9d523099a2497a7c3f24f256dcae0893d0e6 Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Tue, 12 Sep 2023 21:55:55 -0500 Subject: [PATCH 08/32] bodge DataIdentity to get 50.10 working --- library/DataIdentity.cpp | 3 +++ library/include/DataIdentity.h | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/library/DataIdentity.cpp b/library/DataIdentity.cpp index 8e9467c5b..767724931 100644 --- a/library/DataIdentity.cpp +++ b/library/DataIdentity.cpp @@ -47,7 +47,10 @@ namespace df { STL_OPAQUE_IDENTITY_TRAITS(condition_variable); STL_OPAQUE_IDENTITY_TRAITS(fstream); STL_OPAQUE_IDENTITY_TRAITS(mutex); + STL_OPAQUE_IDENTITY_TRAITS(shared_ptr); STL_OPAQUE_IDENTITY_TRAITS(future); + STL_OPAQUE_IDENTITY_TRAITS(function); + STL_OPAQUE_IDENTITY_TRAITS(optional >); buffer_container_identity buffer_container_identity::base_instance; } diff --git a/library/include/DataIdentity.h b/library/include/DataIdentity.h index 07e85e8a8..4f275b854 100644 --- a/library/include/DataIdentity.h +++ b/library/include/DataIdentity.h @@ -30,6 +30,7 @@ distribution. #include #include #include +#include #include "DataDefs.h" @@ -38,6 +39,10 @@ namespace std { class mutex; }; +namespace df { + class widget; +} + /* * Definitions of DFHack namespace structs used by generated headers. */ @@ -573,6 +578,9 @@ namespace df OPAQUE_IDENTITY_TRAITS(std::fstream); OPAQUE_IDENTITY_TRAITS(std::mutex); OPAQUE_IDENTITY_TRAITS(std::future); + OPAQUE_IDENTITY_TRAITS(std::shared_ptr); + OPAQUE_IDENTITY_TRAITS(std::function); + OPAQUE_IDENTITY_TRAITS(std::optional >); template<> struct DFHACK_EXPORT identity_traits { static bool_identity identity; From dbee92cd817dd2760a8c406a042327977d30f2c7 Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Tue, 12 Sep 2023 22:01:58 -0500 Subject: [PATCH 09/32] `widget` is a `struct` not a `class` at least as far as df-structures is concerned... --- library/include/DataIdentity.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/include/DataIdentity.h b/library/include/DataIdentity.h index 4f275b854..ff15535d1 100644 --- a/library/include/DataIdentity.h +++ b/library/include/DataIdentity.h @@ -40,7 +40,7 @@ namespace std { }; namespace df { - class widget; + struct widget; } /* From fd676fa70f0870dce209f8554dca40b551ed8ec0 Mon Sep 17 00:00:00 2001 From: lethosor Date: Tue, 12 Sep 2023 23:37:56 -0400 Subject: [PATCH 10/32] Add identity_traits for std::unordered_map --- library/include/DataIdentity.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/library/include/DataIdentity.h b/library/include/DataIdentity.h index ff15535d1..05df82e79 100644 --- a/library/include/DataIdentity.h +++ b/library/include/DataIdentity.h @@ -25,12 +25,13 @@ distribution. #pragma once #include +#include #include +#include #include #include +#include #include -#include -#include #include "DataDefs.h" @@ -661,6 +662,10 @@ namespace df static container_identity *get(); }; + template struct identity_traits> { + static container_identity *get(); + }; + template<> struct identity_traits > { static bit_array_identity identity; static bit_container_identity *get() { return &identity; } @@ -738,6 +743,13 @@ namespace df return &identity; } + template + inline container_identity *identity_traits>::get() { + typedef std::unordered_map container; + static ro_stl_assoc_container_identity identity("unordered_map", identity_traits::get(), identity_traits::get()); + return &identity; + } + template inline bit_container_identity *identity_traits >::get() { static bit_array_identity identity(identity_traits::get()); From a43522351f60c3a13be145390dd3230835dc31ab Mon Sep 17 00:00:00 2001 From: lethosor Date: Tue, 12 Sep 2023 23:42:50 -0400 Subject: [PATCH 11/32] check-structures-sanity: ignore std::unordered_map --- plugins/devel/check-structures-sanity/dispatch.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/devel/check-structures-sanity/dispatch.cpp b/plugins/devel/check-structures-sanity/dispatch.cpp index d57beb0cb..c0d4764f9 100644 --- a/plugins/devel/check-structures-sanity/dispatch.cpp +++ b/plugins/devel/check-structures-sanity/dispatch.cpp @@ -377,10 +377,14 @@ void Checker::dispatch_container(const QueueItem & item, const CheckedStructure { // TODO: check DfArray } - else if (base_container.substr(0, 4) == "map<") + else if (base_container.starts_with("map<")) { // TODO: check map } + else if (base_container.starts_with("unordered_map<")) + { + // TODO: check unordered_map + } else { UNEXPECTED; From d2ae5463df742df1d0cec2ad5f9976cc3eb5ed8c Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Tue, 12 Sep 2023 22:58:26 -0700 Subject: [PATCH 12/32] update xml ref --- library/xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xml b/library/xml index 7c2a6fc6f..3875c956f 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 7c2a6fc6f94de4512c25fffb6937e81987a84c92 +Subproject commit 3875c956f125105eaf430b5ccc4b5c00d72dc7e2 From 863df21dd216e51dce1dd0756a908f4726be6505 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Tue, 12 Sep 2023 23:08:55 -0700 Subject: [PATCH 13/32] protect against missing keys param --- library/modules/Screen.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/library/modules/Screen.cpp b/library/modules/Screen.cpp index cce06d284..5f98c40e5 100644 --- a/library/modules/Screen.cpp +++ b/library/modules/Screen.cpp @@ -962,6 +962,7 @@ int dfhack_lua_viewscreen::do_input(lua_State *L) if (!self) return 0; auto keys = (std::set*)lua_touserdata(L, 2); + if (!keys) return 0; lua_getfield(L, -1, "onInput"); From 9ea68d38c57497876e59f3b076489af564452a43 Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Wed, 13 Sep 2023 13:57:55 -0500 Subject: [PATCH 14/32] sync structures --- library/xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xml b/library/xml index 3875c956f..9fb4bb450 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 3875c956f125105eaf430b5ccc4b5c00d72dc7e2 +Subproject commit 9fb4bb45022361704daf14f59de4160d518503d3 From a7e59c8f77e068370f4cf77d57ee2b572ed75a47 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Wed, 13 Sep 2023 17:06:33 -0700 Subject: [PATCH 15/32] update xml ref --- library/xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xml b/library/xml index 9fb4bb450..ce3982598 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 9fb4bb45022361704daf14f59de4160d518503d3 +Subproject commit ce39825984a344a0b569c66ea08d29529e00cf37 From d9cae63e4e127ecc4291bd8cd54f4cc262535b0f Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Wed, 13 Sep 2023 18:02:44 -0700 Subject: [PATCH 16/32] move dfhack logo over a little --- plugins/lua/hotkeys.lua | 11 +++++++++-- plugins/lua/overlay.lua | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/plugins/lua/hotkeys.lua b/plugins/lua/hotkeys.lua index 43d11bbda..be1a95570 100644 --- a/plugins/lua/hotkeys.lua +++ b/plugins/lua/hotkeys.lua @@ -26,9 +26,10 @@ end HotspotMenuWidget = defclass(HotspotMenuWidget, overlay.OverlayWidget) HotspotMenuWidget.ATTRS{ - default_pos={x=2,y=2}, + default_pos={x=5,y=1}, default_enabled=true, - hotspot=true, + hotspot=false, + version=2, viewscreens={ 'adopt_region', 'choose_game_type', @@ -170,10 +171,16 @@ end function Menu:init() local hotkeys, bindings = getHotkeys() + if #hotkeys == 0 then + hotkeys = {''} + bindings = {['']='gui/launcher'} + end local is_inverted = not not self.hotspot.frame.b local choices,list_width = get_choices(hotkeys, bindings, is_inverted) + list_width = math.max(35, list_width) + local list_frame = copyall(self.hotspot.frame) local list_widget_frame = {h=math.min(#choices, MAX_LIST_HEIGHT)} local quickstart_frame = {} diff --git a/plugins/lua/overlay.lua b/plugins/lua/overlay.lua index 55ca44bc9..d3f0b9c9d 100644 --- a/plugins/lua/overlay.lua +++ b/plugins/lua/overlay.lua @@ -581,7 +581,8 @@ end TitleVersionOverlay = defclass(TitleVersionOverlay, OverlayWidget) TitleVersionOverlay.ATTRS{ - default_pos={x=7, y=2}, + default_pos={x=11, y=1}, + version=2, default_enabled=true, viewscreens='title/Default', frame={w=35, h=5}, From 96f6893a320607a700ab74eb35be0e5bccf28bac Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Wed, 13 Sep 2023 18:02:52 -0700 Subject: [PATCH 17/32] update xml ref --- library/xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xml b/library/xml index ce3982598..649505331 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit ce39825984a344a0b569c66ea08d29529e00cf37 +Subproject commit 649505331539bbdccccd900e751ff9ee9b2d1665 From 561f447a548da02c252609adf3d0abf8036b9fc0 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Wed, 13 Sep 2023 18:17:23 -0700 Subject: [PATCH 18/32] update xml ref --- library/xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xml b/library/xml index 649505331..3d9c46b10 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 649505331539bbdccccd900e751ff9ee9b2d1665 +Subproject commit 3d9c46b105181cc9afde943993aa4ad433bf87cf From 49e449a422cf746d87813cb7f3a1c1ceb12bcde6 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Wed, 13 Sep 2023 18:20:49 -0700 Subject: [PATCH 19/32] update xml ref --- library/xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xml b/library/xml index 3d9c46b10..be6abfb4a 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 3d9c46b105181cc9afde943993aa4ad433bf87cf +Subproject commit be6abfb4af929c1445dc91aa51aade44ca62ac57 From 017e280b181bb4a31f29bfd382bb9b6a80b732af Mon Sep 17 00:00:00 2001 From: lethosor Date: Wed, 13 Sep 2023 21:57:28 -0400 Subject: [PATCH 20/32] Define identity_traits> for all T (opaque for now) --- library/DataIdentity.cpp | 1 - library/include/DataIdentity.h | 17 ++++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/library/DataIdentity.cpp b/library/DataIdentity.cpp index 767724931..c041b009d 100644 --- a/library/DataIdentity.cpp +++ b/library/DataIdentity.cpp @@ -47,7 +47,6 @@ namespace df { STL_OPAQUE_IDENTITY_TRAITS(condition_variable); STL_OPAQUE_IDENTITY_TRAITS(fstream); STL_OPAQUE_IDENTITY_TRAITS(mutex); - STL_OPAQUE_IDENTITY_TRAITS(shared_ptr); STL_OPAQUE_IDENTITY_TRAITS(future); STL_OPAQUE_IDENTITY_TRAITS(function); STL_OPAQUE_IDENTITY_TRAITS(optional >); diff --git a/library/include/DataIdentity.h b/library/include/DataIdentity.h index 05df82e79..035f59d4b 100644 --- a/library/include/DataIdentity.h +++ b/library/include/DataIdentity.h @@ -40,10 +40,6 @@ namespace std { class mutex; }; -namespace df { - struct widget; -} - /* * Definitions of DFHack namespace structs used by generated headers. */ @@ -579,10 +575,21 @@ namespace df OPAQUE_IDENTITY_TRAITS(std::fstream); OPAQUE_IDENTITY_TRAITS(std::mutex); OPAQUE_IDENTITY_TRAITS(std::future); - OPAQUE_IDENTITY_TRAITS(std::shared_ptr); OPAQUE_IDENTITY_TRAITS(std::function); OPAQUE_IDENTITY_TRAITS(std::optional >); +#ifdef BUILD_DFHACK_LIB + template + struct DFHACK_EXPORT identity_traits> { + static opaque_identity *get() { + typedef std::shared_ptr type; + static std::string name = std::string("shared_ptr<") + typeid(T).name() + ">"; + static opaque_identity identity(sizeof(type), allocator_noassign_fn, name); + return &identity; + } + }; +#endif + template<> struct DFHACK_EXPORT identity_traits { static bool_identity identity; static bool_identity *get() { return &identity; } From b11a3ead1e1e711453c6875f15d445ca75aceb08 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 14 Sep 2023 01:31:19 -0700 Subject: [PATCH 21/32] make DFHack logo respond to clicks, not mouseover --- data/art/{dfhack.png => logo.png} | Bin data/art/logo_hovered.png | Bin 0 -> 997 bytes plugins/lua/hotkeys.lua | 82 ++++++++++++++---------------- 3 files changed, 39 insertions(+), 43 deletions(-) rename data/art/{dfhack.png => logo.png} (100%) create mode 100644 data/art/logo_hovered.png diff --git a/data/art/dfhack.png b/data/art/logo.png similarity index 100% rename from data/art/dfhack.png rename to data/art/logo.png diff --git a/data/art/logo_hovered.png b/data/art/logo_hovered.png new file mode 100644 index 0000000000000000000000000000000000000000..133dc5aaf8c98921bcc0203ebd986d4915c726cd GIT binary patch literal 997 zcmVnc%n2qL3P&<7QL*(pc~60K|QZ+CX5 z;r-SBwq*l8=FOWo^ZxVkd(Y-drP9<$GT^te@}oi4gTZeG=04pzox7!}!DP^iPEJnb z^z!l&qtEASZEgJ@4@hz}8uNO+&2_22zyJ337RqaDYr4vy~Zk>hAI`tBScAgimZ zJPiZ_7~9&~q>eIup96fgoK8=bN~1dPHe{4v-m7)1n7!BRz#ibbDJ`dCz-2uqU5 zBr#0u>+4lQw7I#7Zv-4MGJ{8Cuqp!rA&?odB25~dPA9EG&RAU&u3;1=BnV4nhBLkl z0No@!I5^;2LF+&bQAbAyU5%(2Vq&ovuRc9J?eFiSw6KaVW>n{Xo|u>b`l2^$HX2OG zn4%AMc6JEP$o<8|1sI3JL2C2!^ER7}lzV%70eLkWjhY3gqb>#X!$c;Nq5kUb?$%yM zur9#|R|NodZf@@8=BA1RqtS>F8o+wK0M5_PF^-RqQ!8CxUo$|#0a*t_`a?rQ0|Ns( z&lW-g9G?o2;)68a-QAI0ATt=qv8p^|AVCb3>qyOk#bV(TF%^qN+6e;g)5Wr}vB3(2 z-U>je4({*oF+M&%YSG{2av@5rGc`3u)s@TT@x<_IAkWC_OzrD)xN@i{x{N2+d4wh^Ns$-9OL7E%=7wV?~0|2#6)Vmyserf;!01jnXNoGw=04e|g00;m800000 T0Mb*F00000NkvXXu0mjfn&!gY literal 0 HcmV?d00001 diff --git a/plugins/lua/hotkeys.lua b/plugins/lua/hotkeys.lua index be1a95570..f74b54416 100644 --- a/plugins/lua/hotkeys.lua +++ b/plugins/lua/hotkeys.lua @@ -5,7 +5,8 @@ local helpdb = require('helpdb') local overlay = require('plugins.overlay') local widgets = require('gui.widgets') -local textures = dfhack.textures.loadTileset('hack/data/art/dfhack.png', 8, 12) +local logo_textures = dfhack.textures.loadTileset('hack/data/art/logo.png', 8, 12) +local logo_hovered_textures = dfhack.textures.loadTileset('hack/data/art/logo_hovered.png', 8, 12) local function get_command(cmdline) local first_word = cmdline:trim():split(' +')[1] @@ -28,7 +29,6 @@ HotspotMenuWidget = defclass(HotspotMenuWidget, overlay.OverlayWidget) HotspotMenuWidget.ATTRS{ default_pos={x=5,y=1}, default_enabled=true, - hotspot=false, version=2, viewscreens={ 'adopt_region', @@ -48,54 +48,50 @@ HotspotMenuWidget.ATTRS{ 'update_region', 'world' }, - overlay_onupdate_max_freq_seconds=0, frame={w=4, h=3} } function HotspotMenuWidget:init() - self.mouseover = false -end - -function HotspotMenuWidget:overlay_onupdate() - local hasMouse = self:getMousePos() - if hasMouse and not self.mouseover then - self.mouseover = true - return true + local to_pen = dfhack.pen.parse + local function tp(idx, ch) + return to_pen{ + tile=function() return dfhack.textures.getTexposByHandle(logo_textures[idx]) end, + ch=ch, + fg=COLOR_GREY, + } + end + local function tph(idx, ch) + return to_pen{ + tile=function() return dfhack.textures.getTexposByHandle(logo_hovered_textures[idx]) end, + ch=ch, + fg=COLOR_WHITE, + } + end + local function get_tile_token(idx, ch) + return { + tile=tp(idx, ch), + htile=tph(idx, ch), + width=1, + } end - self.mouseover = hasMouse -end -function HotspotMenuWidget:overlay_trigger() - return MenuScreen{hotspot=self}:show() + self:addviews{ + widgets.Label{ + text={ + get_tile_token(1, '!'), get_tile_token(2, 'D'), get_tile_token(3, 'F'), get_tile_token(4, '!'), NEWLINE, + get_tile_token(5, '!'), get_tile_token(6, 'H'), get_tile_token(7, 'a'), get_tile_token(8, '!'), NEWLINE, + get_tile_token(9, '!'), get_tile_token(10, 'c'), get_tile_token(11, 'k'), get_tile_token(12, '!'), + }, + }, + } end -local dscreen = dfhack.screen - -function HotspotMenuWidget:onRenderBody(dc) - local x, y = dc.x, dc.y - local tp = function(offset) - return dfhack.textures.getTexposByHandle(textures[offset]) - end - - if tp(1) == nil then - dscreen.paintString(COLOR_WHITE, x, y + 0, '!DF!') - dscreen.paintString(COLOR_WHITE, x, y + 1, '!Ha!') - dscreen.paintString(COLOR_WHITE, x, y + 2, '!ck!') - else - dscreen.paintTile(COLOR_WHITE, x + 0, y + 0, '!', tp(1)) - dscreen.paintTile(COLOR_WHITE, x + 1, y + 0, 'D', tp(2)) - dscreen.paintTile(COLOR_WHITE, x + 2, y + 0, 'F', tp(3)) - dscreen.paintTile(COLOR_WHITE, x + 3, y + 0, '!', tp(4)) - - dscreen.paintTile(COLOR_WHITE, x + 0, y + 1, '!', tp(5)) - dscreen.paintTile(COLOR_WHITE, x + 1, y + 1, 'H', tp(6)) - dscreen.paintTile(COLOR_WHITE, x + 2, y + 1, 'a', tp(7)) - dscreen.paintTile(COLOR_WHITE, x + 3, y + 1, '!', tp(8)) - - dscreen.paintTile(COLOR_WHITE, x + 0, y + 2, '!', tp(9)) - dscreen.paintTile(COLOR_WHITE, x + 1, y + 2, 'c', tp(10)) - dscreen.paintTile(COLOR_WHITE, x + 2, y + 2, 'k', tp(11)) - dscreen.paintTile(COLOR_WHITE, x + 3, y + 2, '!', tp(12)) +function HotspotMenuWidget:onInput(keys) + if HotspotMenuWidget.super.onInput(self, keys) then + return true + elseif keys._MOUSE_L_DOWN and self:getMousePos() then + MenuScreen{hotspot=self}:show() + return true end end @@ -290,7 +286,7 @@ function Menu:onInput(keys) df.global.enabler.mouse_lbut = 0 return true end - if not self:getMouseFramePos() and not self.hotspot:getMousePos() then + if not self:getMouseFramePos() then self.parent_view:dismiss() return true end From b6c4eb77010fe956812710cbb70d44ba12410cb7 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 14 Sep 2023 09:59:36 -0700 Subject: [PATCH 22/32] realign tooltip ids in confirm --- plugins/lua/confirm.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/lua/confirm.lua b/plugins/lua/confirm.lua index 1ddf190b4..2fcbfa721 100644 --- a/plugins/lua/confirm.lua +++ b/plugins/lua/confirm.lua @@ -82,7 +82,7 @@ haul_delete_stop.message = "Are you sure you want to delete this stop?" depot_remove = defconf('depot-remove') function depot_remove.intercept_key(key) - if df.global.game.main_interface.current_hover == 299 and + if df.global.game.main_interface.current_hover == 301 and key == MOUSE_LEFT and df.building_tradedepotst:is_instance(dfhack.gui.getSelectedBuilding(true)) then for _, caravan in pairs(df.global.plotinfo.caravans) do @@ -98,7 +98,7 @@ depot_remove.message = "Are you sure you want to remove this depot?\n" .. squad_disband = defconf('squad-disband') function squad_disband.intercept_key(key) - return key == MOUSE_LEFT and df.global.game.main_interface.current_hover == 341 + return key == MOUSE_LEFT and df.global.game.main_interface.current_hover == 343 end squad_disband.title = "Disband squad" squad_disband.message = "Are you sure you want to disband this squad?" From 3634075df0f9ffb9b88b7c8cac9ff11f57cee3be Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 14 Sep 2023 10:12:25 -0700 Subject: [PATCH 23/32] make DFHack logo glow on hover --- data/art/logo_hovered.png | Bin 997 -> 5124 bytes plugins/lua/hotkeys.lua | 10 +--------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/data/art/logo_hovered.png b/data/art/logo_hovered.png index 133dc5aaf8c98921bcc0203ebd986d4915c726cd..fe82cc1aed28be37d973b2f915e16be918785e4d 100644 GIT binary patch literal 5124 zcmeHKYg7~079KzpDcGQ>NWnV>RJ2Z#NkT|cf+7To5Y9%lb7K!bO7ysTa&y40 zUxXj+HJyf{$9i4-uGd=7^(lqF^zZU_R%+q08h0G9vZ0iL zRW3fA9%}}(NT*1mTyv{bZp$W7Rm8hLymg|9IJ)~T_mTe>!w)liMrdoq5~Vbo1L?Zz zZaAuaW+?`WcQ#!446S<#kMwHD=Sn7@yhDW`lP!doSAf9F>v=vPi@c3HdA?sQ zbGZ2awUxog$XZg|rGWgNLULxMCI3i3%+?S`KgzRB3#LfbT3uE?BB@rQPMO?_+uHRQJOvYSF zPcBjC-*%ZES~oqAH1A*f0xOFJ-0N^uPL>3{g$8iZz?vA``Zo zQFJLkFN~l&ulVDdt)+R#vyaa&nqt*vdTxVUadKmx2Q;U9ae|qHgJ~E4o5(@EP8X#Z z*-tziG-KRQW$fCS+79YYPk{Og75Z_-3K<2HC`33#FH?fTgCO^%dL<^_fNNk89!1D` zJ3{$XGysYoQJTZAuNq)rxqP z80TwoxyETCghV`UuZ&m48q<-8sdy|d1FCA^6@AI&3V|?S+`>RX6d_X@tpM3CX=(`R z3$k8{&9GujXJR10d>r>B?dQ20m4TK}$n{o;;|<{nym@4Uf38F!CL~fuY=#?S0+c|m)?jimZh!*d6awI&I0u-qaD+v7lORmG zgoR)nmK5QLIZ`(k9c8lF_yh=l6#=Rei=7yi0ZIa(FfmQ)hOsz^2&KCrOeOI|&&Ug;SOCD5DPp;atxE0gp_l&|XLaVlj;r81Tq` zggjpVVj+l-;cGRRflZXfVY;Cx>WYGp8En=Ir4U@D29;>QL}?TT)3{>T7A{Bz5Q`b= z6aX0IAQ!He3db}GRggjv%Oe{?f(@4A%Rjl)HmK`4z&bLF}M z`rWv+3Hk~NAx-#S+J@$V-AA|Fmrw)$2}aRqN3F%TP5YD|ku zjBx_2(Is&-CXd3w=`mKW&*jA5l!8ctqiz@tM=-G)iZDT8AtDJ=gkWx<7BF1u>dG9= zY8+jykZN?83ipfxJOZvjc^bKbU5p#G=;c^+(YRq30AUD?gZz~+>R7^5!BOgLnK-KY#4Uf?XGjvt0&oPl`%$=}#s{F5$V__dQ);`cROujzUv23|?|b#=X_ z>y;RICFR%E^?#$w^2K!umxHe$9k?vze!jQ`T(l;OR;}q5Y4>?6Tgn!aR8obQJZ{$zhqMLg4SaCdqu0~o77sIsV4YVvr<24EVB8yu(R9#El!1n zO-1Xv{(MD$@9i{!iqn^r`otEy-MDXfNnhiWFShrUfB)vWItcnUx%;=~dwahdnbvXl za!zUT(}ApijhLi(+(jpc3un)s-81m$(JUw=BxI83kYieXc#X@4={^U~7c9@lThC0L zmxgKL9}RzSBPQ5(sr&bjYivl%&&qO(iQKQluij%0PYVvdS(JEgwZ+kp<2wpFT1du_spD@0?nFFjUX8?-qTxJX-d z{(O5bZO?AXq`Voc9}K%c8E%kFpOJzdu$w!#m!i$d$?4ftOk5Q0`Qr ze&xra7$a($g0 z>hFa{XZUQ+AUq1Fww5kYzR7B}8KhRL@6O7qKU`eg#IdvLu4*rDDhs85W)*T258Hpo z(a{mxDD?AFzGLp0Uf*?MXwS+bU*}VmmGQ~RKc%gYj<$fvJAEr|9EcPcukj=`C2O@>skHcVh56nKrlyOzHMn~>Dd|3@&hDRc2}3UJEgmEs;&S1fq_X7l}bI?T~k&@`sm`3 z?{3|)Z!g)lZHksUe|^!t_tL-lRaG8Zm+9+ux}w5qhX^K}t*Wx0GsiQDlC#$K*QZaP z4h%5utQPEUXl`C}`PBWj3l=U+`2ES!@avDm%Vlp}ZeljpME0}~R(<`S52zi#J$(Pj Z2o#j-Nb=lLw87Bo0{&|6lI80+{TEB3t%Cpn delta 975 zcmV;=12FuADCGx`B!3xnMObuGZ)S9NVRB^vL1b@YWgtmyVP|DhWnpA_ami&o000AR zNklIMuJ-o!v_=t}TK@FQbar-Dencvj!dNbsrOxQ+Xp5lg4mvwK zVuhku8Mf2?e))v8E_hld9T2in>qHrlmMir6cXf*on93UX8tE)T>1Ogb_+S;U!GJT%|e6^fTPfu$TMsT9z zKvAOU*4CChJ`zX?pqMb3OeTG>J3T#>3&4rp-Cb!N(Vv-_A^!02P%0}$RR!!6Y>@s3Ouxw(mN1ROCkgGXerDgy!` zkQuQeO&Xm}C#^!xSX~pYVH74L2uoy!GrkM}-6T9XIN)1B>p%@rM@I);ji?!7VzC&n zK0Q6{@9(3uu!=8cROf!4n3w?iqBm#X!$c;Nq5kUb?$%yMur9#|R|NodZf@@8=BA1RqtS>F8o+wK z0M5_PF^-RqQ!8CxUo$|#0a*t_`a?rQ0|Ns(&lW-g9G?o2;)68a-QAI0ATt=qv8p^| zAb&v&mFq~&fyH9s6EPKwMcN4h?$gDxv9ZAlgx(53sSfV%?=e0;K5Eh5<#HiPtTQz= zMb(wd<>X#=Aff3`h){fhHo6fxM2m}yNH|V+c6Meqn@NsFMS&h29c^!Kqim4>_V#wj z=_oxtJu3En1dHTzhzQM0ZHTAQN3lq@7)TSIIVi2y*H?ZTebwu_asNS@8~qpRrvL*0 xwN2E!9EpBv0000EWmrjOO-%qQ00008000000002eQ Date: Thu, 14 Sep 2023 10:18:49 -0700 Subject: [PATCH 24/32] update structures ref --- library/xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xml b/library/xml index be6abfb4a..71889ec62 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit be6abfb4af929c1445dc91aa51aade44ca62ac57 +Subproject commit 71889ec62cf615c9c0f1346402b858718d16cf3c From e7762e7bc6124cc5c51a3725a1ca7d48703bfdbf Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 14 Sep 2023 10:20:20 -0700 Subject: [PATCH 25/32] update structures ref --- library/xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xml b/library/xml index 71889ec62..46a365e05 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 71889ec62cf615c9c0f1346402b858718d16cf3c +Subproject commit 46a365e0533f0dffac9f3ce44f3dc992153b1c41 From 04999cae8dfd7c27afcfa57ef0670174299110af Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 14 Sep 2023 10:43:35 -0700 Subject: [PATCH 26/32] unbreak Ctrl-Shift-C --- plugins/lua/hotkeys.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/lua/hotkeys.lua b/plugins/lua/hotkeys.lua index a366e45bb..ac62b49e0 100644 --- a/plugins/lua/hotkeys.lua +++ b/plugins/lua/hotkeys.lua @@ -82,11 +82,15 @@ function HotspotMenuWidget:init() get_tile_token(5, '!'), get_tile_token(6, 'H'), get_tile_token(7, 'a'), get_tile_token(8, '!'), NEWLINE, get_tile_token(9, '!'), get_tile_token(10, 'c'), get_tile_token(11, 'k'), get_tile_token(12, '!'), }, - on_click=function() MenuScreen{hotspot=self}:show() end, + on_click=function() dfhack.run_command('hotkeys') end, }, } end +function HotspotMenuWidget:overlay_trigger() + return MenuScreen{hotspot=self}:show() +end + -- register the menu hotspot with the overlay OVERLAY_WIDGETS = {menu=HotspotMenuWidget} @@ -267,7 +271,7 @@ end function Menu:onInput(keys) if keys.LEAVESCREEN or keys._MOUSE_R_DOWN then return false - elseif keys.STANDARDSCROLL_RIGHT then + elseif keys.KEYBOARD_CURSOR_RIGHT then self:onSubmit2(self.subviews.list:getSelected()) return true elseif keys._MOUSE_L_DOWN then From fc88bfcbbcf8b3a03c39cb6d1692612dffe772b6 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 14 Sep 2023 11:46:30 -0700 Subject: [PATCH 27/32] don't close the logo menu on mouseout now that we no longer open on hover, it doesn't make as much sense, and the behavior can be frustrating when the mouse is moved unintentionally --- docs/plugins/hotkeys.rst | 15 +++++++++------ plugins/lua/hotkeys.lua | 11 ++--------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/docs/plugins/hotkeys.rst b/docs/plugins/hotkeys.rst index 6b2ef3f0c..561a34382 100644 --- a/docs/plugins/hotkeys.rst +++ b/docs/plugins/hotkeys.rst @@ -19,14 +19,17 @@ Usage Menu overlay widget ------------------- -The in-game hotkeys menu is registered with the `overlay` framework and can be -enabled as a hotspot in the upper-left corner of the screen. You can bring up -the menu by hovering the mouse cursor over the hotspot and can select a command -to run from the list by clicking on it with the mouse or by using the keyboard -to select a command with the arrow keys and hitting :kbd:`Enter`. +The in-game hotkeys menu is registered with the `overlay` framework and appears +as a DFHack logo in the upper-left corner of the screen. You can bring up the +menu by clicking on the logo or by hitting the global :kbd:`Ctrl`:kbd:`Shift`:kbd:`c` hotkey. You can select a command to run from +the list by clicking on it with the mouse or by using the keyboard to select a +command with the arrow keys and hitting :kbd:`Enter`. + +The menu closes automatically when an action is taken or when you click or +right click anywhere else on the screen. A short description of the command will appear in a nearby textbox. If you'd like to see the full help text for the command or edit the command before -running, you can open it for editing in `gui/launcher` by right clicking on the +running, you can open it for editing in `gui/launcher` by shift clicking on the command, left clicking on the arrow to the left of the command, or by pressing the right arrow key while the command is selected. diff --git a/plugins/lua/hotkeys.lua b/plugins/lua/hotkeys.lua index ac62b49e0..fae138353 100644 --- a/plugins/lua/hotkeys.lua +++ b/plugins/lua/hotkeys.lua @@ -297,7 +297,7 @@ function Menu:onRenderFrame(dc, rect) self.initialize() self.initialize = nil end - Menu.super.onRenderFrame(dc, rect) + Menu.super.onRenderFrame(self, dc, rect) end function Menu:getMouseFramePos() @@ -306,7 +306,7 @@ function Menu:getMouseFramePos() end function Menu:onRenderBody(dc) - local panel = self.subviews.list_panel + Menu.super.onRenderBody(self, dc) local list = self.subviews.list local idx = list:getIdxUnderMouse() if idx and idx ~= self.last_mouse_idx then @@ -316,13 +316,6 @@ function Menu:onRenderBody(dc) list:setSelected(idx) self.last_mouse_idx = idx end - if self:getMouseFramePos() then - self.mouseover = true - elseif self.mouseover then - -- once the mouse has entered the list area, leaving the frame should - -- close the menu screen - self.parent_view:dismiss() - end end -- ---------- -- From 540bd602af8f0e96313ab480e6f2ba17ae21f4b5 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 14 Sep 2023 11:47:15 -0700 Subject: [PATCH 28/32] revise quickstart guide --- docs/Quickstart.rst | 220 +++++++++++++++++++++++--------------------- 1 file changed, 116 insertions(+), 104 deletions(-) diff --git a/docs/Quickstart.rst b/docs/Quickstart.rst index f4a022a9c..8016a99b2 100644 --- a/docs/Quickstart.rst +++ b/docs/Quickstart.rst @@ -45,67 +45,75 @@ Here are some common tasks people use DFHack tools to accomplish: - Quickly scan the map for visible ores of specific types so you can focus your mining efforts -Some tools are one-shot commands. For example, you can run `unforbid all ` -to claim all (reachable) items on the map after a messy siege. - -Other tools must be `enabled ` and then they will run in the background. -For example, `enable seedwatch ` will start monitoring your stocks of -seeds and prevent your chefs from cooking seeds that you need for planting. -Tools that are enabled in the context of a fort will save their state with that -fort, and they will remember that they are enabled the next time you load your save. - -A third class of tools add information to the screen or provide new integrated -functionality via the DFHack `overlay` framework. For example, the `unsuspend` -tool, in addition to its basic function of unsuspending all building construction -jobs, can also overlay a marker on suspended buildings to indicate that they are -suspended (and will use different markers to tell you whether this is a problem). +Some tools are one-shot commands. For example, you can run +`unforbid all ` to claim all (reachable) items on the map after a +messy siege. + +Other tools must be `enabled ` once and then they will run in the +background. For example, once enabled, `seedwatch` will start monitoring your +stocks of seeds and prevent your chefs from cooking seeds that you need for +planting. Tools that are enabled in the context of a fort will save their state +with that fort, and they will remember that they are enabled the next time you +load your save. + +A third class of tools adds information to the screen or provides new integrated +functionality via the DFHack `overlay` framework. For example, the `sort` tool +adds widgets to the squad member selection screen that allow you to search, +sort, and filter the list of military candidates. You don't have to run any +command to get the benefits of the tool, it appears automatically when you're +on the relevant screen. How can I figure out which commands to run? ------------------------------------------- -There are several ways to scan DFHack tools and find the ones you need right now. +There are several ways to scan DFHack tools and find the ones you need right +now. -The first place to check is the DFHack logo hover hotspot. It's in the upper -left corner of the screen by default, though you can move it anywhere you want -with the `gui/overlay` configuration UI. +The first place to check is the DFHack logo menu. It's in the upper left corner +of the screen by default, though you can move it anywhere you want with the +`gui/overlay` configuration UI. -When you hover the mouse over the logo (or hit the Ctrl-Shift-C keyboard shortcut) -a list of DFHack tools relevant to the current context comes up. For example, when -you have a unit selected, the hotspot will show a list of tools that inspect -units, allow you to edit them, or maybe even teleport them. Next to each tool, -you'll see the hotkey you can hit to invoke the command without even opening the -hover list. +When you click on the logo (or hit the Ctrl-Shift-C keyboard shortcut), a short +list of popular, relevant DFHack tools comes up. These are the tools that have +been assigned hotkeys that are active in the current context. For example, when +you're looking at a fort map, the list will contain fortress design tools like +`gui/quickfort` and `gui/design`. You can click on the tools in the list, or +note the hotkeys listed next to them and maybe use them to launch the tool next +time without even opening the logo menu. The second place to check is the DFHack control panel: `gui/control-panel`. It will give you an overview of which tools are currently enabled, and will allow you to toggle them on or off, see help text for them, or launch their dedicated configuration UIs. You can open the control panel from anywhere with the -Ctrl-Shift-E hotkey or by selecting it from the logo hover list. +Ctrl-Shift-E hotkey or by selecting it from the logo menu list. In the control panel, you can also select which tools you'd like to be -automatically enabled when you start a new fort. There are also system settings -you can change, like whether DFHack windows will pause the game when they come -up. - -Finally, you can explore the full extent of the DFHack catalog in `gui/launcher`, -which is always listed first in the DFHack logo hover list. You can also bring up -the launcher by tapping the backtick key (\`) or hitting Ctrl-Shift-D. In the -launcher, you can quickly autocomplete any command name by selecting it in the -list on the right side of the window. Commands are ordered by how often you run -them, so your favorite commands will always be on top. You can also pull full -commandlines out of your history with Alt-S or by clicking on the "history search" -hotkey hint. - -Once you have typed (or autocompleted, or searched for) a command, other commands -related to the one you have selected will appear in the right-hand panel. Scanning -through that list is a great way to learn about new tools that you might find -useful. You can also see how commands are grouped by running the `tags` command. +automatically enabled and popular commands you'd like to run when you start a +new fort. On the "Preferences" tab, there are settings you can change, like +whether you want to limit DFHack functionality to interface improvements, +bugfixes, and productivity tools, hiding the god-mode tools ("mortal mode") or +whether you want DFHack windows to pause the game when they come up. + +Finally, you can explore the full extent of the DFHack catalog in +`gui/launcher`, which is always listed first in the DFHack logo menu list. You +can also bring up the launcher by tapping the backtick key (\`) or hitting +Ctrl-Shift-D. In the launcher, you can quickly autocomplete any command name by +selecting it in the list on the right side of the window. Commands are ordered +by how often you run them, so your favorite commands will always be on top. You +can also pull full commandlines out of your history with Alt-S or by clicking +on the "history search" hotkey hint. + +Once you have typed (or autocompleted, or searched for) a command, other +commands related to the one you have selected will appear in the right-hand +panel. Scanning through that list is a great way to learn about new tools that +you might find useful. You can also see how commands are grouped by running the +`tags` command. The bottom panel will show the full help text for the command you are running, -allowing you to refer to the usage documentation and examples when you are typing -your command. After you run a command, the bottom panel switches to command output -mode, but you can get back to the help text by hitting Ctrl-T or clicking on the -``Help`` tab. +allowing you to refer to the usage documentation and examples when you are +typing your command. After you run a command, the bottom panel switches to +command output mode, but you can get back to the help text by hitting Ctrl-T or +clicking on the ``Help`` tab. How do DFHack in-game windows work? ----------------------------------- @@ -122,84 +130,88 @@ you type at the keyboard. Hit Esc or right click to close the window or cancel the current action. You can click anywhere on the screen that is not a DFHack window to unfocus the window and let it just sit in the background. It won't respond to key presses or mouse clicks until you click on it again to give it -focus. If no DFHack windows are focused, you can right click directly on a window -to close it without left clicking to focus it first. +focus. If no DFHack windows are focused, you can right click directly on a +window to close it without left clicking to focus it first. DFHack windows are draggable from the title bar or from anywhere on the window that doesn't have a mouse-clickable widget on it. Many are resizable as well (if the tool window has components that can reasonably be resized). -You can generally use DFHack tools without interrupting the game. That is, if the -game is unpaused, it can continue to run while a DFHack window is open. If configured -to do so in `gui/control-panel`, tools will initially pause the game to let you -focus on the task at hand, but you can unpause like normal if you want. You can -also interact with the map, scrolling it with the keyboard or mouse and selecting -units, buildings, and items. Some tools will intercept all mouse clicks to allow -you to select regions on the map. When these tools have focus, you will not be able -to use the mouse to interact with map elements or pause/unpause the game. Therefore, -these tools will pause the game when they open, regardless of your settings in -`gui/control-panel`. You can still unpause with the keyboard (spacebar by default), -though. +You can generally use DFHack tools without interrupting the game. That is, if +the game is unpaused, it can continue to run while a DFHack window is open. If +configured to do so in `gui/control-panel`, tools will initially pause the game +to let you focus on the task at hand, but you can unpause like normal if you +want. You can also interact with the map, scrolling it with the keyboard or +mouse and selecting units, buildings, and items. Some tools will intercept all +mouse clicks to allow you to select regions of the map. When these tools have +focus, you will not be able to use the mouse to interact with map elements or +pause/unpause the game. Therefore, these tools will pause the game when they +open, regardless of your settings in `gui/control-panel`. You can still unpause +with the keyboard (spacebar by default), though. Where do I go next? ------------------- To recap: -You can get to popular, relevant tools for the current context by hovering -the mouse over the DFHack logo or by hitting Ctrl-Shift-C. +You can get to popular, relevant tools for the current context by clicking on +the DFHack logo or by hitting Ctrl-Shift-C. You can enable DFHack tools and configure settings with `gui/control-panel`, -which you can access directly with the Ctrl-Shift-E hotkey. +which you can open from the DFHack logo or access directly with the +Ctrl-Shift-E hotkey. You can get to the launcher and its integrated autocomplete, history search, and help text by hitting backtick (\`) or Ctrl-Shift-D, or, of course, by -running it from the logo hover list. +running it from the logo menu list. With those three interfaces, you have the complete DFHack tool suite at your -fingertips. So what to run first? Here are a few commands to get you started. -You can run them all from the launcher. +fingertips. So what to run first? Here are a few examples to get you started. First, let's import some useful manager orders to keep your fort stocked with basic necessities. Run ``orders import library/basic``. If you go to your -manager orders screen, you can see all the orders that have been created for you. -Note that you could have imported the orders directly from this screen as well, -using the DFHack `overlay` widget at the bottom of the manager orders panel. - -Next, try setting up `autochop` to automatically designate trees for chopping when -you get low on usable logs. Run `gui/control-panel` and select ``autochop`` in the -``Fort`` list. Click on the button to the left of the name or hit Enter to enable -it. You can then click on the configure button (the gear icon) to launch -`gui/autochop` if you'd like to customize its settings. If you have the extra -screen space, you can go ahead and set the `gui/autochop` window to minimal mode -(click on the hint near the upper right corner of the window or hit Alt-M) and -click on the map so the window loses keyboard focus. As you play the game, you can -glance at the live status panel to check on your stocks of wood. - -Finally, let's do some fort design copy-pasting. Go to some bedrooms that you have -set up in your fort. Run `gui/blueprint`, set a name for your blueprint by -clicking on the name field (or hitting the 'n' hotkey), typing "rooms" (or whatever) -and hitting Enter to set. Then draw a box around the target area by clicking with -the mouse. When you select the second corner, the blueprint will be saved to your -``blueprints`` subfolder. - -Now open up `gui/quickfort`. You can search for the blueprint you just created by -typing its name, but it should be up near the top already. If you copied a dug-out -area with furniture in it, your blueprint will have two labels: "/dig" and "/build". -Click on the "/dig" blueprint or select it with the keyboard arrow keys and hit Enter. -You can rotate or flip the blueprint around if you need to with the transform hotkeys. -You'll see a preview of where the blueprint will be applied as you move the mouse -cursor around the map. Red outlines mean that the blueprint may fail to fully apply -at that location, so be sure to choose a spot where all the preview tiles are shown -with green diamonds. Click the mouse or hit Enter to apply the blueprint and -designate the tiles for digging. Your dwarves will come and dig it out as if you -had designated the tiles yourself. - -Once the area is dug out, run `gui/quickfort` again and select the "/build" blueprint -this time. Apply the blueprint in the dug-out area, and your furniture will be -designated. It's just that easy! Note that `quickfort` uses `buildingplan` to place -buildings, so you don't even need to have the relevant furniture or building -materials in stock. The planned furniture/buildings will get built whenever you are -able to produce the building materials. +manager orders screen, you can see all the orders that have been created for +you. Note that you could have imported the orders directly from this screen as +well, using the DFHack `overlay` widget at the bottom of the manager orders +panel. + +Next, try setting up `autochop` to automatically designate trees for chopping +when you get low on usable logs. Run `gui/control-panel` and select +``autochop`` in the ``Fort`` list. Click on the button to the left of the name +or hit Enter to enable it. You can then click on the configure button (the gear +icon) to launch `gui/autochop` if you'd like to customize its settings. If you +have the extra screen space, you can go ahead and set the `gui/autochop` window +to minimal mode (click on the hint near the upper right corner of the window or +hit Alt-M) and click on the map so the window loses keyboard focus. As you play +the game, you can glance at the live status panel to check on your stocks of +wood. + +Finally, let's do some fort design copy-pasting. Go to some bedrooms that you +have set up in your fort. Run `gui/blueprint`, set a name for your blueprint by +clicking on the name field (or hitting the 'n' hotkey), typing "rooms" (or +whatever) and hitting Enter to set. Then draw a box around the target area by +clicking with the mouse. When you select the second corner, the blueprint will +be saved to your ``dfhack-config/blueprints`` subfolder. + +Now open up `gui/quickfort`. You can search for the blueprint you just created +by typing its name, but it should be up near the top already. If you copied a +dug-out area with furniture in it, your blueprint will have two labels: "/dig" +and "/build". Click on the "/dig" blueprint or select it with the keyboard +arrow keys and hit Enter. You can rotate or flip the blueprint around if you +need to with the transform hotkeys. You'll see a preview of where the blueprint +will be applied as you move the mouse cursor around the map. Red outlines mean +that the blueprint may fail to fully apply at that location, so be sure to +choose a spot where all the preview tiles are shown with green diamonds. Click +the mouse or hit Enter to apply the blueprint and designate the tiles for +digging. Your dwarves will come and dig it out as if you had designated the +tiles yourself. + +Once the area is dug out, run `gui/quickfort` again and select your "/build" +blueprint this time. Hit `o` to generate manager orders for the required +furniture. Apply the blueprint in the dug-out area, and your furniture will be +designated. It's just that easy! Note that `quickfort` uses `buildingplan` to +place buildings, so you don't even need to have the relevant furniture or +building materials in stock yet. The planned furniture/buildings will get built +whenever you are able to produce the building materials. There are many, many more tools to explore. Have fun! From 2a0f5a547402af84d2ad0d46532537bac80081cc Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 14 Sep 2023 11:54:41 -0700 Subject: [PATCH 29/32] fix typo in quickstart guide --- docs/Quickstart.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Quickstart.rst b/docs/Quickstart.rst index 8016a99b2..10349a65f 100644 --- a/docs/Quickstart.rst +++ b/docs/Quickstart.rst @@ -207,7 +207,7 @@ digging. Your dwarves will come and dig it out as if you had designated the tiles yourself. Once the area is dug out, run `gui/quickfort` again and select your "/build" -blueprint this time. Hit `o` to generate manager orders for the required +blueprint this time. Hit ``o`` to generate manager orders for the required furniture. Apply the blueprint in the dug-out area, and your furniture will be designated. It's just that easy! Note that `quickfort` uses `buildingplan` to place buildings, so you don't even need to have the relevant furniture or From a13159bc35265ec169fa6597f09e8b0e7e8f5822 Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Thu, 14 Sep 2023 17:42:15 -0500 Subject: [PATCH 30/32] use `TerminateProcess` for die on windows evades issues with the stacktrace logger in 50.10 --- library/Core.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/Core.cpp b/library/Core.cpp index 176d5014d..032e2b0be 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -1033,7 +1033,11 @@ command_result Core::runCommand(color_ostream &con, const std::string &first_, s } else if (first == "die") { +#ifdef WIN32 + TerminateProcess(GetCurrentProcess(),666); +#else std::_Exit(666); +#endif } else if (first == "kill-lua") { From aec29502777a76c9dd0f025c3f03ac2df3acc5c6 Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Sun, 17 Sep 2023 01:38:07 -0500 Subject: [PATCH 31/32] update scripts --- scripts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts b/scripts index 2b16f8d6b..0f457b565 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit 2b16f8d6bb09652458771439072d29823aa8c264 +Subproject commit 0f457b56595f0e7eaba8300a6870af406b1154f6 From c2448654cae1a78068c025be48fdfbec7fef2962 Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Sun, 17 Sep 2023 03:03:14 -0500 Subject: [PATCH 32/32] Update scripts --- scripts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts b/scripts index 0f457b565..f7706b0b2 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit 0f457b56595f0e7eaba8300a6870af406b1154f6 +Subproject commit f7706b0b2ac0f28bcd1f48c05edc5786aaf05b6c