summaryrefslogtreecommitdiff
path: root/library/LuaTypes.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update license, add contributors file, bump release numberPetr Mrázek2012-09-301-2/+2
|
* Fix access to unnamed bits in bitfields, and allow hook.apply(false)Alexander Gavrilov2012-09-011-2/+2
|
* Implement support for lua-backed viewscreens.Alexander Gavrilov2012-08-191-0/+22
|
* Add rather inefficient type_identity wrapping for std::set.Alexander Gavrilov2012-08-181-0/+3
| | | | Accessing an element is O(N), as if it was walking a list.
* Make primitive refs (i.e. pointers to numbers, etc) behave as arrays.Alexander Gavrilov2012-06-131-2/+24
|
* Update dfhack for specific_ref.Alexander Gavrilov2012-05-031-7/+20
|
* Implement unconstructed building instance creation and linking into world.Alexander Gavrilov2012-04-291-0/+5
| | | | | | For more flexibility, the base api is split into 3 phases: alloc, setSize, and construct. No support for non-actual buildings like stockpiles and activity zones at the moment.
* Enable warnings correctly on linux and fix a lot of them.Alexander Gavrilov2012-04-201-29/+0
|
* Support the '#' string as index for wrapper vector insert at end.Alexander Gavrilov2012-04-171-3/+12
|
* Add an official core lua context, and allow plugins to send events to it.Alexander Gavrilov2012-04-151-4/+14
| | | | | | | | | | - 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.
* Allow plugins to export functions to lua with safe reload support.Alexander Gavrilov2012-04-141-0/+6
| | | | | | | | | | | | | | | | | | - To ensure reload safety functions have to be wrapped. Every call checks the loaded state and locks a mutex in Plugin. If the plugin is unloaded, calling its functions throws a lua error. Therefore, plugins may not create closures or export yieldable functions. - The set of function argument and return types supported by LuaWrapper is severely limited when compared to being compiled inside the main library. Currently supported types: numbers, bool, std::string, df::foo, df::foo*, std::vector<bool>, std::vector<df::foo*>. - To facilitate postponing initialization until after all plugins have been loaded, the core sends a SC_CORE_INITIALIZED event. - As an example, the burrows plugin now exports its functions.
* Export a few maps functions to lua.Alexander Gavrilov2012-04-111-0/+9
|
* Stop printall(df.global) from breaking if there are unknown addresses.Alexander Gavrilov2012-04-101-6/+9
|
* Wrap a few utility functions defined on the c++ side for lua.Alexander Gavrilov2012-04-051-5/+28
|
* Experimental: try wrapping a dfhack api function.Alexander Gavrilov2012-04-051-3/+8
|
* Optimize wrapper: use pointers instead of strings as most frequent keys.Alexander Gavrilov2012-04-011-3/+3
|
* Update lua to 5.2 and fix obvious breakage due to obsolete api.Alexander Gavrilov2012-03-311-2/+2
|
* Allow assigning NULL lightuserdata to pointers, and export a global.Alexander Gavrilov2012-03-291-1/+8
| | | | Otherwise there is no way to specify NULL via recursive lua table assign.
* Implement __pairs and __ipairs for DF objects.Alexander Gavrilov2012-03-291-30/+208
| | | | | | 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).
* Merge branch 'master' of https://github.com/peterix/dfhackQuietust2012-03-281-2/+13
|\ | | | | | | | | | | Conflicts: library/LuaTypes.cpp library/LuaWrapper.cpp
| * Disable pointer auto-vivification unless new is specified.Alexander Gavrilov2012-03-281-1/+12
| | | | | | | | | | | | | | 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.
| * Implement recursive transfer of values from lua to c++ structures.Alexander Gavrilov2012-03-281-2/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | E.g. df.global.cursor = { x = 1, y = 2, z = 3 }. The lua data must be represented by raw lua tables. For structs, the entries in the table are assigned to matching fields. For containers, if a 'resize' field is missing or nil, the table is treated like 1-based lua array, and the container is resized to match its # length. Otherwise, the field must be either an explicit number, true or false. If it is true, the size is selected by the highest index in the table. After that, entries are copied using 0-based indices. For pointers, the table must match the target object. If the pointer is null, the object is auto-allocated; this can be controlled using the 'new' field, the value of which will be passed to df.new().
* | Implement recursive transfer of values from lua to c++ structures.Alexander Gavrilov2012-03-271-2/+68
|/ | | | | | | | | | | | | | | | | E.g. df.global.cursor = { x = 1, y = 2, z = 3 }. The lua data must be represented by raw lua tables. For structs, the entries in the table are assigned to matching fields. For containers, if a 'resize' field is missing or nil, the table is treated like 1-based lua array, and the container is resized to match its # length. Otherwise, the field must be either an explicit number, true or false. If it is true, the size is selected by the highest index in the table. After that, entries are copied using 0-based indices. For pointers, the table must match the target object. If the pointer is null, the object is auto-allocated; this can be controlled using the 'new' field, the value of which will be passed to df.new().
* Make enum attributes accessible through the lua wrapper.Alexander Gavrilov2012-03-251-0/+14
| | | | TODO: make them completely read-only.
* Attach static methods to the type objects in the lua wrapper.Alexander Gavrilov2012-03-251-0/+27
|
* Expose virtual methods in the lua wrapper.Alexander Gavrilov2012-03-251-22/+95
|
* Support resize/erase/insert for containers, and allow any index in BitArray.Alexander Gavrilov2012-03-241-7/+114
|
* Split LuaWrapper.cpp into two files.Alexander Gavrilov2012-03-241-0/+872