Merge branch 'develop' into tailor-v2

develop
Kelly Kinkade 2021-08-16 07:17:53 -05:00 committed by GitHub
commit 92f258bdbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 742 additions and 288 deletions

@ -28,4 +28,7 @@ jobs:
git config user.email "63161697+DFHack-Urist@users.noreply.github.com"
if bash -x ci/update-submodules.bash; then
git push --recurse-submodules=check
elif ! git diff --exit-code HEAD; then
echo "update-submodules.bash failed to commit changes"
exit 1
fi

4
.gitmodules vendored

@ -19,16 +19,12 @@
[submodule "depends/xlsxio"]
path = depends/xlsxio
url = ../../DFHack/xlsxio.git
shallow = true
[submodule "depends/libzip"]
path = depends/libzip
url = ../../DFHack/libzip.git
shallow = true
[submodule "depends/libexpat"]
path = depends/libexpat
url = ../../DFHack/libexpat.git
shallow = true
[submodule "depends/luacov"]
path = depends/luacov
url = ../../DFHack/luacov.git
shallow = true

@ -21,7 +21,9 @@ write_msg ""
cat ci/update-submodules.manifest | while read path branch; do
cd "${git_root}/${path}"
test "${git_root}" != "$(get_git_root)"
git fetch origin "${branch}:${branch}"
git checkout "${branch}"
git branch --set-upstream-to="origin/${branch}" "${branch}"
git pull --ff-only
cd "${git_root}"
if ! git diff --quiet --ignore-submodules=dirty -- "${path}"; then

@ -4,3 +4,4 @@ plugins/stonesense master
depends/libzip dfhack
depends/libexpat dfhack
depends/xlsxio dfhack
depends/luacov dfhack

File diff suppressed because it is too large Load Diff

@ -1 +1 @@
Subproject commit 19b52ca0298c8942df82dd441d7a4a588db4c413
Subproject commit 87d6ae018cb8d288d854f632e9d8d959d75d7db4

@ -38,6 +38,9 @@ there are a few important standards for completeness and consistent style. Trea
this section as a guide rather than iron law, match the surrounding text, and you'll
be fine.
Command documentation
---------------------
Each command should have a short (~54 character) help string, which is shown
by the `ls` command. For scripts, this is a comment on the first line
(the comment marker and whitespace is stripped). For plugins it's the second
@ -80,6 +83,9 @@ Try to keep lines within 80-100 characters, so it's readable in plain text
in the terminal - Sphinx (our documentation system) will make sure
paragraphs flow.
Command usage
-------------
If there aren't many options or examples to show, they can go in a paragraph of
text. Use double-backticks to put commands in monospaced font, like this::
@ -103,6 +109,9 @@ describe the effect::
``resume all``
Resumes all suspended constructions.
Links
-----
If it would be helpful to mention another DFHack command, don't just type the
name - add a hyperlink! Specify the link target in backticks, and it will be
replaced with the corresponding title and linked: e.g. ```autolabor```
@ -118,6 +127,17 @@ section like this::
Add link targets if you need them, but otherwise plain headings are preferred.
Scripts have link targets created automatically.
Note that the DFHack documentation is configured so that single backticks (with
no prefix or suffix) produce links to internal link targets, such as the
``autolabor`` target shown above. This is different from the reStructuredText
default behavior of rendering such text in italics (as a reference to a title).
For alternative link behaviors, see:
- `The reStructuredText documentation on roles <https://docutils.sourceforge.io/docs/ref/rst/roles.html>`__
- `The reStructuredText documentation on external links <https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#hyperlink-targets>`__
- `The Sphinx documentation on roles <https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html>`__
- ``:doc:`` is useful for linking to another document
Required dependencies
=====================

