diff options
| author | Alexander Gavrilov | 2012-04-05 19:55:59 +0400 |
|---|---|---|
| committer | Alexander Gavrilov | 2012-04-05 19:55:59 +0400 |
| commit | 9eed9f0d246f44a51266a05e0107ea22fea54e73 (patch) | |
| tree | 72eb99e5ca85311b7a486f8e4036b9dd703ae3d4 /Lua API.html | |
| parent | 28a741082f8b0981806b8a63589279627bd8e39e (diff) | |
| download | dfhack-9eed9f0d246f44a51266a05e0107ea22fea54e73.tar.gz dfhack-9eed9f0d246f44a51266a05e0107ea22fea54e73.tar.bz2 dfhack-9eed9f0d246f44a51266a05e0107ea22fea54e73.tar.xz | |
Wrap a few utility functions defined on the c++ side for lua.
Diffstat (limited to 'Lua API.html')
| -rw-r--r-- | Lua API.html | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/Lua API.html b/Lua API.html index 25b6f06d..877bdbd8 100644 --- a/Lua API.html +++ b/Lua API.html @@ -335,6 +335,11 @@ ul.auto-toc { </li> <li><a class="reference internal" href="#dfhack-utilities" id="id10">DFHack utilities</a><ul> <li><a class="reference internal" href="#persistent-configuration-storage" id="id11">Persistent configuration storage</a></li> +<li><a class="reference internal" href="#c-function-wrappers" id="id12">C++ function wrappers</a><ul> +<li><a class="reference internal" href="#gui-module" id="id13">Gui module</a></li> +<li><a class="reference internal" href="#job-module" id="id14">Job module</a></li> +</ul> +</li> </ul> </li> </ul> @@ -753,6 +758,59 @@ and automatically stored in the save game, these save and retrieval functions can just copy values in memory without doing any actual I/O. However, currently every entry has a 180+-byte dead-weight overhead.</p> </div> +<div class="section" id="c-function-wrappers"> +<h2><a class="toc-backref" href="#id12">C++ function wrappers</a></h2> +<p>Thin wrappers around C++ functions, similar to the ones for virtual methods.</p> +<div class="section" id="gui-module"> +<h3><a class="toc-backref" href="#id13">Gui module</a></h3> +<ul> +<li><p class="first"><tt class="docutils literal">dfhack.gui.getSelectedWorkshopJob(silent)</tt></p> +<p>When a job is selected in <em>'q'</em> mode, returns the job, else +prints error unless silent and returns <em>nil</em>.</p> +</li> +<li><p class="first"><tt class="docutils literal">dfhack.gui.getSelectedJob(silent)</tt></p> +<p>Returns the job selected in a workshop or unit/jobs screen.</p> +</li> +<li><p class="first"><tt class="docutils literal">dfhack.gui.getSelectedUnit(silent)</tt></p> +<p>Returns the unit selected via <em>'v'</em>, <em>'k'</em>, unit/jobs, or +a full-screen item view of a cage or suchlike.</p> +</li> +<li><p class="first"><tt class="docutils literal">dfhack.gui.getSelectedItem(silent)</tt></p> +<p>Returns the item selected via <em>'v'</em> ->inventory, <em>'k'</em>, <em>'t'</em>, or +a full-screen item view of a container. Note that in the +last case, the highlighted <em>contained item</em> is returned, not +the container itself.</p> +</li> +<li><p class="first"><tt class="docutils literal">dfhack.gui.showAnnouncement(text,color,is_bright)</tt></p> +<p>Adds a regular announcement with given text, color, and brightness. +The is_bright boolean actually seems to invert the brightness.</p> +</li> +<li><p class="first"><tt class="docutils literal">dfhack.gui.showPopupAnnouncement(text,color,is_bright)</tt></p> +<p>Pops up a titan-style modal announcement window.</p> +</li> +</ul> +</div> +<div class="section" id="job-module"> +<h3><a class="toc-backref" href="#id14">Job module</a></h3> +<ul> +<li><p class="first"><tt class="docutils literal">dfhack.job.cloneJobStruct(job)</tt></p> +<p>Creates a deep copy of the given job.</p> +</li> +<li><p class="first"><tt class="docutils literal">dfhack.job.printJobDetails(job)</tt></p> +<p>Prints info about the job.</p> +</li> +<li><p class="first"><tt class="docutils literal">dfhack.job.getJobHolder(job)</tt></p> +<p>Returns the building holding the job.</p> +</li> +<li><p class="first"><tt class="docutils literal">dfhack.job.is_equal(job1,job2)</tt></p> +<p>Compares important fields in the job and nested item structures.</p> +</li> +<li><p class="first"><tt class="docutils literal">dfhack.job.is_item_equal(job_item1,job_item2)</tt></p> +<p>Compares important fields in the job item structures.</p> +</li> +</ul> +</div> +</div> </div> </div> </body> |
