From d4f41141ef907f336c56197a9ac3be62e751eda7 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Wed, 17 May 2023 16:45:35 -0700 Subject: [PATCH 01/21] fix game_extra reference --- plugins/lua/autolabor.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/lua/autolabor.lua b/plugins/lua/autolabor.lua index a468b30e1..a2c0e88cd 100644 --- a/plugins/lua/autolabor.lua +++ b/plugins/lua/autolabor.lua @@ -40,7 +40,7 @@ function AutolaborOverlay:init() end function AutolaborOverlay:render(dc) - if df.global.game_extra.external_flag ~= 1 then return end + if df.global.game.external_flag ~= 1 then return end AutolaborOverlay.super.render(self, dc) end From b9afb94ba6f5405d681ccb289419bf1e72f5d02e Mon Sep 17 00:00:00 2001 From: DFHack-Urist via GitHub Actions <63161697+DFHack-Urist@users.noreply.github.com> Date: Thu, 18 May 2023 07:12:59 +0000 Subject: [PATCH 02/21] Auto-update submodules scripts: master --- scripts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts b/scripts index 2a646f9c7..97557b923 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit 2a646f9c7204253cae70bbfb5ed194182e0ac373 +Subproject commit 97557b9239a5ad8297f6a32651b78fd9dbb333ec From eb742a603dcc945a09181662c9ea9138b78f81ba Mon Sep 17 00:00:00 2001 From: Taxi Service Date: Thu, 18 May 2023 11:22:58 +0200 Subject: [PATCH 03/21] renamed XYZ_FRAME to FRAME_XYZ --- library/include/modules/Textures.h | 10 ++++---- library/lua/gui.lua | 33 +++++++++++++++--------- library/modules/Textures.cpp | 40 +++++++++++++++--------------- 3 files changed, 46 insertions(+), 37 deletions(-) diff --git a/library/include/modules/Textures.h b/library/include/modules/Textures.h index 95e628d5a..1664f6081 100644 --- a/library/include/modules/Textures.h +++ b/library/include/modules/Textures.h @@ -54,11 +54,11 @@ DFHACK_EXPORT long getControlPanelTexposStart(); /** * Get the first texpos for the DFHack borders. Each is a 7x3 grid. */ -DFHACK_EXPORT long getThinBordersTexposStart(); -DFHACK_EXPORT long getMediumBordersTexposStart(); -DFHACK_EXPORT long getBoldBordersTexposStart(); -DFHACK_EXPORT long getPanelBordersTexposStart(); -DFHACK_EXPORT long getWindowBordersTexposStart(); +DFHACK_EXPORT long getBorderThinTexposStart(); +DFHACK_EXPORT long getBorderMediumTexposStart(); +DFHACK_EXPORT long getBorderBoldTexposStart(); +DFHACK_EXPORT long getBorderPanelTexposStart(); +DFHACK_EXPORT long getBorderWindowTexposStart(); } } diff --git a/library/lua/gui.lua b/library/lua/gui.lua index 7e991e1df..311edc1f3 100644 --- a/library/lua/gui.lua +++ b/library/lua/gui.lua @@ -905,7 +905,7 @@ local BASE_FRAME = { } local function make_frame(name, double_line) - local texpos = dfhack.textures['get'..name..'BordersTexposStart']() + local texpos = dfhack.textures['getBorder'..name..'TexposStart']() local tp = function(offset) if texpos == -1 then return nil end return texpos + offset @@ -923,17 +923,26 @@ local function make_frame(name, double_line) return frame end -WINDOW_FRAME = make_frame('Window', true) -PANEL_FRAME = make_frame('Panel', false) -MEDIUM_FRAME = make_frame('Medium', false) -BOLD_FRAME = make_frame('Bold', true) -INTERIOR_FRAME = make_frame('Thin', false) -INTERIOR_FRAME.signature_pen = false -INTERIOR_MEDIUM_FRAME = copyall(MEDIUM_FRAME) -INTERIOR_MEDIUM_FRAME.signature_pen = false +FRAME_WINDOW = make_frame('Window', true) +FRAME_PANEL = make_frame('Panel', false) +FRAME_MEDIUM = make_frame('Medium', false) +FRAME_BOLD = make_frame('Bold', true) +FRAME_INTERIOR = make_frame('Thin', false) +FRAME_INTERIOR.signature_pen = false +FRAME_INTERIOR_MEDIUM = copyall(FRAME_MEDIUM) +FRAME_INTERIOR_MEDIUM.signature_pen = false -- for compatibility with pre-steam code -GREY_LINE_FRAME = WINDOW_FRAME +GREY_LINE_FRAME = FRAME_PANEL + +-- for compatibility with deprecated frame naming scheme +WINDOW_FRAME = FRAME_WINDOW +PANEL_FRAME = FRAME_PANEL +MEDIUM_FRAME = FRAME_MEDIUM +BOLD_FRAME = FRAME_BOLD +INTERIOR_FRAME = FRAME_INTERIOR +INTERIOR_MEDIUM_FRAME = FRAME_INTERIOR_MEDIUM + function paint_frame(dc,rect,style,title,inactive,pause_forced,resizable) local pen = style.frame_pen @@ -942,8 +951,8 @@ function paint_frame(dc,rect,style,title,inactive,pause_forced,resizable) dscreen.paintTile(style.rt_frame_pen or pen, x2, y1) dscreen.paintTile(style.lb_frame_pen or pen, x1, y2) local rb_frame_pen = style.rb_frame_pen - if rb_frame_pen == WINDOW_FRAME.rb_frame_pen and not resizable then - rb_frame_pen = PANEL_FRAME.rb_frame_pen + if rb_frame_pen == FRAME_WINDOW.rb_frame_pen and not resizable then + rb_frame_pen = FRAME_PANEL.rb_frame_pen end dscreen.paintTile(rb_frame_pen or pen, x2, y2) dscreen.fillRect(style.t_frame_pen or style.h_frame_pen or pen,x1+1,y1,x2-1,y1) diff --git a/library/modules/Textures.cpp b/library/modules/Textures.cpp index a30f879a0..40339a616 100644 --- a/library/modules/Textures.cpp +++ b/library/modules/Textures.cpp @@ -24,11 +24,11 @@ static long g_red_pin_texpos_start = -1; static long g_icons_texpos_start = -1; static long g_on_off_texpos_start = -1; static long g_control_panel_texpos_start = -1; -static long g_thin_borders_texpos_start = -1; -static long g_medium_borders_texpos_start = -1; -static long g_bold_borders_texpos_start = -1; -static long g_panel_borders_texpos_start = -1; -static long g_window_borders_texpos_start = -1; +static long g_border_thin_texpos_start = -1; +static long g_border_medium_texpos_start = -1; +static long g_border_bold_texpos_start = -1; +static long g_border_panel_texpos_start = -1; +static long g_border_window_texpos_start = -1; // Converts an arbitrary Surface to something like the display format // (32-bit RGBA), and converts magenta to transparency if convert_magenta is set @@ -132,15 +132,15 @@ void Textures::init(color_ostream &out) { g_num_dfhack_textures += load_textures(out, "hack/data/art/control-panel.png", &g_control_panel_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-thin.png", - &g_thin_borders_texpos_start); + &g_border_thin_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-medium.png", - &g_medium_borders_texpos_start); + &g_border_medium_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-bold.png", - &g_bold_borders_texpos_start); + &g_border_bold_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-panel.png", - &g_panel_borders_texpos_start); + &g_border_panel_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-window.png", - &g_window_borders_texpos_start); + &g_border_window_texpos_start); DEBUG(textures,out).print("loaded %ld textures\n", g_num_dfhack_textures); @@ -197,22 +197,22 @@ long Textures::getControlPanelTexposStart() { return g_control_panel_texpos_start; } -long Textures::getThinBordersTexposStart() { - return g_thin_borders_texpos_start; +long Textures::getBorderThinTexposStart() { + return g_border_thin_texpos_start; } -long Textures::getMediumBordersTexposStart() { - return g_medium_borders_texpos_start; +long Textures::getBorderMediumTexposStart() { + return g_border_medium_texpos_start; } -long Textures::getBoldBordersTexposStart() { - return g_bold_borders_texpos_start; +long Textures::getBorderBoldTexposStart() { + return g_border_bold_texpos_start; } -long Textures::getPanelBordersTexposStart() { - return g_panel_borders_texpos_start; +long Textures::getBorderPanelTexposStart() { + return g_border_panel_texpos_start; } -long Textures::getWindowBordersTexposStart() { - return g_window_borders_texpos_start; +long Textures::getBorderWindowTexposStart() { + return g_border_window_texpos_start; } From 90fe6e7ae34132a8aa1670ae6d0cb7189a1cfd6c Mon Sep 17 00:00:00 2001 From: Taxi Service Date: Thu, 18 May 2023 11:30:21 +0200 Subject: [PATCH 04/21] swapped any instance of 'border' being after 'xyz', everywhere --- docs/dev/Lua API.rst | 16 ++++++++-------- library/LuaApi.cpp | 10 +++++----- plugins/lua/buildingplan/pens.lua | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/dev/Lua API.rst b/docs/dev/Lua API.rst index 1d70647f7..6fb2aca2c 100644 --- a/docs/dev/Lua API.rst +++ b/docs/dev/Lua API.rst @@ -4347,32 +4347,32 @@ A framed screen has the following attributes: There are the following predefined frame style tables: -* ``WINDOW_FRAME`` +* ``FRAME_WINDOW`` A frame suitable for a draggable, optionally resizable window. -* ``PANEL_FRAME`` +* ``FRAME_PANEL`` A frame suitable for a static (non-draggable, non-resizable) panel. -* ``MEDIUM_FRAME`` +* ``FRAME_MEDIUM`` A frame suitable for overlay widget panels. -* ``BOLD_FRAME`` +* ``FRAME_BOLD`` A frame suitable for a non-draggable panel meant to capture the user's focus, like an important notification, confirmation dialog or error message. -* ``INTERIOR_FRAME`` +* ``FRAME_INTERIOR`` A frame suitable for light interior accent elements. This frame does *not* have a visible ``DFHack`` signature on it, so it must not be used as the most external frame for a DFHack-owned UI. -* ``INTERIOR_MEDIUM_FRAME`` +* ``FRAME_INTERIOR_MEDIUM`` - A copy of ``MEDIUM_FRAME`` that lacks the ``DFHack`` signature. Suitable for + A copy of ``FRAME_MEDIUM`` that lacks the ``DFHack`` signature. Suitable for panels that are part of a larger widget cluster. Must *not* be used as the most external frame for a DFHack-owned UI. @@ -4509,7 +4509,7 @@ Has attributes: by 1. The attributes are identical to what is defined in the `FramedScreen class`_. When using the predefined frame styles in the ``gui`` module, remember to ``require`` the gui module and prefix the identifier with - ``gui.``, e.g. ``gui.GREY_LINE_FRAME``. + ``gui.``, e.g. ``gui.FRAME_GREY_LINE``. Has functions: diff --git a/library/LuaApi.cpp b/library/LuaApi.cpp index 08903c7bd..d21ce29e5 100644 --- a/library/LuaApi.cpp +++ b/library/LuaApi.cpp @@ -1716,11 +1716,11 @@ static const LuaWrapper::FunctionReg dfhack_textures_module[] = { WRAPM(Textures, getIconsTexposStart), WRAPM(Textures, getOnOffTexposStart), WRAPM(Textures, getControlPanelTexposStart), - WRAPM(Textures, getThinBordersTexposStart), - WRAPM(Textures, getMediumBordersTexposStart), - WRAPM(Textures, getBoldBordersTexposStart), - WRAPM(Textures, getPanelBordersTexposStart), - WRAPM(Textures, getWindowBordersTexposStart), + WRAPM(Textures, getBorderThinTexposStart), + WRAPM(Textures, getBorderMediumTexposStart), + WRAPM(Textures, getBorderBoldTexposStart), + WRAPM(Textures, getBorderPanelTexposStart), + WRAPM(Textures, getBorderWindowTexposStart), { NULL, NULL } }; diff --git a/plugins/lua/buildingplan/pens.lua b/plugins/lua/buildingplan/pens.lua index e69a4c210..c68e12eae 100644 --- a/plugins/lua/buildingplan/pens.lua +++ b/plugins/lua/buildingplan/pens.lua @@ -18,12 +18,12 @@ function reload_pens() GOOD_TILE_PEN = to_pen{ch='o', fg=COLOR_GREEN, tile=dfhack.screen.findGraphicsTile('CURSORS', 1, 2)} BAD_TILE_PEN = to_pen{ch='X', fg=COLOR_RED, tile=dfhack.screen.findGraphicsTile('CURSORS', 3, 0)} - local tb_texpos = dfhack.textures.getThinBordersTexposStart() + local tb_texpos = dfhack.textures.getBorderThinTexposStart() VERT_TOP_PEN = to_pen{tile=tp(tb_texpos, 10), ch=194, fg=COLOR_GREY, bg=COLOR_BLACK} VERT_MID_PEN = to_pen{tile=tp(tb_texpos, 4), ch=179, fg=COLOR_GREY, bg=COLOR_BLACK} VERT_BOT_PEN = to_pen{tile=tp(tb_texpos, 11), ch=193, fg=COLOR_GREY, bg=COLOR_BLACK} - local mb_texpos = dfhack.textures.getMediumBordersTexposStart() + local mb_texpos = dfhack.textures.getBorderMediumTexposStart() HORI_LEFT_PEN = to_pen{tile=tp(mb_texpos, 12), ch=195, fg=COLOR_GREY, bg=COLOR_BLACK} HORI_MID_PEN = to_pen{tile=tp(mb_texpos, 5), ch=196, fg=COLOR_GREY, bg=COLOR_BLACK} HORI_RIGHT_PEN = to_pen{tile=tp(mb_texpos, 13), ch=180, fg=COLOR_GREY, bg=COLOR_BLACK} From c52b1cc950b3e55b27050740fb3f037d45918c09 Mon Sep 17 00:00:00 2001 From: Taxi Service Date: Thu, 18 May 2023 12:46:21 +0200 Subject: [PATCH 05/21] reverted to just renaming FRAMES in gui.lua --- library/LuaApi.cpp | 10 ++++---- library/include/modules/Textures.h | 10 ++++---- library/lua/gui.lua | 2 +- library/modules/Textures.cpp | 40 +++++++++++++++--------------- plugins/lua/buildingplan/pens.lua | 4 +-- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/library/LuaApi.cpp b/library/LuaApi.cpp index d21ce29e5..08903c7bd 100644 --- a/library/LuaApi.cpp +++ b/library/LuaApi.cpp @@ -1716,11 +1716,11 @@ static const LuaWrapper::FunctionReg dfhack_textures_module[] = { WRAPM(Textures, getIconsTexposStart), WRAPM(Textures, getOnOffTexposStart), WRAPM(Textures, getControlPanelTexposStart), - WRAPM(Textures, getBorderThinTexposStart), - WRAPM(Textures, getBorderMediumTexposStart), - WRAPM(Textures, getBorderBoldTexposStart), - WRAPM(Textures, getBorderPanelTexposStart), - WRAPM(Textures, getBorderWindowTexposStart), + WRAPM(Textures, getThinBordersTexposStart), + WRAPM(Textures, getMediumBordersTexposStart), + WRAPM(Textures, getBoldBordersTexposStart), + WRAPM(Textures, getPanelBordersTexposStart), + WRAPM(Textures, getWindowBordersTexposStart), { NULL, NULL } }; diff --git a/library/include/modules/Textures.h b/library/include/modules/Textures.h index 1664f6081..95e628d5a 100644 --- a/library/include/modules/Textures.h +++ b/library/include/modules/Textures.h @@ -54,11 +54,11 @@ DFHACK_EXPORT long getControlPanelTexposStart(); /** * Get the first texpos for the DFHack borders. Each is a 7x3 grid. */ -DFHACK_EXPORT long getBorderThinTexposStart(); -DFHACK_EXPORT long getBorderMediumTexposStart(); -DFHACK_EXPORT long getBorderBoldTexposStart(); -DFHACK_EXPORT long getBorderPanelTexposStart(); -DFHACK_EXPORT long getBorderWindowTexposStart(); +DFHACK_EXPORT long getThinBordersTexposStart(); +DFHACK_EXPORT long getMediumBordersTexposStart(); +DFHACK_EXPORT long getBoldBordersTexposStart(); +DFHACK_EXPORT long getPanelBordersTexposStart(); +DFHACK_EXPORT long getWindowBordersTexposStart(); } } diff --git a/library/lua/gui.lua b/library/lua/gui.lua index 311edc1f3..d511cd51f 100644 --- a/library/lua/gui.lua +++ b/library/lua/gui.lua @@ -905,7 +905,7 @@ local BASE_FRAME = { } local function make_frame(name, double_line) - local texpos = dfhack.textures['getBorder'..name..'TexposStart']() + local texpos = dfhack.textures['get'..name..'BordersTexposStart']() local tp = function(offset) if texpos == -1 then return nil end return texpos + offset diff --git a/library/modules/Textures.cpp b/library/modules/Textures.cpp index 40339a616..a30f879a0 100644 --- a/library/modules/Textures.cpp +++ b/library/modules/Textures.cpp @@ -24,11 +24,11 @@ static long g_red_pin_texpos_start = -1; static long g_icons_texpos_start = -1; static long g_on_off_texpos_start = -1; static long g_control_panel_texpos_start = -1; -static long g_border_thin_texpos_start = -1; -static long g_border_medium_texpos_start = -1; -static long g_border_bold_texpos_start = -1; -static long g_border_panel_texpos_start = -1; -static long g_border_window_texpos_start = -1; +static long g_thin_borders_texpos_start = -1; +static long g_medium_borders_texpos_start = -1; +static long g_bold_borders_texpos_start = -1; +static long g_panel_borders_texpos_start = -1; +static long g_window_borders_texpos_start = -1; // Converts an arbitrary Surface to something like the display format // (32-bit RGBA), and converts magenta to transparency if convert_magenta is set @@ -132,15 +132,15 @@ void Textures::init(color_ostream &out) { g_num_dfhack_textures += load_textures(out, "hack/data/art/control-panel.png", &g_control_panel_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-thin.png", - &g_border_thin_texpos_start); + &g_thin_borders_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-medium.png", - &g_border_medium_texpos_start); + &g_medium_borders_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-bold.png", - &g_border_bold_texpos_start); + &g_bold_borders_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-panel.png", - &g_border_panel_texpos_start); + &g_panel_borders_texpos_start); g_num_dfhack_textures += load_textures(out, "hack/data/art/border-window.png", - &g_border_window_texpos_start); + &g_window_borders_texpos_start); DEBUG(textures,out).print("loaded %ld textures\n", g_num_dfhack_textures); @@ -197,22 +197,22 @@ long Textures::getControlPanelTexposStart() { return g_control_panel_texpos_start; } -long Textures::getBorderThinTexposStart() { - return g_border_thin_texpos_start; +long Textures::getThinBordersTexposStart() { + return g_thin_borders_texpos_start; } -long Textures::getBorderMediumTexposStart() { - return g_border_medium_texpos_start; +long Textures::getMediumBordersTexposStart() { + return g_medium_borders_texpos_start; } -long Textures::getBorderBoldTexposStart() { - return g_border_bold_texpos_start; +long Textures::getBoldBordersTexposStart() { + return g_bold_borders_texpos_start; } -long Textures::getBorderPanelTexposStart() { - return g_border_panel_texpos_start; +long Textures::getPanelBordersTexposStart() { + return g_panel_borders_texpos_start; } -long Textures::getBorderWindowTexposStart() { - return g_border_window_texpos_start; +long Textures::getWindowBordersTexposStart() { + return g_window_borders_texpos_start; } diff --git a/plugins/lua/buildingplan/pens.lua b/plugins/lua/buildingplan/pens.lua index c68e12eae..e69a4c210 100644 --- a/plugins/lua/buildingplan/pens.lua +++ b/plugins/lua/buildingplan/pens.lua @@ -18,12 +18,12 @@ function reload_pens() GOOD_TILE_PEN = to_pen{ch='o', fg=COLOR_GREEN, tile=dfhack.screen.findGraphicsTile('CURSORS', 1, 2)} BAD_TILE_PEN = to_pen{ch='X', fg=COLOR_RED, tile=dfhack.screen.findGraphicsTile('CURSORS', 3, 0)} - local tb_texpos = dfhack.textures.getBorderThinTexposStart() + local tb_texpos = dfhack.textures.getThinBordersTexposStart() VERT_TOP_PEN = to_pen{tile=tp(tb_texpos, 10), ch=194, fg=COLOR_GREY, bg=COLOR_BLACK} VERT_MID_PEN = to_pen{tile=tp(tb_texpos, 4), ch=179, fg=COLOR_GREY, bg=COLOR_BLACK} VERT_BOT_PEN = to_pen{tile=tp(tb_texpos, 11), ch=193, fg=COLOR_GREY, bg=COLOR_BLACK} - local mb_texpos = dfhack.textures.getBorderMediumTexposStart() + local mb_texpos = dfhack.textures.getMediumBordersTexposStart() HORI_LEFT_PEN = to_pen{tile=tp(mb_texpos, 12), ch=195, fg=COLOR_GREY, bg=COLOR_BLACK} HORI_MID_PEN = to_pen{tile=tp(mb_texpos, 5), ch=196, fg=COLOR_GREY, bg=COLOR_BLACK} HORI_RIGHT_PEN = to_pen{tile=tp(mb_texpos, 13), ch=180, fg=COLOR_GREY, bg=COLOR_BLACK} From ff498fcc586c37e9464f5e682db0bcc32b4a9114 Mon Sep 17 00:00:00 2001 From: Taxi Service Date: Thu, 18 May 2023 12:50:25 +0200 Subject: [PATCH 06/21] fixed overly aggressive FRAME renaming in docs --- docs/dev/Lua API.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/Lua API.rst b/docs/dev/Lua API.rst index 6fb2aca2c..52ca4d935 100644 --- a/docs/dev/Lua API.rst +++ b/docs/dev/Lua API.rst @@ -4509,7 +4509,7 @@ Has attributes: by 1. The attributes are identical to what is defined in the `FramedScreen class`_. When using the predefined frame styles in the ``gui`` module, remember to ``require`` the gui module and prefix the identifier with - ``gui.``, e.g. ``gui.FRAME_GREY_LINE``. + ``gui.``, e.g. ``gui.GREY_LINE_FRAME``. Has functions: From 58519890b6eda1f29b9f1dc8ddc3c03164ebe38e Mon Sep 17 00:00:00 2001 From: Taxi Service Date: Thu, 18 May 2023 13:13:56 +0200 Subject: [PATCH 07/21] added changelog entry --- docs/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog.txt b/docs/changelog.txt index c9f9fca89..cc717d0bf 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -62,6 +62,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Lua - ``overlay.reload()``: has been renamed to ``overlay.rescan()`` so as not to conflict with the global ``reload()`` function. If you are developing an overlay, please take note of the new function name for reloading your overlay during development. +- `gui.lua`: changed frame naming scheme to `FRAME_X` rather than `X_FRAME`, and added aliases for backwards compatibility. (for example `BOLD_FRAME` is now called `FRAME_BOLD`) ## Removed - `orders`: ``library/military_include_artifact_materials`` library file removed since recent research indicates that platinum blunt weapons and silver crossbows are not more effective than standard steel. the alternate military orders file was also causing unneeded confusion. From c224a534355154173f8b73b6d44cfaa47c0e5da8 Mon Sep 17 00:00:00 2001 From: Taxi Service Date: Thu, 18 May 2023 13:21:18 +0200 Subject: [PATCH 08/21] fixed changelog entry... --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index cc717d0bf..4baa5e54f 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -62,7 +62,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Lua - ``overlay.reload()``: has been renamed to ``overlay.rescan()`` so as not to conflict with the global ``reload()`` function. If you are developing an overlay, please take note of the new function name for reloading your overlay during development. -- `gui.lua`: changed frame naming scheme to `FRAME_X` rather than `X_FRAME`, and added aliases for backwards compatibility. (for example `BOLD_FRAME` is now called `FRAME_BOLD`) +- ``gui.lua``: changed frame naming scheme to `FRAME_X` rather than `X_FRAME`, and added aliases for backwards compatibility. (for example `BOLD_FRAME` is now called `FRAME_BOLD`) ## Removed - `orders`: ``library/military_include_artifact_materials`` library file removed since recent research indicates that platinum blunt weapons and silver crossbows are not more effective than standard steel. the alternate military orders file was also causing unneeded confusion. From 69612bde0f76cdb0656a6b30e0850a5de966022b Mon Sep 17 00:00:00 2001 From: Taxi Service Date: Thu, 18 May 2023 13:27:27 +0200 Subject: [PATCH 09/21] ATTEMPTING to fix changelog entry... --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 4baa5e54f..9495658d9 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -62,7 +62,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Lua - ``overlay.reload()``: has been renamed to ``overlay.rescan()`` so as not to conflict with the global ``reload()`` function. If you are developing an overlay, please take note of the new function name for reloading your overlay during development. -- ``gui.lua``: changed frame naming scheme to `FRAME_X` rather than `X_FRAME`, and added aliases for backwards compatibility. (for example `BOLD_FRAME` is now called `FRAME_BOLD`) +- `gui`: changed frame naming scheme to `FRAME_X` rather than `X_FRAME`, and added aliases for backwards compatibility. (for example `BOLD_FRAME` is now called `FRAME_BOLD`) ## Removed - `orders`: ``library/military_include_artifact_materials`` library file removed since recent research indicates that platinum blunt weapons and silver crossbows are not more effective than standard steel. the alternate military orders file was also causing unneeded confusion. From e7eb664eadde01c29e18c42ae13a80a0044d6a04 Mon Sep 17 00:00:00 2001 From: Taxi Service Date: Thu, 18 May 2023 13:29:26 +0200 Subject: [PATCH 10/21] ATTEMPTING to fix changelog entry... AGAIN --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 9495658d9..3d9ca0356 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -62,7 +62,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Lua - ``overlay.reload()``: has been renamed to ``overlay.rescan()`` so as not to conflict with the global ``reload()`` function. If you are developing an overlay, please take note of the new function name for reloading your overlay during development. -- `gui`: changed frame naming scheme to `FRAME_X` rather than `X_FRAME`, and added aliases for backwards compatibility. (for example `BOLD_FRAME` is now called `FRAME_BOLD`) +- gui.lua: changed frame naming scheme to `FRAME_X` rather than `X_FRAME`, and added aliases for backwards compatibility. (for example `BOLD_FRAME` is now called `FRAME_BOLD`) ## Removed - `orders`: ``library/military_include_artifact_materials`` library file removed since recent research indicates that platinum blunt weapons and silver crossbows are not more effective than standard steel. the alternate military orders file was also causing unneeded confusion. From 4cf88a1f8e68b03bf71de050a96567913aa235bb Mon Sep 17 00:00:00 2001 From: Taxi Service Date: Thu, 18 May 2023 13:52:07 +0200 Subject: [PATCH 11/21] actually fixed changelog entry..? --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 3d9ca0356..c8ccdec15 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -62,7 +62,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Lua - ``overlay.reload()``: has been renamed to ``overlay.rescan()`` so as not to conflict with the global ``reload()`` function. If you are developing an overlay, please take note of the new function name for reloading your overlay during development. -- gui.lua: changed frame naming scheme to `FRAME_X` rather than `X_FRAME`, and added aliases for backwards compatibility. (for example `BOLD_FRAME` is now called `FRAME_BOLD`) +- ``gui.lua``: changed frame naming scheme to ``FRAME_X`` rather than ``X_FRAME``, and added aliases for backwards compatibility. (for example ``BOLD_FRAME`` is now called ``FRAME_BOLD``) ## Removed - `orders`: ``library/military_include_artifact_materials`` library file removed since recent research indicates that platinum blunt weapons and silver crossbows are not more effective than standard steel. the alternate military orders file was also causing unneeded confusion. From afcbee48ddf1b67073993a9223e0c22a1152ffe9 Mon Sep 17 00:00:00 2001 From: TaxiService Date: Thu, 18 May 2023 19:28:30 +0200 Subject: [PATCH 12/21] Update docs/changelog.txt Co-authored-by: Myk --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index c8ccdec15..832a81c56 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -62,7 +62,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Lua - ``overlay.reload()``: has been renamed to ``overlay.rescan()`` so as not to conflict with the global ``reload()`` function. If you are developing an overlay, please take note of the new function name for reloading your overlay during development. -- ``gui.lua``: changed frame naming scheme to ``FRAME_X`` rather than ``X_FRAME``, and added aliases for backwards compatibility. (for example ``BOLD_FRAME`` is now called ``FRAME_BOLD``) +- ``gui``: changed frame naming scheme to ``FRAME_X`` rather than ``X_FRAME``, and added aliases for backwards compatibility. (for example ``BOLD_FRAME`` is now called ``FRAME_BOLD``) ## Removed - `orders`: ``library/military_include_artifact_materials`` library file removed since recent research indicates that platinum blunt weapons and silver crossbows are not more effective than standard steel. the alternate military orders file was also causing unneeded confusion. From 9928ea874abe18ca577d3214378f69259f4e4298 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Wed, 17 May 2023 17:26:33 -0700 Subject: [PATCH 13/21] transfer Ctrl-H keybinding to gui/autodump --- data/init/dfhack.keybindings.init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/init/dfhack.keybindings.init b/data/init/dfhack.keybindings.init index 0fc596215..f677ca301 100644 --- a/data/init/dfhack.keybindings.init +++ b/data/init/dfhack.keybindings.init @@ -43,8 +43,8 @@ keybinding add Ctrl-C spotclean # destroy the selected item keybinding add Ctrl-K@dwarfmode autodump-destroy-item -# destroy items designated for dump in the selected tile -keybinding add Ctrl-H@dwarfmode autodump-destroy-here +# bring up the autodump UI +keybinding add Ctrl-H@dwarfmode gui/autodump # apply blueprints to the map keybinding add Ctrl-Shift-Q@dwarfmode gui/quickfort From ee5553358e536bc97be7b9f7aa82a376a3e29626 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Wed, 17 May 2023 17:28:35 -0700 Subject: [PATCH 14/21] update changelog --- docs/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog.txt b/docs/changelog.txt index 832a81c56..64d491906 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -55,6 +55,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: - `gui/design`: Improved performance for drawing shapes - Dreamfort: improve traffic patterns throughout the fortress (stockpiles and zones are still not working, pending updates in `quickfort`) - Core: For debugging purposes, you can now pass ``--disable-dfhack`` on the Dwarf Fortress commandline or specify ``DFHACK_DISABLE=1`` in the environment to disable DFHack for the current session. +- `gui/autodump`: fort-mode keybinding: Ctrl-H ## Documentation From 796eb331ff4992de64e53c8021506631f178295c Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 18 May 2023 11:01:16 -0700 Subject: [PATCH 15/21] update scripts head --- scripts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts b/scripts index 97557b923..0f02ade81 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit 97557b9239a5ad8297f6a32651b78fd9dbb333ec +Subproject commit 0f02ade81771a7c24a4bbd6cfd7969704288f94b From 73f6c66c3e484451335cb4c266031d3776cf22bb Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 18 May 2023 11:13:47 -0700 Subject: [PATCH 16/21] bump version to 50.08-r2rc1 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d1d4c562..c1560c630 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -192,8 +192,8 @@ endif() # set up versioning. set(DF_VERSION "50.08") -set(DFHACK_RELEASE "r1") -set(DFHACK_PRERELEASE FALSE) +set(DFHACK_RELEASE "r2rc1") +set(DFHACK_PRERELEASE TRUE) set(DFHACK_VERSION "${DF_VERSION}-${DFHACK_RELEASE}") From 1212ee0ef8bd60cacd2b05fc8f3afb96ef1d11fb Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 18 May 2023 14:06:00 -0700 Subject: [PATCH 17/21] retrieve steam SDK from a private repo --- .github/workflows/build.yml | 15 +++++---- .github/workflows/steam.yml | 13 ++++---- package/windows/CMakeLists.txt | 60 +++++++++++++++------------------- 3 files changed, 42 insertions(+), 46 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 131c21743..94aa49452 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,12 +72,6 @@ jobs: # - name: Download DF # run: | # sh ci/download-df.sh - - name: Restore steam SDK - uses: actions/cache@v3 - with: - path: depends/steam - key: steam-sdk-156 - enableCrossOsArchive: true - name: Configure DFHack env: CC: gcc-${{ matrix.gcc }} @@ -145,6 +139,13 @@ jobs: with: submodules: true fetch-depth: 0 + - name: Get 3rd party SDKs + uses: actions/checkout@v3 + with: + repository: DFHack/3rdparty + ref: main + token: ${{ secrets.DFHACK_3RDPARTY_TOKEN }} + path: depends - name: Fetch ccache uses: actions/cache@v3 with: @@ -155,7 +156,7 @@ jobs: ccache-win64-cross-msvc - name: Cross-compile win64 artifacts env: - CMAKE_EXTRA_ARGS: '-DBUILD_STONESENSE:BOOL=1' + CMAKE_EXTRA_ARGS: '-DBUILD_STONESENSE:BOOL=1 -DBUILD_DFLAUNCH:BOOL=1' run: | cd build bash -x build-win64-from-linux.sh diff --git a/.github/workflows/steam.yml b/.github/workflows/steam.yml index 5210b3a11..4f785969a 100644 --- a/.github/workflows/steam.yml +++ b/.github/workflows/steam.yml @@ -32,6 +32,13 @@ jobs: submodules: true fetch-depth: 0 ref: ${{ github.event.inputs.commit_hash }} + - name: Get 3rd party SDKs + uses: actions/checkout@v3 + with: + repository: DFHack/3rdparty + ref: main + token: ${{ secrets.DFHACK_3RDPARTY_TOKEN }} + path: depends - name: Fetch ccache uses: actions/cache@v3 with: @@ -40,12 +47,6 @@ jobs: restore-keys: | ccache-win64-cross-msvc-${{ github.event.inputs.commit_hash }} ccache-win64-cross-msvc - - name: Restore steam SDK - uses: actions/cache@v3 - with: - path: depends/steam - key: steam-sdk-156 - enableCrossOsArchive: true - name: Cross-compile win64 artifacts env: CMAKE_EXTRA_ARGS: '-DBUILD_STONESENSE:BOOL=1 -DBUILD_DFLAUNCH:BOOL=1' diff --git a/package/windows/CMakeLists.txt b/package/windows/CMakeLists.txt index d92d687c4..ad5469c6b 100644 --- a/package/windows/CMakeLists.txt +++ b/package/windows/CMakeLists.txt @@ -1,38 +1,32 @@ project(package_windows) -if(WIN32) - if (BUILD_DFLAUNCH) - if ((DEFINED ENV{steam_username}) AND (DEFINED ENV{steam_password})) - # download Steam SDK - set (STEAMAPI_DIR ${dfhack_SOURCE_DIR}/depends/steam) - file(DOWNLOAD "https://partner.steamgames.com/downloads/steamworks_sdk_156.zip" - ${STEAMAPI_DIR}/steamworks_sdk_156.zip - EXPECTED_HASH MD5=af5a579990dbe5ae4c1b0689260d001b - USERPWD $ENV{steam_username}:$ENV{steam_password} - STATUS STEAM_SDK_DOWNLOAD_STATUS - SHOW_PROGRESS - ) - list(GET STEAM_SDK_DOWNLOAD_STATUS 0 STEAM_SDK_DL_STATUS_CODE) - list(GET STEAM_SDK_DOWNLOAD_STATUS 1 STEAM_SDK_DL_ERROR_MESSAGE) - if (NOT (${STEAM_SDK_DL_STATUS_CODE} EQUAL 0)) - message(FATAL_ERROR "Steam SDK download: " ${STEAM_SDK_DL_ERROR_MESSAGE}) - else () - message(STATUS "Steam SDK download: " ${STEAM_SDK_DL_ERROR_MESSAGE}) - file(ARCHIVE_EXTRACT - INPUT ${STEAMAPI_DIR}/steamworks_sdk_156.zip - DESTINATION ${STEAMAPI_DIR}) - set(STEAMAPI_LIBRARY "${STEAMAPI_DIR}/sdk/redistributable_bin/win64/steam_api64.lib") - set(STEAMAPI_SOURCE_DIR "${STEAMAPI_DIR}/sdk/public/steam") - set(STEAMAPI_SHARED_LIBRARY "${STEAMAPI_DIR}/sdk/redistributable_bin/win64/steam_api64.dll") - endif() - else() - message(SEND_ERROR "Need to set steam_username and steam_password in environment to download Steamworks SDK") - endif() +option(BUILD_DFLAUNCH "Whether to build the Steam launcher exectuable (requires Steam SDK)." OFF) - include_directories(${STEAMAPI_SOURCE_DIR}) - link_libraries(${STEAMAPI_LIBRARY}) - add_executable(launchdf WIN32 launchdf.cpp) - install(TARGETS launchdf DESTINATION ${DFHACK_DATA_DESTINATION}) - install(FILES ${STEAMAPI_SHARED_LIBRARY} DESTINATION ${DFHACK_DATA_DESTINATION}) +if(WIN32 AND BUILD_DFLAUNCH) + # builder must manually download Steam SDK + set (STEAMAPI_DIR ${dfhack_SOURCE_DIR}/depends/steam) + set (STEAMAPI_VER 156) + set (STEAMAPI_ZIP_EXPECTED_HASH af5a579990dbe5ae4c1b0689260d001b) + set (STEAMSDK_ZIP ${STEAMAPI_DIR}/steamworks_sdk_${STEAMAPI_VER}.zip) + + set (STEAM_SDK_HASH "NOT FOUND") + file(MD5 ${STEAMSDK_ZIP} STEAM_SDK_HASH) + if (NOT (${STEAM_SDK_HASH} STREQUAL ${STEAMAPI_ZIP_EXPECTED_HASH})) + message(FATAL_ERROR "You need the Steamworks SDK at ${STEAMSDK_ZIP} to build launchdf.exe. Please disable the BUILD_DFLAUNCH CMake option or download the Steam SDK from: https://partner.steamgames.com/downloads/steamworks_sdk_${STEAMAPI_VER}.zip") + endif() + if (${STEAMSDK_ZIP} IS_NEWER_THAN ${STEAMAPI_DIR}/sdk) + file(ARCHIVE_EXTRACT + INPUT ${STEAMSDK_ZIP} + DESTINATION ${STEAMAPI_DIR}) endif() + + set(STEAMAPI_LIBRARY "${STEAMAPI_DIR}/sdk/redistributable_bin/win64/steam_api64.lib") + set(STEAMAPI_SOURCE_DIR "${STEAMAPI_DIR}/sdk/public/steam") + set(STEAMAPI_SHARED_LIBRARY "${STEAMAPI_DIR}/sdk/redistributable_bin/win64/steam_api64.dll") + + include_directories(${STEAMAPI_SOURCE_DIR}) + link_libraries(${STEAMAPI_LIBRARY}) + add_executable(launchdf WIN32 launchdf.cpp) + install(TARGETS launchdf DESTINATION ${DFHACK_DATA_DESTINATION}) + install(FILES ${STEAMAPI_SHARED_LIBRARY} DESTINATION ${DFHACK_DATA_DESTINATION}) endif() From 14bbff85376cbdf412aadde12dcc1a750c0eb57f Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 18 May 2023 14:39:49 -0700 Subject: [PATCH 18/21] secrets can't be accessed from PRs; remove from build action --- .github/workflows/build.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94aa49452..9aed03c17 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -139,13 +139,6 @@ jobs: with: submodules: true fetch-depth: 0 - - name: Get 3rd party SDKs - uses: actions/checkout@v3 - with: - repository: DFHack/3rdparty - ref: main - token: ${{ secrets.DFHACK_3RDPARTY_TOKEN }} - path: depends - name: Fetch ccache uses: actions/cache@v3 with: @@ -156,7 +149,7 @@ jobs: ccache-win64-cross-msvc - name: Cross-compile win64 artifacts env: - CMAKE_EXTRA_ARGS: '-DBUILD_STONESENSE:BOOL=1 -DBUILD_DFLAUNCH:BOOL=1' + CMAKE_EXTRA_ARGS: '-DBUILD_STONESENSE:BOOL=1' run: | cd build bash -x build-win64-from-linux.sh From b6ee0d5c02cb620cf6f466fa2f860abfa600ca19 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 18 May 2023 14:59:08 -0700 Subject: [PATCH 19/21] follow advice in actions/checkout#664 --- .github/workflows/steam.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/steam.yml b/.github/workflows/steam.yml index 4f785969a..5ca1ebe8d 100644 --- a/.github/workflows/steam.yml +++ b/.github/workflows/steam.yml @@ -32,6 +32,7 @@ jobs: submodules: true fetch-depth: 0 ref: ${{ github.event.inputs.commit_hash }} + persist-credentials: false - name: Get 3rd party SDKs uses: actions/checkout@v3 with: From 09621809812812238057b2913766ef4141b90f8f Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 18 May 2023 15:10:15 -0700 Subject: [PATCH 20/21] attempting as an ssh-key instead of a token --- .github/workflows/steam.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/steam.yml b/.github/workflows/steam.yml index 5ca1ebe8d..7f4c58afe 100644 --- a/.github/workflows/steam.yml +++ b/.github/workflows/steam.yml @@ -32,13 +32,12 @@ jobs: submodules: true fetch-depth: 0 ref: ${{ github.event.inputs.commit_hash }} - persist-credentials: false - name: Get 3rd party SDKs uses: actions/checkout@v3 with: repository: DFHack/3rdparty ref: main - token: ${{ secrets.DFHACK_3RDPARTY_TOKEN }} + ssh-key: ${{ secrets.DFHACK_3RDPARTY_TOKEN }} path: depends - name: Fetch ccache uses: actions/cache@v3 From b2102d66fa3668eeb3e62f3ef07433553291bf7b Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 18 May 2023 16:16:24 -0700 Subject: [PATCH 21/21] check out repo directly in steam dir so we don't bork the rest of depends --- .github/workflows/steam.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/steam.yml b/.github/workflows/steam.yml index 7f4c58afe..46dd27270 100644 --- a/.github/workflows/steam.yml +++ b/.github/workflows/steam.yml @@ -38,7 +38,7 @@ jobs: repository: DFHack/3rdparty ref: main ssh-key: ${{ secrets.DFHACK_3RDPARTY_TOKEN }} - path: depends + path: depends/steam - name: Fetch ccache uses: actions/cache@v3 with: