1
0
forked from mirrors/0ad

Add private and public icons to the game list

Display locked icon for matches with password, unlocked otherwise.
This should help players to avoid clicking to the locked matches, when
they do not know password.

Differential revision: D3480
Fixes: #5949
Comments by: Stan, Freagarach, wraitii, borg
This was SVN commit r24795.
This commit is contained in:
Angen
2021-01-26 20:30:20 +00:00
parent 16a91c37e9
commit c2155e31c0
8 changed files with 30 additions and 0 deletions
Binary file not shown.
@@ -146,6 +146,8 @@ class Game
Engine.ProfileStop();
}
displayData.private = newStanza.hasPassword ? '[icon="icon_private"]' : '[icon="icon_public"]';
this.stanza = newStanza;
this.sortValue = this.sortValues[sortKey];
}
@@ -32,6 +32,7 @@ class GameList
// Avoid repeated array construction
this.list_buddy = [];
this.list_private = [];
this.list_gameName = [];
this.list_mapName = [];
this.list_mapSize = [];
@@ -138,6 +139,7 @@ class GameList
Engine.ProfileStart("setupGameList");
let length = this.gameList.length;
this.list_buddy.length = length;
this.list_private.length = length;
this.list_gameName.length = length;
this.list_mapName.length = length;
this.list_mapSize.length = length;
@@ -150,6 +152,7 @@ class GameList
let displayData = game.displayData;
this.list_buddy[i] = displayData.buddy;
this.list_private[i] = displayData.private;
this.list_gameName[i] = displayData.gameName;
this.list_mapName[i] = displayData.mapName;
this.list_mapSize[i] = displayData.mapSize;
@@ -166,6 +169,7 @@ class GameList
{
Engine.ProfileStart("copyToGUI");
let gamesBox = this.gamesBox;
gamesBox.list_private = this.list_private;
gamesBox.list_buddy = this.list_buddy;
gamesBox.list_gameName = this.list_gameName;
gamesBox.list_mapName = this.list_mapName;
@@ -8,6 +8,7 @@
font="sans-stroke-13"
>
<column id="buddy" width="12"/>
<column id="private" width="20"/>
<column id="gameName" color="128 128 128" width="33%-12">
<translatableAttribute id="heading">Name</translatableAttribute>
</column>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<setup>
<icon name="icon_private"
sprite="stretched:lobby/private.png"
size="16 16"
/>
</setup>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<setup>
<icon name="icon_public"
sprite="stretched:lobby/public.png"
size="16 16"
/>
</setup>
@@ -7,6 +7,7 @@
<include>common/styles.xml</include>
<include>common/sprites.xml</include>
<include>lobby/icons/</include>
<include>lobby/lobby.xml</include>
<!-- Work around a render bug: