Skip to content

Commit

Permalink
Merge branch 'DFHack:develop' into squid-docs-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
realSquidCoder authored Feb 13, 2025
2 parents 3e77c6b + 9485eae commit f030289
Show file tree
Hide file tree
Showing 107 changed files with 2,817 additions and 1,386 deletions.
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
If this PR makes an externally-visible change in behavior or API, please add an appropriate line to `docs/changelog.txt`.
10 changes: 6 additions & 4 deletions .github/workflows/generate-symbols.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,9 @@ jobs:
pip install itch-dl
minor=$(echo "${{ inputs.version }}" | cut -d. -f1)
patch=$(echo "${{ inputs.version }}" | cut -d. -f2)
itch-dl https://kitfoxgames.itch.io/dwarf-fortress --download-to . --api-key $ITCH_API_KEY
tar xjf "kitfoxgames/dwarf-fortress/files/dwarf_fortress_${minor}_${patch}_linux.tar.bz2" -C DF_itch
fname="dwarf_fortress_${minor}_${patch}_linux.tar.bz2"
itch-dl https://kitfoxgames.itch.io/dwarf-fortress --download-to . --api-key $ITCH_API_KEY --filter-files-glob "${fname}"
tar xjf "kitfoxgames/dwarf-fortress/files/${fname}" -C DF_itch
tar xjf dfhack-symbols-linux64-build.tar.bz2 -C DF_itch
xml/symbols_gen_linux.sh ${{ inputs.version }} ITCH DF_itch
Expand Down Expand Up @@ -270,8 +271,9 @@ jobs:
pip install itch-dl
minor=$(echo "${{ inputs.version }}" | cut -d. -f1)
patch=$(echo "${{ inputs.version }}" | cut -d. -f2)
itch-dl https://kitfoxgames.itch.io/dwarf-fortress --download-to . --api-key $ITCH_API_KEY
unzip -d DF_itch "kitfoxgames/dwarf-fortress/files/dwarf_fortress_${minor}_${patch}_windows.zip"
fname="dwarf_fortress_${minor}_${patch}_windows.zip"
itch-dl https://kitfoxgames.itch.io/dwarf-fortress --download-to . --api-key $ITCH_API_KEY --filter-files-glob "${fname}"
unzip -d DF_itch "kitfoxgames/dwarf-fortress/files/${fname}"
xml/symbols_gen_windows.sh ${{ inputs.version }} ITCH DF_itch
# Classic
Expand Down
155 changes: 155 additions & 0 deletions .github/workflows/watch-df-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: Watch DF Releases

on:
schedule:
- cron: '8/10 * * * *'
workflow_dispatch:

jobs:
check-steam:
if: github.repository == 'DFHack/dfhack'
name: Check Steam (${{ matrix.df_steam_branch }}) for new DF releases
runs-on: ubuntu-latest
concurrency: watch-release-steam-${{ matrix.df_steam_branch }}
strategy:
fail-fast: false
matrix:
# df_steam_branch: which DF Steam branch to watch
# platform: leave blank to default to all
# structures_ref: leave blank to default to master
# dfhack_ref: leave blank if no structures update is desired
# steam_branch: leave blank if no DFHack steam push is desired
include:
- df_steam_branch: public
- df_steam_branch: beta
steps:
- name: Fetch state
uses: actions/cache/restore@v4
with:
path: state
key: watch-release-steam-${{ matrix.df_steam_branch }}
- name: Compare branch metadata
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
retry_wait_seconds: 60
command: |
blob=$(wget 'https://api.steamcmd.net/v1/info/975370?pretty=1' -O- | \
awk '/^ *"branches"/,0' | \
awk '/^ *"${{ matrix.df_steam_branch }}"/,0')
buildid=$(echo "$blob" | \
fgrep buildid | \
head -n1 | \
cut -d'"' -f4)
timestamp=$(echo "$blob" | \
fgrep timeupdated | \
head -n1 | \
cut -d'"' -f4)
test -z "$buildid" && echo "no buildid result" && exit 1
test -z "$timestamp" && echo "no timestamp result" && exit 1
test "$buildid" -gt 0 || exit 1
test "$timestamp" -gt 0 || exit 1
echo "buildid and timestamp of last branch update: $buildid, $timestamp"
mkdir -p state
touch state/buildid state/timestamp
last_buildid=$(cat state/buildid)
last_timestamp=$(cat state/timestamp)
if [ -z "$last_timestamp" ]; then
echo "no stored timestamp"
last_buildid=0
last_timestamp=0
else
echo "stored buildid and timestamp of last branch update: $last_buildid, $last_timestamp"
fi
if [ "$buildid" -ne "$last_buildid" -a "$timestamp" -gt "$last_timestamp" ]; then
echo "branch updated"
echo "$buildid" >state/buildid
echo "$timestamp" >state/timestamp
echo BUILDID=$buildid >> $GITHUB_ENV
fi
- name: Discord Webhook Action
uses: tsickert/[email protected]
if: env.BUILDID
with:
webhook-url: ${{ secrets.DISCORD_TEAM_PRIVATE_WEBHOOK_URL }}
content: "<@&${{ secrets.DISCORD_TEAM_ROLE_ID }}> Steam ${{ matrix.df_steam_branch }} branch updated (build id: ${{ env.BUILDID }})"
- name: Launch symbol generation workflow
if: env.BUILDID && matrix.dfhack_ref
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=auto \
-f platform=${{ matrix.platform }} \
-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.BUILDID
with:
path: state
key: watch-release-steam-${{ matrix.df_steam_branch }}-${{ env.BUILDID }}

