Commit Graph

729 Commits (57fc0f3e89ae1bef6802dd24312117cc278812a9)

Author SHA1 Message Date
Alexander Gavrilov 92a3277777 Add a MemoryPatcher class as an optimization of scattered patchMemory.
This class can cache the set of memory regions during its lifetime,
and make them writable only once. This avoids e.g. re-reading
/proc/*/maps once for every modified vtable in interpose code.
2012-10-27 21:58:40 +04:00
Alexander Gavrilov 09f8e8e419 Start working on gui for workflow. 2012-10-23 21:42:03 +04:00
jj cfbdf47f6e follow rename Carried->Hauled in df-structures unit inventory mode 2012-10-22 19:37:12 +02:00
Alexander Gavrilov 0c9f1e0af4 Check the item type against job_item_vector_id when matching to jobs.
This will prevent setting an invalid item type via the job command.
2012-10-20 21:01:22 +04:00
Alexander Gavrilov 2b1d856214 Add a few utility functions to the lua api. 2012-10-20 17:06:33 +04:00
Alexander Gavrilov 2d4935bc17 Add lua API functions for verifying item and material vs job_item flags. 2012-10-17 19:16:18 +04:00
Alexander Gavrilov 2865e1373a Experimental API for associating tile bitmasks with persistent data.
Use block_square_event_world_constructionst objects with the same
bogus negative id as the matching historical figure object.
2012-10-11 17:34:34 +04:00
Alexander Gavrilov 5206236b01 Look through missing intermediate bases when interposing subclasses. 2012-10-11 15:10:19 +04:00
Warmist 923ea3f4b0 Reactionhooks more usefull and gm-editor minor tweaks (e.g. search in containers) 2012-10-07 20:44:18 +03:00
Alexander Gavrilov 459c69046b Dissolve the World module class into a namespace.
It made accessing persistent data way too cumbersome.
2012-10-06 13:46:20 +04:00
Alexander Gavrilov 5396a67465 Some tweaking and edited NEWS. 2012-10-06 12:40:46 +04:00
Alexander Gavrilov 7440e80e6c Add an API function to retrieve interface key bindings for display. 2012-10-02 13:49:31 +04:00
Petr Mrázek 8812238bf6 Update license, add contributors file, bump release number 2012-09-30 04:03:37 +02:00
Alexander Gavrilov 48da06ec37 Add an API function for reading the nominal skill level. 2012-09-29 15:18:04 +04:00
Alexander Gavrilov eaddd0e646 Try shutting up a few random warnings. 2012-09-29 12:47:41 +04:00
Alexander Gavrilov 164c61b638 Forbid stuff from bins in siege-engine, if forbid ammo standing order set. 2012-09-27 10:43:42 +04:00
Alexander Gavrilov 038d62367e Implement explicit hook priority in vmethod interpose.
This resolves a getName order conflict between power-meter and rename.
2012-09-22 13:14:06 +04:00
Alexander Gavrilov c39a337223 Add unit/item/job/building getter hook vmethods to dfhack_viewscreen. 2012-09-20 11:11:20 +04:00
Alexander Gavrilov 7ce772ae0e Add an API function that returns the selected building. 2012-09-20 10:41:03 +04:00
Alexander Gavrilov 36e44c682c Add a plugin implementing 'add spatter to item' reactions. 2012-09-17 21:15:51 +04:00
Alexander Gavrilov c1e20c6f05 Follow changes to structures. 2012-09-17 12:47:18 +04:00
Alexander Gavrilov 24772f4dbc Add an api function for destroying items. 2012-09-14 18:49:02 +04:00
Quietust 1d8c9a6a5f Merge https://github.com/danaris/dfhack 2012-09-13 14:30:44 -05:00
Alexander Gavrilov 7c71aeab5f Add function for making item projectiles. 2012-09-12 18:17:42 +04:00
Alexander Gavrilov 3a075f4bc7 Trivial siege engine aiming at units, with logic in lua. 2012-09-11 19:17:24 +04:00
Timothy Collett ccefd02ee3 Merge branch 'master' of git://github.com/angavrilov/dfhack 2012-09-10 11:56:23 -04:00
Timothy Collett 96abc903ab Merge branch 'master' of http://github.com/peterix/dfhack 2012-09-10 11:54:56 -04:00
Timothy Collett 274d6038ad Merge further changes (???) 2012-09-10 09:19:21 -04:00
Alexander Gavrilov 9679b7729c Clean up the movement speed calculation function and move into the core. 2012-09-09 17:04:58 +04:00
Alexander Gavrilov ec3d489bda Move curse-affected attribute value getters to the core. 2012-09-09 12:51:08 +04:00
Alexander Gavrilov a36fe25e72 Finish the effective skill computation function, and move to core. 2012-09-09 12:27:40 +04:00
Alexander Gavrilov e925d8f4d9 Add an API function for reading tiles from the screen buffers. 2012-09-07 11:36:45 +04:00
Alexander Gavrilov c971a819de Experimental creation of map blocks in gui/liquids script. 2012-09-06 22:45:19 +04:00
Alexander Gavrilov 57086ac56e Add stock MessageBox and InputBox dialog screens for lua scripts. 2012-09-05 19:45:45 +04:00
Alexander Gavrilov 3b8e3d1459 Fix wrong assumptions in lua wrapper for BitArray. 2012-09-02 17:18:01 +04:00
Alexander Gavrilov 3713c5ea9e Add some APIs required by steam engine to the core. 2012-09-02 14:10:58 +04:00
Alexander Gavrilov e0097d8d43 Fix access to unnamed bits in bitfields, and allow hook.apply(false) 2012-09-01 11:25:24 +04:00
Alexander Gavrilov f1915915b4 Follow change in xml again. 2012-08-27 23:03:02 +04:00
Alexander Gavrilov 3402a3cd5d Fix a deadlock problem between suspend in (un)load, and onupdate. 2012-08-26 14:43:14 +04:00
Alexander Gavrilov 7f1e4b46bc Implement inheritance-aware vmethod interposing.
I.e. overwriting the vmethod in all vtables that use it, not only one.
2012-08-26 14:43:14 +04:00
Alexander Gavrilov 41ad42d0fd Expose the liquids plugin engine to lua, and make a wrapper gui script. 2012-08-25 10:37:03 +04:00
Alexander Gavrilov 8359e80b23 Expose a few API functions to lua, and implement a room browser overlay. 2012-08-24 18:26:18 +04:00
Alexander Gavrilov e825dc5ddb Tweak the API for current viewscreen, and dispatch show/dismiss from C++. 2012-08-24 13:20:08 +04:00
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
Quietust 1e28ceff6d Add getProfessionColor and getCasteProfessionColor to Units module 2012-08-22 16:54:00 -05:00
Alexander Gavrilov 7987ea9a98 Put some compatibility features into the base dfhack viewscreen. 2012-08-22 18:18:19 +04:00
Alexander Gavrilov 8969fc9435 manipulator: Inherit from dfhack_viewscreen, and don't use itoa. 2012-08-22 12:23:56 +04:00
Quietust 51ba252344 Add Screen::drawBorder(string), duplicates DF's interfacest::drawborder() 2012-08-21 15:28:11 -05: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 b8ee52131b Add a module for painting tiles into the gps global. 2012-08-19 09:31:09 +04:00
Alexander Gavrilov fd0bf2ef92 Extract the color enum from color_ostream to toplevel. 2012-08-19 09:21:25 +04:00
Alexander Gavrilov c6694e386f Add rather inefficient type_identity wrapping for std::set.
Accessing an element is O(N), as if it was walking a list.
2012-08-18 14:34:20 +04:00
Alexander Gavrilov 24cc8b5c7a Expose an API to claim the suspend lock from the Core.
Previously it was hard-coded in Core::Update, but interposed
vmethods may need this feature too.
2012-08-18 11:52:38 +04:00
Alexander Gavrilov 01ba2a31fc Tweak the interpose API, and fix a couple of bugs. 2012-08-18 11:48:07 +04:00
Alexander Gavrilov 236ffd578b Add experimental support for interposing vmethods of known classes.
The hairiest bit is the abuse of compiler-specific pointer-to-member
internals in order to provide more or less transparent API.
2012-08-17 22:40:53 +04:00
Alexander Gavrilov bcc41c081a Add a utility function for patching read-only memory. 2012-08-17 15:07:48 +04:00
Petr Mrázek a5977db443 Merge https://github.com/jjyg/dfhack 2012-07-09 01:13:07 +02:00
jj 8e17ebbefc add SC_PAUSED / SC_UNPAUSED onStateChange events 2012-07-05 18:03:02 +02:00
jj a7a25b80a0 ruby: use the color_ostream argument from dfhack to output to dfhack-run 2012-07-03 16:13:15 +02:00
Timothy Collett c24333515b Merge branch 'master' of https://github.com/jjyg/dfhack
Conflicts:
	library/Core.cpp

Starting to merge in Ruby stuffs
2012-07-02 11:07:30 -04:00
Timothy Collett 6f433ff58f Move back to using interposition to be more portable 2012-06-29 10:15:48 -04:00
jj 552da8417e ruby: handle .rb files in df/hack/scripts/ 2012-06-24 20:24:46 +02:00
Alexander Gavrilov 752da9ced5 Move formatting newly-found globals for symbols.xml to lua code. 2012-06-21 21:26:25 +04:00
Timothy Collett 9b941bcd4d Merge branch 'master' of https://github.com/angavrilov/dfhack
Trying out angavrilov's changes
2012-06-18 09:29:20 -04:00
Alexander Gavrilov db91850464 Sync to the change in gamemode/gametype globals. 2012-06-16 14:42:56 +04:00
Timothy Collett c6700585bc Merge branch 'master' of github.com:peterix/dfhack 2012-06-14 09:59:53 -04:00
Timothy Collett 19595f5225 Disable a whole bunch of no-longer-necessary debug output 2012-06-14 09:55:34 -04:00
Petr Mrázek 316973c463 Re-add fake SDL headers, get rid of real SDL use. 2012-06-14 02:15:43 +02:00
Petr Mrázek 52f9fe4a6a Merge https://github.com/danaris/dfhack
Conflicts:
	depends/clsocket
2012-06-14 00:00:36 +02:00
Petr Mrázek 5e011ac217 Merge https://github.com/jjyg/dfhack 2012-06-13 23:56:26 +02:00
Alexander Gavrilov c50b605dfc Support casting references and allocating arrays of numbers in lua wrapper. 2012-06-13 22:26:54 +04:00
jj 95606ee3dc Merge branch 'master' of git://github.com/angavrilov/dfhack 2012-06-11 16:00:00 +02:00
Alexander Gavrilov b7edbf2076 Support 7-argument vmethods. 2012-06-05 14:00:52 +04:00
jj b612532348 export openplugin/lookupplugin from plugin manager 2012-06-02 23:35:05 +02:00
Timothy Collett 7ec0fd6fc0 Trying to set up an autorelease pool, but not yet succeeding. 2012-05-26 16:08:15 -04:00
Timothy Collett 1dd4cc5667 More work on getting dfhack building & compiling on Mac OS X 2012-05-25 14:28:59 -04:00
Timothy Collett 44c3afc306 Merge git://github.com/quietust/dfhack
Gotta get the changes that prevent DFHack from crashing.
2012-05-24 15:39:11 -04:00
Timothy Collett 24d221052b Initial changes to get dfhack building on the Mac 2012-05-24 11:31:20 -04:00
Quietust 9a73ea9f14 Cleanup World module to use df::global, and fix crashes when control_mode/game_mode are missing 2012-05-23 12:51:03 -05: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 d28d240dbd Merge remote-tracking branch 'kmartin/master' 2012-05-20 11:03:41 +04:00
Alexander Gavrilov 1b4a24c827 Support using focus strings to limit keybinding scope. 2012-05-19 21:31:42 +04:00
Petr Mrázek 51f06c78fc Merge https://github.com/playfordh/dfhack
Conflicts:
	library/include/modules/Items.h
	library/modules/Items.cpp
2012-05-19 19:09:13 +02: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
Petr Mrázek ed6da7618a Merge https://github.com/warmist/dfhack 2012-05-18 17:41:09 +02:00
Alexander Gavrilov 3c44e22760 Support trade viewscreens in Items::getSelectedItem. 2012-05-18 17:54:05 +04:00
Warmist 48185568e9 Added df::Items::moveToBuilding. Moved item from ground to building, usefull for museum forts (placing items on tables) 2012-05-18 16:05:29 +03:00
Alexander Gavrilov e9ef9b87b5 Add central locations for onUpdate and onStateChange handling in core. 2012-05-17 20:04:09 +04:00
harlanplayford 27ca317871 Added new method - Items::moveToInventory(...)
Signed-off-by: playfordh <harlanplayford@gmail.com>
2012-05-15 06:01:59 -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 3bd44e5367 Move some things that won't work in dfhack-client to a separate file. 2012-05-05 21:07:18 +04:00
Alexander Gavrilov 81f2240c23 Fix some things that confuse MSVC. 2012-05-05 20:46:28 +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 d4d6349f48 Expose builtin commands to dfhack-run, and add lua script support.
Move builtin command implementation to Core methods, and fall
back to hack/scripts/*.lua for otherwise unrecognized commands.
2012-05-04 19:47:18 +04:00
Alexander Gavrilov 5afe2ca002 Update dfhack for specific_ref. 2012-05-03 11:47:04 +04:00