diff --git a/.github/workflows/steam.yml b/.github/workflows/steam.yml index 71e56b662..ca6802446 100644 --- a/.github/workflows/steam.yml +++ b/.github/workflows/steam.yml @@ -36,6 +36,12 @@ jobs: restore-keys: | ccache-win64-cross-msvc-develop-${{ github.event.inputs.commit_hash }} ccache-win64-cross-msvc + - name: Restore steam SDK + uses: actions/cache@v3 + with: + path: depends/steam/steamworks_sdk_156.zip + 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/docs/changelog.txt b/docs/changelog.txt index b85c738a5..91f25a323 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -57,6 +57,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Lua - ``widgets.RangeSlider``: new mouse-controlled two-headed slider widget - ``gui.ZScreenModal``: ZScreen subclass for modal dialogs +- ``widgets.CycleHotkeyLabel``: exposed "key_sep" and "val_gap" attributes for improved stylistic control. ## Removed - `title-version`: replaced by an `overlay` widget diff --git a/docs/dev/Lua API.rst b/docs/dev/Lua API.rst index 9c320fc98..37d85f7f6 100644 --- a/docs/dev/Lua API.rst +++ b/docs/dev/Lua API.rst @@ -4912,12 +4912,17 @@ It has the following attributes: :key: The hotkey keycode to display, e.g. ``'CUSTOM_A'``. :key_back: Similar to ``key``, but will cycle backwards (optional) +:key_sep: If specified, will be used to customize how the activation key is + displayed. See ``token.key_sep`` in the ``Label`` documentation. :label: The string (or a function that returns a string) to display after the hotkey. :label_width: The number of spaces to allocate to the ``label`` (for use in aligning a column of ``CycleHotkeyLabel`` labels). :label_below: If ``true``, then the option value will apear below the label instead of to the right of it. Defaults to ``false``. +:val_gap: The size of the gap between the label text and the option value. + Default is ``1``. If set to ``0``, there'll be no gap between the strings. + Note that ``val_gap`` is ignored if ``label_below`` is set to ``true``. :options: A list of strings or tables of ``{label=string or fn, value=val[, pen=pen]}``. String options use the same string for the label and value and use the default pen. The optional ``pen`` diff --git a/library/lua/gui/widgets.lua b/library/lua/gui/widgets.lua index a778df639..c7cde698c 100644 --- a/library/lua/gui/widgets.lua +++ b/library/lua/gui/widgets.lua @@ -1488,6 +1488,8 @@ CycleHotkeyLabel = defclass(CycleHotkeyLabel, Label) CycleHotkeyLabel.ATTRS{ key=DEFAULT_NIL, key_back=DEFAULT_NIL, + key_sep=': ', + val_gap=1, label=DEFAULT_NIL, label_width=DEFAULT_NIL, label_below=false, @@ -1499,17 +1501,16 @@ CycleHotkeyLabel.ATTRS{ function CycleHotkeyLabel:init() self:setOption(self.initial_option) - local val_gap = 1 if self.label_below then - val_gap = 0 + (self.key_back and 1 or 0) + (self.key and 3 or 0) + self.val_gap = 0 + (self.key_back and 1 or 0) + (self.key and 3 or 0) end self:setText{ self.key_back ~= nil and {key=self.key_back, key_sep='', width=0, on_activate=self:callback('cycle', true)} or {}, - {key=self.key, key_sep=': ', text=self.label, width=self.label_width, + {key=self.key, key_sep=self.key_sep, text=self.label, width=self.label_width, on_activate=self:callback('cycle')}, self.label_below and NEWLINE or '', - {gap=val_gap, text=self:callback('getOptionLabel'), + {gap=self.val_gap, text=self:callback('getOptionLabel'), pen=self:callback('getOptionPen')}, } end diff --git a/package/windows/CMakeLists.txt b/package/windows/CMakeLists.txt index b74cdfec5..d92d687c4 100644 --- a/package/windows/CMakeLists.txt +++ b/package/windows/CMakeLists.txt @@ -9,13 +9,22 @@ if(WIN32) ${STEAMAPI_DIR}/steamworks_sdk_156.zip EXPECTED_HASH MD5=af5a579990dbe5ae4c1b0689260d001b USERPWD $ENV{steam_username}:$ENV{steam_password} + STATUS STEAM_SDK_DOWNLOAD_STATUS + SHOW_PROGRESS ) - 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") + 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() diff --git a/plugins/lua/overlay.lua b/plugins/lua/overlay.lua index 81dde32b6..cf7008a40 100644 --- a/plugins/lua/overlay.lua +++ b/plugins/lua/overlay.lua @@ -577,7 +577,7 @@ TitleVersionOverlay.ATTRS{ function TitleVersionOverlay:init() local text = {} table.insert(text, 'DFHack ' .. dfhack.getDFHackVersion() .. - (dfhack.isPrerelease() and (' (git: %s)'):format(dfhack.getGitCommit(true)) or '')) + (dfhack.isRelease() and '' or (' (git: %s)'):format(dfhack.getGitCommit(true)))) if #dfhack.getDFHackBuildID() > 0 then table.insert(text, NEWLINE) table.insert(text, 'Build ID: ' .. dfhack.getDFHackBuildID()) diff --git a/scripts b/scripts index 6b4001dc2..ad1998a00 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit 6b4001dc2f9d0e662bb7d06d8ba6fcf343a656aa +Subproject commit ad1998a0032ce50e90d05429a4178b668c0840ba