diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 131c21743..9aed03c17 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 }} diff --git a/.github/workflows/steam.yml b/.github/workflows/steam.yml index 5210b3a11..46dd27270 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 + ssh-key: ${{ secrets.DFHACK_3RDPARTY_TOKEN }} + path: depends/steam - 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/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}") 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 diff --git a/docs/changelog.txt b/docs/changelog.txt index 59974909e..337c1d2ef 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -56,6 +56,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: - 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. - `overlay`: added links to the quickstart guide and the control panel on the DF title screen +- `gui/autodump`: fort-mode keybinding: Ctrl-H ## Documentation @@ -63,6 +64,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``) ## 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. diff --git a/docs/dev/Lua API.rst b/docs/dev/Lua API.rst index 1d70647f7..52ca4d935 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. diff --git a/library/lua/gui.lua b/library/lua/gui.lua index 7e991e1df..d511cd51f 100644 --- a/library/lua/gui.lua +++ b/library/lua/gui.lua @@ -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/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() 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 diff --git a/scripts b/scripts index 2a646f9c7..0f02ade81 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit 2a646f9c7204253cae70bbfb5ed194182e0ac373 +Subproject commit 0f02ade81771a7c24a4bbd6cfd7969704288f94b