@ -36,8 +36,15 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
## New Plugins
- `dig-now`: instantly completes dig designations (including smoothing and carving tracks)
## Fixes
- Core: ``alt`` keydown state is now cleared when DF loses and regains focus, ensuring the ``alt`` modifier state is not stuck on for systems that don't send standard keyup events in response to ``alt-tab`` window manager events
- Lua: ``memscan.field_offset()``: fixed an issue causing `devel/export-dt-ini` to crash sometimes, especially on Windows
- `autogems`: no longer assigns gem cutting jobs to workshops with gem cutting prohibited in the workshop profile
## Misc Improvements
- `buildingplan`: now displays which items are attached and which items are still missing for planned buildings
- `tiletypes-here`, `tiletypes-here-point`: add --cursor and --quiet options to support non-interactive use cases
- `quickfort`: Dreamfort blueprint set improvements: extensive revision based on playtesting and feedback. includes updated ``onMapLoad.init`` settings file and enhanced automation orders. see full changelog at https://github.com/DFHack/dfhack/pull/1921
- `tailor`: allow user to specify which materials to be used, and in what order
## Documentation

@ -2472,13 +2472,20 @@ int UnicodeAwareSym(const SDL::KeyboardEvent& ke)
//MEMO: return false if event is consumed
int Core::DFH_SDL_Event(SDL::Event* ev)
{
//static bool alt = 0;
// do NOT process events before we are ready.
if(!started) return true;
if(!ev)
return true;
if(ev && (ev->type == SDL::ET_KEYDOWN || ev->type == SDL::ET_KEYUP))
if(ev->type == SDL::ET_ACTIVEEVENT && ev->active.gain)
{
// clear modstate when gaining focus in case alt-tab was used when
// losing focus and modstate is now incorrectly set
modstate = 0;
return true;
}
if(ev->type == SDL::ET_KEYDOWN || ev->type == SDL::ET_KEYUP)
{
auto ke = (SDL::KeyboardEvent *)ev;

@ -310,7 +310,7 @@ function field_ref(handle,...)
end
function field_offset(type,...)
local tmp = df.new('intptr_t') -- pointer to nullptr
local tmp = df.new('int8_t', df.sizeof(type))
local _, haddr = df.sizeof(tmp)
local handle = df.reinterpret_cast(type, tmp)
local _, addr = df.sizeof(field_ref(handle,...))

@ -1 +1 @@
Subproject commit 54b8a7c3d0491e016b60cdd2b50b9bd21be8064b
Subproject commit 581c0be73c4b15be0ea1dc413d662afb03b625f0

@ -155,6 +155,12 @@ void create_jobs() {
continue;
}
auto profile = workshop->getWorkshopProfile();
if (profile && profile->blocked_labors[df::unit_labor::CUT_GEM]) {
// workshop profile does not allow cut gem jobs (fixes #1263)
continue;
}
if (links.size() > 0) {
for (auto l = links.begin(); l != links.end() && workshop->jobs.size() <= MAX_WORKSHOP_JOBS; ++l) {
auto stockpile = virtual_cast<df::building_stockpilest>(*l);

@ -498,6 +498,17 @@ struct buildingplan_query_hook : public df::viewscreen_dwarfmodest
INTERPOSE_NEXT(feed)(input);
}
static bool is_filter_satisfied(df::building *bld, int filter_idx)
{
if (!bld
|| bld->jobs.size() < 1
|| bld->jobs[0]->job_items.size() <= filter_idx)
return false;
// if all items for this filter are attached, the quantity will be 0
return bld->jobs[0]->job_items[filter_idx]->quantity == 0;
}
DEFINE_VMETHOD_INTERPOSE(void, render, ())
{
INTERPOSE_NEXT(render)();
@ -515,10 +526,12 @@ struct buildingplan_query_hook : public df::viewscreen_dwarfmodest
Screen::Pen pen(' ', COLOR_BLACK);
Screen::fillRect(pen, x, y, dims.menu_x2, y);
bool attached = is_filter_satisfied(pb->getBuilding(), filter_idx);
auto & filter = pb->getFilters()[filter_idx];
y = 24;
std::string item_label =
stl_sprintf("Item %d of %d", filter_count - filter_idx, filter_count);
stl_sprintf("Item %d of %d (%s)", filter_count - filter_idx, filter_count, attached ? "attached" : "pending");
OutputString(COLOR_WHITE, x, y, "Planned Building Filter", true, left_margin + 1);
OutputString(COLOR_WHITE, x, y, item_label.c_str(), true, left_margin + 1);
OutputString(COLOR_WHITE, x, y, get_item_label(toBuildingTypeKey(bld), filter_idx).c_str(), true, left_margin);