<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.splashdamage.com/index.php?action=history&amp;feed=atom&amp;title=GUIs%3A_List_Enumeration</id>
	<title>GUIs: List Enumeration - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.splashdamage.com/index.php?action=history&amp;feed=atom&amp;title=GUIs%3A_List_Enumeration"/>
	<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=GUIs:_List_Enumeration&amp;action=history"/>
	<updated>2026-04-07T15:46:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=GUIs:_List_Enumeration&amp;diff=1487&amp;oldid=prev</id>
		<title>192.168.0.142 at 10:34, 16 October 2007</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=GUIs:_List_Enumeration&amp;diff=1487&amp;oldid=prev"/>
		<updated>2007-10-16T10:34:27Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Most lists in the game are filled from enumerators.&amp;lt;includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{main|GUIs: List Enumeration}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Most lists in the game are filled from enumerators which means that the list window usually calls [[UIList:fillFromEnumerator|fillFromEnumerator]] during GUI creation or regularly using a timeline.&lt;br /&gt;
&lt;br /&gt;
Examples of using enumerators for filling lists are:&lt;br /&gt;
* Player lists (in vehicle, mission, fireteam menu, scoreboard)&lt;br /&gt;
* Missions system mission list on HUD.&lt;br /&gt;
* Maps in the admin menu.&lt;br /&gt;
* Weapons selection in the limbo menu.&lt;br /&gt;
&lt;br /&gt;
This is the player list shown in the Trojan:&lt;br /&gt;
 windowDef vPlayerList {&lt;br /&gt;
 	type list;&lt;br /&gt;
 	properties {&lt;br /&gt;
 		float 	fontSize 		= 48;			&lt;br /&gt;
 		float	flags			= immediate( flags ) | WF_AUTO_SIZE_WIDTH | WF_TRUNCATE_TEXT;&lt;br /&gt;
 		rect 	rect 			= 24, 50, 590, 350;&lt;br /&gt;
 		color	backColor		= 0,0,0,0;			&lt;br /&gt;
 	}&lt;br /&gt;
 	events {&lt;br /&gt;
 		onCreate {&lt;br /&gt;
 			insertColumn( gui.blankWStr, 0, 0 ); // player class icon&lt;br /&gt;
 			insertColumn( gui.blankWStr, 590, 1 ); // player name&lt;br /&gt;
 		}	&lt;br /&gt;
 	}&lt;br /&gt;
 	timeLine {&lt;br /&gt;
 		onTime 250 {&lt;br /&gt;
 			// Fill the list with all the players in the vehicle every 250 milliseconds.&lt;br /&gt;
 			fillFromEnumerator( &amp;quot;vehiclePlayerList&amp;quot; );&lt;br /&gt;
 			resetTime( 0 );&lt;br /&gt;
 		}&lt;br /&gt;
 	}		&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== List Setup ==&lt;br /&gt;
The GUI should create all the columns that is expected by the enumerator similar to in the example above. Once the column have been created [[UIList:fillFromEnumerator|fillFromEnumerator]] may be called to fill the list. The enumerator will always clear the list before it starts filling it.&lt;br /&gt;
&lt;br /&gt;
The valid enumerator names can be found in the gamecode in ''idGameLocal::Init'':&lt;br /&gt;
* demoList - list of netdemos.&lt;br /&gt;
* crosshairs - list of all custom crosshairs available.&lt;br /&gt;
* keyBindings - list of key bindings for a category.&lt;br /&gt;
* vehiclePlayerList - players in a vehicle.&lt;br /&gt;
* activeTaskList - Currently selectable/Active tasks.&lt;br /&gt;
* fireTeamList - Fireteam menu.&lt;br /&gt;
* inventoryList - Weapon items in limbo menu.&lt;br /&gt;
* scoreboardList - List of players in the scoreboard.&lt;br /&gt;
* playerAdminList - List admin and superuser players.&lt;br /&gt;
* userGroupsList - List all user groups.&lt;br /&gt;
* serverConfigList - List all the server configs that can be executed.&lt;br /&gt;
* videoModeList - All the video modes available.&lt;br /&gt;
* campaignList - List maps for a campaign.&lt;br /&gt;
* mapList - List all maps.&lt;br /&gt;
* weaponSwitchList - Weapon selection when switching weapon in the hud.&lt;br /&gt;
* callVoteList - List all votes.&lt;br /&gt;
* callVoteListOptions - List all options for the current vote.&lt;br /&gt;
* colors - Color picker list.&lt;br /&gt;
* spawnLocations - Spawn locations currently available.&lt;br /&gt;
* availableMSAA - List available anti-aliasing options.&lt;br /&gt;
&lt;br /&gt;
== Item and Column Formatting ==&lt;br /&gt;
The gamecode often inserts one item for each row even when multiple columns is wanted. This is possible since the GUIs support inline material names/text formatting/localized text/item flags, and support for inserting multiple columns with the use of the indentation escape code (\t) to separate between columns:&lt;br /&gt;
 // Insert a new item, row index -1 means it will insert a new row.&lt;br /&gt;
 // Add three columns.&lt;br /&gt;
 newItem = insertItem( toWStr( &amp;quot;First column\tSecond column\tThird column&amp;quot; ), -1, 0 );&lt;br /&gt;
&lt;br /&gt;
There are some differences in the possible formatting that can be added for columns and items which are detailed below.&lt;br /&gt;
&lt;br /&gt;
=== Material ===&lt;br /&gt;
Materials may be set for list items by using a formatting like this:&lt;br /&gt;
 &amp;quot;&amp;lt;material = 'materialName'&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Example from ''guis/common/stats/class.include'':&lt;br /&gt;
 index = insertItem( toWStr( &amp;quot;&amp;lt;material = 'stats_separator'&amp;gt;&amp;quot; ), -1, 0 );&lt;br /&gt;
&lt;br /&gt;
=== Text Formatting ===&lt;br /&gt;
Text alignment flags for an item or column may be set like this where alignment flags are comma separated:&lt;br /&gt;
 &amp;quot;&amp;lt;align = flags&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Valid text align flags are:&lt;br /&gt;
* ''right''&lt;br /&gt;
* ''left''&lt;br /&gt;
* ''center''&lt;br /&gt;
* ''top''&lt;br /&gt;
* ''bottom''&lt;br /&gt;
* ''vcenter''&lt;br /&gt;
&lt;br /&gt;
An example from ''guis/game/limbo/tabpages/campaign_info.include'':&lt;br /&gt;
 insertColumn( toWStr( &amp;quot;&amp;lt;align = right&amp;gt;&amp;quot; ), 20, 1 ); // number of players&lt;br /&gt;
Will align the text to the right for all items in this column.&lt;br /&gt;
&lt;br /&gt;
=== Localized Text ===&lt;br /&gt;
Localized text may be specified for a list item or column by using a formatting like this:&lt;br /&gt;
 &amp;quot;&amp;lt;loc = 'localizedTextName'&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For example inserting an item like this from the stats gui (in ''guis/common/stats/achievements.include''):&lt;br /&gt;
 index = insertItem( toWStr( &amp;quot;&amp;lt;loc = 'guis/mainmenu/clan'&amp;gt;&amp;quot; ), 1, 0 );&lt;br /&gt;
Will insert an item in column 1 with the localized text ''guis/mainmenu/clan''&lt;br /&gt;
&lt;br /&gt;
=== Flags ===&lt;br /&gt;
==== Row ====&lt;br /&gt;
Valid item flags:&lt;br /&gt;
* customDraw - Items with this flag will call [[UIList:onDrawItem|onDrawItem]] before the gamecode does default drawing for the item.&lt;br /&gt;
&lt;br /&gt;
==== Column ====&lt;br /&gt;
Valid column flags:&lt;br /&gt;
* customDraw - Columns with this flag will call [[UIList:onDrawColumn|onDrawColumn]] for the column header before the gamecode does default drawing for the header.&lt;br /&gt;
* numeric - Sort the column by converting the item text to numbers.&lt;br /&gt;
* noSort - Do not allowing sorting in this column.&lt;br /&gt;
* dataSort - Sort by the integer values of the item data.&lt;br /&gt;
&lt;br /&gt;
=== Forecolor ===&lt;br /&gt;
Set the forecolor for an item or column:&lt;br /&gt;
 &amp;lt;fore = 1, 1, 1, 1&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
 &amp;lt;fore = 1 1 1 1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example (in ''guis/game/scoreboard/scoreboard.include''):&lt;br /&gt;
 insertColumn( toWStr( &amp;quot;&amp;lt;loc = 'guis/game/scoreboard/fireteam'&amp;gt;&amp;lt;fore =&amp;quot; + COLOR_YELLOW_TEXT + &amp;quot;&amp;gt;&amp;quot; ),	40, SC_FIRETEAM );&lt;br /&gt;
&lt;br /&gt;
=== Backcolor ===&lt;br /&gt;
Set the backcolor for an item or column:&lt;br /&gt;
 &amp;lt;back = 1, 1, 1, 1&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
 &amp;lt;back = 1 1 1 1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:GUIs]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>192.168.0.142</name></author>
		
	</entry>
</feed>