Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:EA Window HelpGetTopicList

From RoR Wiki

UI Lua API · Help functions
Version: WAR 1.4.8

Returns the topic tree of the in-game manual.

topics = EA_Window_HelpGetTopicList()

Arguments

None.

Returns

topics
table – Array of top-level entries, indexed from 1.

Each entry is a table with these fields:

Key Type Meaning
id number Entry id. Pass it to EA_Window_HelpGetEntryData to get the entry's text.
parentEntryId number Id of the parent entry.
name wstring Title of the entry. Missing if the client's manual name list is not loaded.
expanded boolean Always false. The stock UI uses the field to remember which entries are open.
childEntries table Array of the child entries, indexed from 1, each with the same fields. Empty if the entry has no children.

Details

  • The client loads its manual data the first time it is needed.* The names come from the client's game_manual_entry_names data list, indexed by entry id.
  • A new table is built on every call. The stock manual window calls it once and keeps the result.
  • Arguments are not checked; anything passed is ignored.

Errors

None.

Example

From ea_helpwindow/source/manualwindow.lua:

-- lazy load the manual data as this window is almost never opened
if not ManualWindow.data
then
    ManualWindow.data = EA_Window_HelpGetTopicList()

Walking the tree, from the same file:

local function AddEntryAsRow(entryIndex, entryData, depth)
    local entryTable = {name = entryData.name, depth = depth}
    ...
    if entryData.expanded
    then
        -- entry is expanded so add children as rows, recursively
        for childEntryIndex, childEntryData in ipairs( entryData.childEntries ) do
            AddEntryAsRow(childEntryIndex, childEntryData, depth+1)
        end
    end
end

for entryIndex, entryData in ipairs( ManualWindow.data ) do
    AddEntryAsRow(entryIndex, entryData, 0)
end

See also