check-non-steam:
if: github.repository == 'DFHack/dfhack'
name: Check ${{ matrix.channel }} for new DF releases
runs-on: ubuntu-latest
concurrency: watch-release-${{ matrix.channel }}
strategy:
fail-fast: false
matrix:
include:
- channel: itch
url: 'https://kitfoxgames.itch.io/dwarf-fortress'
prefix: 'dwarf_fortress'
- channel: classic
url: 'https://www.bay12games.com/dwarves/'
prefix: 'df'
steps:
- name: Fetch state
uses: actions/cache/restore@v4
with:
path: state
key: watch-release-${{ matrix.channel }}
- name: Compare versions
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
retry_wait_seconds: 60
command: |
version=$(wget "${{ matrix.url }}" -qO- | tr '"' '\n' | fgrep 'tar.bz2' | head -n1 | sed -r 's/${{ matrix.prefix }}_([0-9]{2})_([0-9]{2})_linux.tar.bz2/\1.\2/')
echo "latest ${{ matrix.channel }} version: $version"
if ! grep -qE '^[0-9]+\.[0-9]+$' <<<"$version"; then
echo "invalid version"
exit 1
fi
mkdir -p state
touch state/last_version
last_version=$(cat state/last_version)
if [ -z "$last_version" ]; then
echo "no stored version"
last_version=0
else
echo "stored ${{ matrix.channel }} version: $last_version"
fi
if [ "$(tr -d '.' <<<"$version")" -gt "$(tr -d '.' <<<"$last_version")" ]; then
echo "${{ matrix.channel }} has been updated"
echo "$version" >state/last_version
echo NEW_VERSION=$version >> $GITHUB_ENV
fi
- name: Discord Webhook Action
uses: tsickert/[email protected]
if: env.NEW_VERSION
with:
webhook-url: ${{ secrets.DISCORD_TEAM_PRIVATE_WEBHOOK_URL }}
content: "<@&${{ secrets.DISCORD_TEAM_ROLE_ID }}> ${{ matrix.channel }} updated to ${{ env.NEW_VERSION }}"
- name: Save state
uses: actions/cache/save@v4
if: env.NEW_VERSION
with:
path: state
key: watch-release-${{ matrix.channel }}-${{ env.NEW_VERSION }}
84 changes: 0 additions & 84 deletions .github/workflows/watch-df-steam.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
args: ['--fix=lf']
- id: trailing-whitespace
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.30.0
rev: 0.31.1
hooks:
- id: check-github-workflows
- repo: https://github.com/Lucas-C/pre-commit-hooks
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cmake_policy(SET CMP0048 NEW)
cmake_policy(SET CMP0074 NEW)

# set up versioning.
set(DF_VERSION "51.02")
set(DF_VERSION "51.05")
set(DFHACK_RELEASE "r1")
set(DFHACK_PRERELEASE FALSE)

Expand Down
3 changes: 3 additions & 0 deletions ci/download-df.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ set -e

