Commit Graph

4052 Commits (9e17bc938c9212d3d1679404961ec0c0e2b57954)

Author SHA1 Message Date
bseiller 6a1b70ae76 making lint happy by removing trailing whitespace 2021-01-19 17:43:32 +01:00
bseiller 438811e108 handling special case of the cursor having been positioned in the lower right corner before the search
- matcher.cpp: manually moving the cursor to the neighbouring world tile so it can be moved back and embark_update is being called when all (incursion) data has been collected

Co-Authored-By: PatrikLundell <22739822+PatrikLundell@users.noreply.github.com>
2021-01-19 16:37:59 +01:00
bseiller 9b9373be4f removing commented out assigments 2021-01-19 12:06:36 +01:00
bseiller cb496c3f59 fixing indention/whitespaces
- defs.h: replacing tab with space/blank for indents
2021-01-19 00:07:28 +01:00
bseiller e99c8faa24 switching to mid_level_tile_incursion_base to store incursion data of world tile edges
- defs.h: using mid_level_tile_incursion_base in region_tile_datum to store incursion data of world tile edges
- survey.cpp: commented out "not used" blocks of assignment in survey_mid_level_tile that no longer make sense now
2021-01-19 00:01:54 +01:00
bseiller bdfd50cc65 using mid_level_tile_incursion_base instead of mid_level_tile for incursion processing
- matcher.cpp, survey.cpp: adapting signatures to use new struct that only contains incursion specific attributes
2021-01-18 23:50:14 +01:00
bseiller cc68767336 created struct mid_level_tile_incursion_base that only contains attributes that are relevant for incursion processing
- def.h: make attributes/fields of mid_level_tile_incursion_base available in mid_level_tile by inheriting from mid_level_tile_incursion_base which also allows treating mid_level_tile as a mid_level_tile_incursion_base
2021-01-18 23:23:50 +01:00
bseiller 85fe05b723 early return from embark_update during an active search to improve performance
- embark-assistant.cpp: checking if a search is active, if so return early
2021-01-18 22:08:46 +01:00
bseiller c300cae2f9 removing 2 dead stores to speed up survey::survey_mid_level_tile
- survey.cpp: removing layer_bottom and layer_top, which are never read, but slow down survey_mid_level_tile significantly because entries are added quite often into the tree map structure
- survey.h: removing now obsolete include for map
2021-01-18 19:38:57 +01:00
Susan 84b07005d8 tabs to spaces [whoops] 2021-01-16 23:47:41 +00:00
Susan 7a14bf475f don't turn off seedwatch on map load
fixes #682
2021-01-16 23:23:05 +00:00
Susan b506f0a240 remove misleading comment
per https://github.com/DFHack/dfhack/issues/682#issuecomment-138705257, seedwatch supports linux and has done for over a decade.
2021-01-16 23:01:25 +00:00
abstern 78df890217 factor out functions to get plant names and set individual farms 2021-01-13 08:55:48 +01:00
abstern 80674f7697 [feature] autofarm: fallow farms when no further plants requested 2021-01-12 21:37:51 +01:00
Myk Taylor 339d5ce26b
set buildingplan global settings from prompt
allow buildingplan settings to be set from the DFHack# prompt. For
example, if a player knows they'll always want to build with blocks,
they could add the following two lines to onMapLoad.init:

