Merge pull request #2976 from myk002/myk_automaterial

turn down automaterial (superseded by buildingplan)
develop
Myk 2023-03-06 15:48:45 -08:00 committed by GitHub
commit 3ba9459883
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 1417 deletions

@ -18,6 +18,14 @@ An automated labor management tool that only addressed hauling labors, leaving t
of skilled labors entirely up to the player. Fundamentally incompatible with the work detail of skilled labors entirely up to the player. Fundamentally incompatible with the work detail
system of labor management in v50 of Dwarf Fortress. system of labor management in v50 of Dwarf Fortress.
.. _automaterial:
automaterial
============
Moved frequently used materials to the top of the materials list when building
buildings. Also offered extended options when building constructions. All
functionality has been merged into `buildingplan`.
.. _combine-drinks: .. _combine-drinks:
combine-drinks combine-drinks

@ -58,6 +58,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
## Removed ## Removed
-@ ``gui.THIN_FRAME``: replaced by ``gui.INTERIOR_FRAME`` -@ ``gui.THIN_FRAME``: replaced by ``gui.INTERIOR_FRAME``
- `automaterial`: all functionality has been merged into `buildingplan`
# 50.07-alpha2 # 50.07-alpha2

@ -1,53 +0,0 @@
automaterial
============
.. dfhack-tool::
:summary: Sorts building materials by recent usage.
:tags: untested fort design productivity buildings map
:no-command:
This plugin makes building constructions (walls, floors, fortifications, etc)
much easier by saving you from having to trawl through long lists of materials
each time you place one.
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 means you can place most constructions without having
to search for your preferred material type.
Usage
-----
::
enable automaterial
.. image:: ../images/automaterial-mat.png
Pressing :kbd:`a` while highlighting any material will enable that material for
"auto select" for this construction type. You can enable multiple materials. 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 at
all -- the construction will be placed and you will be back in the construction
menu.
When choosing the construction placement, you will see a couple of options:
.. image:: ../images/automaterial-pos.png
Use :kbd:`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
:kbd:`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.
The ``automaterial`` plugin also enables extra construction placement modes,
such as designating areas larger than 10x10 and allowing you to designate hollow
rectangles instead of the default filled ones.

@ -82,7 +82,6 @@ dfhack_plugin(autodump autodump.cpp)
dfhack_plugin(autofarm autofarm.cpp) dfhack_plugin(autofarm autofarm.cpp)
#dfhack_plugin(autogems autogems.cpp LINK_LIBRARIES jsoncpp_static) #dfhack_plugin(autogems autogems.cpp LINK_LIBRARIES jsoncpp_static)
add_subdirectory(autolabor) add_subdirectory(autolabor)
#dfhack_plugin(automaterial automaterial.cpp LINK_LIBRARIES lua)
dfhack_plugin(automelt automelt.cpp LINK_LIBRARIES lua) dfhack_plugin(automelt automelt.cpp LINK_LIBRARIES lua)
dfhack_plugin(autonestbox autonestbox.cpp LINK_LIBRARIES lua) dfhack_plugin(autonestbox autonestbox.cpp LINK_LIBRARIES lua)
#dfhack_plugin(autotrade autotrade.cpp) #dfhack_plugin(autotrade autotrade.cpp)

File diff suppressed because it is too large Load Diff

@ -1,23 +0,0 @@
local _ENV = mkmodule('plugins.automaterial')
local buildingplan = require('plugins.buildingplan')
-- construct the building and register it with buildingplan for item selection
function build_with_buildingplan_box_select(subtype, x, y, z)
local pos = xyz2pos(x, y, z)
local bld, err = dfhack.buildings.constructBuilding{
type=df.building_type.Construction, subtype=subtype, pos=pos}
-- it's not a user error if we can't place a building here; just indicate
-- that no building was placed by returning false.
if err then return false end
buildingplan.addPlannedBuilding(bld)
return true
end
function build_with_buildingplan_ui()
for _,bld in ipairs(buildingplan.construct_buildings_from_ui_state()) do
buildingplan.addPlannedBuilding(bld)
end
end
return _ENV