minor=$(echo "$DF_VERSION" | cut -d. -f1)
patch=$(echo "$DF_VERSION" | cut -d. -f2)
if [ "$DF_VERSION" = "51.03" -o "$DF_VERSION" = "51.04" ]; then
patch=02
fi
df_url="https://www.bay12games.com/dwarves/df_${minor}_${patch}"
if test "$OS_TARGET" = "windows"; then
WGET="C:/msys64/usr/bin/wget.exe"
Expand Down
3 changes: 3 additions & 0 deletions data/init/dfhack.keybindings.init
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ keybinding add Ctrl-T@dwarfmode/ViewSheets/UNIT|dwarfmode/ViewSheets/ITEM|dungeo
# quicksave
keybinding add Ctrl-Alt-S@dwarfmode quicksave

# toggle spectate
keybinding add Ctrl-Shift-S@dwarfmode/Default "spectate toggle"

# designate the whole vein for digging
keybinding add Ctrl-V@dwarfmode digv
keybinding add Ctrl-Shift-V@dwarfmode "digv x"
Expand Down
2 changes: 1 addition & 1 deletion depends/dfhooks
2 changes: 2 additions & 0 deletions docs/about/Authors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ NotRexButCaesar NotRexButCaesar
Nuno Fernandes UnknowableCoder
nuvu vallode
Omniclasm
Ong Ying Gao ong-yinggao98
oorzkws oorzkws
OwnageIsMagic OwnageIsMagic
palenerd dlmarquis
Expand Down Expand Up @@ -242,6 +243,7 @@ thurin thurin
Tim Siegel softmoth
Tim Walberg twalberg
Timothy Collett danaris
Timothy Torres timothymtorres
Timur Kelman TymurGubayev
Tom Jobbins TheBloke
Tom Prince
Expand Down
46 changes: 46 additions & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,65 @@ Template for new versions:
## New Tools

## New Features
- `spectate`: can now specify number of seconds (in real time) before switching to follow a new unit
- `spectate`: new "cinematic-action" mode that dynamically speeds up perspective switches based on intensity of conflict
- `spectate`: new global keybinding for toggling spectate mode: Ctrl-Shift-S
- `spectate`: when spectate mode is enabled, left/right arrow will cycle through following next/prevous units

## Fixes
- `createitem`: output items will now end up at look cursor if active
- `spectate`: don't allow temporarily modified announcement settings to be written to disk when "auto-unpause" mode is enabled
- `changevein`: fix a crash that could occur when attempting to change a vein into itself

## Misc Improvements
- `spectate`: player-set configuration is now stored globally instead of per-fort
- `autobutcher`: treat animals on restraints as unavailable for slaughter
- `stockpiles`: add property filters for brewable, millable, and processable (e.g. at a Farmer's workshop) organic materials

## Documentation
- `stonesense-art-guide`: guide for making sprite art for Stonesense

## API
- ``Military::removeFromSquad``: removes unit from any squad assignments
- ``Buildings::checkFreeTiles``: now replaces the extents parameter for a building pointer

## Lua
- ``dfhack.units.setAutomaticProfessions``: sets unit labors according to current work detail settings
- ``dfhack.military.removeFromSquad``: Lua API for ``Military::removeFromSquad``
- ``gui.dwarfmode``: adventure mode cursor now supported in ``getCursorPos``, ``setCursorPos``, and ``clearCursorPos`` funcitons
- ``dfhack.buildings.checkFreeTiles``: now replaces the extents parameter for a building pointer

## Removed

# 51.05-r1

## Misc Improvements
- Compatibility with DF 51.05
# 51.04-r1.1

## Fixes
- `gui/launcher`: ensure commandline is fully visible when searching through history and switching from a very long command to a short command
- `gui/launcher`: flatten text when pasting multi-line text from the clipboard
- Ctrl-a hotkeys have been changed to something else (Ctrl-n) for tools that also have an editable text field, where Ctrl-a is interpreted as select all text

## API
- ``Core::getUnpausedMs``: new API for getting unpaused ms since load in a fort-mode game

# 51.04-r1

## Misc Improvements
- Compatibility with Steam release of DF 51.04

# 51.03-r1.1

## Misc Improvements
- Compatibility with Itch release of DF 51.03

# 51.03-r1

## Fixes
- `gui/gm-editor`: fix Enter key not being recognized for opening the selected object

# 51.02-r1

## Misc Improvements
Expand Down
Loading

0 comments on commit f030289

Please sign in to comment.