Skip to content

Commit

Permalink
Merge branch 'develop' into testing
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Apr 22, 2024
2 parents e5f75a3 + d4800b0 commit 0f9c70b
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 32 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/generate-symbols.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down
73 changes: 48 additions & 25 deletions .github/workflows/watch-df-steam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion library/lua/gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
5 changes: 4 additions & 1 deletion test/library/gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0f9c70b

Please sign in to comment.