Commit Graph

1190 Commits (eff5189acb039da0b7b74f94c5cf352bcfe73cb7)

Author SHA1 Message Date
Petr Mrázek a45e83ef14 Merge pull request #146 from wjrogers/feature-protobuf-api
Add ListJobSkills protobuf API
2012-04-04 16:46:20 -07:00
Will Rogers 1b6f5f3f34 Add additional related data to ListJobSkills.
Add the attributes for profession and unit_labor, and (re)name the
protobuf messages JobSkillAttr, ProfessionAttr, and UnitLaborAttr to
better reflect their content and distinguish them from e.g. the
SkillInfo message included in BasicUnitInfo.
2012-04-04 11:53:47 -04:00
Alexander Gavrilov 7efbd798ce Upgrade lua errors to structures when attaching stack trace.
This allows detecting when it's re-thrown and avoiding attaching the
stack twice, and so on. Would also be useful if debugging is added.
2012-04-04 13:34:07 +04:00
Alexander Gavrilov 81fb57a853 Add color output and input prompt support to core lua api. 2012-04-04 10:40:33 +04:00
Will Rogers 7e896277ec Don't export describeJobSkills. 2012-04-03 14:22:46 -04:00
Will Rogers 59d7b6faab Add ListJobSkills. 2012-04-03 14:03:06 -04:00
Alexander Gavrilov 2d4af4ac3e A few more utility functions for lua. 2012-04-03 20:02:01 +04:00
Alexander Gavrilov 42a9b0a592 Make Core::Suspend safe in plugin_onupdate by pretending to hold the lock.
It is in essence true that OnUpdate owns the suspend lock, so
expose it officially to the recursive suspend lock mechanics.
2012-04-03 13:29:59 +04:00
Alexander Gavrilov 444377f9db Finish documenting the DFHack core lua api existing so far. 2012-04-03 13:13:44 +04:00
Alexander Gavrilov a8fe0eccb4 Add functions for checking validity of lua wrapper objects. 2012-04-02 22:02:04 +04:00
Petr Mrázek 467f4108ae Track structures 2012-04-02 13:42:56 +02:00
Petr Mrázek 2a998a5b8a Merge https://github.com/quietust/dfhack 2012-04-02 13:42:18 +02:00
Quietust 06da0f9720 Fix coord/coord2d division/modulo operators to properly handle negative numbers (fixes some glitches with revflood and possibly other utils) 2012-04-01 19:44:35 -05:00
Alexander Gavrilov d109b6570b Add dfhack.with_suspend(f[, args...]) that calls f with core suspended.
The lock is properly removed in case of error, which is then propagated.
Just for fun, it also can be yielded from within in a coroutine.
2012-04-01 19:38:42 +04:00
Alexander Gavrilov e3d50b9b04 Optimize wrapper: use pointers instead of strings as most frequent keys. 2012-04-01 18:34:04 +04:00
Alexander Gavrilov 604c84953b Fix a bug: LookupTypeInfo cannot assume the result is userdata. 2012-04-01 17:59:47 +04:00
Alexander Gavrilov a3e526abdb Add df.is_instance(a,b) to check if typeof(b) is subtype of typeof(a).
Allows both objects and types as arguments. Also accepts nil and
primitives as b, returning nil.
2012-04-01 17:32:57 +04:00
Alexander Gavrilov edd63080b5 Only print the shortcut help once in the lua interactive mode. 2012-04-01 17:00:25 +04:00
Alexander Gavrilov afe4eba957 Improve performance of the persistent data api, and wrap it for lua.
Use an stl table for string keys to avoid linear cost of lookup.

