<?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%3AGetCreditsData</id>
	<title>API:GetCreditsData - 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%3AGetCreditsData"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetCreditsData&amp;action=history"/>
	<updated>2026-10-18T06:58:46Z</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:GetCreditsData&amp;diff=30368&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:GetCreditsData&amp;diff=30368&amp;oldid=prev"/>
		<updated>2026-10-16T19:43:27Z</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=Pregame}}&lt;br /&gt;
Returns the game credits as nested tables of sections, subsections and people.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
creditsData = GetCreditsData()&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;
;creditsData : &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; – A table with one field, &amp;lt;code&amp;gt;sections&amp;lt;/code&amp;gt;.&lt;br /&gt;
&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;sections&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || Array of section tables, indexed from 1.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Each section table:&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;name&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Section title.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;subsections&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || Array of subsection tables, indexed from 1.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Each subsection table:&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;name&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Subsection title. &amp;lt;code&amp;gt;L&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; when the CSV gives no string id.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;desc&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Subsection description. &amp;lt;code&amp;gt;L&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; when the CSV gives no string id.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;people&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || Array of person tables, indexed from 1.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Each person table:&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;name&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || The person&amp;#039;s name.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || The person&amp;#039;s job title. Only present when the subsection&amp;#039;s title string file could be loaded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The structure comes from &amp;lt;code&amp;gt;interfacecore/credits/sections.csv&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;interfacecore/credits/subsections.csv&amp;lt;/code&amp;gt;. Each subsections row names a section, string ids for its name and description, a names file, a titles file and the number of people.&lt;br /&gt;
* The texts are loaded from the client&amp;#039;s credits string files for the current language. The string tables are loaded for the call and unloaded again afterwards.&lt;br /&gt;
* The whole table is built from the files on every call.&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;interfacecore/source/creditswindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local creditsData = GetCreditsData()&lt;br /&gt;
for sectionIndex, sectionData in ipairs( creditsData.sections )&lt;br /&gt;
do&lt;br /&gt;
    LabelSetText( sectionWindowName, wstring.upper( sectionData.name )  )&lt;br /&gt;
    for subSectionIndex, subSectionData in ipairs( sectionData.subsections )&lt;br /&gt;
    do&lt;br /&gt;
        local namesText = L&amp;quot;&amp;quot;&lt;br /&gt;
        local titlesText = L&amp;quot;&amp;quot;&lt;br /&gt;
        for _, personData in ipairs( subSectionData.people )&lt;br /&gt;
        do&lt;br /&gt;
            namesText = namesText..L&amp;quot;\n&amp;quot;..personData.name&lt;br /&gt;
            if( personData.title )&lt;br /&gt;
            then&lt;br /&gt;
                titlesText = titlesText..L&amp;quot;\n&amp;quot;..personData.title&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        -- ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(Window creation lines left out.)&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:LoadStringTable|LoadStringTable]]&lt;br /&gt;
* [[API:BuildTableFromCSV|BuildTableFromCSV]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>