<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetBraggingRights</id>
	<title>API:GetBraggingRights - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetBraggingRights"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetBraggingRights&amp;action=history"/>
	<updated>2026-10-18T06:58:58Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:GetBraggingRights&amp;diff=30349&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetBraggingRights&amp;diff=30349&amp;oldid=prev"/>
		<updated>2026-10-16T19:43:09Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Social}}&lt;br /&gt;
Returns the player&amp;#039;s bragging rights (Tome of Knowledge entries shown to other players) and bragging-rights card slots.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brags, cards = GetBraggingRights()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;brags : &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; – Array of 10 brag tables, one per slot.&lt;br /&gt;
;cards : &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; – Array of 6 tables, one per card slot. Each has one field, &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt;), the value set with [[API:SetBraggingRightsCard|SetBraggingRightsCard]].&lt;br /&gt;
&lt;br /&gt;
Each brag table has these fields:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Tome entry id in the slot. 0 for an empty slot.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Name of the tome entry.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;cardId&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Id of the card that belongs to the entry, or 0. The stock UI passes it to &amp;lt;code&amp;gt;TomeGetCardData&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rewards&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || Only present when the entry has reward data. Array of up to two reward tables with &amp;lt;code&amp;gt;rewardType&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt;) and &amp;lt;code&amp;gt;rewardId&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt;). The first one always has &amp;lt;code&amp;gt;rewardType&amp;lt;/code&amp;gt; 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* Both tables always have all their entries (10 and 6), including empty slots.&lt;br /&gt;
* The data is the client&amp;#039;s local copy. [[API:SetBraggingRight|SetBraggingRight]] and [[API:SetBraggingRightsCard|SetBraggingRightsCard]] change it at once and fire &amp;lt;code&amp;gt;SystemData.Events.SOCIAL_BRAGGING_RIGHTS_UPDATED&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;default/ea_characterwindow/source/characterwindowbrags.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CharacterWindow.braggingRights = GetBraggingRights()&lt;br /&gt;
&lt;br /&gt;
for index, brag in ipairs( CharacterWindow.braggingRights )&lt;br /&gt;
do&lt;br /&gt;
    ...&lt;br /&gt;
    LabelSetText( windowName..&amp;quot;Text&amp;quot;, brag.name )&lt;br /&gt;
&lt;br /&gt;
    -- set the reward data&lt;br /&gt;
    if( not brag.rewards )&lt;br /&gt;
    then&lt;br /&gt;
        WindowSetShowing( windowName..&amp;quot;Reward1&amp;quot;, false )&lt;br /&gt;
        WindowSetShowing( windowName..&amp;quot;Reward2&amp;quot;, false )&lt;br /&gt;
    else&lt;br /&gt;
        TomeWindow.SetTomeReward( windowName..&amp;quot;Reward1&amp;quot;, brag.rewards[1] )&lt;br /&gt;
        TomeWindow.SetTomeReward( windowName..&amp;quot;Reward2&amp;quot;, brag.rewards[2] )&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reading both results, from &amp;lt;code&amp;gt;default/ea_tomeofknowledge/source/tomewindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TomeWindow.braggingRights, TomeWindow.braggingRightsCards = GetBraggingRights()&lt;br /&gt;
WindowRegisterEventHandler( &amp;quot;TomeWindow&amp;quot;, SystemData.Events.SOCIAL_BRAGGING_RIGHTS_UPDATED, &amp;quot;TomeWindow.OnBraggingRightsUpdated&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:SetBraggingRight|SetBraggingRight]]&lt;br /&gt;
* [[API:SetBraggingRightsCard|SetBraggingRightsCard]]&lt;br /&gt;
* [[API:GetInspectionBragData|GetInspectionBragData]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>