Skip to content

Commit

Permalink
Merge branch 'develop' into adv-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Apr 22, 2024
2 parents 68474d7 + d4800b0 commit 5bc0fec
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 137 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
71 changes: 48 additions & 23 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,34 +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/stderr.txt
tail -F $HOME/Steam/logs/stderr.txt &
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 "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
2 changes: 2 additions & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ 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
4 changes: 4 additions & 0 deletions docs/dev/Lua API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ Numerical indices correspond to the shift value,
and if a subfield occupies multiple bits, the
``ipairs`` order would have a gap.

Additionally, bitfields have a ``whole`` property,
which returns the value of the bitfield as an
integer.

Since currently there is no API to allocate a bitfield
object fully in GC-managed lua heap, consider using the
lua table assignment feature outlined below in order to
Expand Down
8 changes: 4 additions & 4 deletions docs/plugins/cursecheck.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ cursecheck
:summary: Check for cursed creatures.
:tags: fort armok inspection units

This command checks a single map tile (or the whole map/world) for cursed
creatures (ghosts, vampires, necromancers, werebeasts, zombies, etc.).
This command checks a single unit or the whole map for curses (ghosts, vampires,
necromancers, werebeasts, zombies, etc.).

With an active in-game cursor, only the selected tile will be checked. Without a
cursor, the whole map will be checked.
If a unit is selected, only the selected unit will be checked. Otherwise, all
units on the map will be checked.

By default, you will just see the count of cursed creatures in case you just
want to find out if you have any of them running around in your fort. Dead and
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
Loading

0 comments on commit 5bc0fec

Please sign in to comment.