From a7121a2f80252155f94f56a4befd7d4aed47c3cb Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sun, 10 Sep 2023 04:26:02 -0700 Subject: [PATCH 01/44] 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/44] 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/44] 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/44] 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/44] 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/44] 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/44] 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/44] 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/44] `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/44] 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/44] 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/44] 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/44] 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/44] 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/44] 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/44] 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/44] 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/44] 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/44] 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/44] 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/44] 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/44] 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/44] 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/44] 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/44] 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/44] 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/44] 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/44] 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/44] 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/44] 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 ac5d9decd2ed57e0569fb8cf0db5cf18a1fa8663 Mon Sep 17 00:00:00 2001 From: Jacek Konieczny Date: Fri, 15 Sep 2023 20:04:24 +0200 Subject: [PATCH 31/44] linux: preserve existing LD_PRELOAD content that is needed for Steam overlay and game streaming to work fixes https://github.com/DFHack/dfhack/issues/3768 --- docs/about/Authors.rst | 1 + docs/changelog.txt | 1 + package/linux/dfhack | 16 ++++++++-------- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/about/Authors.rst b/docs/about/Authors.rst index 4b5d4e0c2..e81649d8d 100644 --- a/docs/about/Authors.rst +++ b/docs/about/Authors.rst @@ -83,6 +83,7 @@ Herwig Hochleitner bendlas Hevlikn Hevlikn Ian S kremlin- IndigoFenix +Jacek Konieczny Jajcus James 20k James Gilles kazimuth James Logsdon jlogsdon diff --git a/docs/changelog.txt b/docs/changelog.txt index c29879631..6579cf1a8 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -56,6 +56,7 @@ Template for new versions: ## New Features ## Fixes +- Linux launcher: preserve LD_PRELOAD set by Steam, so Steam Overlay and game streaming works ## Misc Improvements diff --git a/package/linux/dfhack b/package/linux/dfhack index a83da71b4..fab3d0602 100755 --- a/package/linux/dfhack +++ b/package/linux/dfhack @@ -60,7 +60,7 @@ fi case "$1" in -g | --gdb) shift - echo "set exec-wrapper env LD_LIBRARY_PATH='$LD_LIBRARY_PATH' LD_PRELOAD='$PRELOAD_LIB' MALLOC_PERTURB_=45" > gdbcmd.tmp + echo "set exec-wrapper env LD_LIBRARY_PATH='$LD_LIBRARY_PATH' LD_PRELOAD='${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB' MALLOC_PERTURB_=45" > gdbcmd.tmp gdb $DF_GDB_OPTS -x gdbcmd.tmp --args ./dwarfort "$@" rm gdbcmd.tmp ret=$? @@ -95,35 +95,35 @@ case "$1" in ;; -h | --helgrind) shift - LD_PRELOAD="$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_HELGRIND_OPTS --tool=helgrind --log-file=helgrind.log ./dwarfort "$@" + LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_HELGRIND_OPTS --tool=helgrind --log-file=helgrind.log ./dwarfort "$@" ret=$? ;; -v | --valgrind) shift - LD_PRELOAD="$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_VALGRIND_OPTS --log-file=valgrind.log ./dwarfort "$@" + LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_VALGRIND_OPTS --log-file=valgrind.log ./dwarfort "$@" ret=$? ;; -c | --callgrind) shift - LD_PRELOAD="$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_CALLGRIND_OPTS --tool=callgrind --separate-threads=yes --dump-instr=yes --instr-atstart=no --log-file=callgrind.log ./dwarfort "$@" + LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_CALLGRIND_OPTS --tool=callgrind --separate-threads=yes --dump-instr=yes --instr-atstart=no --log-file=callgrind.log ./dwarfort "$@" ret=$? ;; --strace) shift - strace -f setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./dwarfort "$@" 2> strace.log + strace -f setarch "$setarch_arch" -R env LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" ./dwarfort "$@" 2> strace.log ret=$? ;; -x | --exec) - exec setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./dwarfort "$@" + exec setarch "$setarch_arch" -R env LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" ./dwarfort "$@" # script does not resume ;; --sc | --sizecheck) PRELOAD_LIB="${PRELOAD_LIB:+$PRELOAD_LIB:}./hack/libsizecheck.so" - MALLOC_PERTURB_=45 setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./dwarfort "$@" + MALLOC_PERTURB_=45 setarch "$setarch_arch" -R env LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" ./dwarfort "$@" ret=$? ;; *) - setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./dwarfort "$@" + setarch "$setarch_arch" -R env LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" ./dwarfort "$@" ret=$? ;; esac From aec29502777a76c9dd0f025c3f03ac2df3acc5c6 Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Sun, 17 Sep 2023 01:38:07 -0500 Subject: [PATCH 32/44] 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 1c704fad6c47f6149b010a03dbd77019047ed0c0 Mon Sep 17 00:00:00 2001 From: DFHack-Urist via GitHub Actions <63161697+DFHack-Urist@users.noreply.github.com> Date: Sun, 17 Sep 2023 07:11:59 +0000 Subject: [PATCH 33/44] Auto-update submodules scripts: master --- 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 From c2448654cae1a78068c025be48fdfbec7fef2962 Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Sun, 17 Sep 2023 03:03:14 -0500 Subject: [PATCH 34/44] 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 From 9905fc7eafad5a8b4e4a3658826797bf0f0c0467 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sun, 17 Sep 2023 21:16:17 -0700 Subject: [PATCH 35/44] update version to 50.10-r1 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a6d1b7c41..74c37d4c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,8 +8,8 @@ project(dfhack) # set up versioning. set(DF_VERSION "50.10") -set(DFHACK_RELEASE "beta1") -set(DFHACK_PRERELEASE TRUE) +set(DFHACK_RELEASE "r1") +set(DFHACK_PRERELEASE FALSE) set(DFHACK_VERSION "${DF_VERSION}-${DFHACK_RELEASE}") set(DFHACK_ABI_VERSION 1) From a8c4456c773e35a786e33a58ecef34ed493dc520 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sun, 17 Sep 2023 21:16:35 -0700 Subject: [PATCH 36/44] update xml ref --- library/xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xml b/library/xml index d72558199..5f8d3f96f 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit d72558199aca591cc6cf778d0fe75dba8793059e +Subproject commit 5f8d3f96f2db6c5bddeb07cfda3c0541a5b3f710 From dc270abd0c431bd9fe9db9a6fbe69b433c1b56e3 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sat, 16 Sep 2023 19:07:45 -0700 Subject: [PATCH 37/44] add wheelbarrows back to dreamfort stockpiles --- data/blueprints/dreamfort.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/blueprints/dreamfort.csv b/data/blueprints/dreamfort.csv index f82fa3584..31ba9512e 100644 --- a/data/blueprints/dreamfort.csv +++ b/data/blueprints/dreamfort.csv @@ -1431,7 +1431,7 @@ doors/farming_doors ,,c,c,c,c,c,c,c,c,c,,,,`,,`,,,,c,c,c,c,c,c,c,c,c ,,c,c,c,c,c,c,c,c,,,c,`,`,`,`,`,c,,,c,c,c,c,c,c,c,c ,,c,c,c,c,c,c,c,c,,"c{name=""Unprepared fish"" take_from=""Starting food""}:+unpreparedfish",c,,,`,,,"c{name=""Rawhides"" take_from=""Starting cloth/trash""}:+rawhides",c,,c,c,c,c,c,c,c,c -,,c,c,c,c,c,c,c,,,c,c,,"c{name=""Refuse feeder"" give_to=""Rawhides"" take_from=""Starting cloth/trash""}:+cat_refuse/type(1x3)","y{name=""Corpse feeder"" take_from=""Starting cloth/trash""}:+cat_refuse/corpses,bodyparts(2x3)",~,,c,c,,,c,c,c,c,c,c,c +,,c,c,c,c,c,c,c,,,c,c,,"c{name=""Refuse feeder"" give_to=""Rawhides"" take_from=""Starting cloth/trash""}:+cat_refuse/type(1x3)","y2{name=""Corpse feeder"" take_from=""Starting cloth/trash""}:+cat_refuse/corpses,bodyparts(2x3)",~,,c,c,,,c,c,c,c,c,c,c ,,c,c,c,c,c,c,c,,`,`,`,,~,~,~,,`,`,`,,c,c,c,c,c,c,c ,,c,c,c,c,c,c,c,,`,`,`,,~,~,~,,`,`,`,,c,c,c,c,c,c,c ,,c,c,c,c,c,c,c,,`,`,`,,,`,,,`,`,`,,c,c,c,c,c,c,c @@ -1687,7 +1687,7 @@ build2/industry_build2 ,,w,`,`,`,`,`,`,"w{name=""Wood feeder""}(2x5)",,"g{name=""Goods feeder"" containers=0}:+cat_food/tallow+wax-crafts-goblets(3x3)",,`,,`,`,`,`,`,,"hlS{name=""Cloth/bones feeder"" containers=0}:+cat_refuse/skulls/,bones/,hair/,shells/,teeth/,horns/-adamantinethread(5x5)",,,~,~,`,`,`,`,`,`,c ,,w,`,`,`,`,`,`,~,~,~,~,~,`,`,,,,`,`,~,~,~,~,~,`,`,`,`,`,`,c ,,`,`,`,`,`,"c{name=""Goods/wood quantum"" quantum=true give_to=""Pots,Barrels,Jugs,Bags,Seeds feeder""}:+all",`,~,~,~,~,~,,`,,`,,`,,~,~,~,~,~,`,"r{name=""Cloth/bones quantum"" quantum=true}:+all",`,`,`,`,c -,,"c{name=""Lye"" barrels=0}:+miscliquid",`,`,`,`,`,`,~,~,"u{name=""Furniture feeder""}:-sand(3x2)",~,~,`,`,,,,`,`,~,~,~,~,~,`,`,`,`,`,`,c +,,"c{name=""Lye"" barrels=0}:+miscliquid",`,`,`,`,`,`,~,~,"u2{name=""Furniture feeder""}:-sand(3x2)",~,~,`,`,,,,`,`,~,~,~,~,~,`,`,`,`,`,`,c ,,c,`,`,`,`,`,`,~,~,~,~,~,,`,`,`,`,`,,~,~,~,~,~,`,`,`,`,`,`,c ,,c,`,`,`,`,`,`,`,`,`,`,`,,,`,,`,,,`,`,`,`,`,`,`,`,`,`,`,c ,,c,`,`,`,`,`,`,`,`,`,`,`,`,"bnpdz{name=""Bar/military feeder"" containers=0}:-potash+adamantinethread(5x3)",,,,~,`,`,`,`,`,`,`,`,`,`,`,`,c From 48c48baab4a718c7198259b8538425442052cfad Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sat, 16 Sep 2023 19:08:38 -0700 Subject: [PATCH 38/44] allow semi-wild units to be butchered --- docs/changelog.txt | 1 + plugins/autobutcher.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 6579cf1a8..fde3e40a6 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -57,6 +57,7 @@ Template for new versions: ## Fixes - Linux launcher: preserve LD_PRELOAD set by Steam, so Steam Overlay and game streaming works +- `autobutcher`: allow semi-wild units to be butchered again ## Misc Improvements diff --git a/plugins/autobutcher.cpp b/plugins/autobutcher.cpp index 483e29759..d3d8487de 100644 --- a/plugins/autobutcher.cpp +++ b/plugins/autobutcher.cpp @@ -746,7 +746,8 @@ static bool isInappropriateUnit(df::unit *unit) { static bool isProtectedUnit(df::unit *unit) { return Units::isWar(unit) // ignore war dogs etc || Units::isHunter(unit) // ignore hunting dogs etc - || Units::isMarkedForTraining(unit) // ignore units marked for any kind of training + || Units::isMarkedForWarTraining(unit) // ignore units marked for any kind of training + || Units::isMarkedForHuntTraining(unit) // ignore creatures in built cages which are defined as rooms to leave zoos alone // (TODO: better solution would be to allow some kind of slaughter cages which you can place near the butcher) || (isContainedInItem(unit) && isInBuiltCageRoom(unit)) // !!! see comments in isBuiltCageRoom() From 4695b8c86d0358d0278c0f4f6c7d1d4e73aa825b Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sun, 17 Sep 2023 21:22:43 -0700 Subject: [PATCH 39/44] use osyncstream for writing to gamelog.txt --- library/modules/Gui.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/library/modules/Gui.cpp b/library/modules/Gui.cpp index 9eee284ac..a191cc130 100644 --- a/library/modules/Gui.cpp +++ b/library/modules/Gui.cpp @@ -28,7 +28,11 @@ distribution. #include #include #include -using namespace std; +#include + +using std::map; +using std::string; +using std::vector; #include "modules/Gui.h" #include "MemAccess.h" @@ -1397,8 +1401,10 @@ DFHACK_EXPORT void Gui::writeToGamelog(std::string message) return; std::ofstream fseed("gamelog.txt", std::ios::out | std::ios::app); - if(fseed.is_open()) - fseed << message << std::endl; + if(fseed.is_open()) { + std::osyncstream wrapped_fseed(fseed); + wrapped_fseed << message << std::endl; + } fseed.close(); } @@ -1540,7 +1546,7 @@ DFHACK_EXPORT int Gui::makeAnnouncement(df::announcement_type type, df::announce if (flags.bits.D_DISPLAY) { world->status.display_timer = ANNOUNCE_DISPLAY_TIME; - Gui::writeToGamelog('x' + to_string(repeat_count + 1)); + Gui::writeToGamelog('x' + std::to_string(repeat_count + 1)); } return -1; } @@ -1802,7 +1808,7 @@ bool Gui::autoDFAnnouncement(df::report_init r, string message) if (a_flags.bits.D_DISPLAY) { world->status.display_timer = r.display_timer; - Gui::writeToGamelog('x' + to_string(repeat_count + 1)); + Gui::writeToGamelog('x' + std::to_string(repeat_count + 1)); } DEBUG(gui).print("Announcement succeeded as repeat:\n%s\n", message.c_str()); return true; From a61b8d11d09916319e6ed21e7d71bb82138edcc5 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sun, 17 Sep 2023 21:38:48 -0700 Subject: [PATCH 40/44] Revert "use osyncstream for writing to gamelog.txt" This reverts commit 4695b8c86d0358d0278c0f4f6c7d1d4e73aa825b. --- library/modules/Gui.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/library/modules/Gui.cpp b/library/modules/Gui.cpp index a191cc130..9eee284ac 100644 --- a/library/modules/Gui.cpp +++ b/library/modules/Gui.cpp @@ -28,11 +28,7 @@ distribution. #include #include #include -#include - -using std::map; -using std::string; -using std::vector; +using namespace std; #include "modules/Gui.h" #include "MemAccess.h" @@ -1401,10 +1397,8 @@ DFHACK_EXPORT void Gui::writeToGamelog(std::string message) return; std::ofstream fseed("gamelog.txt", std::ios::out | std::ios::app); - if(fseed.is_open()) { - std::osyncstream wrapped_fseed(fseed); - wrapped_fseed << message << std::endl; - } + if(fseed.is_open()) + fseed << message << std::endl; fseed.close(); } @@ -1546,7 +1540,7 @@ DFHACK_EXPORT int Gui::makeAnnouncement(df::announcement_type type, df::announce if (flags.bits.D_DISPLAY) { world->status.display_timer = ANNOUNCE_DISPLAY_TIME; - Gui::writeToGamelog('x' + std::to_string(repeat_count + 1)); + Gui::writeToGamelog('x' + to_string(repeat_count + 1)); } return -1; } @@ -1808,7 +1802,7 @@ bool Gui::autoDFAnnouncement(df::report_init r, string message) if (a_flags.bits.D_DISPLAY) { world->status.display_timer = r.display_timer; - Gui::writeToGamelog('x' + std::to_string(repeat_count + 1)); + Gui::writeToGamelog('x' + to_string(repeat_count + 1)); } DEBUG(gui).print("Announcement succeeded as repeat:\n%s\n", message.c_str()); return true; From 66a93ad0ccf184c8c9594c0d669d15f66f567c02 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sun, 17 Sep 2023 23:32:24 -0700 Subject: [PATCH 41/44] update xml ref --- library/xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xml b/library/xml index 5f8d3f96f..6bf70cdc4 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 5f8d3f96f2db6c5bddeb07cfda3c0541a5b3f710 +Subproject commit 6bf70cdc49837dd55da4a20280fc674cd7991a68 From 64d46af38e33146e62d4e23dde731f9b55dbea80 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sun, 17 Sep 2023 23:52:37 -0700 Subject: [PATCH 42/44] bump to 50.10-r1 --- docs/changelog.txt | 8 ++++++-- library/xml | 2 +- scripts | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index fde3e40a6..044cb1ca4 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -56,8 +56,6 @@ Template for new versions: ## New Features ## Fixes -- Linux launcher: preserve LD_PRELOAD set by Steam, so Steam Overlay and game streaming works -- `autobutcher`: allow semi-wild units to be butchered again ## Misc Improvements @@ -69,6 +67,12 @@ Template for new versions: ## Removed +# 50.10-r1 + +## Fixes +- Linux launcher: allow Steam Overlay and game streaming to function +- `autobutcher`: don't ignore semi-wild units when marking units for slaughter + # 50.09-r4 ## New Features diff --git a/library/xml b/library/xml index 6bf70cdc4..53a82ea51 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 6bf70cdc49837dd55da4a20280fc674cd7991a68 +Subproject commit 53a82ea5171cb6fa7e50131eeb0bec801a727fda diff --git a/scripts b/scripts index f7706b0b2..e0591830b 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit f7706b0b2ac0f28bcd1f48c05edc5786aaf05b6c +Subproject commit e0591830b72cdfaec5c9bdb1bf713a74fe744788 From 8e86c5c0ab178930abb072aa5e043c85e81c01bb Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Mon, 18 Sep 2023 10:06:06 -0700 Subject: [PATCH 43/44] update xml ref --- library/xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xml b/library/xml index 53a82ea51..f1205a08d 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 53a82ea5171cb6fa7e50131eeb0bec801a727fda +Subproject commit f1205a08de0ecfbcf02b641b9591e6d6bb60dc21 From 8d03dd4d71cc8396308f41019d26b49a89f5514c Mon Sep 17 00:00:00 2001 From: lethosor Date: Tue, 19 Sep 2023 18:14:59 -0400 Subject: [PATCH 44/44] Update xml for 50.10-r1.1 --- library/xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xml b/library/xml index f1205a08d..041493b22 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit f1205a08de0ecfbcf02b641b9591e6d6bb60dc21 +Subproject commit 041493b221e0799c106abeac1f86df4535ab80d3