API:TomeGetSigilEntry
From RoR Wiki
UI Lua API · Tome functions
Version: WAR 1.4.8
Returns the Tome of Knowledge page of a sigil: its texts and its fragments with their tasks.
sigilData = TomeGetSigilEntry(sigilEntryId)
Arguments
- sigilEntryId
number– Sigil entry id, as in TomeGetSigilTOC. Only the low 16 bits are used.
Returns
- sigilData
table– The sigil's data, or nothing if the id is invalid or the player is not in the world.
| Key | Type | Meaning |
|---|---|---|
id |
number |
Sigil entry id. |
fullname |
wstring |
Full name of the sigil. |
description |
wstring |
Description. |
fragmentsTitle |
wstring |
Heading of the fragment list. |
fragmentsDescription |
wstring |
Text of the fragment list. |
fragments |
table |
Array of fragment tables (see below). |
Each fragment table in fragments:
| Key | Type | Meaning |
|---|---|---|
id |
number |
Fragment id. |
index |
number |
Position of the fragment within the sigil. |
numTasks |
number |
Number of tasks of the fragment. |
iconNum |
number |
Icon id for GetIconData. |
isUnlocked |
boolean |
Whether the player has unlocked the fragment. |
name |
wstring |
Fragment name. |
taskDescription |
wstring |
Text shown above the task list. |
tasks |
table |
Array of task tables with isCompleted (boolean), name (wstring), counterValue and counterMax (number; both 0 for a task without a counter).
|
Details
- Texts come from the client's string tables; they are empty wide strings if a table is not loaded.
- Exactly one argument must be passed.
Errors
These are written to the UI log, and the function returns nothing.
Error in function call 'TomeGetSigilEntry': %d is not a valid entry id.
Example
From default/ea_tomeofknowledge/source/tomewindow_sigils.lua:
local sigilData = TomeGetSigilEntry( sigilEntryId ) if( not sigilData or not sigilData.id ) ... LabelSetText(PARENT_WINDOW.."SigilTitle", sigilData.fullname ) LabelSetText(PARENT_WINDOW.."SigilDesc", sigilData.description ) LabelSetText(PARENT_WINDOW.."FragmentsTitle", sigilData.fragmentsTitle ) LabelSetText(PARENT_WINDOW.."FragmentsDesc", sigilData.fragmentsDescription )
From the same file, the task list of a fragment:
for index, task in ipairs( fragment.tasks )
do
...
local taskText = task.name
if( task.counterMax > 0 )
then
taskText = GetStringFormat( StringTables.Default.LABEL_SIGIL_FRAGMENT_TASKNAME_AND_COUNTER, {taskText, task.counterValue, task.counterMax} )
end
...
ButtonSetPressedFlag( taskWindowName.."CompletedBtn", task.isCompleted )
