Commit Graph

4313 Commits (84cd3f0e6d90218f55309ea9a19e00db6dd74771)

Author SHA1 Message Date
Josh Cooper fe29bff845
Adds cxxrandom unit test and fixes interface problems (#2099)
* Adds cxxrandom unit test and fixes interface problems

* Tightens braces

* Adds detection code for Shuffle's seqID/engID

* Adds usage examples for cxxrandom

* Gives cxxrandom objects id ranges, sort of

* Updates changelog

* Updates changelog.txt

* Increases id space for cxxrandom

* Fixes bool distribution error message and improves check

* Adds comment explaining the seeded RNG tests for cxxrandom

* Fixes type problem for 32bit builds

* Reduces loop count a few magnitudes

* Fixes a mistake in test.cxxrandom_seed
2022-04-30 21:46:47 -07:00
Josh Cooper 8eb2831b7e
Adds plugins/external/ and auto-populates the cmake within upon creation (#2095)
* Adds a plugins sub-directory

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Auto-adds plugins/external sub-directories

* Moves plugins/external globbing as to generate plugins/external/cmake

* Removes plugins/external/.gitignore since the directory is generated

* Fixes cmake error

* Moves gitignore for plugins/external to ensure existence for fresh clone

* Adds missing EOF newline

* Adds requested changes
2022-04-27 19:53:05 -07:00
Quietust dc2a14c0c2 Add "partial-items" tweak.
When active, the displayed names of partially-consumed items (e.g.
hospital cloth) will display a percentage indicator at the end.

Also re-sort a few Tweaks so they're in alphabetical order again.
2022-04-27 11:27:11 -07:00
Guilherme Abraham 2aa28d34b6
Adding ids output to cursecheck (#2093)
Co-authored-by: Guilherme Abraham <guilherme.abraham@zpesystems.com>
Co-authored-by: Myk <myk002@yahoo.com>
2022-04-21 20:22:05 -07:00
Josh Cooper 9bf9a79a11
EventManager/Eventful - Generate event arrays (#2097)
* Replaces EventManager.cpp's event array with an auto-gen one

* Replaces eventful.cpp's event array with auto-gen one
2022-04-14 21:47:25 -07:00
lethosor 5f3d5bbcd5 Add new `plugins/external` subdirectory for external/untracked plugins
This is more convenient for some devs than the old CMakeLists.custom.txt
solution because it allows the plugins themselves (files or folders) to be
ignored, rather than needing to remember to leave them unstaged.
2022-04-14 10:38:23 -07:00
Tim Siegel bf60879c81 [tweak/stable-cursor] Keep stable cursor when viewport is near enough
Allow the viewport to move a bit and still keep the cursor location.
2022-04-12 19:53:16 -07:00
lethosor d1f0edd33b
Apply initial pre-commit config 2022-04-12 14:48:19 -04:00
myk002 54e8761aa0 capture fortifications and engravings in blueprint 2022-04-01 12:20:37 -07:00
Su 8a120837c6
only designate enough trees to reach max_logs (#2064)
* only designate enough trees to reach max_logs
* Chop largest trees first
2022-03-31 20:41:44 -07:00
Tim Siegel b5af004194
[manipulator] Tweak colors to make cursor easier to locate (#2051) 2022-03-30 23:39:20 -07:00
Myk 257e7a3dfd
[core] Debug logging facelift (#2060)
* route 'Loading script...' messages through the debug logging framework
  * they are now controllable via debugfilter. to turn off, add this to your dfhack.init file: debugfilter set Warning core script
* clarify debug logging docs
* prevent DEBUG messages from being compiled out of the binary
* recolor INFO messages so they blend into existing console output
* add configuration interface for log message header elements so they are individually configurable. all default to off
2022-03-30 14:46:09 -07:00
Myk 2df6980237
fix crash in eventful due to misaligned fn map (#2059)
also add warnings in eventful and EventManager to prompt devs to keep them in sync
2022-03-29 12:51:21 -07:00
Josh Cooper 69ca0d8a28
Improves support for dfhack as a sub-project (#2058)
Replaces CMAKE_SOURCE_DIR with dfhack_SOURCE_DIR so it can be included in other cmake projects that have a different top-level CMAKE_SOURCE_DIR
2022-03-29 10:28:52 -07:00
DwarvenM acbfe500ab
Typo Fix in dig.cpp (#2053)
vdig -> digv
2022-03-27 16:54:01 -07:00
Tim Siegel ab54cbff7a
[confirm] Fix typo in help message (#2046) 2022-03-23 19:45:13 -07:00
Kelly Kinkade e0ecf21896
autofarm code cleanup (#2033)
* code cleanup on autofarm.cpp

* more code cleanup on aufofarm.cpp

* yet more cleanup of autofarm.cpp

mostly whitespace, some `*` and `&` adjustments

* downgrade autofarm to c++11

apparently the gcc we use doesn't support c++14 generic lambdas

* death to whitespace

apparently visual studio's default whitespace murderer doesn't touch `#define`s. who knew?

* Update autofarm.cpp

const is good
2022-03-16 19:43:24 -07:00
Kelly Kinkade d25cd0874a remove check for discovered plants in autofarm
Remove limitation on planting only "discovered" plants in autofarm because there was never any reason for doing so.

Resolves #1988.
2022-03-15 08:23:18 -07:00
Josh Cooper dda487a535
Adds new plugin: Spectate (#1918)
* Adds spectate plugin

* Updates spectate.cpp

* Changes spectate toggle message

* Updates changelog.txt

* Adds spectate to Plugins.rst

* Adds requested changes

- foreach syntax replaces active units loops
- removes CR_FAILURE return on double enable/disable usage
- removes disabled code
- implements a few clion clang tidy suggestions (auto declare when casting)
- Updates zcount to have accurate count for performing RNG
- adds eof newline
- adds todo comment about a redundant if condition

* Declares spectate section in Plugins.rst
2022-03-14 19:33:41 -07:00
myk002 e60ef479c6 handle carving fortifications in dig-now 2022-03-12 13:33:36 -08:00
myk002 7c665dcb7a allow search terms to match full item labels
even when the item label is truncated for length
this change also fixes items that were being incorrecty grouped due to
having differences only in the truncated part of their labels
2022-03-12 12:41:19 -08:00
Quietust aa1bc3fe52 Cleanup Kitchen module (and the seedwatch plugin which uses it) 2022-03-12 12:04:34 -08:00
Josh Cooper ba5710f263 Adds new event type NEW_UNIT_ACTIVE 2022-03-12 11:33:27 -08:00
Josh Cooper 20b42145c1 On second thought, not redundant 2022-03-12 11:33:27 -08:00
Josh Cooper a2e690d5d9 Re-adds removed lines to diggingInvaders.cpp 2022-03-12 11:33:27 -08:00
Josh Cooper 2b8024e62f Updates eventful plugin with new EventManager event JOB_STARTED 2022-03-12 11:33:27 -08:00
Josh Cooper 4aac87a7f0 Updates the plugin skeletons again 2022-03-12 11:33:27 -08:00
Josh Cooper 79e2188a5f Corrects a regression in skeleton.cpp documentation 2022-03-12 11:33:27 -08:00
Josh Cooper 051e891680 Improves plugin dev documentation through updating skeleton.cpp 2022-03-12 11:33:27 -08:00
Josh Cooper ddbeead2b2 Updates diggingInvaders according to EventManager refactor 2022-03-12 11:33:27 -08:00
Josh Cooper 12df6d14e9 Improves documentation for plugin writing 2022-03-12 11:33:27 -08:00
myk002 33f06668d5 ensure we don't crash when tiletypes-here is run
from the commandline
2022-03-03 21:37:38 -08:00
myk002 dbe87d4156 implement orders list 2022-02-25 12:58:56 -08:00
myk002 2ebfca42dd merge buildingplan-lib.cpp into buildingplan.cpp 2022-02-25 12:57:17 -08:00
myk002 0d1668a7a5 merge buildingplan-lib into buildingplan
so no one else is tempted to use it as a library. starting buildingplan
from two separate plugins just runs two completely separate engines with
separate state, one of which is completely inaccessible from the UI.
2022-02-25 12:57:17 -08:00
myk002 eae90c9448 remove fortplan code; leave doc stub 2022-02-25 12:57:17 -08:00
myk002 434d072919 implement zone phase for blueprint 2021-10-04 15:32:26 -07:00
myk002 ffe5bad66b implement "track" phase in blueprint
required decoupling phases from modes since now we have two "dig" phases
2021-10-04 12:53:31 -07:00
myk002 089de5f422 support non-rectangular extent-based buildings 2021-10-03 08:54:27 -07:00
myk002 27c0c41536 only create empty blueprints on explicit request
and use the new functionality in the ecosystem tests, which simplifies
the blueprint commandline creation
2021-10-02 23:36:26 -07:00
myk002 12eb9e48c7 support multi-type and non-rectangular stockpiles
and add integration tests
2021-10-02 12:50:47 -07:00
myk002 09d7cd83df add/fix missing/incorrect building specs
added:
- wS
- wp
- roller speed designations
- n
- TS
- ~s
- ~h
- ~c
- F
- ~a

fixed:
- Wall (CW -> Cw)
- DownStair (Cj -> Cd)

also remove track designations. we'll add that back once we create a
"track" phase.
2021-10-02 09:25:19 -07:00
myk002 d7d4f364ac channel over dig equals no ramp
fixes special case where a channel tile is specified over a regular dig
tile. this allows dig-now to produce a flat floor in that case, which is
likely what is intended.
2021-10-02 09:25:19 -07:00
myk002 42f4cbdc9c remove designations from all modified tiles
found this bug with blueprint-generated blueprints. if both a channel
and the resulting ramp are explicitly marked in the blueprint (like the
blueprint plugin does), the channel is processed first, pre-creating the
ramp in the tile designated for a ramp. Then, when the ramp designation
is processed, the ramp is already there, which is an invalid tile to
make a ramp on, so the designation is skipped (and therefore not
cleared). this change clears the designation for both the ramp tile and
the channel tile when either is processed. this opens another edge case
where the designation under a channel is a regular 'd' mine, which will
now get ignored and leave a ramp insead of a flat floor. but I'll
address that in the next commit.
2021-10-02 09:25:19 -07:00
myk002 1a11c43546 record carved tracks in dig blueprints 2021-10-02 09:25:19 -07:00
myk002 c23970f36b add unit tests 2021-09-20 16:10:15 -07:00
myk002 596f72f06b implement --playback-start param and logic 2021-09-20 16:10:15 -07:00
myk002 2bbd4ab79e clean up, document 2021-09-17 10:57:26 -07:00
myk002 afc7096329 use vector instead of map for great memory savings 2021-09-17 10:57:26 -07:00
myk002 44a93fcb28 update unit tests 2021-09-17 10:57:26 -07:00
myk002 42e04fc6ec use const char *, not std::string for efficiency
so we can actually process large maps without OOMing
2021-09-17 10:57:26 -07:00
myk002 772e386427 implement --format option for minimal and pretty
pretty is currently equivalent to the previous format, though there will
be changes in the future
2021-09-17 10:57:26 -07:00
myk002 1fd2eba2db give generated blueprints proper labels 2021-09-10 11:11:44 -07:00
myk002 0747f872b0 add --splitby param to blueprint
--splitby=none is the new default, allowing all blueprint phases to be
written to a single file. old behavior of one phase per file is
supported via --splitby=phase.
2021-09-09 09:58:53 -07:00
myk002 6073cfeb5d pass params from blueprint gui to gui/blueprint
without passing the initial "gui" literal string
2021-09-09 09:58:23 -07:00
myk002 97fab76bba lay down tiles in order when using buildingplan
improves on implementation in 22ac163d5. we don't need to set the anchor
at all when using buildingplan.
2021-09-09 00:35:15 -07:00
lethosor c74d881e44
Update stonesense 2021-09-07 15:01:21 -04:00
lethosor badf19b424
tweak military-assign: fix likely missing bounds check 2021-09-07 01:18:13 -04:00
lethosor 91e7e12464
RemoteFortressReader: fix likely copy-paste error between width/height 2021-09-07 01:17:38 -04:00
lethosor e7754ea890
Enable -Wunused-variable and fix most errors 2021-09-07 01:16:21 -04:00
lethosor fbe0319515
Merge remote-tracking branch 'lethosor/ci-scripts-cleanup' into develop 2021-09-06 22:41:02 -04:00
lethosor a083a7f670
tailor: fix operator precedence in command parsing
&& has a higher precendence than ||, so this could have resulted in a crash in
some cases. It also produced unintentional behavior where e.g. `tailor 1 foo`
would enable the plugin, unlike `tailor enable foo`.

From #1920
2021-09-06 22:35:38 -04:00
lethosor e5487c812a
Update stonesense lint filter 2021-09-06 19:08:22 -04:00
lethosor 11222f21d3
Update lint.py filters and fix a couple identified issues 2021-09-06 18:42:45 -04:00
DFHack-Urist via GitHub Actions 0cbcabee59 Auto-update submodules
scripts: master
plugins/stonesense: master
2021-09-04 07:15:42 +00:00
Quietust 9d8eccd152 Fix remotefortressreader to use new ocean_wave field names 2021-09-02 06:58:55 -06:00
lethosor 0d14a2ccef
Merge remote-tracking branch 'ab9rf/tailor-v2' into develop
Conflicts: docs/changelog.txt
2021-09-01 23:34:30 -04:00
myk002 bd0a2e3877
only output when changes are made
avoids spamming the console when `orders sort` is run on repeat
2021-09-01 16:52:11 -07:00
myk002 f21ba5c8aa
implement orders sort, document, and add to init 2021-09-01 13:04:23 -07:00
lethosor 687b84378d
Merge remote-tracking branch 'ab9rf/autofarm-berry-fix' into develop 2021-08-31 00:52:18 -04:00
lethosor 27ce7cf1ee
check-structures-sanity: print error for untagged unions instead of aborting
These come up in structures such as world.poetic_forms.all[i].subject_target
without a clear fix.
2021-08-31 00:28:42 -04:00
lethosor 1d9f12fe3f
Fix signed/unsigned comparison warning
From #1903
2021-08-28 15:15:13 -04:00
lethosor 39c650de13
Fix compilation error on macOS with GCC 11
This should make `-fpermissive` (from #1924) unnecessary, so I also removed
those instructions.
2021-08-21 12:58:17 -04:00
Kelly Kinkade 22bcbf9877
Merge branch 'develop' into autofarm-berry-fix 2021-08-16 07:22:11 -05:00
Kelly Kinkade 92f258bdbf
Merge branch 'develop' into tailor-v2 2021-08-16 07:17:53 -05:00
myk002 37a8260c3b
import and export reaction-specific item conditions 2021-08-14 16:35:40 -07:00
Kelly Kinkade 2981deb521 update autogems to respect workshop profiles
Add a test so that autogems will not assign cut gem jobs to workshops that are not allowed to do them.

Fixes #1263
2021-08-10 06:29:10 -05:00
lethosor 0140ace317
Merge remote-tracking branch 'myk002/myk_buildingplan_attached' into develop 2021-08-10 01:07:35 -04:00
Kelly Kinkade 73107fb21b tailor: add support for user-specified material list
Add support for user-specified material list. Also refactor, fix some mostly-innocuous bugs

Resolves #1911.
2021-08-08 09:53:32 -05:00
Kelly Kinkade 685e5111ae Update autofarm.cpp
`dts::make_unique`, not `std::make_unique`, sorry my bad
2021-08-07 15:51:21 -05:00
Kelly Kinkade ce50bbdfde fix autofarm berry problem
Update autofarm to count PLANT_GROWTHS as well as PLANTS for threshold purposes. This addresses #1902.

Also addresses some pointer hygiene issues in autofarm.
2021-08-07 15:32:43 -05:00
myk002 d8b5ac41d9
ensure soil tiles get randomized variants 2021-08-01 23:30:04 -07:00
myk002 98fd6effdc
generate random time variants where applicable 2021-08-01 07:07:20 -07:00
myk002 92701d6da7
connect smooth walls to doors 2021-07-30 13:09:20 -07:00
myk002 3c8a174a68
use pillars for wall ends instead of NS or EW 2021-07-30 13:09:20 -07:00
myk002 79bdf36ed4
expose link_adjacent_smooth_walls to lua
so build-now can use it
2021-07-30 13:09:20 -07:00
myk002 8fb456313f
allow only one positional param to be specified 2021-07-30 13:09:20 -07:00
myk002 c1665f35b4
fix off by one error 2021-07-30 13:09:20 -07:00
myk002 95fa9f3d7a
use new library functions in dig-now 2021-07-30 13:09:20 -07:00
myk002 a6c62a025f
unhide properly when digging at visible edges 2021-07-30 13:09:20 -07:00
myk002 0b703d9818
fix adjacent smooth walls when we dig one out 2021-07-30 13:09:19 -07:00
myk002 48f90da72e
remove extra return 2021-07-30 13:09:19 -07:00
myk002 c807398eff
remove old reference to dig-now.h 2021-07-30 13:09:18 -07:00
myk002 93d67dd51e
export dig_now_tile over Lua 2021-07-30 13:09:18 -07:00
myk002 fc19fb6785
add external api: dig_now_tile(out, pos) 2021-07-30 13:09:18 -07:00
myk002 1a19c3a944
ramp/channel: don't dig into undiggable tiles 2021-07-30 13:09:18 -07:00
myk002 d6c9f99c61
don't overflow prod->count. it's a measly int16_t 2021-07-30 13:09:18 -07:00
myk002 aa1cbc95db
skip marker mode dig designations 2021-07-30 13:09:18 -07:00
myk002 1670cfab05
also "and" -> "&&" 2021-07-30 13:09:18 -07:00
myk002 dfc938a99d
omg lua is ruining me
on the other hand, why doesn't MSVC just support "or" to mean "||"?
2021-07-30 13:09:17 -07:00