API:EA Window HelpGetFAQTopicList
From RoR Wiki
UI Lua API · Help functions
Version: WAR 1.4.8
Returns the sections and questions of the in-game FAQ.
sections = EA_Window_HelpGetFAQTopicList()
Arguments
None.
Returns
- sections
table– Array of section tables, indexed from 1.
Each section table has these fields:
| Key | Type | Meaning |
|---|---|---|
id |
number |
Section id. |
name |
wstring |
Section title. |
expanded |
boolean |
Always false. The stock UI uses the field to remember which sections are open.
|
entries |
table |
Array of the section's questions, indexed from 1 (see below). |
Each entry in entries has these fields:
| Key | Type | Meaning |
|---|---|---|
id |
number |
Entry id. Pass it to EA_Window_HelpGetFAQEntryData to get the answer text. |
subSection |
number |
– |
name |
wstring |
The question (entry title). |
Details
- A new table is built on every call.
- The stock FAQ window sorts the sections by name itself.
- Arguments are not checked; anything passed is ignored.
Errors
None.
Example
From ea_helpwindow/source/faqwindow.lua:
FAQWindow.data = EA_Window_HelpGetFAQTopicList()
Listing a section's questions, from the same file:
if( sectionData.expanded == true ) then -- we check if the category is expanded, and if so, we loop on its entries
for entryIndex, entryData in ipairs( sectionData.entries ) do -- loop once per each entry of the section
...
local entryTable = {name = L" "..entryData.name, isSection = false, id = entryData.id}