This uncovered a bug in the new luaL_getsubtable function.
2012-04-01 16:43:40 +04:00
Alexander Gavrilov a9a6fbd8b5 Lua tweaks: a couple of functions, dfusion tweak, backtrace metadata. 2012-04-01 12:50:56 +04:00
Petr Mrázek 7ff728b6fc Track world and map changes separately for plugin_onstatechange 2012-04-01 02:56:54 +02:00
Petr Mrázek 209b261284 Get rid of MALLOC_FILL build option 2012-04-01 00:30:42 +02:00
Petr Mrázek 4bac6edd79 Merge https://github.com/rh73/dfhack 2012-04-01 00:29:00 +02:00
Alexander Gavrilov 9d6e26fa5f Fix crashing color_ostream::printerr due to vfprintf vs fprintf mixup.
Also enable heap clearing in gdb mode, and fix a few newlines.
2012-03-31 22:26:41 +04:00
Robert Heinrich 39787e9cd5 Renamed digging commands to uniformly start with 'dig*'(vdig -> digv etc). Added command digl, diglx (dig layerstone instead of veins). Updated readme.rst. 2012-03-31 15:41:55 +02:00
Alexander Gavrilov 0f41608ed4 Pull console output support and REPL out of dfusion into core lib. 2012-03-31 15:40:54 +04:00
Alexander Gavrilov 9384f0c842 Update lua to 5.2 and fix obvious breakage due to obsolete api. 2012-03-31 12:11:43 +04:00
Alexander Gavrilov 10b610669f Give some sensible looking names to the arrays in pregnancy_ptr. 2012-03-31 10:31:45 +04:00
Petr Mrázek a01f512733 Track structures 2012-03-31 01:33:14 +02:00
Petr Mrázek 543f3970db Tweak readme, bump version to 0.34.07 2012-03-31 01:13:21 +02:00
Petr Mrázek 5d8415c8d9 Merge https://github.com/warmist/dfhack
Conflicts:
	plugins/Dfusion/luafiles/init.lua
2012-03-30 20:32:57 +02:00
Alexander Gavrilov 81bc73f435 Follow a typo fix in flag name. 2012-03-30 10:44:52 +04:00
Quietust 07bb51946f Fix bug in MapCache - squash veins with the correct priority 2012-03-29 18:59:07 -05:00
Alexander Gavrilov ec48405f0a Fix mistake: static initialization code cannot access other static objects.
Specifically, the eid->type() call depends on the order of linking.
2012-03-29 22:56:06 +04:00
Petr Mrázek 004acdad4e Tweaks!
Strip commands.clear() from all plugins
Fix changeitem - a variable name has changed in item flags
2012-03-29 18:37:22 +02:00
Robert Heinrich cc54d5dfa9 Merge branch 'master' of git://github.com/angavrilov/dfhack
Conflicts:
	library/xml
2012-03-29 16:12:54 +02:00
Robert Heinrich 9b75373403 Merge branch 'master' of git://github.com/peterix/dfhack
Conflicts:
	library/xml
2012-03-29 16:03:12 +02:00
Robert Heinrich 88c914142b added plugin changeitem (change material type and base quality) 2012-03-29 15:33:54 +02:00
Alexander Gavrilov a9b7c74a23 Allow assigning NULL lightuserdata to pointers, and export a global.
Otherwise there is no way to specify NULL via recursive lua table assign.
2012-03-29 14:47:33 +04:00
Alexander Gavrilov 85c91c92d8 Implement __pairs and __ipairs for DF objects.
Structs enumerate fields in memory order in pairs().
Containers & biftields enumerate int indexes in ipairs, and
string keys in pairs (i.e. using index-enum for arrays).
2012-03-29 14:39:13 +04:00
Alexander Gavrilov 17ff235c81 Use codegen.out.xml instead of static.inc in cmake code generation rules.
Now only that file is guaranteed to always be overwritten.
2012-03-29 10:59:54 +04:00
Petr Mrázek d82120a3db More fixes
Include unistd.h in linux process file
Fix assert in autolabor
Don't print 'script missing' error on DF start
2012-03-29 02:49:44 +02:00
Petr Mrázek 757ad3334c Track structures 2012-03-29 00:27:03 +02:00
Petr Mrázek 6235d2e801 Merge https://github.com/angavrilov/dfhack 2012-03-28 19:53:10 +02:00
Quietust 95ec363a7f Merge branch 'master' of https://github.com/peterix/dfhack
Conflicts:
	library/LuaTypes.cpp
	library/LuaWrapper.cpp
2012-03-28 11:51:49 -05:00
Alexander Gavrilov e4e643f9d2 Clear the command vector during plugin load and unload to avoid confusion. 2012-03-28 18:47:03 +04:00
Alexander Gavrilov b7ff7681ac Merge remote-tracking branch 'peterix/master' 2012-03-28 15:07:13 +04:00
Petr Mrázek 06188da380 Track structures 2012-03-28 12:46:50 +02:00
Petr Mrázek 40cf5fe538 Track structures 2012-03-28 11:46:23 +02:00
Alexander Gavrilov 929657bed4 Disable pointer auto-vivification unless new is specified.
Since it is essentially allocating non-gc managed objects,
it can lead to memory leaks and shouldn't happen invisibly.
Also support using the 'assign' key to request assign()
from another object before processing the current map.
2012-03-28 17:00:07 +08:00