Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:WindowGetId

From RoR Wiki
Revision as of 19:51, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Window functions
Version: WAR 1.4.8

Returns the number stored on a window as its id.

id = WindowGetId(windowName)

Arguments

windowName
string – Name of the window.

Returns

id
number – The window's id, a whole number.

Details

  • The id is a free number for the UI's own use. It is set with WindowSetId.
  • A common use is to find out which of several similar windows triggered an event handler, by reading the id of SystemData.ActiveWindow.name or one of its parents.

Errors

  • Error in function call 'WindowGetId': Window %s does not exist

Example

Finding the dialog that a clicked button belongs to, from easystem_dialogmanager/source/dialogmanager.lua:

function DialogManager.OnOneButtonDlgButton1()
    local dlgIndex = WindowGetId( WindowGetParent( WindowGetParent(SystemData.ActiveWindow.name) ) )
    -- ...
end

See also