buildingplan set boulders false
buildingplan set logs false
2021-01-10 17:29:53 -08:00
Timur Kelman f115767713
add missing `\n` in digFlood's example 2020-12-31 13:47:02 +01:00
lethosor b585bca90b
look_menu_search: fix crash due to certain cursor keys not restoring list
Fixes #1737
2020-12-30 15:04:43 -05:00
lethosor a7232499ac
Silence some warnings from GCC 10
Specifically `gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0`
2020-12-30 00:04:49 -05:00
PatrikLundell 4a2704665d Merge branch 'develop' of https://github.com/DFHack/dfhack into embark-assistant 2020-12-27 11:20:18 +01:00
PatrikLundell dbfd838786 corrected temperature calculation factor order 2020-12-27 11:07:33 +01:00
lethosor 8cace1eb06
probe: print more designation and occupancy-related flags
This was useful for testing #1729
2020-12-23 15:36:39 -05:00
lethosor eff360b49d
Merge remote-tracking branch 'PatrikLundell/embark-assistant' into develop 2020-12-20 01:15:40 -05:00
PatrikLundell 0b7ab90d3d corrected mismatched indices 2020-12-17 11:49:15 +01:00
lethosor de21e0cdb8
Merge remote-tracking branch 'PatrikLundell/embark-assistant' into develop 2020-12-16 13:25:25 -05:00
PatrikLundell 3e3a34af99 corrected index usage 2020-12-16 10:59:27 +01:00
lethosor d437cfe649
Add test for invalid job types in workflow's job_outputs 2020-12-15 21:36:57 -05:00
lethosor 5d3924a8c0
Remove old jobs from plant_products
Identified by Quietust in #1722
2020-12-14 00:04:53 -05:00
lethosor 123c207d9c
Fix error in material_defs lookups
Changed in dfhack/df-structures@7dfea1f1d4
Fixes #1722
2020-12-14 00:03:29 -05:00
lethosor 4e08357aaf
search: reset when screen is dismissed, even if it's still present under gview
Fixes #1725
2020-12-08 23:09:07 -05:00
lethosor a3d8c5a2ec
revflood docs: clarify that constructed walls are ignored
Closes #1719
2020-12-05 19:41:32 -05:00
lethosor db03f943c9
Merge remote-tracking branch 'PatrikLundell/embark-assistant' into develop 2020-12-04 23:54:50 -05:00
PatrikLundell c36fbe4c8b Corrected river size handling 2020-12-03 15:40:22 +01:00
Tachytaenius 2a4e16d6da
Cover artifacts at greasing station
The inconsistent [DOES_NOT_DETERMINE_PRODUCT_AMOUNT] distribution is right, I assume?
2020-11-28 18:08:04 +00:00
lethosor 8548295fe5
Merge remote-tracking branch 'PatrikLundell/embark-assistant' into develop 2020-11-18 11:12:17 -05:00
PatrikLundell afe99b83c2 corrected orientation bug 2020-11-18 10:43:15 +01:00
lethosor 90cf6e8587
Merge remote-tracking branch 'quietust/dwarfvet' into develop 2020-11-17 23:38:06 -05:00
lethosor 53916dbe6b
Use charToKey and clean up logic a bit
Ref #1714
2020-11-17 23:33:18 -05:00
Nilsolm 4ac3e62e60 ignore input if selection is zero 2020-11-18 02:41:20 +01:00
PatrikLundell 1cd9babfb7 2 spaces killed 2020-11-17 21:10:40 +01:00
PatrikLundell 7944026742 fixed help screen misalignment 2020-11-17 20:55:14 +01:00
PatrikLundell 8f5d9fe1e9 Merge branch 'develop' of https://github.com/DFHack/dfhack into embark-assistant 2020-11-17 19:53:09 +01:00
PatrikLundell ab617f67cc corrected world tile level incursion calculations 2020-11-17 19:52:46 +01:00
Quietust 877fd42214 dwarfvet - initialize spot_index (#1711), fix types in Patient 2020-11-17 09:13:03 -06:00
lethosor 0b886399fe
zone: stop enumnick from taking priority over assign/unassign/slaughter
Fixes #1709
Ref #1652
2020-11-15 22:21:46 -05:00
lethosor 4921cb4ac7
Merge remote-tracking branch 'PatrikLundell/embark-assistant' into develop 2020-11-14 15:08:22 -05:00
PatrikLundell 0ef56ba859 another space character met its demise 2020-11-14 14:53:54 +01:00
PatrikLundell 46835c9edd reworked aquifer bit fiddling 2020-11-14 14:43:43 +01:00
myk002 59e76ae407
detect buildingplan buildings in the resume plugin 2020-11-13 12:43:46 -08:00
PatrikLundell d51b56c780 removed a blank 2020-11-13 20:28:22 +01:00
PatrikLundell 6014a45235 Fixed bug missing world tiles lacking incurson supplied resources 2020-11-13 20:11:03 +01:00
lethosor 2e4f23d49f
Merge remote-tracking branch 'myk002/myk_isplannedbuilding' into develop 2020-11-13 14:09:36 -05:00
myk002 efdba8b596
add buildingplan.isPlannedBuilding 2020-11-13 10:18:54 -08:00
myk002 10616a387f
cleaner mask-based implementation 2020-11-12 22:44:38 -08:00
myk002 6b14a92385
allow buildingplan to match metal bars 2020-11-12 19:54:00 -08:00
myk002 02a86d761a
identify bars as non_economic items
allows Job::isSuitableMaterial() to match metal bars as a building
material
2020-11-12 19:10:06 -08:00
myk002 36110902fa
don't use cached iterators across map reloads 2020-11-12 00:11:13 -08:00
lethosor 923b1b14f3
Merge remote-tracking branch 'myk002/buildingplan_persist_global_settings' into develop 2020-11-11 23:59:09 -05:00
lethosor 9c13b497bf
Merge remote-tracking branch 'myk002/myk_automaterial_buildingplan_fix' into develop 2020-11-11 23:36:42 -05:00
myk002 54702085d5
don't eat keys while building is being renamed
allows buildingplan to prevent unsuspension of planned buildings without
also eating the 's' key when the user is trying to use it to give the
building a custom name.
2020-11-11 17:12:56 -08:00
lethosor c87d5260d3
buildingplan: make hotkeys added to existing menus red
For clarity (per Lua API.rst guidelines)
2020-11-11 16:04:40 -05:00
lethosor 58079217d9
Merge remote-tracking branches 'myk002/myk_buildingplan_no_quality' and 'myk002/myk_buildingplan_pause' into develop 2020-11-03 00:09:03 -05:00
Myk Taylor 2c65113bdb detect all conditions that make the game pause 2020-10-31 03:03:05 -07:00
Myk Taylor fbc26336cf don't show quality properties for no-quality items
for items that cannot have a quality or be decorated:

in place mode, don't show quality adjustment hotkeys (or isDecorated
flag hotkey) and don't interpret the associated keycodes if they are
pressed.

