From e825dc5ddb1f2c0798b571ebcb02a52e184fc689 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Fri, 24 Aug 2012 13:20:08 +0400 Subject: Tweak the API for current viewscreen, and dispatch show/dismiss from C++. --- Lua API.html | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'Lua API.html') 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.
dfhack.gui.getCurViewscreen()
-Returns the viewscreen that is current in the core.
+dfhack.gui.getCurViewscreen([skip_dismissed])
+Returns the topmost viewscreen. If skip_dismissed is true, +ignores screens already marked to be removed.
dfhack.gui.getFocusString(viewscreen)
Returns a string representation of the current focus position in the ui. The string has a "screen/foo/bar/baz..." format.
dfhack.gui.getCurFocus([skip_dismissed])
+Returns the focus string of the current viewscreen.
+dfhack.gui.getSelectedWorkshopJob([silent])
When a job is selected in 'q' mode, returns the job, else prints error unless silent and returns nil.
@@ -1465,8 +1469,9 @@ interface screens added by dfhack should bear the "DFHack" signature.<Displays the given screen, possibly placing it below a different one. The screen must not be already shown. Returns true if success.
dfhack.screen.dismiss(screen)
-Marks the screen to be removed when the game enters its event loop.
+dfhack.screen.dismiss(screen[,to_first])
+Marks the screen to be removed when the game enters its event loop. +If to_first is true, all screens up to the first one will be deleted.
dfhack.screen.isDismissed(screen)
Checks if the screen is already marked for removal.
@@ -1482,9 +1487,18 @@ that delegates all processing to methods stored in that table.Initialized by show with a reference to the backing viewscreen object, and removed again when the object is deleted.
function screen:onShow()
+Called by dfhack.screen.show if successful.
+function screen:onDismiss()
+Called by dfhack.screen.dismiss if successful.
+function screen:onDestroy()
Called from the destructor when the viewscreen is deleted.
function screen:onResize(w, h)
+Called before onRender or onIdle when the window size has changed.
+function screen:onRender()
Called when the viewscreen should paint itself. This is the only context where the above painting functions work correctly.
-- cgit v1.2.1