diff --git a/.github/workflows/generate-symbols.yml b/.github/workflows/generate-symbols.yml index 6ecfa04ff8..f73d33dca4 100644 --- a/.github/workflows/generate-symbols.yml +++ b/.github/workflows/generate-symbols.yml @@ -42,7 +42,6 @@ on: steam_branch: description: DFHack Steam branch to deploy to (leave blank to skip deploy) type: string - default: staging jobs: package: @@ -113,8 +112,6 @@ jobs: else BETA_PARAMS="-beta ${{ inputs.df_steam_branch }}" fi - touch $HOME/Steam/logs/stderr.txt - tail -F $HOME/Steam/logs/stderr.txt & ${{ steps.steamcmd.outputs.executable }} \ +@ShutdownOnFailedCommand 1 \ +force_install_dir $PWD/DF_steam \ @@ -223,8 +220,6 @@ jobs: else BETA_PARAMS="-beta ${{ inputs.df_steam_branch }}" fi - touch $HOME/Steam/logs/stderr.txt - tail -F $HOME/Steam/logs/stderr.txt & ${{ steps.steamcmd.outputs.executable }} \ +@ShutdownOnFailedCommand 1 \ +@sSteamCmdForcePlatformType windows \ diff --git a/.github/workflows/watch-df-steam.yml b/.github/workflows/watch-df-steam.yml index 330cdc46c6..12d428f1e7 100644 --- a/.github/workflows/watch-df-steam.yml +++ b/.github/workflows/watch-df-steam.yml @@ -17,6 +17,11 @@ jobs: version: 51.01-beta df_steam_branch: beta steam_branch: adventure-beta + - dfhack_ref: testing + structures_ref: testing + version: testing + df_steam_branch: testing + steam_branch: '' steps: - name: Setup steamcmd id: steamcmd @@ -30,36 +35,54 @@ jobs: path: state key: watchstate-${{ matrix.version }}-${{ env.TIMESTAMP_SECONDS }} restore-keys: watchstate-${{ matrix.version }} - - name: Detect changes on branch - shell: bash + - name: Prep Steam auth env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }} STEAM_CONFIG_VDF: ${{ secrets.STEAM_CONFIG_VDF }} run: | mkdir -p $HOME/Steam/config echo "$STEAM_CONFIG_VDF" | base64 -d >$HOME/Steam/config/config.vdf - touch $HOME/Steam/logs/{appinfo,cloud,compat,parental,workshop}_log.txt - ls -l $HOME/Steam/logs - tail -n0 -F $HOME/Steam/logs/* & - timestamp=$(${{ steps.steamcmd.outputs.executable }} \ - +@ShutdownOnFailedCommand 1 \ - +login $STEAM_USERNAME \ - +app_info_request 975370 \ - +app_info_print 975370 \ - +quit | awk '/^{/,0' | awk '/^\t\t"branches"/,0' | awk '/^\t\t\t"beta"/,0' | fgrep timeupdated | head -n1 | cut -d'"' -f4) - ls -l $HOME/Steam/logs - echo "timestamp of last branch update: $timestamp" - mkdir -p state - touch state/timestamp - last_timestamp=$(cat state/timestamp) - echo "stored timestamp of last branch update: $last_timestamp" - if [ "$timestamp" != "$last_timestamp" ]; then - echo "launching generate-symbols" - echo "$timestamp" >state/timestamp - gh workflow run generate-symbols.yml -R DFHack/dfhack -r ${{ matrix.dfhack_ref }} -f structures_ref=${{ matrix.structures_ref }} -f version=${{ matrix.version }} -f platform=all -f channel=steam -f df_steam_branch=${{ matrix.df_steam_branch }} -f steam_branch=${{ matrix.steam_branch }} - echo TIMESTAMP_UPDATED=1 >> $GITHUB_ENV - fi + - name: Compare branch metadata + uses: nick-fields/retry@v3 + env: + STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }} + with: + timeout_minutes: 2 + command: | + timestamp=$(${{ steps.steamcmd.outputs.executable }} \ + +@ShutdownOnFailedCommand 1 \ + +login $STEAM_USERNAME \ + +app_info_request 975370 \ + +app_info_print 975370 \ + +quit | \ + awk '/^{/,0' | \ + awk '/^\t\t"branches"/,0' | \ + awk '/^\t\t\t"beta"/,0' | \ + fgrep timeupdated | \ + head -n1 | \ + cut -d'"' -f4) + echo "timestamp of last branch update: $timestamp" + mkdir -p state + touch state/timestamp + last_timestamp=$(cat state/timestamp) + echo "stored timestamp of last branch update: $last_timestamp" + if [ "$timestamp" != "$last_timestamp" ]; then + echo "$timestamp" >state/timestamp + echo TIMESTAMP_UPDATED=1 >> $GITHUB_ENV + fi + - name: Launch symbol generation workflow + if: env.TIMESTAMP_UPDATED + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh workflow run generate-symbols.yml \ + -R DFHack/dfhack \ + -r ${{ matrix.dfhack_ref }} \ + -f structures_ref=${{ matrix.structures_ref }} \ + -f version=${{ matrix.version }} \ + -f platform=all \ + -f channel=steam \ + -f df_steam_branch=${{ matrix.df_steam_branch }} \ + -f steam_branch=${{ matrix.steam_branch }} - name: Save state uses: actions/cache/save@v4 if: env.TIMESTAMP_UPDATED diff --git a/docs/changelog.txt b/docs/changelog.txt index ca28bc7d5c..21e95d62fd 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -58,6 +58,7 @@ Template for new versions: ## Fixes - Fixed misidentification of visitors from your own civ as residents; affects all tools that iterate through citizens/residents - `cursecheck`: don't try to rely on cursor; check for selected unit instead +- Fixed incorrect DFHack background window texture when DF is started in ascii mode and subsequently switched to graphics mode ## Misc Improvements - `suspendmanager`: Account for walls planned on the z-layer below when determining accessibility to a job diff --git a/library/lua/gui.lua b/library/lua/gui.lua index ec8b9352bc..dac075f1dc 100644 --- a/library/lua/gui.lua +++ b/library/lua/gui.lua @@ -10,7 +10,16 @@ local getval = utils.getval local to_pen = dfhack.pen.parse -CLEAR_PEN = to_pen{tile=dfhack.internal.getAddress('init') and df.global.init.texpos_border_interior or nil, ch=32, fg=0, bg=0, write_to_lower=true} +local function getInteriorTexpos() + if not dfhack.internal.getAddress('init') then return end + if dfhack.screen.inGraphicsMode() then + return df.global.init.texpos_border_interior + else + return df.global.init.classic_texpos_border_interior + end +end + +CLEAR_PEN = to_pen{tile=getInteriorTexpos(), ch=32, fg=0, bg=0, write_to_lower=true} TRANSPARENT_PEN = to_pen{tile=0, ch=0} KEEP_LOWER_PEN = to_pen{ch=32, fg=0, bg=0, keep_lower=true} diff --git a/test/library/gui.lua b/test/library/gui.lua index 3fc8b889d6..6cc2b5a302 100644 --- a/test/library/gui.lua +++ b/test/library/gui.lua @@ -11,8 +11,11 @@ function test.getKeyDisplay() end function test.clear_pen() + local expected_tile = dfhack.screen.inGraphicsMode() and + df.global.init.texpos_border_interior or df.global.init.classic_texpos_border_interior + expect.table_eq(gui.CLEAR_PEN, { - tile = df.global.init.texpos_border_interior, + tile = expected_tile, ch = string.byte(' '), fg = COLOR_BLACK, bg = COLOR_BLACK,