Merge branch 'develop' of https://github.com/DFHack/dfhack into feature/manipulator_goal

develop
Ryan Bennitt 2020-08-07 22:17:32 +01:00
commit 23c22b3b9d
18 changed files with 744 additions and 168 deletions

@ -0,0 +1,15 @@
This directory is for quickfort blueprints. You can apply them to your fortress
map with the DFHack
[quickfort script](https://docs.dfhack.org/en/stable/docs/_auto/base.html#quickfort).
You can create blueprints by hand or by using any spreadsheet application,
saving them as .xlsx or .csv files. You can also build your plan "for real" in
Dwarf Fortress, and then export your map using the DFHack
[blueprint plugin](https://docs.dfhack.org/en/stable/docs/Plugins.html#blueprint)
for later replay in a different fort.
DFHack blueprints are compatible with the original Quickfort 2.0 syntax. If you
have existing blueprints that worked with https://github.com/joelpt/quickfort,
then they should work just fine in DFHack quickfort.
There are many ready-to-use examples of blueprints in the library subfolder.

@ -1,14 +0,0 @@
This directory is for quickfort blueprints. You can apply them to your fortress
map with the DFHack quickfort plugin. See
https://docs.dfhack.org/en/stable/docs/Scripts.html#quickfort for details.
You can create blueprints by hand or by using any spreadsheet application,
saving them as .xlsx or .csv files. You can also build your plan "for real" in
Dwarf Fortress, and then export your map using the DFHack blueprint for later
replay in a different fort. See
https://docs.dfhack.org/en/stable/docs/Plugins.html#blueprint for more info.
DFHack blueprints follow the original Quickfort 2.0 syntax. See
https://github.com/joelpt/quickfort for joelpt's excellent documentation.
There are many ready-to-use examples of blueprints in the library subfolder.

@ -1,135 +1,428 @@
# quickfort aliases common baseline configuration file
# Common baseline for aliases for quickfort query mode blueprints.
#
# Defines custom keycode shortcuts for blueprints. Please DO NOT EDIT this file
# directly. Instead, custom aliases should be added to
# dfhack-config/quickfort/aliases.txt.
# Please DO NOT EDIT this file directly. Instead, custom aliases should be added
# to dfhack-config/quickfort/aliases.txt. See that file for syntax
# documentation.
#
# Syntax:
# aliasname: keystrokes
#
# Special keys:
# {Right}, {Left}, {Up}, {Down}, >, < move the DF cursor
# {/}, {*}, {+}, {-} can be used to navigate some DF menus
# {Enter}, +{Enter}, {ExitMenu} - Enter, Shift+Enter, and Escape, respectively
# {Wait} pauses playback briefly
#
# Special keys can be repeated by adding a number inside the curly braces, for
# example: {Down 5}
# The aliases in this file were tested in DF 0.47.04 on 2020 Jul 18.
#
# Some shorthand:
# & expands to {Enter}
# @ expands to +{Enter}
# ^ expands to {ExitMenu}
# % expands to {Wait}
# The aliases are generally split into three categories:
# 1) The aliases that name a type disables everything else for that stockpile
# category and enable only that type. For example, "preparedfood" enables
# prepared food and disables all other types of food.
# 2) The aliases that start with "forbid" only forbid (or toggle) the named type
# and leave the rest of the stockpile untouched.
# 3) The aliases that start with "permit" only permit (or toggle) the named type
# and leave the rest of the stockpile untouched.
#
# The aliases in this file were tested in DF 0.47.04 on 2020 Jul 18.
# Aliases that don't fit into those two categories have comments explaining
# their usage.
########################################
# general purpose stockpile adjustments
########################################
linksonly: a
nocontainers: CE
# for configuring stockpiles to give to other nearby stockpiles/workshops
give2up: g{Up 2}&
give2down: g{Down 2}&
give2left: g{Left 2}&
give2right: g{Right 2}&
give10up: g{Up 10}&
give10down: g{Down 10}&
give10left: g{Left 10}&
give10right: g{Right 10}&
# use to toggle a sequence of stockpile options. for example: {togglesequence 5}
togglesequence: &{Down}
togglesequence2: &{Down 2}
enablesequence: e{Down}
# Enables everything but corpses and refuse. Refuse is excluded since otherwise
# clothes and armor in this quantum stockpile will rot away. If you want bones
# in your quantum stockpile, apply this alias to a refuse stockpile (but don't
# put useful clothes or armor in there!)
quantum: {linksonly}{nocontainers}{enableanimals}{enablefood}{furnitureprefix}{enablestone}{enableammo}{enablecoins}{enablebars}{enablegems}{enablefinishedgoods}{enableleather}{enablecloth}{enablewood}}{enableweapons}{enablearmor}{enablesheet}
# Run one of the quantumstopfrom* aliases over a track stop that is set to dump
# into a quantum stockpile. The alias will set up the stop to accept all types
# (the actual types stored in the quantum stockpile is controlled by the feeder
# stockpile) and link the indicated adjacent feeder stockpile. All you need to
# do afterwards is assign a vehicle to the stop (and optionally give the route a
# name). The track stop does not need to be constructed yet, but the stockpile
# needs to be in place so we can link to it.
quantumstopprefix: ^hrs&xxx&{enablesequence 17}^
quantumstopfromeast: {quantumstopprefix}s{Right}p^{Left}^q
quantumstopfromsouth: {quantumstopprefix}s{Down}p^{Up}^q
quantumstopfromwest: {quantumstopprefix}s{Left}p^{Right}^q
quantumstopfromnorth: {quantumstopprefix}s{Up}p^{Down}^q
##################################
# animal stockpile adjustments
##################################
animalsprefix: s
enableanimals: {animalsprefix}e^
disableanimals: {animalsprefix}d^
# enables only the specified type (and disables everything else)
cages: {animalsprefix}bu^
traps: {animalsprefix}bj^
# forbids specific items in an already-configured stockpile
forbidcages: {animalsprefix}u^
forbidtraps: {animalsprefix}j^
##################################
# food stockpile adjustments
##################################
seeds: s{Down}deb{Right}{Down 9}p^
noseeds: s{Down}dea{Right}{Down 9}f^
booze: s{Down}deb{Right}{Down 5}p{Down}p^
food: s{Down}dea{Right}{Down 5}f{Down}f{Down 3}f^
plants: s{Down}deb{Right}{Down 4}p^
foodprefix: s{Down}
enablefood: {foodprefix}e^
disablefood: {foodprefix}d^
preparedfood: {foodprefix}bu^
unpreparedfish: {foodprefix}b{Right}{Down 2}p^
plants: {foodprefix}b{Right}{Down 4}p^
booze: {foodprefix}b{Right}{Down 5}p{Down}p^
seeds: {foodprefix}b{Right}{Down 9}p^
dye: {foodprefix}b{Right}{Down 11}{Right}{Down 28}{togglesequence 4}^
tallow: {foodprefix}b{Right}{Down 13}{Right}{Down}{togglesequence2 811}^
miscliquid: {foodprefix}b{Right}{Down 18}p^
forbidpreparedfood: {foodprefix}u^
forbidunpreparedfish: {foodprefix}{Right}{Down 2}f^
forbidplants: {foodprefix}{Right}{Down 4}f^
forbidbooze: {foodprefix}{Right}{Down 5}f{Down}f^
forbidseeds: {foodprefix}{Right}{Down 9}f^
forbiddye: {foodprefix}{Right}{Down 11}{Right}{Down 28}{togglesequence 4}^
forbidtallow: {foodprefix}{Right}{Down 13}{Right}{Down}{togglesequence2 811}^
forbidmiscliquid: {foodprefix}{Right}{Down 18}f^
permitpreparedfood: {forbidpreparedfood}
permitunpreparedfish: {foodprefix}{Right}{Down 2}p^
permitplants: {foodprefix}{Right}{Down 4}p^
permitbooze: {foodprefix}{Right}{Down 5}p{Down}p^
permitseeds: {foodprefix}{Right}{Down 9}p^
permitdye: {forbiddye}
permittallow: {forbidtallow}
permitmiscliquid: {foodprefix}{Right}{Down 18}p^
# enables everything but seeds
noseeds: {disablefood}{enablefood}{forbidseeds}
# enables all food except for the types listed above
food: {noseeds}{forbidpreparedfood}{forbidunpreparedfish}{forbidplants}{forbidbooze}{forbiddye}{forbidtallow}{forbidmiscliquid}
##################################
# refuse stockpile adjustments
# furniture stockpile adjustments
##################################
corpses: s{Down 4}deb{Right 2}&{Down 2}&{Left}{Down}p{Down}p^
bones: s{Down 4}deb{Right}{Down 3}p{Down}p^
rawhides: s{Down 4}deb{Right 2}{Down}&^
tannedhides: s{Down 4}deb{Right 2}{Down 53}&^
furnitureprefix: s{Down 2}
enablefurniture: {furnitureprefix}e^
disablefurniture: {furnitureprefix}d^
pots: {furnitureprefix}de{Right}f{Right}{Up 5}&^
bags: {furnitureprefix}de{Right}f{Right}{Up 10}&{Left}{Down}f{Down}f{Down}f{Right}{Down}&{Down 6}&{Down}&{Down 6}&^
buckets: {furnitureprefix}de{Right}f{Right}{Up 12}&^
sand: {furnitureprefix}de{Right}f{Right}{Up}&^
###########################################
# corpses and refuse stockpile adjustments
###########################################
corpsesprefix: s{Down 3}
enablecorpses: {corpsesprefix}e^
disablecorpses: {corpsesprefix}d{Up}d^
refuseprefix: s{Down 4}
enablerefuse: {refuseprefix}e^
disablerefuse: {refuseprefix}d^
# bodyparts include remains/corpses and rotten rawhdes
bodyparts: {refuseprefix}b{Right 2}&{Down 2}&{Left}{Down}p{Down}p^
rawhides: {refuseprefix}b{Right 2}{Down}&^
tannedhides: {refuseprefix}b{Right 2}{Down 53}&^
skulls: {refuseprefix}b{Right}{Down 3}p^
bones: {refuseprefix}b{Right}{Down 4}p^
shells: {refuseprefix}b{Right}{Down 5}p^
teeth: {refuseprefix}b{Right}{Down 6}p^
horns: {refuseprefix}b{Right}{Down 7}p^
hair: {refuseprefix}b{Right}{Down 8}p^
craftrefuse: {skulls}{permitbones}{permitshells}{permitteeth}{permithorns}{permithair}
forbidbodyparts: {refuseprefix}{Right 2}&{Down 2}&{Left}{Down}f{Down}f^
forbidrawhides: {refuseprefix}{Right 2}{Down}&^
forbidtannedhides: {refuseprefix}{Right 2}{Down 53}&^
forbidskulls: {refuseprefix}{Right}{Down 3}f^
forbidbones: {refuseprefix}{Right}{Down 4}f^
forbidshells: {refuseprefix}{Right}{Down 5}f^
forbidteeth: {refuseprefix}{Right}{Down 6}f^
forbidhorns: {refuseprefix}{Right}{Down 7}f^
forbidhair: {refuseprefix}{Right}{Down 8}f^
forbidcraftrefuse: {forbidskulls}{forbidbones}{forbidshells}{forbidteeth}{forbidhorns}{forbidhair}
permitbodyparts: {refuseprefix}{Right 2}&{Down 2}&{Left}{Down}p{Down}p^
permitrawhides: {forbidrawhides}
permittannedhides: {forbidtannedhides}
permitskulls: {refuseprefix}{Right}{Down 3}p^
permitbones: {refuseprefix}{Right}{Down 4}p^
permitshells: {refuseprefix}{Right}{Down 5}p^
permitteeth: {refuseprefix}{Right}{Down 6}p^
permithorns: {refuseprefix}{Right}{Down 7}p^
permithair: {refuseprefix}{Right}{Down 8}p^
permitcraftrefuse: {permitskulls}{permitbones}{permitshells}{permitteeth}{permithorns}{permithair}
##################################
# stone stockpile adjustments
##################################
metal: s{Down 5}deb{Right}p^
nometal: s{Down 5}dea{Right}f^
bauxite: s{Down 5}deb{Right}{Down 2}{Right}{Down 42}&^
stoneprefix: s{Down 5}
enablestone: {stoneprefix}e^
disablestone: {stoneprefix}d^
metal: {stoneprefix}b{Right}p^
iron: {stoneprefix}b{Right}{Right}&{Down}&{Down 13}&^
economic: {stoneprefix}b{Right}{Down}p^
flux: {stoneprefix}b{Right}{Down}{Right}{togglesequence 4}{Down 4}&^
plaster: {stoneprefix}b{Right}{Down}{Right}{Down 6}&{Down 3}{togglesequence 3}^
coalproducing: {stoneprefix}b{Right}{Down}{Right}{Down 4}{togglesequence 2}^
otherstone: {stoneprefix}b{Right}{Down 2}p^
bauxite: {stoneprefix}b{Right}{Down 2}{Right}{Down 42}&^
clay: {stoneprefix}b{Right}{Down 3}p^
forbidmetal: {stoneprefix}{Right}f^
forbidiron: {stoneprefix}{Right}{Right}&{Down}&{Down 13}&^
forbideconomic: {stoneprefix}{Right}{Down}f^
forbidflux: {stoneprefix}{Right}{Down}{Right}{togglesequence 4}{Down 4}&^
forbidplaster: {stoneprefix}{Right}{Down}{Right}{Down 6}&{Down 3}{togglesequence 3}^
forbidcoalproducing: {stoneprefix}{Right}{Down}{Right}{Down 4}{togglesequence 2}^
forbidotherstone: {stoneprefix}{Right}{Down 2}f^
forbidbauxite: {stoneprefix}{Right}{Down 2}{Right}{Down 42}&^
forbidclay: {stoneprefix}{Right}{Down 3}f^
permitmetal: {stoneprefix}{Right}p^
permitiron: {forbidiron}
permiteconomic: {stoneprefix}{Right}{Down}p^
permitflux: {forbidflux}
permitplaster: {forbidplaster}
permitcoalproducing: {forbidcoalproducing}
permitotherstone: {stoneprefix}{Right}{Down 2}p^
permitbauxite: {forbidbauxite}
permitclay: {stoneprefix}{Right}{Down 3}p^
##################################
# ammo stockpile adjustments
##################################
ammoprefix: s{Down 6}
enableammo: {ammoprefix}e^
disableammo: {ammoprefix}d^
bolts: {ammoprefix}a{Right 2}{Down}{togglesequence 2}^
forbidmetalbolts: {ammoprefix}{Right}{Down}f^
forbidwoodenbolts: {ammoprefix}{Right}{Down 2}{Right}&^
forbidbonebolts: {ammoprefix}{Right}{Down 2}{Right}{Down}&^
##################################
# bar stockpile adjustments
##################################
barsprefix: s{Down 8}
enablebars: {barsprefix}e^
disablebars: {barsprefix}d^
bars: {barsprefix}b{Right}p{Down}p^
metalbars: {barsprefix}b{Right}p^
ironbars: {barsprefix}b{Right 2}&^
steelbars: {barsprefix}b{Right 2}{Down 8}&^
pigironbars: {barsprefix}b{Right 2}{Down 9}&^
otherbars: {barsprefix}b{Right}{Down}p^
coal: {barsprefix}b{Right}{Down}{Right}&^
potash: {barsprefix}b{Right}{Down}{Right}{Down}&^
ash: {barsprefix}b{Right}{Down}{Right}{Down 2}&^
pearlash: {barsprefix}b{Right}{Down}{Right}{Down 3}&^
soap: {barsprefix}b{Right}{Down}{Right}{Down 4}&^
blocks: {barsprefix}b{Down 2}p{Down}p{Down}p^
forbidbars: {barsprefix}{Right}f{Down}f^
forbidmetalbars: {barsprefix}{Right}f^
forbidironbars: {barsprefix}{Right 2}&^
forbidsteelbars: {barsprefix}{Right 2}{Down 8}&^
forbidpigironbars: {barsprefix}{Right 2}{Down 9}&^
forbidotherbars: {barsprefix}{Right}{Down}f^
forbidcoal: {barsprefix}{Right}{Down}{Right}&^
forbidpotash: {barsprefix}{Right}{Down}{Right}{Down}&^
forbidash: {barsprefix}{Right}{Down}{Right}{Down 2}&^
forbidpearlash: {barsprefix}{Right}{Down}{Right}{Down 3}&^
forbidsoap: {barsprefix}{Right}{Down}{Right}{Down 4}&^
forbidblocks: {barsprefix}{Down 2}f{Down}f{Down}f^
##################################
# gem stockpile adjustments
##################################
gemsprefix: s{Down 9}
enablegems: {gemsprefix}e^
disablegems: {gemsprefix}d^
roughgems: {gemsprefix}b{Right}p^
roughglass: {gemsprefix}b{Right}{Down}p^
cutgems: {gemsprefix}b{Right}{Down 2}p^
cutglass: {gemsprefix}b{Right}{Down 3}p^
cutstone: {gemsprefix}b{Right}{Down 4}p^
forbidroughgems: {gemsprefix}{Right}f^
forbidroughglass: {gemsprefix}{Right}{Down}f^
forbidcutgems: {gemsprefix}{Right}{Down 2}f^
forbidcutglass: {gemsprefix}{Right}{Down 3}f^
forbidcutstone: {gemsprefix}{Right}{Down 4}f^
#######################################
# finished goods stockpile adjustments
#######################################
finishedgoodsprefix: s{Down 10}
enablefinishedgoods: {finishedgoodsprefix}e^
disablefinishedgoods: {finishedgoodsprefix}d^
jugs: {finishedgoodsprefix}{Right}f{Right}{Up 2}&{Left}{Down 2}f{Down}f{Down}f^
# Only use nobauxite on stone piles that you want to accept all "Other Stone" on.
# This alias works by permitting all "Other Stone",then forbidding just bauxite.
# Thus you wouldn't want to use this on a metal-only pile, for example.
nobauxite: s{Down 5}{Right}{Down 2}p{Right}{Down 42}&^
##################################
# misc stockpile adjustments
# cloth
##################################
# Artifacts-only stockpile, usable on any type of existing pile.
artifacts: sd{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down 4}deu{Right}{Up}f{Right}{Up}&{Left 2}{Down 4}e{Right}{Up}f{Right}{Up}&{Left 2}{Down 4}e{Right}{Up}f{Right}{Up}&{Left 2}{Down 4}e{Right}{Up}f{Right}{Up}&{Left 2}{Down}e{Right}{Up}f{Right}{Up}&{Left 2}^
clothprefix: s{Down 12}
enablecloth: {clothprefix}e^
disablecloth: {clothprefix}d^
# Bans artifacts on any pile (or rather, allows items of any quality except Artifact quality).
# This should be safe to run on any type of pile.
noartifacts: sd{Down 2}{Right}{Up}fp{Right}{Up}&{Down 2}{Left 2}{Down 4}{Right}{Up}fp{Right}{Up}&{Down 2}{Left 2}{Down 4}{Right}{Up}fp{Right}{Up}&{Down 2}{Left 2}{Down 4}{Right}{Up}fp{Right}{Up}&{Down 2}{Left 2}{Down}{Right}{Up}fp{Right}{Up}&{Down 2}{Left 2}^
thread: {clothprefix}b{Right}p{Down}p{Down}p^
adamantinethread: {clothprefix}b{Right}{Down 3}p^
cloth: {clothprefix}b{Right}{Down 4}p{Down}p{Down}p^
adamantinecloth: {clothprefix}b{Right}{Up}p^
##################################
# weapon stockpile adjustments
##################################
weaponsprefix: s{Down 14}
enableweapons: {weaponsprefix}e^
disableweapons: {weaponsprefix}d^
metalweapons: {forbidtrapcomponents}{forbidstoneweapons}{forbidotherweapons}
ironweapons: {metalweapons}{forbidweapons}{permitironweapons}
copperweapons: {metalweapons}{forbidweapons}{permitcopperweapons}
steelweapons: {metalweapons}{forbidweapons}{permitsteelweapons}
forbidweapons: {weaponsprefix}{Right}f^
forbidtrapcomponents: {weaponsprefix}{Right}{Down}f^
forbidmetalweapons: {weaponsprefix}{Right}{Down 2}f^
forbidstoneweapons: {weaponsprefix}{Right}{Down 3}f^
forbidotherweapons: {weaponsprefix}{Right}{Down 4}f^
forbidironweapons: {weaponsprefix}{Right}{Down 2}{Right}&^
forbidcopperweapons: {weaponsprefix}{Right}{Down 2}{Right}{Down 3}&^
forbidsteelweapons: {weaponsprefix}{Right}{Down 2}{Right}{Down 8}&^
permitweapons: {weaponsprefix}{Right}p^
permittrapcomponents: {weaponsprefix}{Right}{Down}p^
permitmetalweapons: {weaponsprefix}{Right}{Down 2}p^
permitstoneweapons: {weaponsprefix}{Right}{Down 3}p^
permitotherweapons: {weaponsprefix}{Right}{Down 4}p^
permitironweapons: {forbidironweapons}
permitcopperweapons: {forbidcopperweapons}
permitsteelweapons: {forbidsteelweapons}
masterworkweapons: {weaponsprefix}{Right}{Down 5}f{Right}{Down 5}&^
artifactweapons: {weaponsprefix}{Right}{Down 5}f{Right}{Down 6}&^
forbidmasterworkweapons: {weaponsprefix}{Right}{Down 5}{Right}{Down 5}&^
forbidartifactweapons: {weaponsprefix}{Right}{Down 5}{Right}{Down 6}&^
permitmasterworkweapons: {forbidmasterworkweapons}
permitartifactweapons: {forbidartifactweapons}
##################################
# armor stockpile adjustments
##################################
armorprefix: s{Down 15}
enablearmor: {armorprefix}e^
disablearmor: {armorprefix}d^
metalarmor: {forbidotherarmor}
otherarmor: {forbidmetalarmor}
ironarmor: {metalarmor}{forbidmetalarmor}{permitironarmor}
copperarmor: {metalarmor}{forbidmetalarmor}{permitcopperarmor}
steelarmor: {metalarmor}{forbidmetalarmor}{permitsteelarmor}
forbidmetalarmor: {armorprefix}{Right}{Down 6}f^
forbidotherarmor: {armorprefix}{Right}{Down 7}f^
forbidironarmor: {armorprefix}{Right}{Down 6}{Right}&^
forbidcopperarmor: {armorprefix}{Right}{Down 6}{Right}{Down 3}&^
forbidsteelarmor: {armorprefix}{Right}{Down 6}{Right}{Down 8}&^
permitmetalarmor: {armorprefix}{Right}{Down 6}p^
permitotherarmor: {armorprefix}{Right}{Down 7}p^
permitironarmor: {forbidironarmor}
permitcopperarmor: {forbidcopperarmor}
permitsteelarmor: {forbidsteelarmor}
masterworkarmor: {armorprefix}{Right}{Down 8}f{Right}{Down 5}&^
artifactarmor: {armorprefix}{Right}{Down 8}f{Right}{Down 6}&^
forbidmasterworkarmor: {armorprefix}{Right}{Down 8}{Right}{Down 5}&^
forbidartifactarmor: {armorprefix}{Right}{Down 8}{Right}{Down 6}&^
permitmasterworkarmor: {forbidmasterworkarmor}
permitartifactarmor: {forbidartifactarmor}
##################################
# others
##################################
coinsprefix: s{Down 7}
enablecoins: {coinsprefix}e^
disablecoins: {coinsprefix}d^
leatherprefix: s{Down 11}
enableleather: {leatherprefix}e^
disableleather: {leatherprefix}d^
woodprefix: s{Down 13}
enablewood: {woodprefix}e^
disablewood: {woodprefix}d^
sheetprefix: s{Down 16}
enablesheet: {sheetprefix}e^
disablesheet: {sheetprefix}d^
# Set a finished goods stockpile to crappy low-quality trade goods only.
# Position such a stockpile near fort entrances to (hopefully) let thieves steal low quality junk.
junkgoods: s{Down 10}de{Right 2}&{Down 5}&{Down}&{Down}&{Down}&{Down 8}&{Down 2}&{Down}&{Down}&{Down}&{Down}&{Down}&{Left}{Down}f{Right}{Down}&{Down}&{Left}{Down}f{Down 2}f{Right}&{Down}&^
##################################
# farm plots
##################################
# Sets a farm plot to grow the LAST type of seed in the list of available seeds, for all 4 seasons.
# The last seed is used because it's usually Plump helmet spawn, suitable for post-embark. If you
# only have 1 seed type, that'll be grown.
growlastcropall: a{/}&b{/}&c{/}&d{/}&
# Sets a farm plot to grow the LAST type of seed in the list of available seeds
# for all 4 seasons. The last seed is used because it's usually Plump helmet
# spawn, suitable for post-embark. If you only have 1 seed type, that'll be
# grown.
growlastcropall: a/&b/&c/&d/&
# Like growlastcropall but grows the first one in the list instead.
growfirstcropall: a&b&c&d&
##################################
# mining tracks
##################################
# The following aliases make it more convenient to build the various types of mine tracks.
# For example, to build a north/south track 'Track (NS)', you would put trackNS in a cell(s).
trackN: CT{Enter}
trackS: CT{+ 1}{Enter}
trackE: CT{+ 2}{Enter}
trackW: CT{+ 3}{Enter}
trackNS: CT{+ 4}{Enter}
trackNE: CT{+ 5}{Enter}
trackNW: CT{+ 6}{Enter}
trackSE: CT{+ 7}{Enter}
trackSW: CT{+ 8}{Enter}
trackEW: CT{+ 9}{Enter}
trackNSE: CT{+ 10}{Enter}
trackNSW: CT{+ 11}{Enter}
trackNEW: CT{+ 12}{Enter}
trackSEW: CT{+ 13}{Enter}
trackNSEW: CT{+ 14}{Enter}
trackrampN: CT{+ 15}{Enter}
trackrampS: CT{+ 15}{+ 1}{Enter}
trackrampE: CT{+ 15}{+ 2}{Enter}
trackrampW: CT{+ 15}{+ 3}{Enter}
trackrampNS: CT{+ 15}{+ 4}{Enter}
trackrampNE: CT{+ 15}{+ 5}{Enter}
trackrampNW: CT{+ 15}{+ 6}{Enter}
trackrampSE: CT{+ 15}{+ 7}{Enter}
trackrampSW: CT{+ 15}{+ 8}{Enter}
trackrampEW: CT{+ 15}{+ 9}{Enter}
trackrampNSE: CT{+ 15}{+ 10}{Enter}
trackrampNSW: CT{+ 15}{+ 11}{Enter}
trackrampNEW: CT{+ 15}{+ 12}{Enter}
trackrampSEW: CT{+ 15}{+ 13}{Enter}
trackrampNSEW: CT{+ 15}{+ 14}{Enter}
# Aliases for building track rollers; use e.g. rollerHqqq to make a low-speed horizontal roller
rollerH: Mrs
rollerV: Mr
rollerNS: Mr
rollerSN: Mrss
rollerEW: Mrs
rollerWE: Mrsss
# Aliases for building track stops that dump in each of the four directions
trackstopN: CSd
trackstopS: CSdd
trackstopE: CSddd
trackstopW: CSdddd

@ -1,30 +1,83 @@
# quickfort aliases configuration file
# aliases for quickfort query mode blueprints
#
# Defines custom keycode shortcuts for blueprints. Definitions in this file take
# precedence over any definitions in the baseline aliases configuration file at
# hack/data/quickfort/aliases-common.txt. See that file for aliases that are
# already defined.
# This file defines custom keycode shortcuts for query mode blueprints.
# Definitions in this file take precedence over any definitions in the baseline
# aliases configuration file at hack/data/quickfort/aliases-common.txt. See that
# file for aliases that are already defined.
#
# This file can be used to simplify repetitive tasks, such as building minecart
# tracks or adjusting a food stockpile to accept seeds only. Making new aliases
# is just a matter of mimicking the keys used to navigate through the menus and
# select options.
# If possible, build on the baseline aliases when defining your own aliases. If
# the DF UI screens change, updated baseline aliases may allow your aliases to
# automatically adapt to the new UI. For example, if you create an alias to
# modify particular furniture stockpile settings, start your alias with
# "{furnitureprefix}" instead of manually writing "s{Down 2}". Then, if the
# location of the furniture setting changes, your alias will automatically
# inherit the updated position when DFHack is updated.
#
# Syntax:
# Aliases simplify repetitive tasks, such as configuring workshop profiles or
# adjusting a food stockpile to accept only seeds. Making new aliases is just a
# matter of mimicking the keys used to navigate through the menus and select
# options. Use the aliases in your blueprint spreadsheets by writing an alias by
# itself in a cell, like "nocontainers", or reference an alias in a larger
# sequence by enclosing in in curly brackets, like "{nocontainers}{linksonly}"
#
# For example, say you have the following build and place blueprints:
#
# #build start(4;1;upper left corner of stockpile) mason stockpile
# ~, ~, ~, `, `, `
# ~, wm, ~, `, `, `
# ~, ~, ~, `, `, `
#
# #place start(4;1;upper left corner of stockpile) build mason
# ~, ~, ~, s, s, s
# ~, ~, ~, s, s, s
# ~, ~, ~, s, s, s
#
# and you want to configure the stockpile to hold only non-economic ("other")
# stone and to give to the adjacent mason workshop. You could write the
# keystrokes directly:
#
# #query start(4;1;upper left corner of stockpile) configure mason
# ~, ~, ~, s{Down 5}deb{Right}{Down 2}p^, `, `
# ~, ~, ~, g{Left 2}&, `, `
# ~, ~, ~, `, `, `
#
# or you could use alias names:
#
# #query start(4;1;upper left corner of stockpile) configure mason
# ~, ~, ~, otherstone, `, `
# ~, ~, ~, give2left, `, `
# ~, ~, ~, `, `, `
#
#
# The syntax for defining aliases is:
# aliasname: keystrokes
#
# Special keys:
# {Right}, {Left}, {Up}, {Down}, >, < move the DF cursor
# {/}, {*}, {+}, {-} can be used to navigate some DF menus
# {Enter}, +{Enter}, {ExitMenu} - Enter, Shift+Enter, and Escape, respectively
# {Wait} pauses playback briefly
# Where aliasname is at least two letters or digits long and keystrokes are
# whatever you would type into the DF UI. A keystroke can also be a named
# keycode from the DF interface definition file (data/init/interface.txt),
# enclosed in curly brackets like an alias, like: "{Right}" or "{Enter}". In
# order to avoid naming conflicts between aliases and keycodes, the convention
# is to start aliases with a lowercase letter. You can add spaces in between
# keystrokes to make them easier to read. Spaces in keystroke sequences will be
# ignored. To insert a literal space, use "{Space}"
#
# Special keys can be repeated by adding a number inside the curly braces, for
# example: {Down 5}
# Anything enclosed within curly brackets can also have a number after it,
# indicating how many times that alias or keycode should be repeated. For
# example: "{buildblocks 9}" or "{Down 5}".
#
# Some shorthand:
# Ctrl, Alt, and Shift modifiers can be specified for the next keycode by adding
# them as keycodes. For example, Alt-h is written as "{Alt}h".
#
# Some frequently-used keystrokes are assigned shorthand characters. Think of
# them as single-character aliases that don't need to be surrounded in curly
# brackets:
# & expands to {Enter}
# @ expands to +{Enter}
# ^ expands to {ExitMenu}
# % expands to {Wait}
# @ expands to {Shift}{Enter}
# + expands to {Shift}
# ~ expands to {Alt}
# ! expands to {Ctrl}
# ^ expands to {ESC}
#
# If you need literal verisons of the shorthand characters, surround them in
# curly brackets, for example: "{+}"
#

@ -1,20 +1,26 @@
# quickfort main configuration file
#
# Set startup defaults for the quickfort script in this file. Settings can be
# dynamically overridden in the active session with the `quickfort set` command.
# temporarily overridden in the active session with the `quickfort set` command.
#
# If you have edited this file but want to revert to "factory defaults", delete
# this file and a fresh one will be copied from
# dfhack-config/default/quickfort/qickfort.txt the next time you start DFHack.
# Directory to search for blueprints. Can be set to an absolute or relative
# Directory tree to search for blueprints. Can be set to an absolute or relative
# path. If set to a relative path, resolves to a directory under the DF folder.
blueprints_dir=blueprints
# Set to "true" or "false". If true, will designate dig blueprints in marker
# mode. If false, only cells with dig codes prefixed with ``m`` will be
# designated in marker mode.
# mode. If false, only cells with dig codes explicitly prefixed with an "m" will
# be designated in marker mode.
force_marker_mode=false
# Allows you to manually select building materials for each
# building/construction when running (or creating orders for) build blueprints.
# Materials in selection dialogs are ordered according to preferences in
# materials.txt. If false, will only prompt for materials that have :labels.
# See https://github.com/joelpt/quickfort#manual-material-selection for details.
force_interactive_build=false
# Set to the maximum number of resources you want assigned to stockpiles of the
# relevant types. Set to -1 for DF defaults (number of stockpile tiles for
# stockpiles that take barrels and bins, 1 wheelbarrow for stone stockpiles).
# The default here for wheelbarrows is 0 since using wheelbarrows normally
# *decreases* the efficiency of your fort.
stockpiles_max_barrels=-1
stockpiles_max_bins=-1
stockpiles_max_wheelbarrows=0

@ -110,6 +110,7 @@ Nikolay Amiantov abbradar
nocico nocico
Omniclasm
OwnageIsMagic OwnageIsMagic
palenerd dlmarquis
Patrik Lundell PatrikLundell
Paul Fenwick pjf
PeridexisErrant PeridexisErrant

@ -13,7 +13,7 @@ Contributing Code
=================
Several things should be kept in mind when contributing code to DFHack.
Code Format
Code format
-----------
* Four space indents for C++. Never use tabs for indentation in any language.
* LF (Unix style) line terminators
@ -26,18 +26,45 @@ Code Format
* #includes should be sorted. C++ libraries first, then dfhack modules, then df structures,
then local includes. Within each category they should be sorted alphabetically.
How to get new code into DFHack
Pull request guidelines
-----------------------
* Pull requests should be based on (and submitted to) the default branch of the
relevant repo, which is the branch you see when you access the repo on GitHub
or clone the repo without specifying a branch. As of 0.47.04-r1, this is
``develop`` for the main DFHack repo and ``master`` for other repos.
* Use a new branch for each feature or bugfix so that your changes can be merged
independently (i.e. not the ``master`` or ``develop`` branch of your fork).
* An exception: for a collection of small miscellaneous changes (e.g.
structures research), one branch instead of many small branches is fine. It
is still preferred that this branch be dedicated to this purpose, i.e. not
``master`` or ``develop``. Your pull request may be merged at any point
unless you indicate that it isn't ready (see below), but you can continue to
push to the same branch and open new pull requests as needed.
* Try to keep pull requests relatively small so that they are easier to review
and merge.
* If you expect to make a large number of related additions or changes (e.g.
adding a large new plugin), multiple PRs are preferred, as they allow more
frequent (and easier) feedback. If development of this feature is expected
to take a while, we may create a dedicated branch to merge your pull
requests into instead of the repo's default branch.
* If you plan to make additional changes to your pull request in the near
future, or if it isn't quite ready to be merged, mark it as a
`draft pull request <https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests#draft-pull-requests>`_
or add "WIP" to the title. Otherwise, your pull request may be reviewed and/or
merged prematurely.
General contribution guidelines
-------------------------------
* Submit pull requests to the ``develop`` branch, not the ``master`` branch.
(The ``master`` branch always points at the most recent release)
* Use a new branch for each feature or bugfix so that your changes can be merged independently
(i.e. not the master or develop branch of your fork).
* If possible, compile on multiple platforms when changing anything that compiles
* It must pass CI - run ``python travis/all.py`` to check this.
* If convenient, compile on multiple platforms when changing anything that
compiles. Our CI should catch anything that fails to build, but checking in
advance can be faster.
* Update documentation when applicable - see `docs-standards` for details.
* Update ``changelog.txt`` and ``docs/Authors.rst`` when applicable. See
`build-changelog` for more information on the changelog format.
* Create a GitHub pull request once finished
* Submit ideas and bug reports as :issue:`issues on GitHub <>`.
Posts in the forum thread can easily get missed or forgotten.
* Work on :issue:`reported problems <?q=is:open+-label:idea>`

@ -291,6 +291,8 @@ One-shot subcommands:
Subcommands that persist until disabled or DF quits:
.. comment: sort these alphabetically
:adamantine-cloth-wear: Prevents adamantine clothing from wearing out while being worn (:bug:`6481`).
:advmode-contained: Works around :bug:`6202`, custom reactions with container inputs
in advmode. The issue is that the screen tries to force you to select
@ -305,6 +307,7 @@ Subcommands that persist until disabled or DF quits:
:craft-age-wear: Fixes the behavior of crafted items wearing out over time (:bug:`6003`).
With this tweak, items made from cloth and leather will gain a level of
wear every 20 years.
:do-job-now: Adds a job priority toggle to the jobs list
:embark-profile-name: Allows the use of lowercase letters when saving embark profiles
:eggs-fertile: Displays a fertility indicator on nestboxes
:farm-plot-select: Adds "Select all" and "Deselect all" options to farm plot menus
@ -335,12 +338,14 @@ Subcommands that persist until disabled or DF quits:
i.e. stop the rightmost list of the Positions page of the military
screen from constantly resetting to the top.
:nestbox-color: Fixes the color of built nestboxes
:reaction-gloves: Fixes reactions to produce gloves in sets with correct handedness (:bug:`6273`)
:shift-8-scroll: Gives Shift-8 (or :kbd:`*`) priority when scrolling menus, instead of scrolling the map
:stable-cursor: Saves the exact cursor position between t/q/k/d/b/etc menus of fortress mode.
:stone-status-all: Adds an option to toggle the economic status of all stones
:title-start-rename: Adds a safe rename option to the title screen "Start Playing" menu
:tradereq-pet-gender: Displays pet genders on the trade request screen
:reaction-gloves: Fixes reactions to produce gloves in sets with correct handedness (:bug:`6273`)
.. comment: sort these alphabetically
.. _fix-armory:

@ -34,12 +34,14 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
# Future
## New Tweaks
- `tweak` do-job-now: adds a job priority toggle to the jobs list
- `tweak` reaction-gloves: adds an option to make reactions produce gloves in sets with correct handedness
## Fixes
- Fixed a segfault when attempting to start a headless session with a graphical PRINT_MODE setting
- Fixed an issue with the macOS launcher failing to un-quarantine some files
- Linux: fixed ``dfhack.getDFPath()`` (Lua) and ``Process::getPath()`` (C++) to always return the DF root path, even if the working directory has changed
- `getplants`: fixed issues causing plants to be collected even if they have no growths (or unripe growths)
- `labormanager`: fixed handling of new jobs in 0.47
- `embark-assistant`: fixed a couple of incursion handling bugs.
- Fixed ``Units::isEggLayer``, ``Units::isGrazer``, ``Units::isMilkable``, ``Units::isTrainableHunting``, ``Units::isTrainableWar``, and ``Units::isTamable`` ignoring the unit's caste
@ -55,6 +57,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
- Extended ``Filesystem::listdir_recursive`` to optionally make returned filenames relative to the start directory
## Internals
- Linux/macOS: Added console keybindings for deleting words (Alt+Backspace and Alt+d in most terminals)
- Added support for splitting scripts into multiple files in the ``scripts/internal`` folder without polluting the output of `ls`
## Lua

@ -541,6 +541,7 @@ namespace DFHack
return Console::SHUTDOWN;
}
lock->lock();
const int old_cursor = raw_cursor;
/* Only autocomplete when the callback is set. It returns < 0 when
* there was an error reading from fd. Otherwise it will return the
* character that should be handled next. */
@ -597,6 +598,29 @@ namespace DFHack
{
forward_word();
}
else if (seq[0] == 127 || seq[0] == 8) // backspace || ctrl-h
{
// delete word
back_word();
if (old_cursor > raw_cursor)
{
yank_buffer = raw_buffer.substr(raw_cursor, old_cursor - raw_cursor);
raw_buffer.erase(raw_cursor, old_cursor - raw_cursor);
prompt_refresh();
}
}
else if (seq[0] == 'd')
{
// delete word forward
forward_word();
if (old_cursor < raw_cursor)
{
yank_buffer = raw_buffer.substr(old_cursor, raw_cursor - old_cursor);
raw_buffer.erase(old_cursor, raw_cursor - old_cursor);
raw_cursor = old_cursor;
prompt_refresh();
}
}
else if(seq[0] == '[')
{
if (!read_char(seq[1]))

@ -334,7 +334,7 @@ virtual_identity *virtual_identity::find(void *vtable)
return p;
}
std::cerr << "UNKNOWN CLASS '" << name << "': vtable = 0x"
std::cerr << "Class not in symbols.xml: '" << name << "': vtable = 0x"
<< std::hex << uintptr_t(vtable) << std::dec << std::endl;
known[vtable] = NULL;

