diff --git a/NEWS b/NEWS index e12608d34..6ba9a769f 100644 --- a/NEWS +++ b/NEWS @@ -47,6 +47,9 @@ DFHack future properly designated barracks be used again for storage of squad equipment. New Search plugin by falconne: Adds an incremental search function to the Stocks, Trading and Unit List screens. + New AutoMaterial plugin by falconne: + Makes building constructions (walls, floors, fortifications, etc) a little bit easier by + saving you from having to trawl through long lists of materials each time you place one. Dfusion plugin: Reworked to make use of lua modules, now all the scripts can be used from other scripts. diff --git a/Readme.html b/Readme.html index f520e1a82..5b231b429 100644 --- a/Readme.html +++ b/Readme.html @@ -508,33 +508,34 @@ access DF memory and allow for easier development of new tools.
Color squad candidates already assigned to other squads in yellow/green to make them stand out more in the list.
- + +Speeds up melee squad training by removing an almost certainly +unintended inverse dependency of training speed on unit count +(i.e. the more units you have, the slower it becomes), and making +the units spar more.
Note
In order to avoid user confusion, as a matter of policy all these tools display the word "DFHack" on the screen somewhere while active.
+When that is not appropriate because they merely add keybinding hints to +existing DF screens, they deliberately use red instead of green for the key.
As an exception, the tweak plugin described above does not follow this guideline because it arguably just fixes small usability bugs in the game UI.
@@ -2836,15 +2846,42 @@ are actually visible in the list; the same effect applies to the Trade Value numbers displayed by the screen. Because of this, pressing the 't' key while search is active clears the search instead of executing the trade. +The automaterial plugin makes building constructions (walls, floors, fortifications, +etc) a little bit easier by saving you from having to trawl through long lists of +materials each time you place one.
+Firstly, it moves the last used material for a given construction type to the top of +the list, if there are any left. So if you build a wall with chalk blocks, the next +time you place a wall the chalk blocks will be at the top of the list, regardless of +distance (it only does this in "grouped" mode, as individual item lists could be huge). +This should mean you can place most constructions without having to search for your +preferred material type.
+ +Pressing 'a' while highlighting any material will enable that material for "auto select" +for this construction type. You can enable multiple materials as autoselect. Now the next +time you place this type of construction, the plugin will automatically choose materials +for you from the kinds you enabled. If there is enough to satisfy the whole placement, +you won't be prompted with the material screen - the construction will be placed and you +will be back in the construction menu as if you did it manually.
+When choosing the construction placement, you will see a couple of options:
+ +Use 'a' here to temporarily disable the material autoselection, e.g. if you need +to go to the material selection screen so you can toggle some materials on or off.
+The other option (auto type selection, off by default) can be toggled on with 't'. If you +toggle this option on, instead of returning you to the main construction menu after selecting +materials, it returns you back to this screen. If you use this along with several autoselect +enabled materials, you should be able to place complex constructions more conveniently.
+To use, bind to a key (the example config uses Alt-L) and activate in the 'k' mode.
While active, use the suggested keys to switch the usual liquids parameters, and Enter to select the target area and apply changes.
To use, bind to a key (the example config uses Ctrl-M) and activate in the 'q' mode.
Lists mechanisms connected to the building, and their links. Navigating the list centers @@ -2854,7 +2891,7 @@ focus on the current one. Shift-Enter has an effect equivalent to pressing Enter re-entering the mechanisms ui.
Backed by the rename plugin, this script allows entering the desired name via a simple dialog in the game ui.
To use, bind to a key (the example config uses Alt-R) and activate in the 'q' mode, either immediately or after opening the assign owner page.
@@ -2885,7 +2922,7 @@ either immediately or after opening the assign owner page. list, and allows unassigning them.Bind to a key (the example config uses Ctrl-W), and activate in the Equip->View/Customize page of the military screen.
Depending on the cursor location, it rewrites all 'individual choice weapon' entries @@ -2896,7 +2933,7 @@ only that entry, and does it even if it is not 'individual choice'.
and may lead to inappropriate weapons being selected.Bind to a key (the example config uses Alt-P), and activate in the Hauling menu with the cursor over a Guide order.
@@ -2904,7 +2941,7 @@ the cursor over a Guide order. computes it when the order is executed for the first time.Bind to a key (the example config uses Alt-A), and activate with a job selected in a workshop in the 'q' mode.
@@ -2940,7 +2977,7 @@ and then try to change the input item type, now it won't let you select plan you have to unset the material first.Bind to a key (the example config uses Alt-W), and activate with a job selected in a workshop in the 'q' mode.
@@ -2970,7 +3007,7 @@ suit your need, and set the item count range.If you don't need advanced settings, you can just press 'y' to confirm creation.
Bind to a key (the example config uses P), and activate when viewing a weapon rack in the 'q' mode.
@@ -2995,7 +3032,7 @@ of currently assigned racks for every valid squad.These plugins, when activated via configuration UI or by detecting certain structures in RAWs, modify the game engine behavior concerning the target objects to add features not otherwise present.
@@ -3006,20 +3043,20 @@ technical challenge, and do not represent any long-term plans to produce more similar modifications of the game.The siege-engine plugin enables siege engines to be linked to stockpiles, and aimed at an arbitrary rectangular area across Z levels, instead of the original four directions. Also, catapults can be ordered to load arbitrary objects, not just stones.
Siege engines are a very interesting feature, but sadly almost useless in the current state because they haven't been updated since 2D and can only aim in four directions. This is an attempt to bring them more up to date until Toady has time to work on it. Actual improvements, e.g. like making siegers bring their own, are something only Toady can do.
The configuration front-end to the plugin is implemented by the gui/siege-engine script. Bind it to a key (the example config uses Alt-A) and activate after selecting a siege engine in 'q' mode.
@@ -3042,7 +3079,7 @@ menu.The power-meter plugin implements a modified pressure plate that detects power being supplied to gear boxes built in the four adjacent N/S/W/E tiles.
The configuration front-end is implemented by the gui/power-meter script. Bind it to a @@ -3053,11 +3090,11 @@ in the build menu.
configuration page, but configures parameters relevant to the modded power meter building.The steam-engine plugin detects custom workshops with STEAM_ENGINE in their token, and turns them into real steam engines.
The vanilla game contains only water wheels and windmills as sources of power, but windmills give relatively little power, and water wheels require flowing water, which must either be a real river and thus immovable and @@ -3068,7 +3105,7 @@ it can be done just by combining existing features of the game engine in a new way with some glue code and a bit of custom logic.
The workshop needs water as its input, which it takes via a passable floor tile below it, like usual magma workshops do. The magma version also needs magma.
@@ -3092,7 +3129,7 @@ short axles that can be built later than both of the engines.In order to operate the engine, queue the Stoke Boiler job (optionally on repeat). A furnace operator will come, possibly bringing a bar of fuel, and perform it. As a result, a "boiling water" item will appear @@ -3123,7 +3160,7 @@ decrease it by further 4%, and also decrease the whole steam use rate by 10%.
The engine must be constructed using barrel, pipe and piston from fire-safe, or in the magma version magma-safe metals.
During operation weak parts get gradually worn out, and @@ -3132,7 +3169,7 @@ toppled during operation by a building destroyer, or a tantruming dwarf.
It should be safe to load and view engine-using fortresses from a DF version without DFHack installed, except that in such case the engines won't work. However actually making modifications @@ -3143,7 +3180,7 @@ being generated.
This plugin makes reactions with names starting with SPATTER_ADD_
produce contaminants on the items instead of improvements. The produced
contaminants are immune to being washed away by water or destroyed by
diff --git a/Readme.rst b/Readme.rst
index 1f5ac08fd..e6554cac0 100644
--- a/Readme.rst
+++ b/Readme.rst
@@ -1968,6 +1968,9 @@ are mostly implemented by lua scripts.
In order to avoid user confusion, as a matter of policy all these tools
display the word "DFHack" on the screen somewhere while active.
+ When that is not appropriate because they merely add keybinding hints to
+ existing DF screens, they deliberately use red instead of green for the key.
+
As an exception, the tweak plugin described above does not follow this
guideline because it arguably just fixes small usability bugs in the game UI.
@@ -2046,6 +2049,42 @@ Value numbers displayed by the screen. Because of this, pressing the 't'
key while search is active clears the search instead of executing the trade.
+AutoMaterial
+============
+
+The automaterial plugin makes building constructions (walls, floors, fortifications,
+etc) a little bit easier by saving you from having to trawl through long lists of
+materials each time you place one.
+
+Firstly, it moves the last used material for a given construction type to the top of
+the list, if there are any left. So if you build a wall with chalk blocks, the next
+time you place a wall the chalk blocks will be at the top of the list, regardless of
+distance (it only does this in "grouped" mode, as individual item lists could be huge).
+This should mean you can place most constructions without having to search for your
+preferred material type.
+
+.. image:: images/automaterial-mat.png
+
+Pressing 'a' while highlighting any material will enable that material for "auto select"
+for this construction type. You can enable multiple materials as autoselect. Now the next
+time you place this type of construction, the plugin will automatically choose materials
+for you from the kinds you enabled. If there is enough to satisfy the whole placement,
+you won't be prompted with the material screen - the construction will be placed and you
+will be back in the construction menu as if you did it manually.
+
+When choosing the construction placement, you will see a couple of options:
+
+.. image:: images/automaterial-pos.png
+
+Use 'a' here to temporarily disable the material autoselection, e.g. if you need
+to go to the material selection screen so you can toggle some materials on or off.
+
+The other option (auto type selection, off by default) can be toggled on with 't'. If you
+toggle this option on, instead of returning you to the main construction menu after selecting
+materials, it returns you back to this screen. If you use this along with several autoselect
+enabled materials, you should be able to place complex constructions more conveniently.
+
+
gui/liquids
===========
diff --git a/images/automaterial-mat.png b/images/automaterial-mat.png
new file mode 100644
index 000000000..5517bbc6d
Binary files /dev/null and b/images/automaterial-mat.png differ
diff --git a/images/automaterial-pos.png b/images/automaterial-pos.png
new file mode 100644
index 000000000..959573643
Binary files /dev/null and b/images/automaterial-pos.png differ
diff --git a/library/include/modules/Screen.h b/library/include/modules/Screen.h
index 2c245ae4c..bfc393734 100644
--- a/library/include/modules/Screen.h
+++ b/library/include/modules/Screen.h
@@ -28,7 +28,9 @@ distribution.
#include "BitArray.h"
#include "ColorText.h"
#include "Types.h"
+
#include