diff options
| author | Alexander Gavrilov | 2012-04-15 19:09:25 +0400 |
|---|---|---|
| committer | Alexander Gavrilov | 2012-04-15 19:09:25 +0400 |
| commit | 14709e5d4598e11ddce6f9d2cce734528d842ca5 (patch) | |
| tree | b1370d42d766b329b1ce8fc5431b4e7abf04a4b8 /Lua API.html | |
| parent | cb27a1d83916b333d1a0d1b5aa24a7f371e120af (diff) | |
| download | dfhack-14709e5d4598e11ddce6f9d2cce734528d842ca5.tar.gz dfhack-14709e5d4598e11ddce6f9d2cce734528d842ca5.tar.bz2 dfhack-14709e5d4598e11ddce6f9d2cce734528d842ca5.tar.xz | |
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.
Diffstat (limited to 'Lua API.html')
| -rw-r--r-- | Lua API.html | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lua API.html b/Lua API.html index 66385840..38a375d8 100644 --- a/Lua API.html +++ b/Lua API.html @@ -344,6 +344,7 @@ ul.auto-toc { <li><a class="reference internal" href="#maps-module" id="id18">Maps module</a></li> </ul> </li> +<li><a class="reference internal" href="#core-interpreter-context" id="id19">Core interpreter context</a></li> </ul> </li> </ul> @@ -1010,6 +1011,18 @@ Returns <em>false</em> in case of error.</p> </ul> </div> </div> +<div class="section" id="core-interpreter-context"> +<h2><a class="toc-backref" href="#id19">Core interpreter context</a></h2> +<p>While plugins can create any number of interpreter instances, +there is one special context managed by dfhack core. It is the +only context that can receive events from DF and plugins.</p> +<p>Core context specific functions:</p> +<ul> +<li><p class="first"><tt class="docutils literal">dfhack.is_core_context</tt></p> +<p>Boolean value; <em>true</em> in the core context.</p> +</li> +</ul> +</div> </div> </div> </body> |
