summaryrefslogtreecommitdiff
path: root/Lua API.html
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-08-24 13:20:08 +0400
committerAlexander Gavrilov2012-08-24 13:20:08 +0400
commite825dc5ddb1f2c0798b571ebcb02a52e184fc689 (patch)
treef5fe92c3ea5b2f56e677f8d9d0b670e252317b4c /Lua API.html
parentb12b9fa91e3be0d4d157f144f4b20202cdb72917 (diff)
downloaddfhack-e825dc5ddb1f2c0798b571ebcb02a52e184fc689.tar.gz
dfhack-e825dc5ddb1f2c0798b571ebcb02a52e184fc689.tar.bz2
dfhack-e825dc5ddb1f2c0798b571ebcb02a52e184fc689.tar.xz
Tweak the API for current viewscreen, and dispatch show/dismiss from C++.
Diffstat (limited to 'Lua API.html')
-rw-r--r--Lua API.html22
1 files changed, 18 insertions, 4 deletions
diff --git a/Lua API.html b/Lua API.html
index c4ab9c8c..15f1d89c 100644
--- a/Lua API.html
+++ b/Lua API.html
@@ -987,13 +987,17 @@ can be omitted.</p>
<div class="section" id="gui-module">
<h3><a class="toc-backref" href="#id18">Gui module</a></h3>
<ul>
-<li><p class="first"><tt class="docutils literal">dfhack.gui.getCurViewscreen()</tt></p>
-<p>Returns the viewscreen that is current in the core.</p>
+<li><p class="first"><tt class="docutils literal"><span class="pre">dfhack.gui.getCurViewscreen([skip_dismissed])</span></tt></p>
+<p>Returns the topmost viewscreen. If <tt class="docutils literal">skip_dismissed</tt> is <em>true</em>,
+ignores screens already marked to be removed.</p>
</li>
<li><p class="first"><tt class="docutils literal">dfhack.gui.getFocusString(viewscreen)</tt></p>
<p>Returns a string representation of the current focus position
in the ui. The string has a &quot;screen/foo/bar/baz...&quot; format.</p>
</li>
+<li><p class="first"><tt class="docutils literal"><span class="pre">dfhack.gui.getCurFocus([skip_dismissed])</span></tt></p>
+<p>Returns the focus string of the current viewscreen.</p>
+</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">dfhack.gui.getSelectedWorkshopJob([silent])</span></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>
@@ -1465,8 +1469,9 @@ interface screens added by dfhack should bear the &quot;DFHack&quot; signature.<
<p>Displays the given screen, possibly placing it below a different one.
The screen must not be already shown. Returns <em>true</em> if success.</p>
</li>
-<li><p class="first"><tt class="docutils literal">dfhack.screen.dismiss(screen)</tt></p>
-<p>Marks the screen to be removed when the game enters its event loop.</p>
+<li><p class="first"><tt class="docutils literal"><span class="pre">dfhack.screen.dismiss(screen[,to_first])</span></tt></p>
+<p>Marks the screen to be removed when the game enters its event loop.
+If <tt class="docutils literal">to_first</tt> is <em>true</em>, all screens up to the first one will be deleted.</p>
</li>
<li><p class="first"><tt class="docutils literal">dfhack.screen.isDismissed(screen)</tt></p>
<p>Checks if the screen is already marked for removal.</p>
@@ -1482,9 +1487,18 @@ that delegates all processing to methods stored in that table.</p>
<p>Initialized by <tt class="docutils literal">show</tt> with a reference to the backing viewscreen
object, and removed again when the object is deleted.</p>
</li>
+<li><p class="first"><tt class="docutils literal">function screen:onShow()</tt></p>
+<p>Called by <tt class="docutils literal">dfhack.screen.show</tt> if successful.</p>
+</li>
+<li><p class="first"><tt class="docutils literal">function screen:onDismiss()</tt></p>
+<p>Called by <tt class="docutils literal">dfhack.screen.dismiss</tt> if successful.</p>
+</li>
<li><p class="first"><tt class="docutils literal">function screen:onDestroy()</tt></p>
<p>Called from the destructor when the viewscreen is deleted.</p>
</li>
+<li><p class="first"><tt class="docutils literal">function screen:onResize(w, h)</tt></p>
+<p>Called before <tt class="docutils literal">onRender</tt> or <tt class="docutils literal">onIdle</tt> when the window size has changed.</p>
+</li>
<li><p class="first"><tt class="docutils literal">function screen:onRender()</tt></p>
<p>Called when the viewscreen should paint itself. This is the only context
where the above painting functions work correctly.</p>