in query mode, don't show quality or decorated fields.
2020-10-31 02:25:26 -07:00
Myk Taylor 65114d904c fix typo in comment 2020-10-29 11:53:31 -07:00
Myk Taylor 22ac163d55 improve UX between automaterial and buildingplan
solves the confusing behavior when both automaterial and buildingplan
are enabled for constructions. the two plugins now communicate with each
other over the Lua layer to negotiate consistent behavior.

if neither plugin is enabled, the standard DF UI acts as normal

if automaterial is enabled but buildingplan is not, then automaterial
behavior is unchanged.

if buildingplan is enabled and automaterial is not then behavior is
the same as other buildings with buildingplan (no material selection
screen, screen stays on building placement screen after placement).
this commit fixes a bug, though, where buildingplan would only lay
down a single tile of contruction instead of a solid block when a
block is requested.

if both plugins are enabled but buildingplan is not enabled for the
building type then automaterial is unchanged from previous behavior,
execpt for an additional header showing the separation between
automaterial hotkeys and buildingplan hotkeys.

finally, if both plugins are enabled and buildingplan is enabled for the
building type then buildingplan behavior prevails, but the box select and
hollow designations features of automaterial are still usable and
useful. the 'Auto Mat-select', 'Reselect Type', and "Open Placement"
automaterial hotkeys are hidden in the UI and ignored in the feed. This
is because buildingplan takes over material selection, so 'Auto
Mat-select' doesn't make sense. Buildingplan also already stays on the
placement screen after placement, so 'Reselect Type' is not necessary.
And all buildingplan-placed buildings have relaxed placement
restrictions (e.g. they can be built in mid-air) so 'Open Placement' is
also not necessary. The missing options are replaced with blank lines so
the vertical alignment of all other options stays constant.

we also remove a few extra lua_pop() calls that are made superfluous by
the StackUnwinder.
2020-10-29 11:00:49 -07:00
lethosor 08bb6ca35e
Tweak colors
Ref #1684
2020-10-29 00:03:07 -04:00
lethosor d508ad3c4b
Merge remote-tracking branch 'myk002/buildingplan_building_material_filters' into develop
Conflicts:
	docs/changelog.txt
