Commit Graph

2903 Commits (9852d92a98049373b018ddd2630d850aff2641ce)

Author SHA1 Message Date
lethosor 6100074ba6 Add a few MD5 and thread functions to the Lua API 2017-07-01 17:39:17 -04:00
lethosor 7a7f1df908 Redirect stdout and stderr again on Windows
DF appears to redirect them itself at an inconvenient point.

Fixes #1124 (hopefully)
2017-06-30 13:29:05 -04:00
lethosor cc0220f030 Add a "key" option to EditField and FilteredList 2017-06-27 21:10:14 -04:00
Vitaly Pronkin 6af5f3b299 fixing getItemBaseValue() for cheese, sheets and instruments 2017-06-26 09:17:23 +12:00
lethosor 10e13c532a Add "tweak cage-butcher" and some extra Building module functions
* Buildings::markedForRemoval()
* Buildings::getCageOccupants()

Closes #906
2017-06-25 15:27:21 -04:00
lethosor db375ae83b Add a Pages:getSelectedPage() helper
Equivalent to select(2, pages:getSelected()), but more readable.
2017-06-23 12:46:46 -04:00
lethosor bf8e65311b Update submodules 2017-06-23 12:43:38 -04:00
lethosor cda5cedacf Fix Gui::refreshSidebar() on topmost z-level 2017-06-23 10:30:16 -04:00
lethosor ae809afde7 Add Gui::refreshSidebar()
This handles feeding CURSOR_DOWN_Z and CURSOR_UP_Z properly, avoiding issues
when on the lowest z-level.
2017-06-23 00:02:21 -04:00
lethosor 0796fafb2a Add new built-in "alias" command
Closes #701
2017-06-19 00:15:20 -04:00
lethosor 27343e3253 Add unit and tile visibility functions 2017-06-10 21:54:08 -04:00
lethosor 9b63c451b1 Expose getUnitsInBox to Lua 2017-06-10 21:03:42 -04:00
lethosor 778ffb0971 More Units module cleanup, modernize getUnitsInBox 2017-06-10 21:02:30 -04:00
lethosor dff94fc97e replacment -> replacement 2017-06-10 19:41:59 -04:00
lethosor 0ed7e60522 getAnyUnit: support viewscreen_layer_unit_relationshipst 2017-06-10 19:06:43 -04:00
lethosor 1321a64613 Remove lots of old/unused functions from the Units module 2017-06-10 17:21:34 -04:00
lethosor ba68683964 Fix ncurses wgetch() on OS X
Ref #731
2017-06-08 13:05:31 -04:00
lethosor 8d23660d55 Expose Gui::getAny* to Lua 2017-06-08 11:21:30 -04:00
lethosor 047a66030b getAnyUnit: add support for viewscreen_unitst, viewscreen_textviewerst 2017-06-07 20:51:40 -04:00
lethosor da98a5054d Make sc-script help more helpful 2017-06-04 19:24:26 -04:00
lethosor 92c2e52e45 Fix MSVC error 2017-06-02 21:22:19 -04:00
lethosor 4eb767c3f0 Expose getDepthAt() to Lua 2017-06-02 15:39:49 -04:00
lethosor ae1aa49089 Add map parameter to Lua paintTile() and use in Painter
Also updated gui/siege-engine.lua
2017-06-02 12:42:51 -04:00
lethosor 9df35dd844 revealInDwarfmodeMap: use map y dimensions 2017-06-02 00:40:59 -04:00
lethosor 43c4a88068 Move some checks in paintTile/readTile after hooks are called 2017-06-02 00:40:14 -04:00
lethosor 346e8b91a9 Use getDwarfmodeViewDims() in getPanelLayout()
Allows C++ hooks to affect Lua scripts as well
2017-06-01 23:36:02 -04:00
lethosor 05f322ca30 Merge remote-tracking branch 'lethosor/lua-dmdims' into develop 2017-06-01 23:34:35 -04:00
lethosor b28742cbd0 Respect script path when running ruby scripts
Fixes #1099
2017-06-01 16:20:26 -04:00
lethosor d41ff4e836 Implement map parameters for Lua paintString() and fillRect(), update docs 2017-06-01 16:17:59 -04:00
lethosor 939aff3231 readTile(): add hook support and map parameter 2017-05-31 12:12:15 -04:00
lethosor f4e18b2d87 Lua: implement to_first argument in dfhack.screen.dismiss()
This was mentioned in Lua API.rst, but never actually implemented.
2017-05-30 09:17:09 -04:00
lethosor e51c5fc2cc Allow key_pen option in some widget text 2017-05-28 23:11:37 -04:00
lethosor f59be2a9a0 Expand focus strings for jobmanagement and workquota_condition viewscreens 2017-05-27 00:57:16 -04:00
lethosor 8600efd06b Make git-describe faster if no git index files have changed
Running "git commit" in core and xml touches .git/index and
.git/modules/library/xml/index, respectively, so if neither of those have
changed, neither has the git information we care about, so avoid running git
entirely (which can be slow sometimes).
2017-05-20 16:27:14 -04:00
lethosor b92095190f Update stonesense, scripts, xml 2017-05-18 20:52:41 -04:00
lethosor 01c6416824 Update submodules 2017-05-13 21:56:08 -04:00
lethosor 787c54d8a7 Remove several unused CMake and Doxygen files 2017-05-11 22:01:57 -04:00
lethosor 9e32269e90 Update xml 2017-05-09 13:52:26 -04:00
lethosor 8bda738466 df_expr_to_ref: support integer array indices 2017-05-07 16:31:30 -04:00
lethosor 55931703ac Designate the correct tile for trees with multi-tile trunks
DF always designates the southeast trunk tile, while plant.pos is the center,
which is sometimes inaccessible (see #1014)
2017-05-05 21:25:25 -04:00
lethosor adb14491d0 Fix loop in Designations::unmarkPlant() 2017-05-05 17:24:51 -04:00
lethosor 81610d0259 Update xml 2017-05-05 14:49:32 -04:00
lethosor d3c496cc2b Add getSelectedPlant() and related functions
Currently only works with the center tile of multi-tile trees
2017-05-05 14:45:46 -04:00
lethosor 1e469453fc Add Designations module, currently supporting plant/tree designations
This makes it easier for tools to properly handle designating and undesignating
trees for chopping and plants for gathering, which changed significantly in
0.40.20.

Ref #531 (?), #656, #1014, #1018, #1030, #1076
2017-05-04 21:47:12 -04:00
lethosor e3258defd7 Expose Gui::revealInDwarfmodeMap() to Lua
Closes #1085
2017-05-04 14:37:14 -04:00
lethosor cd5944689c Use find_package() to find Perl, and run it earlier
Previously, PERL_EXECUTABLE was set manually in library/CMakeLists.txt, which
caused gunzip.pl to fail if was run before that happened.
2017-04-30 17:36:42 -04:00
lethosor 71b553b305 Add a few functions to retrieve unit social activities 2017-04-28 17:25:58 -04:00
Lethosor 318cf92f0b Merge pull request #1079 from Amostubal/patch-1
fix of relations errors.
2017-04-25 21:21:03 -04:00
Amostubal bc47803948 fix of relations errors.
There is a lot more errors in this file, mostly called unk variables... I bet they have names, I've tried to figure out what they were renamed too, but I'm not fully understanding the xml.
2017-04-24 07:07:08 -05:00
lethosor 9d5b69cb20 git-describe.cmake: use 8-digit git commit abbreviations
The length here was previously determined automatically, and jumped from 7 to 8
recently, breaking devel/check-release. Since Git seems to think 8 characters is
better now, specify it explicitly to avoid future breakages.
2017-04-23 18:16:00 -04:00
lethosor 3cfbd735dc Update xml, stonesense, scripts 2017-04-23 17:14:22 -04:00
lethosor 78cb4a31b9 New tweak: condition-material (fixes bug 9905)
http://www.bay12games.com/dwarves/mantisbt/view.php?id=9905
2017-03-28 09:50:38 -04:00
lethosor fa1adbbac4 Allow lua integer writes to accept anything that can be converted to an integer
May address #1044
2017-03-18 17:55:51 -04:00
lethosor 400d22cb76 Update xml (ui_advmode_menu and ui_unit_view_mode) 2017-03-18 00:35:16 -04:00
lethosor 67f39316ce Update xml (assorted viewscreen changes) 2017-03-02 14:05:34 -05:00
lethosor 334817fa1b Add Lua API functions to determine architecture 2017-03-02 14:04:34 -05:00
lethosor 15759808e5 Fix "plug" output width for generated-creature-renamer 2017-03-02 14:04:20 -05:00
lethosor c21b7bf941 Add a Painter:key_string() method 2017-03-01 15:56:50 -05:00
lethosor 19695b4ee7 EventManager/eventful: Pass building ID pointers to event handlers
Previously, there was some disagreement over whether event handlers such as
Buildings::updateBuildings() took building pointers or building IDs shoved
into pointers. It turned out to be the latter, which, unfortunately, did not
compile on x64. Passing building IDs isn't possible in all cases, because
building event handlers can be called for recently-deleted buildings too.
Pointers to building IDs do work reliably, though.

Fixes #1003
2017-02-17 22:53:48 -05:00
lethosor a10d4ae226 Add viewscreen::feed_key method 2017-02-11 16:53:50 -05:00
lethosor f2164d27c9 ls: List scripts outside of hack/scripts
Closes #412
2017-02-05 22:11:35 -05:00
lethosor 34988e53b9 Update supported keys in keybinding help text 2017-02-05 22:03:06 -05:00
lethosor b5c7771b71 Merge remote-tracking branch 'quietust/develop' into develop
Fixes #1061
2017-02-04 15:14:10 -05:00
lethosor 7823d78cd9 Update xml and embark-tools field name 2017-02-04 14:49:21 -05:00
lethosor a8f4833188 internal_memscan: add extra check 2017-02-04 14:49:09 -05:00
Quietust cc02ced0ac Fix RTTI in Win64 - offsets are relative to the current module (e.g. the DLL), so it needs to be looked up explicitly 2017-01-21 15:16:06 -06:00
lethosor 92f890d3c6 Update xml, scripts (#994 and file_compressor fix) 2017-01-04 12:30:42 -05:00
lethosor 61d081849e xml: ui_sidebar_menus.command_line fix 2016-12-30 18:02:51 -05:00
lethosor d18beb8daf xml: Add some linux64 offsets, fix ui_sidebar_menus alignment
Fixes #1053
Fixes #1054
Fixes #1055
2016-12-29 15:33:09 -05:00
lethosor 538b07d214 Update xml and fix knowledge_scholar_category_flag::value() custom method
Allows bitfields within unions (#1047, dfhack/df-structures#169)
2016-12-27 23:24:22 -05:00
Milo Christiansen 8bd92b6a08 Add a Lua module for getting a tile's material (#1031) 2016-12-27 16:49:46 -05:00
lethosor 506d124a98 Update xml
Ref #1047, #1050
2016-12-26 19:41:34 -05:00
lethosor f3e2e5e7d4 Update xml 2016-12-11 18:04:00 -05:00
lethosor 9e0221a44e Merge remote-tracking branch 'dscorbett/bitfield-constructors' into develop 2016-12-11 17:52:00 -05:00
lethosor e8c8953cbb Re-add and update misery plugin
Closes #1037
Ref #1011
2016-12-10 18:22:32 -05:00
lethosor 3bae9d9d65 Lua API: Make bitfield.whole return an integer, not a decimal 2016-12-10 12:27:43 -05:00
David Corbett acdb369aa8 Avoid non-trivial bitfield constructors 2016-12-09 13:41:14 -05:00
lethosor 6e16a7a20c Update xml, scripts 2016-12-09 11:27:44 -05:00
lethosor 8521b830b2 Merge remote-tracking branch 'CannibalVox/job_remove' into develop 2016-12-05 15:24:37 -05:00
Stephen Baynham 595f3857b6 Reverse the param order of these two methods
The current way doesn't match other Job module methods
2016-12-01 20:13:49 -08:00
Stephen Baynham 7920f71517 Bad formatting 2016-11-25 00:25:18 -08:00
Stephen Baynham de0e211e07 Figured I could like test my code. 2016-11-24 23:35:03 -08:00
Stephen Baynham e490afdf00 Rebuilt slightly to offer bool return val
We fail on unknown general ref types now, without modifying the job at
all yet
2016-11-24 22:36:11 -08:00
Stephen Baynham 8b964ca2dc Wipe job_items vector 2016-11-21 06:51:21 -08:00
Stephen Baynham fba32f2e2f Also disconnect the job from its items. 2016-11-17 23:25:48 -08:00
Stephen Baynham 67af9f5e82 Add lua bindings for removeJob 2016-11-17 23:04:48 -08:00
Stephen Baynham 74f5df99db Add job remove method
Job remove eliminates a job's worker & holder references, if any, puts
the worker on cd, if appropriate, removes the job's postings, eliminates
the job from the global linked list, and then finally deletes it.  This
code was tested by incorporating it into autochop and it does make the
plugin work.  However, chop jobs don't have holder building references,
and anyway, with DF being 90% edge case by volume, this could use a heck
of a lot more testing.

I saw elsewhere code that prevented worker removal if the job was a
special job, and that made me feel funny so I made the job remove method
not work if the job is a special job.
2016-11-17 19:54:41 -08:00
lethosor ae59b4f5ad Update xml, scripts 2016-11-10 14:25:05 -05:00
lethosor 04ad7a0a42 Replace some instances of "cmake -E copy_if_different" with a standalone script
@JapaMala reported that CMake < 3.5 doesn't support copy_if_different with
multiple source files.

https://cmake.org/cmake/help/v3.5/release/3.5.html#command-line
2016-11-02 16:23:32 -04:00
lethosor 2c230f0d3e Improve protobuf file regeneration (no longer uses a dummy status.txt file) 2016-10-24 22:51:27 -04:00
lethosor 4fdbba0207 Only touch protobuf generated files if they actually changed 2016-10-24 22:28:51 -04:00
lethosor b19a0b4305 Update scripts, xml
Fixes #1005
2016-10-19 09:53:51 -04:00
lethosor b1e3c1088c Give loadfile() result a better name for tracebacks 2016-10-19 09:53:12 -04:00
lethosor 4c21bbd5ae Add Lua::TableInsert() helper 2016-10-15 14:55:48 -04:00
lethosor 8a138fcc4c Avoid polluting global namespace in MapCache.h 2016-10-15 14:53:10 -04:00
Japa b2424f9a59 Merge branch 'develop' of https://github.com/DFHack/dfhack into develop 2016-10-15 10:32:13 +05:30
Japa 08cc9f3188 Cast size_t to int explicitly to avoid compiler warning C4267 2016-10-15 10:31:38 +05:30
Japa 98ab357df0 Use size_t in both path methods, to avoid warning C4267 2016-10-15 10:17:38 +05:30
lethosor 9f541481ea Fix some warnings with GCC -Wall 2016-10-15 00:37:18 -04:00
Japa 980b6dd12f Update XML again. 2016-10-13 19:42:40 +05:30
Japa d5e8b5eeba Update XML 2016-10-13 19:35:40 +05:30
lethosor e6bb7357df Update xml 2016-10-08 17:09:23 -04:00
lethosor f6a91c2f30 Log architecture on startup 2016-10-08 16:58:08 -04:00
lethosor 70d3c07cdb Initial lua getDwarfmodeViewDims rewrite 2016-10-07 23:51:58 -04:00
lethosor a5338d2f59 Fix rebase_delta type mismatch
See #984. GCC wasn't complaining about this on x64 for some reason.

Also reordered includes.
2016-09-28 20:43:02 -04:00
Quietust 27d2229665 Fix follow_jmp for 64-bit code - skip REX prefix if found 2016-09-25 18:29:57 -05:00
Japa b09ee3407c Merge branch 'v0.43.03' of https://github.com/JapaMala/dfhack into develop
Conflicts:
	library/xml
	plugins/remotefortressreader.cpp
2016-08-29 22:06:37 +05:30
lethosor 41e298bdfc Update submodules 2016-08-27 15:27:57 -04:00
lethosor 85ebbf0e9c Fix df_expr_to_ref for raw userdata 2016-08-24 17:18:55 -04:00
lethosor 6ce470ad57 Add basic lua expression support to memview
Currently just supports basic field accesses (world.x, screen.y.z).
No support for world.x - 4, etc.

Closes #976
2016-08-24 16:26:34 -04:00
lethosor 7487f44fc8 Implement a helper to create lua environments with shortcuts (e.g. scr, unit)
Used in gui/gm-editor and lua

Closes #977
2016-08-23 21:47:41 -04:00
lethosor 2dccd1d0ff Add CheckedArray:__tostring() method 2016-08-22 23:18:30 -04:00
lethosor 1dab45ffed Replace lua_pushnumber with lua_pushinteger in LuaApi.cpp 2016-08-22 23:18:08 -04:00
lethosor e983e66a1a Update xml and scripts 2016-08-21 20:59:24 -04:00
lethosor 70ac99cbfa Fix Buildings::setOwner() persistence
Needed to set bld->owner_id for changes to persist across save/load

Fixes #983, thanks to Quietust
2016-08-21 20:58:40 -04:00
lethosor 98a187ca43 Update xml 2016-08-18 17:28:44 -04:00
lethosor 9e4a6d7591 Update default base address on 64-bit Linux 2016-08-18 17:28:18 -04:00
lethosor 0b6597ddb2 Stop field_offset from crashing due to missing vtables
Now, a pointer to NULL is cast to the type in question, avoiding the need to
call new() or delete() with potentially-misaligned types. Also,
virtual_identity::find has been tweaked to prevent it from crashing on NULL
vtable pointers.

This was suggested by Angavrilov.
2016-08-18 15:59:46 -04:00
lethosor c2997b9c79 Fix save_dir 2016-08-18 15:47:40 -04:00
lethosor de731b0299 Move save_dir back into cur_savegame and update submodules 2016-08-14 12:41:09 -04:00
lethosor e965f5318f Replace many includes with forward declarations in modules/Maps.h 2016-08-13 21:44:01 -04:00
lethosor 576174ea0b Lua: Add lengths of (some) containers to their string representations 2016-08-13 19:52:14 -04:00
lethosor eef6f9bfb7 Add df.new() support for char and unsigned long 2016-08-11 00:01:52 -04:00
lethosor a1ff432bf8 Restore fixed-width types in string representations of lua fields
e.g. tostring(df.new('int16_t')) was returning "<short: 0xaddr>"
2016-08-10 23:58:45 -04:00
lethosor 215afa34f3 Update for 64-bit unit changes
Includes xml, stonesense, scripts

Ref DFHack/df-structures@25cb373
2016-08-10 23:50:00 -04:00
Lethosor 6e741b1a80 Merge pull request #969 from Qartar/win64
Minor fixes/updates for Visual Studio 2015 Win64
2016-08-10 15:15:44 -04:00
lethosor 02eef95147 Fix base address for Darwin x64 2016-08-09 20:00:31 -04:00
lethosor e22b3b1de7 Use non-fixed-width types in integer identity_traits definitions
In some situations (e.g. 32-bit Linux), "intptr_t" is defined as "int", which is
equivalent to "int32_t", leading to issues with duplicate definitions. In other
situations with GCC, "intptr_t" is "long", which isn't covered by any intNN_t
types. Also, definitions for "long" already had to be added on Windows, because
no fixed-width types in MSVC are equivalent to "long".

Switching to non-fixed-width types should hopefully cover all of these
situations. If this doesn't cover any integer types that we need, it will
be caught quickly, e.g. by references to integer_traits<T> in LuaWrapper.cpp.
2016-08-08 11:46:20 -04:00
lethosor 298d16238e Remove a few unneeded includes in DataStaticsFields.cpp 2016-08-08 11:45:00 -04:00
lethosor aeac8b4fef Update xml 2016-08-05 18:04:42 -04:00
lethosor ee7357b60e x86: fix vector validity check 2016-08-05 17:51:08 -04:00
lethosor dde6901534 x86: fix lua address display 2016-08-05 17:50:49 -04:00
Japa 2fda01d90b Add support for site towers. 2016-08-03 10:22:30 +05:30
Japa 9189e3dc7e Send world buildings through remotefortressreader.cpp 2016-08-02 10:30:17 +05:30
Carter Bray 44913609c8 Fix format string warnings 2016-08-01 19:03:26 -07:00
lethosor 79377669a1 Merge remote-tracking branch 'NCommander/dwarfvet' into develop 2016-07-29 16:25:53 -04:00
lethosor 158f18106f Merge remote-tracking branch 'NCommander/vs2015' into develop 2016-07-29 15:30:32 -04:00
lethosor 55970a71ab Fix Lua::Push for enums 2016-07-29 11:06:16 -04:00
lethosor e8fe72826f Add new integer types to memscan and update find-offsets 2016-07-29 00:05:12 -04:00
lethosor dc79e2477b Expose long/[u]intptr_t to lua and fix some integer return values 2016-07-29 00:02:51 -04:00
lethosor b7856fd9f2 Use enable_if for Lua::Push specializations 2016-07-28 22:04:46 -04:00
lethosor 7b7f7a1b79 Fix support for integer fields in Lua 5.3 2016-07-28 16:36:02 -04:00
lethosor 41a81f9021 Fix some more warnings (GCC 4.8) 2016-07-28 11:00:52 -04:00
lethosor 42c620bb9c Download non-broken libstdc++ on OS X 2016-07-27 21:43:38 -04:00
lethosor 828fee532a Switch to downloading zlib.lib and SDLreal.dll on Windows 2016-07-27 21:08:24 -04:00
Vitaly Pronkin 223c83071e win64 fixes: doReadClassName, ParseVersion
cherry-picked from 2f734ae2317060edb83021f17cffc966c435ad7b
2016-07-27 20:21:57 -04:00
lethosor ddd56d7825 Fix (for win64) and avoid duplicating base address 2016-07-27 20:10:03 -04:00
lethosor 50144b60ea A few %08x to %p changes 2016-07-27 19:54:19 -04:00
Vitaly Pronkin 8916aba3bf win64 fixes (partial)
cherry-picked from 2f734ae2317060edb83021f17cffc966c435ad7b
2016-07-27 19:46:49 -04:00
Vitaly Pronkin fe18f176f7 More 64-bit fixes
Cherry-picked from 7eb3ba6
- Lua update already done in e2c6350, 4dd411e
- Excluded library/modules/Buildings.cpp
2016-07-26 23:47:53 -04:00
Vitaly Pronkin 3833ff2e09 proper 64bit address formatting 2016-07-26 23:30:50 -04:00
lethosor a684e1dd0f Merge remote-tracking branch 'lethosor/64-bit' into develop 2016-07-26 22:54:36 -04:00
Michael Casadevall e10397370b Merge branch 'develop' of github.com:DFHack/dfhack into vs2015 2016-07-11 18:59:22 -05:00
Michael Casadevall ed6fb69012 Fix whitespace spacing
Signed-off-by: Michael Casadevall <mcasadevall@ubuntu.com>
2016-07-11 18:54:03 -05:00
lethosor cede0528f2 Merge branch 'develop' of https://github.com/dfhack/dfhack into develop 2016-07-06 21:00:20 -04:00
lethosor 39aa143cfa Update NEWS and submodules 2016-07-06 20:59:49 -04:00
Lethosor 4f96bdd0eb Merge pull request #950 from TC01/linux-system-tinyxml
Support linking against an external tinyxml if EXTERNAL_TINYXML is set
2016-07-06 20:37:28 -04:00
lethosor 2de2e6a983 Update CMakeLists and submodules 2016-07-06 20:30:28 -04:00
lethosor b4063352cf Fix crash in vprinterr due to va_list misuse 2016-07-03 23:33:07 -04:00
lethosor 2455e36510 Initial 64-bit support 2016-07-03 23:32:43 -04:00
lethosor 163207e362 Give more feedback for DF detection failures with mismatched XML versions
This may help address issues where people forget to read the documentation,
don't run "git submodule update", and end up with a df-structures version
that's too old (which is somewhat common, it turns out).
2016-06-30 20:42:27 -04:00
lethosor cfaba3ec71 Update various references to scripts/ and mention old git issues in Compile.rst 2016-06-29 19:38:15 -04:00
lethosor af906d6582 Remove library/scripts submodule 2016-06-29 19:06:00 -04:00
Ben Rosser ae55d2d526 Support linking against an external tinyxml if EXTERNAL_TINYXML is set
As best as I can tell, the copy of tinyxml dfhack uses is unmodified
from whenever it was first bundled. This commit adds an option to CMake,
EXTERNAL_TINYXML, that if set to ON, will attempt to link against a system
tinyxml instead of using the dfhack-bundled one.  It defaults to OFF,
so there is no change in default behavior.

The DFHACK_TINYXML variable is then set to either "tinyxml" or "dfhack-tinyxml"
so the library (and any plugins that need updating) can link against one
or the other.

The FindTinyXML.cmake script was taken from https://github.com/ros/cmake_modules
(licensed under the 3-clause BSD license).

Add license text to new CMake file.
2016-06-29 17:53:16 -04:00
Michael Casadevall d509cf2fb5 It helps when you pop pragmas
Signed-off-by: Michael Casadevall <mcasadevall@ubuntu.com>
2016-06-28 09:39:46 -05:00
Michael Casadevall d49032ef73 Supress a lot of compiler noise in hopes of finding real errors. Right now, a plugin free DFHack can be built with VS2015 2016-06-28 08:34:11 -05:00
Japa b338d0218e Merge branch 'develop' of https://github.com/DFHack/dfhack into develop 2016-06-20 13:22:25 +05:30
Japa 36aafd550b Increased the message size limit in RemoteClient from 8mb to 64mb. 2016-06-20 13:17:30 +05:30
lethosor 6d1c4cd9ce Merge branch 'develop' of https://github.com/dfhack/dfhack into develop 2016-06-16 23:37:21 -04:00
lethosor a7d5c2132a update xml 2016-06-16 23:37:01 -04:00
Japa 0918efd02d fix word_wrap not returning a value. 2016-06-16 20:52:16 +05:30
lethosor 27a84a8246 Move scripts to library/scripts
git can't cope with replacing scripts/3rdparty/* submodules with a single
scripts submodule.
2016-06-15 18:45:08 -04:00
lethosor 9de4550fde Update submodules 2016-06-15 12:11:20 -04:00
lethosor 022a1bf9e8 Wrap script descriptions in `ls` output and remove description length cap 2016-06-14 21:24:27 -04:00
lethosor 4f3a2b39d7 Update xml 2016-06-14 13:21:59 -04:00
lethosor f07bc03c69 Update clsocket and Open()/Listen() usage 2016-06-14 13:21:51 -04:00
Lethosor a2b2c66798 Merge pull request #931 from warmist/advfort2
Advfort2
2016-06-14 09:45:33 -04:00
Michael Casadevall 90c7dc41ec Update where library/xml to point to current master
Signed-off-by: Michael Casadevall <mcasadevall@ubuntu.com>
2016-06-13 17:10:58 -04:00
Michael Casadevall a03b32846a Modify DFHack to handle new produce() prototype. Major thanks to lethosor, and ragundo for their help in this
Signed-off-by: Michael Casadevall <mcasadevall@ubuntu.com>
2016-06-13 16:57:45 -04:00
Michael Casadevall e45fbfc61d Modified dwaftvet plugin to work with latest DFHack
Initial commit of the dwarfvet plugin

Signed-off-by: Michael Casadevall <mcasadevall@ubuntu.com>
2016-06-08 04:14:59 -04:00
lethosor a47a1c83ba Update xml, clsocket 2016-06-07 08:17:40 -04:00
lethosor fa1c589391 Update xml 2016-05-30 16:58:51 -04:00
lethosor d44bc069ad Merge remote-tracking branch 'BenLubar/thread-memory-leak' into develop 2016-05-30 16:24:42 -04:00
lethosor 9fc43cff4d Make const method wrappers possible
Reverts ae3052f
Ref #935
2016-05-28 20:11:42 -04:00
lethosor 113325f885 update xml 2016-05-28 10:29:53 -04:00
lethosor ae3052f79a Make knowledge_scholar_category_flag::value() non-const
const methods can't be wrapped at the moment, at least without changing things
in DataFuncs.h
2016-05-28 10:28:22 -04:00
lethosor 4d3df60470 Update xml (offsets) 2016-05-27 17:51:01 -04:00
lethosor c1ba435058 Update version and xml 2016-05-27 17:41:23 -04:00
Ben Lubar e76258b040 knowledge category flag 2016-05-26 15:15:42 -05:00
Ben Lubar 700392ba55 Fix tinythread memory leak in two ways:
1. update to tinythread version 1.1, which provides a detach method
2. move the thread disassociation to the join function, which allows
attached threads to be joined even after they finish (this was the main
leak)

Also update RemoteServer.cpp to detach threads and delete the thread
objects instead of leaking them (although they are much smaller than the
actual threads).
2016-05-21 19:17:08 -05:00
Warmist 6c64b3441d Fixes to gui/advfort.lua 2016-05-20 13:55:59 +03:00
lethosor d93cf2cd2e Update xml 2016-05-17 23:26:21 -04:00
lethosor b7aa8aca26 Update xml 2016-05-14 22:27:21 -04:00
lethosor 1832e563b7 Update xml 2016-05-14 19:41:41 -04:00
lethosor a89251cdf8 Find job in job screen 2016-05-14 16:07:27 -04:00
lethosor 118d88e44f Update xml 2016-05-14 16:07:10 -04:00
lethosor 55e58e5f06 Update handling of viewscreen_workshop_profilest in Gui module, search/sort plugins 2016-05-14 11:43:37 -04:00
lethosor 97f7cd6081 Bump version and update xml 2016-05-12 16:03:33 -04:00
lethosor fee6e57b40 Disable viewscreen_layer_workshop_profilest focus handler for now 2016-05-11 17:52:56 -04:00
lethosor ed81be16b3 Improve logging of vtable interpose errors 2016-05-11 17:52:10 -04:00
lethosor 38051a5a48 remove tweak manager-quantity 2016-05-11 17:51:57 -04:00
lethosor b53f829737 Update to 0.43.01-alpha0 and update xml 2016-05-10 17:48:50 -04:00
lethosor c1e44c178f Add on_click/on_rclick handlers to widgets.Label
Closes #919
2016-05-09 21:30:34 -04:00
lethosor 402a96b0e6 Expose new unit functions to lua and add some basic safety checks 2016-04-23 21:52:50 -04:00
lethosor bc7c689d93 update xml 2016-04-23 20:33:03 -04:00
lethosor 52728babd4 Merge branch 'develop' into zone-unassign 2016-04-22 18:41:15 -04:00
lethosor b36193857c Add string:startswith(), endswith() 2016-04-16 17:13:41 -04:00
lethosor 0d37209063 use trade_state enum 2016-04-13 09:44:57 -04:00
Warmist 7c91b8f755 Add more informative focus_path
This with conjunction of changes in eventful will make the sidebar overlay more bug-free :)
2016-04-10 16:53:18 +03:00
Warmist 8b8ce4eff9 Spelling mistake 2016-04-10 15:45:43 +03:00
Warmist d1c45d00d2 Fix some bugs in workshopOverlay
Fix bugs relating to "remove building"/"suspend remove" part of overlay.
2016-04-10 14:44:09 +03:00
Warmist 80521d1bb1 add onGetSelectedBuilding to workshop overlay
This will make other stuff that depends on dfhack.gui.getSelectedBuilding work with workshop overlay
2016-04-10 12:28:15 +03:00
lethosor 49863a9f32 Add a file-like lua JSON wrapper 2016-04-08 17:40:14 -04:00
lethosor b97d33ca28 moveToBuilding improvements
- Don't set in_building by default when use_mode is 0 (consistent with most vanilla DF items)
- make use_mode optional and default to 0 (including in Lua API)

Resolves #885
2016-04-05 11:43:02 -04:00
lethosor d9e368cab4 Update xml 2016-04-03 21:10:02 -04:00
lethosor e0ae7bde79 Add Lua primitives: ptr-string, pointer, ptr-vector, bit-vector, bit-array
These are most useful with df.reinterpret_cast, but df.new can also be used for
most of these (except ptr-string)
2016-04-03 20:48:57 -04:00
lethosor 37c81df21c Add reverse vtable name lookup 2016-04-03 20:45:44 -04:00
lethosor a49f313f84 update xml 2016-04-03 13:34:52 -04:00
lethosor ec5e91bd6a Update xml 2016-03-28 21:00:27 -04:00
lethosor b115fdc73f Load script paths from dfhack-config/script-paths.txt 2016-03-27 15:56:23 -04:00
lethosor 866d31f121 Update xml 2016-03-26 11:12:06 -04:00
lethosor af4a3428a6 Split DataStaticsFields into multiple compilation units 2016-03-22 17:34:25 -04:00
lethosor b8bbf5f545 field_offset: Use actual type instances instead of reinterpret_cast(type, 1)
ui_build_selector is a virtual class as of 0.42.06, so reinterpret_cast-ing it
with bad addresses will crash. 'df.new(df.ui_build_selector)' works just fine.
2016-03-22 17:27:53 -04:00
Japa a3ddc63836 Merge branch 'develop' of https://github.com/DFHack/dfhack into develop
Conflicts:
	plugins/remotefortressreader.cpp
2016-03-20 16:30:49 +05:30
lethosor e505bf0a58 Update xml 2016-03-18 17:05:59 -04:00
lethosor 76793045a9 Only block keyboard events in OS X SDL_PollEvent hook without focus
Blocking all events causes issues with window manager controls when the window
is not focused - for example, DF doesn't resize certain screen buffers, leading
to flickering in OpenGL print modes.
2016-03-13 10:33:25 -04:00
expwnent f8ff447cb5 Add a check to the histfig fix and tweak NEWS. 2016-03-10 08:50:03 -05:00
expwnent fd132d3fe7 Fix persistent histfig crashbug. 2016-03-10 08:38:55 -05:00
lethosor cbb4275a44 Update xml 2016-03-09 14:54:24 -05:00
sv-esk dd9f1bf759 make world friend of machine and building handlers to allow use their
protected constructor
2016-03-09 13:03:16 +02:00
lethosor c700847bcf Remove a couple unneeded includes 2016-03-04 20:23:00 -05:00
lethosor c595f7908a Update xml 2016-03-04 20:22:09 -05:00
sv-esk 9da79544de fix Units::isCitizen
fixes a lot of issues where plugins ignore non-dwarf citizens and work
with dwarf mercenaries and bards, where it shouldnot
2016-03-04 22:48:33 +02:00
lethosor 8eb39cc1d0 Merge branch 'develop' of https://github.com/dfhack/dfhack into develop 2016-03-03 23:19:03 -05:00
lethosor 0db3c72557 Update xml 2016-03-03 23:18:36 -05:00
sv-esk d508028bcc fix job-duplicate (do not clone posting_index)
if job cannot be done right now, game puts it in df.global.world.job_postings
when job finally can be done, game removes job from postings and clears posting_index
that index should not be cloned by job-duplicate(new jobs(added by vanilla way) have that value -1 always anyway)
cloning posting_index into the new job causes that job to be ignored
2016-03-03 21:32:16 +02:00
lethosor 5334bd8a6a Bump version to 0.42.06-alpha0 and update xml 2016-02-28 11:18:27 -05:00
lethosor 5bb19a230f getKillCount: also search kills->events 2016-02-25 15:34:56 -05:00
lethosor 25507a10f9 Add Units::getKillCount() and expose it to Lua 2016-02-25 15:21:14 -05:00
lethosor 3e44aabf12 Expose Units::getSquadName to lua 2016-02-25 15:19:35 -05:00
lethosor 297bbd6f20 Merge remote-tracking branch 'warmist/develop' into develop (closes #772) 2016-02-24 17:24:03 -05:00
sv-esk 83c70ccb0f forbid manipulator editing non-citizens 2016-02-11 13:31:52 +02:00
lethosor fafe1e9ce1 Update xml 2016-02-03 23:19:41 -05:00
Warmist d4988c5faf Add no handler version of lua event. 2016-02-01 22:22:12 +02:00
James Gilles 0a670bb0db Implement #804, move some functions to Units, colorize zone output, a
little cleanup
2016-02-01 11:12:06 -05:00
lethosor 2d23a848cc git-describe: Add git xml information 2016-02-01 10:30:53 -05:00
lethosor 77466f01e0 Merge remote-tracking branch 'BenLubar/benlubar-valgrind' into develop 2016-01-31 14:52:04 -05:00
lethosor 248331a196 buildingplan: Support floodgates, grates, bars
See #808
2016-01-31 14:50:07 -05:00
Ben Lubar ea9261f5b5 allow dfhack to run inside valgrind
valgrind replaces the readlink system call, but not the open system
call. By calling readlink first, we guarantee that /proc/self/exe is the
actual Dwarf Fortress executable and not the valgrind executable.

See also: https://bugs.kde.org/show_bug.cgi?id=86921
2016-01-31 13:34:07 -06:00
lethosor 80fd2270db Merge branch 'develop' of https://github.com/dfhack/dfhack into develop 2016-01-31 14:22:57 -05:00
Ben Lubar a316dfa074 set floodgate flags correctly when allocating it in lua or c++
https://github.com/DFHack/dfhack/blob/0.42.04-alpha2/plugins/ruby/building.rb#L63
2016-01-29 14:50:50 -06:00
lethosor 80ecbbd369 get rid of "private" comment in BitArray.h 2016-01-21 16:49:16 -05:00
Ben Lubar 675d173266 set civzone number when constructing a civzone 2016-01-18 14:46:39 -06:00
lethosor 0b2ba377be Update xml 2016-01-18 11:49:37 -05:00
lethosor ab8cce2a86 Update xml 2016-01-18 10:13:16 -05:00
lethosor 0bcc8dc443 exportlegends: fix day/month issues more reliably
Fixes #783, #791
2016-01-09 19:28:12 -05:00
lethosor d670ee8ab4 New tweak: block-labors
Prevents labors that can't be used from being toggled

Suggested at http://www.bay12forums.com/smf/index.php?topic=121451.msg6719464#msg6719464
2016-01-08 19:27:11 -05:00
lethosor 93fe222c35 Revert #719
No plugins built prior to the symbol naming change in 4fc6cb6f can
be loaded in DFHack for v0.42.
2016-01-01 11:20:54 -05:00
lethosor d0c28d3f50 Prevent plugins with active viewscreens from being unloaded
This requires plugins to pass plugin_self to Screen::show(), but
avoids the need to implement special checks in plugin_onstatechange
for the SC_BEGIN_UNLOAD event.
2016-01-01 11:15:29 -05:00
lethosor ef62c044a3 Update NEWS, xml 2016-01-01 10:30:02 -05:00
lethosor 31745f4a36 Fix a couple exportlegends issues and update xml 2015-12-31 14:32:31 -05:00
lethosor 090787e927 Update xml 2015-12-31 13:41:46 -05:00
lethosor 2079093d5a Fix new addresses in export-dt-ini 2015-12-28 23:19:02 -05:00
lethosor 22283066ca Update xml 2015-12-28 17:30:05 -05:00
lethosor 39086acf64 Merge export-dt-ini changes from splintermind/Dwarf-Therapist 2015-12-28 15:46:42 -05:00
lethosor c23ac50250 Always run dfhack.init-example if dfhack.init doesn't exist
This previously only happened if no files matching *dfhack*.init
existed
2015-12-27 16:39:10 -05:00
lethosor e075a06486 Add search controls to all viewscreen_petst subpages 2015-12-27 15:49:10 -05:00
lethosor d087f4f741 Expose process MD5/PE to Lua (useful in export-dt-ini) 2015-12-27 14:59:18 -05:00
lethosor a977f274b1 Update xml 2015-12-26 20:00:09 -05:00
lethosor fabff1ddfb Fix df::occupation usage 2015-12-26 19:59:54 -05:00
lethosor 5263d425a2 Merge remote-tracking branch 'BenLubar/benlubar-init-args' into develop 2015-12-26 13:47:58 -05:00
Ben Lubar 106891f6e0 vim-style +-args. for example, "./dfhack +echo foo" would be equivalent to running ./dfhack and then typing "echo foo" into the console. uses shell argument splitting, so "./dfhack +somecommand 'foo bar' baz" does the right thing. See DFHack#755. 2015-12-26 12:10:44 -06:00
lethosor 9a82f59518 Merge remote-tracking branch 'BenLubar/benlubar-init-args' into develop 2015-12-26 11:49:45 -05:00
lethosor 05926d9734 New tweak: title-start-rename
Adds a safe rename option to the title screen "Start Playing" menu
2015-12-26 11:47:58 -05:00
lethosor 64d861bf6b Add support for viewscreen_locationsst to various gui functions 2015-12-25 11:09:13 -05:00
lethosor 25e808be38 Update xml 2015-12-23 17:45:08 -05:00
lethosor e3e68a8df9 Add a search option to the location occupation menu 2015-12-23 16:57:43 -05:00
lethosor 14f1e6b06c Improve prerelease warning somewhat 2015-12-22 19:34:54 -05:00
lethosor 2a2ab00ca9 Add "map" parameter to a lot of drawing functions
Ref #746
2015-12-22 11:42:51 -05:00
lethosor 10c72a3d5d Fix produce() call in modules/Items.cpp 2015-12-22 09:46:01 -05:00
lethosor e4ff4fe64c Update xml 2015-12-22 09:43:17 -05:00
lethosor ef27018545 Update xml 2015-12-20 15:19:32 -05:00
lethosor eeb0fc7a0f update xml 2015-12-19 23:12:26 -05:00
lethosor eb1ae54d63 Add ui_lever_target_type scan to find-offsets 2015-12-19 17:09:29 -05:00
lethosor ea79fc692a Update xml 2015-12-19 11:07:42 -05:00
lethosor 5a1e5e1464 Expose Units::casteFlagSet() 2015-12-19 11:07:35 -05:00
lethosor ca29f60518 update xml 2015-12-18 23:09:27 -05:00
lethosor 55d5706a21 Update structures and fix various issues with plugins producing items
reaction_product::produce() takes a new unidentified vector<void*>*.
Passing a reference to an empty vector appears to work.
2015-12-18 18:40:11 -05:00
lethosor 347a112aa1 Add support for 11-argument function wrappers
Needed by item::addImprovementFromJob() as of 0.42:
dfhack/df-structures@f6361e2
2015-12-18 17:45:23 -05:00
Ben Lubar 9bccf457c5 Check for ui_sidebar_menus being null before using it. 2015-12-17 10:54:19 -06:00
Ben Lubar 80ec5ab043 vim-style +-args. for example, "./dfhack +echo foo" would be equivalent to running ./dfhack and then typing "echo foo" into the console. uses shell argument splitting, so "./dfhack +somecommand 'foo bar' baz" does the right thing. See DFHack#755. 2015-12-13 14:03:25 -06:00
lethosor 78d6b92127 Change strangemood permitted skill checks to job checks
permitted_skills was removed in 0.42 (dfhack/df-structures@6e2e8731)
2015-12-12 11:17:00 -05:00
lethosor 1329acc516 Update xml 2015-12-11 20:34:48 -05:00
lethosor 83603fcf45 Add prerelease build flag and warning script 2015-12-11 20:27:46 -05:00
lethosor 571df39878 Update submodules 2015-12-11 16:35:42 -05:00
lethosor 7e9d6fba86 Update xml 2015-12-09 20:03:14 -05:00
lethosor 448e367d4d Update xml 2015-12-08 17:32:13 -05:00
lethosor a3d6d16757 Update xml 2015-12-07 17:14:46 -05:00
lethosor 02d2405d1f Update xml 2015-12-07 16:34:47 -05:00
lethosor 49ad153d4b Update xml 2015-12-06 17:12:46 -05:00
lethosor 3b2ace95f8 Make SDL_UpperBlit hook check core status first 2015-12-05 20:07:54 -05:00
lethosor b63270162d Update xml 2015-12-04 23:12:49 -05:00
lethosor 7a69b90277 Update xml 2015-12-02 16:27:51 -05:00
lethosor 8b406cc0b3 Make a separate copy of DF's SDL library to link against on OS X
Linking to any library with ".framework" in its path on OS X causes
that directory to be included in the include path (with -F), which
causes all of the DFHack core to be rebuilt unnecessarily when
changing DF folders.
2015-12-01 17:35:39 -05:00
lethosor 2aeac718cc workflow: Account for job postings correctly and fix existing issues
Without removing postings correctly, it was possible to end up with
multiple workers assigned to a job that workflow had suspended
multiple times, which caused crashes if more than one worker was
assigned to the same job by DF.

This adds an additional command, fix-job-postings, that runs
automatically when loading a world and fixes:
- Multiple job postings that point to the same job
- Job postings that point to a job where posting_index == -1
  (i.e. jobs that should have no posting assigned)

Fixes #741
2015-11-25 20:33:13 -05:00
lethosor df4fb70be2 Provide more suggestions for unrecognized commands 2015-11-25 20:22:14 -05:00
lethosor 610170b0b0 Add hooks for getDwarfmodeViewDims and getDepthAt (new) 2015-11-15 11:54:34 -05:00
lethosor 1ff9277e12 Remove plugin export functionality (unused) 2015-11-15 11:54:34 -05:00
lethosor fcfffd1cb6 Track state of gui hooks
Also fix a bug in drawborder() and expand color-dfhack-text to test
multiple hooks
2015-11-15 11:54:34 -05:00
lethosor fff9072b07 Add initial support for hooking into Gui-related functions 2015-11-15 11:54:34 -05:00
lethosor 875ecf7827 Update Core::top_viewscreen before calling state change handlers
This was previously done right before SC_VIEWSCREEN_CHANGED events
were handled, meaning that code handling earlier events that used
top_viewscreen (rather than getCurViewscreen()) could refer to an
invalid viewscreen, i.e. in the tick after it was deleted.

Fixes #747
2015-11-14 21:48:51 -05:00
lethosor 2882422a3e Don't require short script help to start with a space
Ref #742
2015-11-09 22:58:46 -05:00
lethosor 3fb2628921 Add a Lua implementation of next_enum_item() 2015-11-07 15:22:30 -05:00
lethosor 051244c8d6 Fix GCC compile error 2015-11-06 20:05:14 -05:00
lethosor d1cd5df314 Merge remote-tracking branch 'DoctorVanGogh/automats-floorfix' into develop 2015-11-06 19:54:06 -05:00
DoctorVanGogh e9be1aa657 Fix for construction over existing construction & on top of walls
Fix to allow constructions on top of (natural) down stairs
2015-11-06 19:00:43 +01:00
lethosor 867b733a04 Fix a few GCC warnings on Linux (GCC 4.6) 2015-11-05 21:48:13 -05:00
lethosor 8412a496dd Remove extra check for "type" command 2015-11-05 19:09:14 -05:00
lethosor 23b02ebcf2 Update xml 2015-11-05 16:17:52 -05:00
lethosor e2a1658124 Update xml 2015-11-04 21:42:04 -05:00
Lethosor 14707e7d81 Merge pull request #719 from DoctorVanGogh/r3compat
Allow loading (external) plugins compiled against r3
2015-10-31 19:12:07 -04:00
DoctorVanGogh c6220c9703 Remove tabs/trailing whitespaces 2015-10-31 23:43:57 +01:00
Lethosor 6e5d9c23e5 Merge pull request #715 from DoctorVanGogh/webfix
Add 'undisturbed' flag to job item checks
2015-10-31 11:28:25 -04:00
lethosor 7da3c65079 Fix display of arrows in lua filtered list widgets
Fixes #718
2015-10-30 19:16:29 -04:00
lethosor 83991d2a22 plug: Don't color loaded plugins 2015-10-30 18:45:55 -04:00
lethosor ac71fa8070 Add isValidLabor() to Units module
Closes #711 and could avoid potential issues when editing units from
other civs with manipulator.
2015-10-30 18:41:09 -04:00
lethosor 1250bb5204 type: Provide more useful information (script paths, plugin names) 2015-10-27 17:34:32 -04:00
DoctorVanGogh 4e0f426bba Fix code formatting 2015-10-26 02:37:44 +01:00
DoctorVanGogh ba53f3c035 Add 'undisturbed' flag to job item checks 2015-10-26 02:19:41 +01:00
DoctorVanGogh fb4d16f477 Enable loading of r3 plugins 2015-10-25 00:04:49 +02:00
lethosor 8de710f1c1 Add Renderer module - safer way to install custom renderers 2015-10-21 17:18:39 -04:00
lethosor c44ac8ec6e Improve handling of fatal errors and errors in dfhack.lua
* Several fatal errors that occurred during core initialization didn't
  stop initialization or set 'errorstate' properly, which caused
  update hooks and other code to crash later. This has been fixed and
  should address crashes like the one mentioned in #470.
* Errors when loading dfhack.lua now cause Lua::Open() to fail, which
  triggers a fatal error in Core::Init()
* Failure to initialize the console no longer results in a call to
  fatal() (since it didn't actually stop initialization previously)
2015-10-17 21:18:04 -04:00
lethosor 5387c03ea0 DFHackVersion: Expose whether the built commit is tagged 2015-10-17 15:35:40 -04:00
lethosor d3dbc6225a Implement getViewscreenByType() in lua 2015-10-17 15:11:04 -04:00
lethosor 96df70fe0b Use TCSADRAIN when disabling raw mode as well 2015-10-14 15:58:27 -04:00
lethosor 632a809d6f Update xml 2015-10-11 11:39:16 -04:00
lethosor c2267013b4 plug: List enabled state 2015-10-03 13:42:20 -04:00
lethosor 3f5c002634 Pass virtual_identity by reference 2015-10-03 09:27:24 -04:00
lethosor d343dfd8a0 Add a function to find viewscreens (or parents) of a given type
This makes it possible for some plugins to detect the game state more
reliably - for example, prospector would previously fail when
embarking if the viewscreen_choose_start_sitest instance had any
children.
2015-10-02 21:50:55 -04:00
expwnent e95aea90e0 Fix CMake warning over INTERFACE_LINK_LIBRARIES / policy CMP0022. 2015-09-27 04:30:46 -04:00
lethosor b16e59b91c Check for existence of save folder before attempting to log events
cur_savegame.save_dir can be populated when the save directory does
not yet exist after world generation (since the game can be aborted
at that stage without saving).
2015-09-26 14:26:44 -04:00
lethosor fa60ccdd52 Don't find scripts from the last loaded world's raw/scripts folder 2015-09-26 14:26:13 -04:00
lethosor b679a0c482 Update xml 2015-09-26 13:45:51 -04:00
lethosor 2bcf74d74c Merge branch 'develop' of https://github.com/dfhack/dfhack into develop 2015-09-26 10:46:45 -04:00
lethosor ec17685041 CMake: Add compiler checks and GCC version checks 2015-09-26 10:46:29 -04:00
expwnent dfe9ec90f2 Update XML. 2015-09-25 19:43:14 -04:00
expwnent a188b9d567 Merge branch 'third-party-scripts' into develop 2015-09-25 17:48:25 -04:00
expwnent 5bcff42800 Add third party scripts. 2015-09-23 23:46:26 -04:00
lethosor 788860efb6 Log more information about version information on startup
May help address #653
2015-09-22 20:01:05 -04:00
lethosor 91a1836439 Fix a few issues with init file variations
* GCC does not allow std::string instances or enums without a base
  type to be passed as varargs
* Fixed path concatenation issue causing dfhack.init to not be loaded
2015-09-21 18:57:58 -04:00
expwnent 2c9b268184 Merge pull request #689 from expwnent/develop
Generalize dfhack.init so it looks for more files in more places, for onload, onunload, etc.
2015-09-21 17:33:52 -04:00
expwnent af90d14cb2 Use shenanigans to make a certain table const. 2015-09-21 17:24:51 -04:00
lethosor 051a1f9661 Update xml 2015-09-19 18:00:59 -04:00
lethosor a56a427d12 Make Filesystem::is* functions handle nonexistent paths properly
If stat() failed, these functions could read from an uninitialized
stat struct and return "true" for paths that didn't exist.
2015-09-19 17:34:58 -04:00
expwnent 5bf3093139 Now it looks for dfhack*.init instead of just dfhack.init, onLoad*.init instead of just onLoad.init, etc. 2015-09-15 07:27:42 -04:00
lethosor d696832efa Merge branch '3rd-party-scripts' into develop 2015-09-14 16:52:13 -04:00
lethosor 9eb86c7e38 Support additional script search paths
These can currently be added/removed from C++ or through the Lua API.
2015-09-06 16:23:02 -04:00
lethosor 66c7a461fd Don't attempt to copy non-files into dfhack-config 2015-09-03 15:02:51 -04:00
lethosor 9eac4585b1 keybinding: support 0-9, F10-F12 2015-09-02 15:56:53 -04:00
lethosor 949e4d42cf Remove MacPool.* 2015-08-29 19:42:32 -04:00
lethosor 906fba9b54 Update xml 2015-08-26 16:41:04 -04:00
lethosor 81ef17df32 Update xml 2015-08-25 10:23:59 -04:00
lethosor 29a0aee44c Implement strnlen on OS X <= 10.6
Fixes #182
2015-08-24 17:51:42 -04:00
lethosor 19f966aefc Improve some plugin-related error handling 2015-08-16 17:28:31 -04:00
lethosor 5717c2cdd4 Don't set plugin state to PS_BROKEN due to load failures 2015-08-16 17:02:53 -04:00
lethosor a5f15b279c plug: Include deleted plugins in full list 2015-08-14 19:32:41 -04:00
lethosor 735498c3f9 Fix merge conflict 2015-08-14 16:23:39 -04:00
lethosor 4fc6cb6f17 Several PluginManager improvements
* load/unload/reload are no longer restricted to plugins that exist
  on startup
* Names passed to DFHACK_PLUGIN must match the plugin's filename
  (remotefortressreader vs RemoteFortressReader, counters vs probe)
* "plug" output lists all plugins and state/command information
* Deleted plugins can be reloaded again if they are replaced
* load/unload/reload don't fail silently with broken plugins
* Built-in commands are recognized internally (e.g. "help help"
  does not display "help is not a recognized command"), although help
  for them is not yet implemented
* New command: "type" (bash-like) - shows where/how a command is
  implemented
* "plug" can accept multiple plugin names
* "ls" displays more information about unloaded/unrecognized plugins
* "load all" changed to "load -all" (or "load --all", "load -a", ...)
2015-08-14 16:11:23 -04:00
lethosor 1bf3a6a37a Update xml 2015-08-14 10:46:05 -04:00
lethosor 2aba2da56d Avoid DataStaticsFields dependency on PluginManager.h 2015-08-11 22:59:19 -04:00
lethosor 9c84c78129 Make lua listdir functions return useful error messages 2015-08-10 12:44:27 -04:00
lethosor d09cdc83ba Update xml 2015-08-10 11:25:15 -04:00
lethosor dc747d59df Link dfhack-md5 on Windows 2015-08-09 13:20:28 -04:00
lethosor 418d2831ef Add a framework for including 3rd-party script repos
Repos need to include a CMakeLists.txt file with calls to the
DFHACK_SCRIPTS macro, which functions similarly to DFHACK_PLUGIN.

The `open-legends` script from lethosor/dfhack-scripts is included
as an example.
2015-08-06 21:50:01 -04:00
lethosor f46d3d137f Allow multiple contexts to be specified when adding keybindings 2015-08-06 20:41:54 -04:00
lethosor afce8d810b Update xml 2015-08-06 17:32:42 -04:00
lethosor de49befdbb Improve version information
* Add reimplementations of old DFHACK_VERSION-style macros
* Expose full git commit ID
* Expose all DFHack::Version functions to Lua
2015-08-06 17:30:51 -04:00
lethosor a67326ad00 git-describe: always use long format 2015-08-06 17:01:11 -04:00
lethosor d02e67267a Replace jsonxx with jsoncpp 2015-07-29 15:50:33 -04:00
lethosor cc5045d6df Fix Alt-E/U/N bindings on OS X 2015-07-29 10:32:19 -04:00
lethosor f387eb2960 Fix an issue where Ctrl-*-A and Ctrl-*-Z keybindings were not properly detected 2015-07-29 09:35:09 -04:00
lethosor 786086e5c5 Make non-CR_OK return values for SC_BEGIN_UNLOAD events abort unload
Returning CR_FAILURE, for example, is more consistent with
plugin_shutdown().
2015-07-28 18:36:20 -04:00
lethosor e51779b08c Update xml 2015-07-27 21:40:04 -04:00
lethosor 7eb4c33cb1 Cache result of getPath() on darwin 2015-07-27 20:32:33 -04:00
lethosor 03aa2399a0 Add environment variables to skip global and vtable initialization 2015-07-23 23:25:01 -04:00
lethosor 27295a9b6f Log DFHack and save-specific information on world (un)load events 2015-07-23 23:24:00 -04:00
lethosor c34e9bb657 Update xml 2015-07-22 17:27:57 -04:00
lethosor fc094e2dbc OS X: Check for existence of SDL.framework before building 2015-07-21 16:26:41 -04:00
lethosor 83f89480aa Update xml 2015-07-18 14:10:53 -04:00
lethosor 22ea68e68a Use is_valid_enum_item in FOR_ENUM_ITEMS
This is part of the workaround for
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43680

Fixes DFHack/dfhack#654
Fixes JapaMala/armok-vision#21
2015-07-18 12:57:12 -04:00
lethosor 74404c62e7 Fix deadlock when aborting plugin load 2015-07-17 16:00:41 -04:00
lethosor 797e9b4485 OS X: Prevent DF window from receiving input when not focused
This partially fixes DFHack/stonesense#32, in the sense that input
to Stonesense is no longer received by DF, but does not cause
Stonesense to receive input either.
2015-07-17 13:49:17 -04:00
lethosor 2afc1c6d3f Update xml
viewscreen_choose_start_sitest fixes
2015-07-17 13:48:49 -04:00
lethosor 527b17d964 Update submodules 2015-07-04 20:45:37 -04:00
lethosor 95e04ef56a Update xml 2015-06-30 16:10:49 -04:00
lethosor 6cfc855e19 Use getcwd() in Process::getPath() on OS X
The "dfhack" script sets up the proper working directory
2015-06-29 10:11:46 -04:00
lethosor 0f3753095b update xml 2015-06-29 10:10:44 -04:00
lethosor 716ce1c9e2 Update xml 2015-06-26 23:20:59 -04:00
lethosor 935f4dd628 Log plugin load information to stderr 2015-06-26 16:11:41 -04:00
lethosor 5d1ae9f5ed Allow plugins without git description to be loaded 2015-06-25 11:46:04 -04:00
lethosor 524593a3d3 Locate git with find_package 2015-06-25 11:43:54 -04:00
lethosor ee7a2c7db7 Add git commit information to libdfhack-version
git is run every time 'make' is run, but the generated include file
is only updated when necessary. Plugins will be loaded successfully
if their DFHack version matches core's (assuming OpenLibrary()
succeeds), but will produce a warning if their git commit doesn't
match core's.
2015-06-24 19:32:45 -04:00
lethosor 0fa5570349 Recognize newline characters in Linux/OS X console 2015-06-24 00:54:12 -04:00
lethosor f3d91b3606 Update xml 2015-06-22 23:16:28 -04:00
lethosor 5bb5d87ad8 Install default dfhack-config files
Files from the "dfhack-config" source directory are now installed to
"dfhack-config/default" and copied to "dfhack-config" on startup if
they don't already exist. Previously, config files weren't available
at all unless they were manually installed (93c9a41).
2015-06-18 08:59:01 -04:00
lethosor 73de6a3051 Update xml 2015-06-15 12:58:49 -04:00
lethosor 6fb6645ed5 Merge branch 'dwarfmonitor-widgets' into develop 2015-06-15 12:55:26 -04:00
lethosor 862389d217 Allow lua scripts to redirect to other lua scripts
Addresses #634, #638
2015-06-14 11:56:14 -04:00
lethosor 93c9a41a3a Reimplement dwarfmonitor widgets in Lua (and improve customizability)
Widget positions and a few other options (e.g. date formats) can be
specified in dfhack-config/dwarfmonitor.json on a per-instance basis.

Related changes:
* Fixed an issue loading JSON files from Lua
* JSON files in dfhack-config (only dwarfmonitor.json currently) are
  no longer copied into the DF directory when building DFHack. This
  keeps developers' personal settings intact, but will require
  copying over changes made to DFHack's copies manually.
* Fixed incorrect config path in dwarfmonitor help
2015-06-13 21:15:43 -04:00
lethosor d663784707 Detect null unit pointer in Items::createItem() 2015-06-09 14:02:42 -04:00
lethosor bb93f2e40f Fix circular lua script dependencies 2015-06-05 19:08:11 -04:00
lethosor 36fde3d7e3 Allow Lua screens to allow OPTIONS to work 2015-06-05 18:45:52 -04:00
lethosor 96f3bdafb4 Implement an internal command to interrupt running Lua scripts
This inserts a debug hook that runs every 256 instructions by
default, which has a minimal impact on performance.
2015-05-24 19:06:01 -04:00
lethosor e27493fa02 Treat plugins without a "plugin_dev" symbol as ordinary plugins 2015-05-24 11:42:22 -04:00
lethosor 6278c94775 Update xml 2015-05-16 14:27:17 -04:00
lethosor db08df7e50 Update xml 2015-05-09 19:41:19 -04:00
lethosor b6ec48c99a Add a macro that allows exported functions to use different names 2015-05-09 09:42:15 -04:00
lethosor a8f5e683f7 Merge remote-tracking branches 'RossM/autolabor-changes', 'RossM/workflow-changes' and 'lethosor/plugin-exports' into develop 2015-05-09 09:39:55 -04:00
lethosor a47a5f8b0a Add an alternative to script_environment() that requires scripts to
recognize use as a module

Also document the use of enable/disable with lua scripts
2015-05-09 09:21:00 -04:00
lethosor 42a6cfaee6 Improve Lua enable/disable error handling 2015-05-08 18:03:19 -04:00
lethosor eaf282c18e Allow lua scripts to be enabled and disabled with built-in commands 2015-05-08 18:03:19 -04:00
lethosor db423c1aa6 Allow Lua scripts to specify whether they can be used as a module or
enabled/disabled
2015-05-08 18:03:18 -04:00
lethosor e73a2f8778 Move script internals to a single table 2015-05-08 18:03:18 -04:00
Ross Morgan-Linial 51d61d91cb Change tabs to spaces. 2015-05-07 20:50:19 -07:00
Ross Morgan-Linial 7aac9a8fb8 Improve workflow handling of plant reactions
Makes workflow understand "seeds of any plant", "thread of any plant",
"drink of any plant", "powder of any plant", and "liquid of any plant"
when counting items.

Changes workflow's handling of the built-in plant reactions to
understand that they always produce plant products, and that they also
produce seeds.

This means that you can set a target for, for example, "powder of any
plant", and workflow will use a milling job to produce that.
2015-05-07 20:49:29 -07:00
lethosor a4a2b2f1de Use TCSADRAIN instead of TCSAFLUSH when initializing raw mode 2015-04-19 11:58:35 -04:00
lethosor 3ca00f85d0 Merge remote-tracking branch 'lethosor/json' into develop 2015-04-08 20:18:13 -04:00
lethosor 62cfd0b8ca Reset DYLD_INSERT_LIBRARIES on startup on OS X
This prevents subprocesses (e.g. those launched with Lua's os.execute)
from attempting to load libdfhack.dylib and aborting due to an
architecture mismatch.
2015-04-06 17:05:36 -04:00
lethosor 4b124bc022 Avoid including DFHackVersion.h in PluginManager.h
Changes to DFHackVersion.h previously required recompiling nearly all
of the DFHack core.
2015-04-03 14:02:14 -04:00
lethosor 7758311f88 Make gametype functions use default arguments when called from Lua 2015-04-02 16:55:27 -04:00
lethosor 786581689f Move get_dfhack_version() to a separate namespace and add a few other version-related functions 2015-04-02 16:37:58 -04:00
lethosor 9b6d8d2799 Allow dev plugins to be skipped on startup 2015-04-01 17:50:22 -04:00
lethosor 8b5b8ed864 Log command name collisions 2015-04-01 17:32:11 -04:00
Lethosor e71c55865d Merge pull request #591 from lethosor/penarray
Expose a faster screen drawing/caching API to Lua
2015-03-31 16:11:28 -04:00
lethosor 331be2b589 Make "keybinding list" accept a context
See #588
2015-03-30 19:03:16 -04:00
lethosor bbb41078e7 Expose PenArray dimensions and tiles to Lua 2015-03-28 18:35:07 -04:00
lethosor e2b6ae9beb Allocate Lua PenArray objects using an existing buffer 2015-03-28 11:27:47 -04:00
lethosor 99f4ea4d2b Implement a PenArray class for caching parts of rendered screens 2015-03-27 22:56:30 -04:00
lethosor ac2f537bf4 Merge branch 'async-zoom' into develop 2015-03-26 19:41:02 -04:00
Lethosor ee16c6d1ab Fix "delete" in console on OS X/Linux 2015-03-25 23:31:23 -04:00
lethosor 7f98a632ce Update xml 2015-03-25 17:58:00 -04:00
lethosor 01c6d05775 Add custom enabler::zoom_display() method (screen.zoom in Lua) 2015-03-25 17:55:56 -04:00
lethosor 42e4f584b9 Add SDL_SemWait and SDL_SemPost hooks 2015-03-25 16:08:25 -04:00
lethosor 38fa416ad1 Lua: Indent array values 2015-03-22 14:04:03 -04:00
lethosor 96e5c5d2fd Fix whitespace 2015-03-20 19:55:32 -04:00
lethosor b976053be0 Add Lua JSON library 2015-03-20 19:51:24 -04:00
lethosor f3508f82c1 Add jsonxx to depends/ 2015-03-20 15:45:38 -04:00
lethosor 625be319c9 Re-enable memory range logging on OS X if an environment variable is set 2015-03-19 19:37:10 -04:00
Lethosor 3639920a50 Merge pull request #575 from lethosor/game-type
Add gametype checks to World module
2015-03-13 22:25:37 -04:00
lethosor 016f67e83f Expose strerror to Lua 2015-03-10 16:32:43 -04:00
lethosor afca7419dc Add gametype checks to World.cpp 2015-03-09 20:08:21 -04:00
lethosor ea1c9fa0df Allow plugin exports to be defined in plugins (and looked up when needed) 2015-03-07 17:25:35 -05:00
lethosor 1570af3f4d Allow plugins to export additional functions through a class 2015-03-07 15:56:43 -05:00
lethosor 1591e67bf2 Replace backslashes with forward slashes in command names 2015-03-06 16:53:57 -05:00
lethosor 0c09feae5b Prevent backslashes from being used in command names 2015-02-27 18:46:29 -05:00
lethosor 45acf61b17 Update xml 2015-02-26 16:12:12 -05:00
lethosor 88ff51c755 Add PushEvent hook on OS X
See #553
2015-02-21 21:28:35 -05:00
lethosor bd809d7bbc Replace most interposed functions with dlsym wrappers on OS X 2015-02-21 21:28:35 -05:00
lethosor db9bcc27e4 Make plugin load errors more descriptive 2015-02-21 21:28:35 -05:00
lethosor 0f77a1a578 Move DFHack version to a separate (static) library
This allows the DFHack version to be changed without recompiling
everything
2015-02-19 12:08:23 -05:00
lethosor c80fbbc397 Remove AS prefixes from add-spatter.cpp
The actual cause of this crash was fixed in #558

See #205
2015-02-19 12:05:32 -05:00
lethosor c399377f08 Ensure that command usage information always ends with a newline 2015-02-16 20:17:47 -05:00
lethosor b7f15ef2d6 Update xml, stonesense for 0.40 ui_advmode_menu changes
Closes #552
2015-02-16 19:10:15 -05:00
lethosor 10cfef0553 Fix whitespace issues 2015-02-14 22:53:06 -05:00
lethosor a8a8fc43ef Add df2console() wrapper
Closes #522
2015-02-13 17:56:29 -05:00
lethosor 56dfc66309 Implement map load/unload scripts and allow additional scripts to be registered 2015-02-11 15:03:47 -05:00
lethosor 37f391ea6d Don't store runScript() in script environments 2015-02-10 17:22:16 -05:00
lethosor 337598e0d6 Restore lua environment persistence and update modified timestamp correctly
See #544
2015-02-10 16:36:21 -05:00
lethosor e3b67b2985 Use short plugin name in error messages when possible 2015-02-09 22:06:33 -05:00
lethosor 15d3b7831f hide/show: Provide feedback on unsupported platforms 2015-02-08 09:30:40 -05:00
lethosor a1691b6777 Merge remote-tracking branch 'warmist/console-hide' into develop
Conflicts:
	library/Console-darwin.cpp
2015-02-08 09:20:05 -05:00
expwnent e5e0d93ef1 Added modtools/reaction-product-trigger. 2015-02-02 02:39:05 -05:00
expwnent 712892fb71 Only reload and recompile Lua scripts if they have moved or been updated. 2015-02-02 02:24:43 -05:00
expwnent bf5e491647 Allow Lua scripts to be used as modules. 2015-01-31 22:43:54 -05:00
expwnent 92bd6349a7 Fix listdir_recursive on Windows. 2015-01-31 22:28:17 -05:00
expwnent e9b4fc513a Merge remote-tracking branch 'cdombroski/zone-plugin-cleanup' into temp
Conflicts:
	NEWS
	plugins/zone.cpp
2015-01-31 21:01:41 -05:00
expwnent aa5d7c11bc Merge remote-tracking branches 'lethosor/patch-12' and 'lethosor/fs-expansion' into develop
Conflicts:
	NEWS
2015-01-31 20:25:01 -05:00
lethosor 066adfdf95 Implement a function to list directories recursively 2015-01-30 17:29:17 -05:00
lethosor 3ab558c72d Check for init.lua existence properly
Fixes #501
2015-01-30 16:37:23 -05:00
Chris Dombroski f608235b1e Fix some Lua things 2015-01-29 19:56:50 -05:00
Chris Dombroski f2eec3198c Rename findPenPitAtCoord 2015-01-29 15:02:54 -05:00
Chris Dombroski 868a9944fd Update LuaApi for new Units/Buildings functions. 2015-01-29 14:59:06 -05:00
Chris Dombroski 86495270a6 Remove duplicate isMilkable definition. 2015-01-29 14:40:09 -05:00
Chris Dombroski 48b6cf1beb Export functions to Buildings.h 2015-01-29 13:57:50 -05:00
Chris Dombroski 1514233aaa Add missing null checks to Units.cpp 2015-01-29 13:57:50 -05:00
lethosor daf739fcec Remove FIFO support 2015-01-28 21:39:17 -05:00
Chris Dombroski c179f5b913 Extract some stuff from zone.cpp to plugins/Units.{h,cpp} 2015-01-28 21:28:32 -05:00
lethosor f98e2964e6 Fix a few Windows compilation errors 2015-01-28 20:05:24 -05:00
lethosor bebceffa5f Add Filesystem::listdir() 2015-01-28 19:15:58 -05:00
lethosor e8c0482fdc Add atime()/ctime()/mtime() 2015-01-28 18:18:06 -05:00
lethosor 2e3261565c Clean up Filesystem.h 2015-01-28 17:15:09 -05:00
expwnent 1445b0a919 Allowed Lua scripts to share variables with run_script and corrected dfhack.findScript so that it can find save-specific scripts. 2015-01-26 21:45:31 -05:00
expwnent 4c5b6a5282 For multiline comments, delete the backslash instead of changing it to a space. 2015-01-26 19:24:31 -05:00
expwnent 1993c5fb1b Added support for multiline commands inside dfhack.init and the script command. 2015-01-26 17:18:30 -05:00
expwnent 4e447fc19a Update XML. 2015-01-25 14:08:42 -05:00
expwnent dda780eb8e Update xml. 2015-01-23 21:53:35 -05:00
lethosor a9f2c5bc90 Change MOD_* to DFH_MOD_*
MOD_* constants are defined in Winuser.h on Windows
2015-01-17 08:56:49 -05:00
lethosor 592d42c665 Update xml (0.40.24 OS X offsets) 2015-01-17 08:54:31 -05:00
lethosor 4d194da530 Merge remote-tracking branch 'origin/develop' into 0.40.24-dev 2015-01-17 08:53:49 -05:00
expwnent 14aa68a27f Merge remote-tracking branches 'lethosor/remove-embark', 'lethosor/search-menus', 'lethosor/osx-package-name', 'lethosor/expose-modstate' and 'lethosor/patch-11' into develop 2015-01-15 22:24:05 -05:00