API:TomeGetItemRewardsList
From RoR Wiki
UI Lua API · Tome functions
Version: WAR 1.4.8
Returns the item rewards the player has unlocked through the Tome of Knowledge.
itemList = TomeGetItemRewardsList()
Arguments
None.
Returns
- itemList
table– Array of item rewards.
Each entry:
| Key | Type | Meaning |
|---|---|---|
rewardId |
number |
Id of the reward, for TomeGetItemRewardData. |
itemId |
number |
Id of the item. 0 while the client does not have the item's details yet.
|
name |
wstring |
Item name. Only present when itemId is not 0.
|
iconNum |
number |
Icon number for GetIconData. Only present when itemId is not 0.
|
type |
number |
The item's type. Only present when itemId is not 0.
|
Details
- Only rewards the player has unlocked are listed.
Errors
None.
Example
From ea_tomeofknowledge/source/tomewindow_rewards.lua:
local itemList = TomeGetItemRewardsList()
...
for index, entryData in ipairs( itemList ) do
WindowSetId( entryWindowName, entryData.rewardId )
if( entryData.itemId ~= 0 )
then
ButtonSetText( entryWindowName.."Text", entryData.name )
local texture, x, y = GetIconData( entryData.iconNum )
DynamicImageSetTexture( entryWindowName.."IconIconBase", texture, x, y )
else
ButtonSetText( entryWindowName.."Text", L"" )
DynamicImageSetTexture( entryWindowName.."IconIconBase", L"", 0, 0 )
end
end
