API:SetBraggingRight
From RoR Wiki
UI Lua API · Social functions
Version: WAR 1.4.8
Puts a Tome of Knowledge entry into one of the player's bragging-rights slots, or clears the slot.
SetBraggingRight(slot, entryId)
Arguments
- slot
number– Bragging-rights slot, 1–10.- entryId
number– Tome entry id to show in the slot. 0 clears the slot.
Returns
Nothing.
Details
- The client stores the value in its own list right away (see GetBraggingRights), fires
SystemData.Events.SOCIAL_BRAGGING_RIGHTS_UPDATED, and then sends the slot and entry id to the server. - Nothing is sent to the server when
slotis outside 1–10, or when the connection is not ready. slotis not range-checked before the local store. Passing a slot outside 1–10 writes outside the bragging-rights list in client memory.- The function needs at least two arguments and only reads the last two.
Errors
None besides the generic Invalid Parameters message when an argument is not a number.
Example
Removing a brag, from default/ea_characterwindow/source/characterwindowbrags.lua:
function CharacterWindow.RemoveBrag()
local bragIndex = WindowGetId( WindowGetParent( SystemData.ActiveWindow.name ) )
SetBraggingRight( bragIndex, 0 )
end
Choosing a slot from a context menu, from default/ea_tomeofknowledge/source/tomewindow.lua:
local function OnPickBraggingRight()
if( entryId )
then
SetBraggingRight( index, entryId )
end
end