2020-10-28 23:57:55 -04:00
Myk Taylor c1af3e2817 document what happens if no types are allowed 2020-10-26 21:13:11 -07:00
lethosor 3ab9157a2d
Merge remote-tracking branch 'myk002/buildingplan_refactor5_allbuildings_squashed2' into develop 2020-10-26 21:37:41 -04:00
lethosor b723636fe2
Merge remote-tracking branch 'myk002/buildingplan_refactor4_algorithm_squashed2' into develop 2020-10-26 21:24:05 -04:00
Myk Taylor 1a69a9b483 add more important checks for matching items
stolen (with love) from advfort.lua
2020-10-26 16:54:50 -07:00
Myk Taylor 292d40a6ba change hotkeys for adjusting min and max quality
to avoid 'q' and 'w' conflicts with the standard DF UI hotkeys for
roller speed.

min quality: 'qw' -> 'QW'
max quality: 'QW' - 'AS'
2020-10-26 16:11:34 -07:00
Myk Taylor 72b6ac781b on second thought, let UI-related settings reset
no need to have quickfort_mode stay on forever
2020-10-25 02:45:03 -07:00
Myk Taylor 486bf2719b persist global buildingplan settings
this ensures that a player's preferences are saved across map reloads.
this is particularly important for the building material filters, since
item fulfillment tasks are regenerated on map load, and any changes in
settings when buildingplan is reset will change the item vectors that will
be searched for planned buildings. if the settings were allowed to reset,
then a player who thought all walls would be made out of blocks would be
surprised to find boulders and logs being used after the map is reloaded.
2020-10-25 02:37:22 -07:00
lethosor 58917b03d1
Switch away from CheckDFObject in unprotected calls
See https://github.com/DFHack/dfhack/pull/1674#issuecomment-716028460
2020-10-24 14:27:33 -04:00
Myk Taylor a2f943e7e5 don't shift UI down for track constructions
automat doesn't have UI there to avoid
2020-10-24 09:19:15 -07:00
Myk Taylor e614d16e0e use Lua::CheckDFObject instead of static cast 2020-10-23 15:30:40 -07:00
Myk 55a52554ee
use CheckDFObject instead of static cast
Co-authored-by: Alan <lethosor@users.noreply.github.com>
2020-10-23 13:55:14 -07:00
Myk Taylor 0f517f38f8 don't conflict with automaterial plugin
shift buildingplan text down so we don't overwrite each other
2020-10-22 22:01:45 -07:00
Myk Taylor 7e78d8802e migrate qf's buildings_use_blocks to buildingplan
- remove buildings_use_blocks setting from quickfort config file
- add a new Buildingplan Global Settings dialog to house global settings
- move Quickfort Mode (for legacy Python Quickfort) into that dialog
- add four settings to control how generic building materials are matched:
  - blocks
  - boulders
  - logs
  - bars
- ajust the buildingplan algorithm to register duplicate tasks for
  building material item filters, one for each type. since we track how
  many items we've matched for a filter, the first matched item will
  "win" and the extras will get detected as invalid and popped off the
  queue.
- ensure boulders, logs, and bars are scanned last, and in that order
- more global settings planned for the future! see
  http://www.bay12forums.com/smf/index.php?topic=176889.msg8202679#msg8202679
2020-10-22 21:37:49 -07:00
Myk Taylor 09fbaba726 buildingplan: support all building types
Allow buildingplan to handle all building types, update the docs, and add in little extra fixes to ensure all the new types work correctly.
2020-10-16 14:23:35 -07:00
Myk Taylor 100b374af7 generalize buildingplan for all building types
but restrict to only the currently supported set so we can still assume only one filter is required for each building.

changes:
- update buildingplan plugin version to 2.0
- new serialization format for planned buildings
- old persistent data is automatically migrated to new format on load
- algorithm now respects job_item filters; items must match job_item filter and buildingplan ItemFilter
- more invalid items are now filtered out, like items encased in ice. are there any others we should be checking (see BadFlags struct)
- items are sorted before job is unsuspended so final item ordering is correct regardless of what order the items were matched and attached
- item counts in filters are kept up to date so if buildingplan is disabled before all filters are matched and the building is completed by DF itself, the item counts will come out correct (though the item ordering and building "roughness" may be incorrect)
- fixes two memory leaks in building finalization code
- allows artifacts to be matched (ItemFilter defaults now top out at Masterful -- Artifact is selectable but must be manually specified)
- add gui to switch between items for buildings that require multiple item types
2020-10-16 14:08:52 -07:00
Myk Taylor 1368fb4003 buildingplan: construct buildings from lua
Replace C++ building construction code with lua constructBuilding so we can get the proper job_item filters set. these filters will be used when we replace the core buildingplan algorithm in the next PR.
2020-10-16 14:03:05 -07:00
Myk Taylor 82013c0c5e prep buildingplan for core algorithm changes
Lots of refactoring and reorganizing, with only cosmetic player-visible changes.