@ -313,8 +313,12 @@ bool Plugin::load(color_ostream &con)
if (plug_git_desc_ptr)
{
if (strcmp(dfhack_git_desc, plug_git_desc) != 0)
con.printerr("Warning: Plugin %s compiled for DFHack %s, running DFHack %s\n",
{
std::string msg = stl_sprintf("Warning: Plugin %s compiled for DFHack %s, running DFHack %s\n",
*plug_name, plug_git_desc, dfhack_git_desc);
con << msg << flush;
cerr << msg << flush;
}
}
else
con.printerr("Warning: Plugin %s missing git information\n", *plug_name);

@ -205,14 +205,15 @@ void Units::setNickname(df::unit *unit, std::string nick)
df::historical_figure *id_hfig = NULL;
switch (identity->type) {
case df::identity_type::None:
case df::identity_type::HidingCurse:
case df::identity_type::Identity:
case df::identity_type::FalseIdentity:
case df::identity_type::InfiltrationIdentity:
case df::identity_type::Identity:
break; // We want the nickname to end up in the identity
case df::identity_type::Unk_1: // Guess, but that's how it worked in the past
case df::identity_type::Impersonating:
case df::identity_type::TrueName:
case df::identity_type::Unk_4: // Pure guess, as this is a new case, still unseen
id_hfig = df::historical_figure::find(identity->histfig_id);
break;
}

@ -1 +1 @@
Subproject commit ecd6bcc9ed67c62fa605561b27574467df792342
Subproject commit 9fca46ccca28e0948014b9d56a096ad7343473f1

@ -9,11 +9,16 @@
#include "TileTypes.h"
#include "df/map_block.h"
#include "df/map_block_column.h"
#include "df/plant.h"
#include "df/plant_growth.h"
#include "df/plant_raw.h"
#include "df/tile_dig_designation.h"
#include "df/ui.h"
#include "df/world.h"
#include "df/world_data.h"
#include "df/world_object_data.h"
#include "df/world_site.h"
#include "modules/Designations.h"
#include "modules/Maps.h"
@ -27,7 +32,9 @@ using namespace DFHack;
using namespace df::enums;
DFHACK_PLUGIN("getplants");
REQUIRE_GLOBAL(ui);
REQUIRE_GLOBAL(world);
REQUIRE_GLOBAL(cur_year);
REQUIRE_GLOBAL(cur_year_tick);
enum class selectability {
@ -224,6 +231,106 @@ selectability selectablePlant(const df::plant_raw *plant, bool farming)
}
}
// Formula for determination of the variance in plant growth maturation time, determined via disassembly.
// The x and y parameters are in tiles relative to the embark.
bool ripe(int32_t x, int32_t y, int32_t start, int32_t end) {
int32_t time = (((435522653 - (((y + 3) * x + 5) * ((y + 7) * y * 400181475 + 289700012))) & 0x3FFFFFFF) % 2000 + *cur_year_tick) % 403200;
return time >= start && (end == -1 || time <= end);
}
// Looks in the picked growths vector to see if a matching growth has been marked as picked.
bool picked(const df::plant *plant, int32_t growth_subtype) {
df::world_data *world_data = world->world_data;
df::world_site *site = df::world_site::find(ui->site_id);
int32_t pos_x = site->global_min_x + plant->pos.x / 48;
int32_t pos_y = site->global_min_y + plant->pos.y / 48;
size_t id = pos_x + pos_y * 16 * world_data->world_width;
df::world_object_data *object_data = df::world_object_data::find(id);
df::map_block_column *column = world->map.map_block_columns[(plant->pos.x / 16) * world->map.x_count_block + (plant->pos.y / 16)];
for (size_t i = 0; i < object_data->picked_growths.x.size(); i++) {
if (object_data->picked_growths.x[i] == plant->pos.x &&
object_data->picked_growths.y[i] == plant->pos.y &&
object_data->picked_growths.z[i] - column->z_base == plant->pos.z &&
object_data->picked_growths.subtype[i] == growth_subtype &&
object_data->picked_growths.year[i] == *cur_year) {
return true;
}
}
return false;
}
bool designate(const df::plant *plant, bool farming) {
df::plant_raw *plant_raw = world->raws.plants.all[plant->material];
const DFHack::MaterialInfo basic_mat = DFHack::MaterialInfo(plant_raw->material_defs.type[plant_material_def::basic_mat], plant_raw->material_defs.idx[plant_material_def::basic_mat]);
if (basic_mat.material->flags.is_set(material_flags::EDIBLE_RAW) ||
basic_mat.material->flags.is_set(material_flags::EDIBLE_COOKED))
{
return Designations::markPlant(plant);
}
if (plant_raw->flags.is_set(plant_raw_flags::THREAD) ||
plant_raw->flags.is_set(plant_raw_flags::MILL) ||
plant_raw->flags.is_set(plant_raw_flags::EXTRACT_VIAL) ||
plant_raw->flags.is_set(plant_raw_flags::EXTRACT_BARREL) ||
plant_raw->flags.is_set(plant_raw_flags::EXTRACT_STILL_VIAL))
{
if (!farming) {
return Designations::markPlant(plant);
}
}
if (basic_mat.material->reaction_product.id.size() > 0 ||
basic_mat.material->reaction_class.size() > 0)
{
if (!farming) {
return Designations::markPlant(plant);
}
}
for (size_t i = 0; i < plant_raw->growths.size(); i++)
{
if (plant_raw->growths[i]->item_type == df::item_type::SEEDS || // Only trees have seed growths in vanilla, but raws can be modded...
plant_raw->growths[i]->item_type == df::item_type::PLANT_GROWTH)
{
const DFHack::MaterialInfo growth_mat = DFHack::MaterialInfo(plant_raw->growths[i]->mat_type, plant_raw->growths[i]->mat_index);
if ((plant_raw->growths[i]->item_type == df::item_type::SEEDS &&
(growth_mat.material->flags.is_set(material_flags::EDIBLE_COOKED) ||
growth_mat.material->flags.is_set(material_flags::EDIBLE_RAW))) ||
(plant_raw->growths[i]->item_type == df::item_type::PLANT_GROWTH &&
growth_mat.material->flags.is_set(material_flags::LEAF_MAT))) // Will change name to STOCKPILE_PLANT_GROWTH any day now...
{
bool seedSource = plant_raw->growths[i]->item_type == df::item_type::SEEDS;
if (plant_raw->growths[i]->item_type == df::item_type::PLANT_GROWTH)
{
for (size_t k = 0; growth_mat.material->reaction_product.material.mat_type.size(); k++)
{
if (growth_mat.material->reaction_product.material.mat_type[k] == plant_raw->material_defs.type[plant_material_def::seed] &&
growth_mat.material->reaction_product.material.mat_index[k] == plant_raw->material_defs.idx[plant_material_def::seed])
{
seedSource = true;
break;
}
}
}
if ((!farming || seedSource) &&
ripe(plant->pos.x, plant->pos.y, plant_raw->growths[i]->timing_1, plant_raw->growths[i]->timing_2) &&
!picked(plant, i))
{
return Designations::markPlant(plant);
}
}
}
}
return false;
}
command_result df_getplants (color_ostream &out, vector <string> & parameters)
{
string plantMatStr = "";
@ -448,7 +555,7 @@ command_result df_getplants (color_ostream &out, vector <string> & parameters)
collectionCount[plant->material]++;
++count;
}
if (!deselect && Designations::markPlant(plant))
if (!deselect && designate(plant, farming))
{
// out.print("Designated %s at (%i, %i, %i), %d\n", world->raws.plants.all[plant->material]->id.c_str(), plant->pos.x, plant->pos.y, plant->pos.z, (int)i);
collectionCount[plant->material]++;

@ -86,6 +86,7 @@
#include "tweaks/civ-agreement-ui.h"
#include "tweaks/condition-material.h"
#include "tweaks/craft-age-wear.h"
#include "tweaks/do-job-now.h"
#include "tweaks/eggs-fertile.h"
#include "tweaks/embark-profile-name.h"
#include "tweaks/farm-plot-select.h"
@ -182,6 +183,7 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector <Plugi
/*" tweak fix-dimensions [disable]\n"
" Fixes subtracting small amount of thread/cloth/liquid from a stack\n"
" by splitting the stack and subtracting from the remaining single item.\n"*/
// sort these alphabetically
" tweak adamantine-cloth-wear [disable]\n"
" Stops adamantine clothing from wearing out while being worn (bug 6481).\n"
" tweak advmode-contained [disable]\n"
@ -200,6 +202,8 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector <Plugi
" Fixes a crash in the work order contition material list (bug 9905).\n"
" tweak craft-age-wear [disable]\n"
" Makes cloth and leather items wear out at the correct rate (bug 6003).\n"
" tweak do-job-now [disable]\n"
" Adds a job priority toggle to the jobs list.\n"
" tweak embark-profile-name [disable]\n"
" Allows the use of lowercase letters when saving embark profiles\n"
" tweak eggs-fertile [disable]\n"
@ -243,6 +247,8 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector <Plugi
" tweak pausing-fps-counter [disable]\n"
" Replace fortress mode FPS counter with one that stops counting \n"
" when paused.\n"
" tweak reaction-gloves [disable]\n"
" Changes custom reactions to produce gloves in sets with correct handedness\n"
" tweak shift-8-scroll [disable]\n"
" Gives Shift+8 (or *) priority when scrolling menus, instead of \n"
" scrolling the map\n"
@ -252,8 +258,7 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector <Plugi
" Adds a safe rename option to the title screen \"Start Playing\" menu\n"
" tweak tradereq-pet-gender [disable]\n"
" Displays the gender of pets in the trade request list\n"
" tweak reaction-gloves [disable]\n"
" Changes custom reactions to produce gloves in sets with correct handedness\n"
// sort these alphabetically
// " tweak military-training [disable]\n"
// " Speed up melee squad training, removing inverse dependency on unit count.\n"
));
@ -280,6 +285,9 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector <Plugi
TWEAK_HOOK("craft-age-wear", craft_age_wear_hook, ageItem);
TWEAK_HOOK("do-job-now", do_job_now_hook, feed);
TWEAK_HOOK("do-job-now", do_job_now_hook, render);
TWEAK_HOOK("eggs-fertile", egg_fertile_hook, render);
TWEAK_HOOK("embark-profile-name", embark_profile_name_hook, feed);

