Commit Graph

119 Commits (69ca0d8a2879b2b9b6152b7b9cff49ac5d434913)

Author SHA1 Message Date
Ryan Williams 88b403ec7a
Add functions reverse-engineered from ambushing unit code (#1992)
* Add functions reverse-engineered from ambushing unit code

* Fix whitespace

* Fix debug_showambush check

* Remove getOuterContainerRef from Lua API

Don't think this works properly without allocating a new specific_ref. More trouble that it's worth.

* Fixed tile visibility check

* I don't think gamemode or gametype are ever NULL

* Minor tweaks to documentation

* Reimplement getOuterContainerRef for Lua; fix some comments

* Update Units.cpp and changelog

* Update Units.cpp
* Update changelog.txt
2022-03-13 17:19:35 -07:00
Ryan Williams bc042bc7df
Use copyall instead of nesting pos2xyz and xyz2pos 2021-12-18 02:05:16 -08:00
myk002 7f0c3cc7e4
document dig-now lua api 2021-07-30 13:09:19 -07:00
Ryan Williams a67a5d8283
Rename getPlantAtCoords to getPlantAtTile 2021-06-23 22:58:24 -07:00
Ryan Williams 60fe864426
Update Lua API.rst 2021-06-22 20:10:25 -07:00
lethosor 2fc5fbacb5
Merge remote-tracking branch 'myk002/myk_reveal_unhideFlood' into develop 2021-06-19 01:08:05 -04:00
myk002 fc860478e4
move fastdwarf's teleport code to Units module
and expose in Lua API
2021-06-06 08:48:32 -07:00
myk002 fb8d6614c7
expose core flood unhide logic to Lua
refactor is a straight copy-paste. this code could really stand some
cleanup (unused vars, unnecessary use of the MapCache layer, forced
allocation of all blocks even if they are not being unhidden, etc.), but
that can come in a later PR.
2021-06-02 14:49:19 -07:00
lethosor 4f976a5909
Merge remote-tracking branch 'myk002/myk_blueprint' into develop 2021-05-24 23:48:21 -04:00
lethosor 001e608aa7
Fix invalid role name
Resolves #1851

See https://github.com/sphinx-doc/sphinx/pull/8345 for details
2021-05-11 19:46:01 -04:00
myk002 265f17a53f
update blueprint docs 2021-05-10 21:11:13 -07:00
lethosor d61c4aa234
Merge remote-tracking branch 'myk002/myk_xlsxreader_classes' into develop 2021-03-27 00:10:03 -04:00
myk002 222feff342
expand docs for open and close functions 2021-03-22 10:44:32 -07:00
myk002 4ef0ff2a24
fix formatting errors 2021-03-22 10:40:29 -07:00
myk002 aac958aa50
add open() wrapper fn and document class methods 2021-03-22 09:38:20 -07:00
Gabe Rau 81b6d93701 Minor grammer fixes. 2021-03-20 15:51:35 -06:00
Gabe Rau cc376eeb55 Fixed a number of spelling and grammatical errors. Should be set now. Added better examples and removed redundant words. 2021-03-20 15:49:53 -06:00
Gabe Rau 374fc763eb Fixed whitespace issues that cause a failed build on lint. 2021-03-20 01:55:45 -06:00
Gabe Rau e6639180db Fixed merge conflicts, expanded upon provided examples, added more detail. 2021-03-20 01:47:36 -06:00
Gabe Rau 5aa3c6bfc6 Revised Lua API.rst to better explain command. Added proper examples and explantion of difference between run_command and run_script. 2021-03-19 21:58:24 -06:00
Gabe Rau a77353b2e6
Update Lua API.rst
Corrected the dfhack.run_script documentation and added an example.
2021-03-17 23:17:01 -06:00
myk002 69a2f44020
Lua class wrappers for the xlsxreader plugin API 2021-03-08 15:04:50 -08:00
lethosor 4a7fcc6118
Fix plugin name in error, add link in docs
Ref #1769
2021-02-25 00:41:13 -05:00
myk002 9e17bc938c
only set labor validity for the player civ 2021-02-17 09:16:49 -08:00
myk002 09d91dcae1
move alchemist-enabling logic to autohauler 2021-02-06 14:14:08 -08:00
myk002 6819ee9928
make alchemist flag valid for controllable civs 2021-02-05 16:45:39 -08:00
lethosor 614ea739d0
Merge branch 'develop' into lua-runcommand 2021-01-08 20:45:23 -05:00
Timur Kelman a69c4b9b6d
fix example in Lua API.rst
Whitespace in the wrong place.
2021-01-04 17:05:55 +01:00
myk002 3ba984c22c
only reset extents if they are unusable
this allows callers of Buildings::setSize() to "pre-initialize" the
extents to declare non-rectangular structures. this allows quickfort to
create non-rectangular stockpiles, farm plots, zones, etc. the extents
are still reset as before if the size of the building doesn't match the
caller's expectations.

this commit also fixes a memory leak when setSize() allocates memory for
extents, but the memory is not deallocated if the building is ultimately
invalid for some reason.
2020-12-16 11:10:47 -08:00
lethosor b4c040291f
Document dfhack.run_command() and related functions/constants 2020-11-20 22:23:29 -05:00
lethosor 8319d71dff
Improve documentation of reqscript, dfhack_flags, etc. 2020-11-15 18:42:14 -05:00
lethosor 2e4f23d49f
Merge remote-tracking branch 'myk002/myk_isplannedbuilding' into develop 2020-11-13 14:09:36 -05:00
lethosor 8cb38ecf5b
Merge remote-tracking branch 'myk002/myk_metalhead_mario' into develop 2020-11-13 14:04:30 -05:00
myk002 efdba8b596
add buildingplan.isPlannedBuilding 2020-11-13 10:18:54 -08:00
myk002 93d9ac76be
update docs 2020-11-12 23:08:22 -08:00
lethosor 913d860ae4
Use initial working directory as process path on Linux, and expose to Lua 2020-11-12 19:07:51 -05:00
lethosor 23b230495e
Merge branch 'develop' into cwd-handling 2020-11-12 18:44:05 -05:00
lethosor 9c13b497bf
Merge remote-tracking branch 'myk002/myk_automaterial_buildingplan_fix' into develop 2020-11-11 23:36:42 -05:00
lethosor 0958fdbf4b
Document script paths
Ref #1690
2020-11-10 00:48:27 -05: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 4301252ddf
Merge remote-tracking branch 'myk002/buildingplan_refactor2_squashed' into develop 2020-10-23 13:51:54 -04:00
lethosor 26505acb70
Add some cross-references and clean up 2020-10-20 01:18:25 -04:00
lethosor 2bd0e938ad
Move pathable to Lua API docs 2020-10-20 01:11:01 -04:00
lethosor 84973d1fb8
Sort plugins in Lua API.rst 2020-10-20 01:06:47 -04:00
lethosor ce7772a1c2
Add Filesystem::restorecwd()
This allows restoring the working directory to its original value, which may not actually be the DF root. See #1671, dfhack/scripts#152
2020-10-14 21:22:53 -04:00
Myk Taylor 9d2abafefc Merge branch 'buildingplan_refactor' into buildingplan_refactor2_squashed 2020-10-11 12:11:51 -07: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 2382247398
Update some docs links to use HTTPS 2020-10-09 19:17:59 -04:00
lethosor 28efe1d2a7
Add local TOCs to Lua API plugin sections 2020-10-09 12:20:13 -04:00
lethosor c2280356cb
Set language of some code blocks to enable syntax highlighting 2020-10-09 01:15:42 -04:00