- show quickfort mode hotlkey label regardless of whether the current building type has buildingplan enabled. before, it was only shown after the user enabled buildingplan for the current building. this eliminates the extra step when enabling quickfort mode, which force-enables all building types.
- changed signature of lua-exported isPlannableBuilding to take subtype
  and custom type in addition to building type. this is only used by
  quickfort, and it already sends all three params in preparation for
  this change
- added lua-exported scheduleCycle(), which is like doCycle(), but only
  takes effect on the next non-paused frame. this lets quickfort
  run only one buildingplan cycle regardless of how many #build
  blueprints were run
- declared a few dfhack library methods and params const so buildingplan
  could call them from const methods
- converted buildingplan internal debug logging fn to have a printf api
- reshaped buildingplan-planner API and refactored implementation in
  preparation for upcoming core algorithm changes for supporing all
  building types (no externally-visible functionality changes)
  - changed df::building_type params to type, subtype, custom tuple keys
  - introduced capability to return multiple filters per building type
    (though the current buildings all only have one filter per)
- split monolith hook functions in buildingplan.cpp into one per scope.
  this significantly cleans up the code and preps the hooks to handle
  iterating through multiple item filters.
- got rid of send_key function and replaced with better reporting of
  whether keys have been handled
2020-10-16 13:52:23 -07:00
lethosor 895fa59c79
Merge branch 'buildingplan_refactor' into develop 2020-10-16 00:05:01 -04:00
lethosor 93520b4b00
dwarfmonitor prefs: fix segfault if item_subtype is null for some item types 2020-10-11 20:45:56 -04:00
lethosor 9c8098b4f0
Expose to_search_normalized to Lua, add test, and use in ListColumn (most useful for the `stocks` plugin) 2020-10-10 01:40:00 -04:00
lethosor 1b53c0e748
Merge remote-tracking branch 'GitOnUp/normalize_search' into develop 2020-10-09 22:18:39 -04:00
lethosor e2de358f00
Merge remote-tracking branch 'PassionateAngler/zone-qol-improvements' into develop 2020-10-09 21:43:04 -04:00
lethosor 2382247398
Update some docs links to use HTTPS 2020-10-09 19:17:59 -04:00
lethosor c9609ad590
Make `createitem inspect` consistent for PLANT_GROWTH items 2020-10-09 12:45:49 -04:00
lethosor 691b35bf04
Merge remote-tracking branch 'quietust/createitem' into develop 2020-10-09 12:35:40 -04:00
George Murray a3c565b243 Add to_search_normalized to search for characters with accents 2020-09-24 07:31:10 -07:00
Myk Taylor 1c2761f903 enable all in quickfort mode
and simplify logic since new bool map values are already initialized to
false
2020-09-23 20:00:04 -07:00
Myk Taylor 323d377f63 Merge remote-tracking branch 'upstream/develop' into buildingplan_refactor 2020-09-23 19:21:49 -07:00
lethosor 577bb0a258
Merge remote-tracking branch 'myk002/buildingplan_format' into develop 2020-09-23 20:04:17 -04:00
Quietust d3520a2f5f Fix createitem to properly create plant growths (#898) 2020-09-20 16:11:41 -06:00
lethosor 0e6e00af5e
getplants: fix crash when world_object_data is not present for certain blocks 2020-09-20 01:24:46 -04:00
lethosor 9c37a3a068
Add "createitem inspect" subcommand 2020-09-19 20:33:47 -04:00
lethosor 8df8eb0c5d
Remove obsolete xlsxio_project dependency 2020-09-19 16:23:21 -04:00