@ -0,0 +1,43 @@
#include "df/viewscreen_joblistst.h"
struct do_job_now_hook : public df::viewscreen_joblistst {
typedef df::viewscreen_joblistst interpose_base;
bool handleInput(std::set<df::interface_key> *input) {
if (input->count(interface_key::BUILDJOB_NOW)) {
df::job *job = vector_get(jobs, cursor_pos);
if (job) {
job->flags.bits.do_now = !job->flags.bits.do_now;
}
return true;
}
return false;
}
DEFINE_VMETHOD_INTERPOSE(void, feed, (std::set<df::interface_key> *input)) {
if (!handleInput(input)) {
INTERPOSE_NEXT(feed)(input);
}
}
DEFINE_VMETHOD_INTERPOSE(void, render, ()) {
INTERPOSE_NEXT(render)();
int x = 32;
auto dim = Screen::getWindowSize();
int y = dim.y - 2;
bool do_now = false;
df::job *job = vector_get(jobs, cursor_pos);
if (job) {
do_now = job->flags.bits.do_now;
}
OutputHotkeyString(x, y, (!do_now ? "Do job now!" : "Reset priority"),
interface_key::BUILDJOB_NOW, false, x, job ? COLOR_WHITE : COLOR_DARKGREY, COLOR_LIGHTRED);
}
};
IMPLEMENT_VMETHOD_INTERPOSE(do_job_now_hook, feed);
IMPLEMENT_VMETHOD_INTERPOSE(do_job_now_hook, render);

@ -1 +1 @@
Subproject commit a50a72a143cab62348909c3568ddbe63745e5451
Subproject commit 823d47c4d181ac5b754dce5d605f3e7f242aed26