Commit Graph

127 Commits (89ed9950c7eb6ec4e01307ac06d8a1e3f7d5fc1c)

Author SHA1 Message Date
myk002 ed5523152c
factor text wrapping out of TooltipLabel into WrappedLabel 2022-04-22 09:53:10 -07:00
myk002 07761e1d5d add some more handy widgets to the library
TooltipLabel
HotkeyLabel
CycleHotkeyLabel
ToggleHotkeyLabel
2022-04-18 17:37:11 -07:00
Timur Kelman cb123e5076
default unset `frame_inset` values to 0 (#2100)
* default unset `frame_inset` values to 0

This change allows writing `frame_inset = {r=1}` instead of `frame_inset = {l=0, r=1, t=0, b=0}`
2022-04-16 08:17:35 -07:00
Myk fd1ee233a2
automatically manage sidebar modes in MenuOverlay (#2083) 2022-04-11 20:58:54 -07:00
Myk 10f22ecc27
add ResizingPanel class and autolayout for Panels (#2086)
* add autolayout for Panels and new ResizingPanel
2022-04-11 18:25:00 -07:00
Myk 4f9608da13
Document and update argparse module (#2089)
also add unit tests and use new string fns in processArgs and allow it to recognize parameters with two dashes instead of just one
2022-04-11 16:16:55 -07:00
Myk 96b5b4420b
Add string:escape_pattern() utility function (#2082)
* add string:escape_pattern() to dfhack.lua

stolen from devel/query.lua. will migrate scripts to use the common implementation later
2022-04-10 21:18:01 -07:00
Myk c603d6a9f3 Move docs for include_prefix param to correct function
It was listed under listdir, but it only appears in listdir_recursive
2022-04-08 23:13:10 -07:00
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