1
0
forked from 0ad/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

BIN
binaries/data/mods/public/art/textures/ui/lobby/private.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
binaries/data/mods/public/art/textures/ui/lobby/public.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -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];
}

View File

@ -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;

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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: