Commit Graph

107 Commits (b976053be054b902a478ce034f06899219b402ec)

Author SHA1 Message Date
Alexander Gavrilov c6c5ad56c9 Track lua event listener count, and let the C++ host know.
This allows completely avoiding the call overhead if there
are none. The downside is that the event object now has to
be a userdata with lots of metamethods.
2012-08-23 19:27:28 +04:00
Alexander Gavrilov 2b79582e99 Implement a policy of marking DFHack-owned screens with a signature. 2012-08-22 12:28:01 +04:00
Alexander Gavrilov 38a07a4ca5 Export the tile finder function to lua, and improve mouse event reporting. 2012-08-19 20:00:10 +04:00
Alexander Gavrilov 30f71ff510 Implement support for lua-backed viewscreens. 2012-08-19 14:27:44 +04:00
Alexander Gavrilov bcc41c081a Add a utility function for patching read-only memory. 2012-08-17 15:07:48 +04:00
Alexander Gavrilov 07dc20055a Tweak documentation for utils.make_sort_order and devel/prepare-save 2012-06-30 16:25:41 +04:00
Alexander Gavrilov 9046fed648 Add documentation for some utility functions implemented in lua. 2012-06-24 12:51:19 +04:00
Alexander Gavrilov bd37cc09c5 Update the Lua API document with info about scripts. 2012-06-22 20:17:55 +04:00
Alexander Gavrilov 65e82f7c12 Support controllable error presentation verbosity in lua code.
Use qerror to squash stack traces and location prefix.
2012-06-22 16:36:50 +04:00
Alexander Gavrilov 752da9ced5 Move formatting newly-found globals for symbols.xml to lua code. 2012-06-21 21:26:25 +04:00
Alexander Gavrilov e687a07f2e Fix getRebaseDelta: should be signed int. 2012-06-19 21:02:27 +04:00
Alexander Gavrilov fa41a27f26 Add an api function to get vtable address from version info. 2012-06-17 14:26:27 +04:00
Alexander Gavrilov dc5bef2cb8 Add lua internal api functions needed for scanning memory. 2012-06-16 13:33:49 +04:00
Alexander Gavrilov 7eb4fc19de Make dfhack.run_script usable from other scripts, and document it. 2012-06-14 12:46:12 +04:00
Petr Mrázek eaac32c765 Version bump and text updates. 2012-06-14 00:29:01 +02:00
Alexander Gavrilov 149f175909 Make primitive refs (i.e. pointers to numbers, etc) behave as arrays. 2012-06-13 22:40:39 +04:00
Alexander Gavrilov c50b605dfc Support casting references and allocating arrays of numbers in lua wrapper. 2012-06-13 22:26:54 +04:00
Alexander Gavrilov 8d7cf092fd Add Lua API for access to some contextual and low-level info. 2012-06-13 21:12:36 +04:00
Alexander Gavrilov 24e2c15113 Enhance docs on bitfield refs to cover a question raised on chat recently. 2012-06-13 11:00:54 +04:00
Alexander Gavrilov 9adf310d7f Update Units::isCitizen after looking at game-over detection code. 2012-05-22 12:31:37 +04:00
Alexander Gavrilov b992b04f0b Remove stuff that shouldn't be in the core, and expose to lua what's left.
Specifically, any "if (verbose) { Core::printerr("blah") }" kind
of stuff definitely doesn't belong in the common API functions.
Also, ref->getUnit() is very expensive.

On the other hand, checks for crash-inducing conflicts with the
ui should be in the core api, and not in client plugins.
2012-05-20 21:57:45 +04:00
Alexander Gavrilov 7774f5f2c1 Add a mechanism converting ui focus to a string representation.
The idea is to make ui handling more modular, dispensing with
huge functions that switch or if/else on lots of variables.
For now, used to split up functions in the sort plugin.
2012-05-19 19:50:36 +04:00
Alexander Gavrilov 2c0024adc9 Make Items::getPosition exactly match the DF original in behavior. 2012-05-17 19:56:55 +04:00
Alexander Gavrilov dbd39af58a Support testing and modifying pending timeout callbacks. 2012-05-16 17:06:08 +04:00
Alexander Gavrilov 642a625586 Support custom buildings in dfhack.buildings.getFiltersByType.
Also document it and constructBuilding in Lua API docs.
2012-05-13 18:39:00 +04:00
Alexander Gavrilov 87ec1de891 Improve lua api for tile biome access. 2012-05-13 13:58:41 +04:00
Alexander Gavrilov c6b52067bd Request designation rescan in auto-growing burrows.
This improves performance of burrowed miners digging 1-wide tunnels.
2012-05-12 20:54:26 +04:00
Alexander Gavrilov 60bb486aba Add api for enabling liquid and temperature updates for blocks.
Now updates also have to be enabled for the z level to work.
2012-05-12 20:12:09 +04:00
Alexander Gavrilov 9ad8d767b4 Add code for adding abstract buildings and removing constructions. 2012-05-06 19:09:11 +04:00
Alexander Gavrilov b70130cf36 Add a couple more building api functions. 2012-05-06 11:22:55 +04:00
Alexander Gavrilov 7e01b004e9 Implement timeouts in the core lua context, and quicksave script. 2012-05-04 20:59:06 +04:00
Alexander Gavrilov 5afe2ca002 Update dfhack for specific_ref. 2012-05-03 11:47:04 +04:00
Alexander Gavrilov 28b5068382 Allow both coordinate object and (x,y,z) as arguments to getTileBlock. 2012-05-02 12:50:05 +04:00
Alexander Gavrilov eadce95940 Add a convenience function for designating constructions. 2012-05-01 19:55:25 +04:00
Alexander Gavrilov 4cffb6428d Update building creation code with new knowledge, and fix zone.
Also, document new lua api, and add a more convenient wrapper.
2012-05-01 18:55:30 +04:00
Alexander Gavrilov 82a0e52a3e Add api to check the walkable cache, and update flow_forbid in liquids. 2012-04-26 18:51:39 +04:00
Alexander Gavrilov 16ee049664 Split off the burrows api from Maps and Units. 2012-04-26 12:56:28 +04:00
Alexander Gavrilov 6ab270d129 Retrieve unit noble position info, and use it in getProfessionName. 2012-04-26 12:03:56 +04:00
Alexander Gavrilov 763a301b4f Add a few more lua api functions, documentation, and unit sort orders.
Units::getProfessionName appears to work correctly for
everything except nobles.
2012-04-23 21:30:53 +04:00
Alexander Gavrilov 378a1fb914 Support the '#' string as index for wrapper vector insert at end. 2012-04-17 12:15:45 +04:00
Alexander Gavrilov 3beb2ebf25 Export the onStateChange event to core lua context & add some docs. 2012-04-17 11:45:09 +04:00
Alexander Gavrilov 14709e5d45 Add an official core lua context, and allow plugins to send events to it.
- This context requires core suspend lock and asserts it in a few places.
- Special 'event' objects are introduced. They can be invoked as
  functions, in which case they iterate all their fields and call
  them as functions. Errors are printed and consumed.
- When a plugin is opened by the core context, events registered in
  a special array are linked to it. The system is organized so as to
  avoid even trying to pass the event to lua if the module isn't loaded.
2012-04-15 19:09:25 +04:00
Alexander Gavrilov 7a34a89f53 Add burrow subcommands to modify burrow unit and tile sets. 2012-04-14 14:12:59 +04:00
Alexander Gavrilov 37cfb1fdcd Add unit position and container api. 2012-04-13 16:10:19 +04:00
Alexander Gavrilov 2d8611a480 Add core api for moving items between ground and containers. 2012-04-12 18:37:27 +04:00
Alexander Gavrilov 5d5502ae34 Update the item owner modification api and export it to lua. 2012-04-11 20:10:31 +04:00
Alexander Gavrilov 0c2b78b96b Add api for manipulating burrows to the core. 2012-04-11 19:42:05 +04:00
Alexander Gavrilov 61245711f7 Export a few maps functions to lua. 2012-04-11 16:20:16 +04:00
Alexander Gavrilov 93c795cfc3 Job module api tweaks: add a namespace to match others and some funcs. 2012-04-10 11:43:36 +04:00
Alexander Gavrilov 0e0740fddf Stop printall(df.global) from breaking if there are unknown addresses. 2012-04-10 10:34:03 +04:00
Alexander Gavrilov 45ae2ed67f Pull a few utility functions into the core and publish to lua. 2012-04-07 19:08:30 +04:00
Alexander Gavrilov e74788cb26 Add a generic facility for object finalization during stack unwind.
Supports two modes of finalization:

- try {...} finally {...}
- try {...} catch { ...; throw }

Argument passing discipline is designed with vararg tail calls in mind.
2012-04-07 14:21:38 +04:00
Alexander Gavrilov 0daafef690 Wrap MaterialInfo for lua. 2012-04-06 19:56:19 +04:00
Alexander Gavrilov 903e9ee716 Export a few more functions to lua. 2012-04-06 11:21:28 +04:00
Alexander Gavrilov 9eed9f0d24 Wrap a few utility functions defined on the c++ side for lua. 2012-04-05 19:55:59 +04:00
Petr Mrázek a6dd17919f Update Lua API doc html. 2012-04-05 02:42:08 +02:00
Petr Mrázek 7fa4ffeb9e Add a html version of the LUA API doc, package it. 2012-04-05 02:39:38 +02:00