|
|
@ -987,13 +987,17 @@ can be omitted.</p>
|
|
|
|
<div class="section" id="gui-module">
|
|
|
|
<div class="section" id="gui-module">
|
|
|
|
<h3><a class="toc-backref" href="#id18">Gui module</a></h3>
|
|
|
|
<h3><a class="toc-backref" href="#id18">Gui module</a></h3>
|
|
|
|
<ul>
|
|
|
|
<ul>
|
|
|
|
<li><p class="first"><tt class="docutils literal">dfhack.gui.getCurViewscreen()</tt></p>
|
|
|
|
<li><p class="first"><tt class="docutils literal"><span class="pre">dfhack.gui.getCurViewscreen([skip_dismissed])</span></tt></p>
|
|
|
|
<p>Returns the viewscreen that is current in the core.</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>
|
|
|
|
<li><p class="first"><tt class="docutils literal">dfhack.gui.getFocusString(viewscreen)</tt></p>
|
|
|
|
<li><p class="first"><tt class="docutils literal">dfhack.gui.getFocusString(viewscreen)</tt></p>
|
|
|
|
<p>Returns a string representation of the current focus position
|
|
|
|
<p>Returns a string representation of the current focus position
|
|
|
|
in the ui. The string has a "screen/foo/bar/baz..." format.</p>
|
|
|
|
in the ui. The string has a "screen/foo/bar/baz..." format.</p>
|
|
|
|
</li>
|
|
|
|
</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>
|
|
|
|
<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
|
|
|
|
<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>
|
|
|
|
prints error unless silent and returns <em>nil</em>.</p>
|
|
|
@ -1465,8 +1469,9 @@ interface screens added by dfhack should bear the "DFHack" signature.<
|
|
|
|
<p>Displays the given screen, possibly placing it below a different one.
|
|
|
|
<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>
|
|
|
|
The screen must not be already shown. Returns <em>true</em> if success.</p>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li><p class="first"><tt class="docutils literal">dfhack.screen.dismiss(screen)</tt></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.</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>
|
|
|
|
<li><p class="first"><tt class="docutils literal">dfhack.screen.isDismissed(screen)</tt></p>
|
|
|
|
<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>
|
|
|
|
<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
|
|
|
|
<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>
|
|
|
|
object, and removed again when the object is deleted.</p>
|
|
|
|
</li>
|
|
|
|
</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>
|
|
|
|
<li><p class="first"><tt class="docutils literal">function screen:onDestroy()</tt></p>
|
|
|
|
<p>Called from the destructor when the viewscreen is deleted.</p>
|
|
|
|
<p>Called from the destructor when the viewscreen is deleted.</p>
|
|
|
|
</li>
|
|
|
|
</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>
|
|
|
|
<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
|
|
|
|
<p>Called when the viewscreen should paint itself. This is the only context
|
|
|
|
where the above painting functions work correctly.</p>
|
|
|
|
where the above painting functions work correctly.</p>
|
|
|
|