Index: binaries/data/mods/public/gui/common/gamedescription.js =================================================================== --- binaries/data/mods/public/gui/common/gamedescription.js +++ binaries/data/mods/public/gui/common/gamedescription.js @@ -32,7 +32,7 @@ /** * Denotes which players are a lobby buddy of the current user. */ -var g_BuddySymbol = '•'; +var g_BuddySymbol = '★'; /** * Returns a formatted string describing the player assignments. Index: binaries/data/mods/public/gui/lobby/LobbyPage/GameList.js =================================================================== --- binaries/data/mods/public/gui/lobby/LobbyPage/GameList.js +++ binaries/data/mods/public/gui/lobby/LobbyPage/GameList.js @@ -26,9 +26,6 @@ this.gamesBox = Engine.GetGUIObjectByName("gamesBox"); this.gamesBox.onSelectionChange = this.onSelectionChange.bind(this); this.gamesBox.onSelectionColumnChange = this.onFilterChange.bind(this); - let ratingColumn = Engine.ConfigDB_GetValue("user", "lobby.columns.gamerating") == "true"; - this.gamesBox.hidden_mapType = ratingColumn; - this.gamesBox.hidden_gameRating = !ratingColumn; // Avoid repeated array construction this.list_buddy = []; @@ -38,7 +35,6 @@ this.list_mapSize = []; this.list_mapType = []; this.list_maxnbp = []; - this.list_gameRating = []; this.list = []; this.filters = []; @@ -136,6 +132,9 @@ let selectedGameIndex = -1; { + let ratingSetting = Engine.ConfigDB_GetValue("user", "lobby.columns.gamerating") == "true"; + this.gamesBox.heading_maxnbp = ratingSetting ? "Players (rating)" : "Players"; + Engine.ProfileStart("setupGameList"); let length = this.gameList.length; this.list_buddy.length = length; @@ -145,7 +144,6 @@ this.list_mapSize.length = length; this.list_mapType.length = length; this.list_maxnbp.length = length; - this.list_gameRating.length = length; this.list.length = length; this.gameList.forEach((game, i) => { @@ -157,8 +155,7 @@ this.list_mapName[i] = displayData.mapName || ""; this.list_mapSize[i] = displayData.mapSize || ""; this.list_mapType[i] = displayData.mapType || ""; - this.list_maxnbp[i] = displayData.playerCount || ""; - this.list_gameRating[i] = game.gameRating || ""; + this.list_maxnbp[i] = ratingSetting ? `${displayData.playerCount} (${game.gameRating})` || "" : displayData.playerCount || ""; this.list[i] = ""; if (selectedGame && game.stanza.hostJID == selectedGame.stanza.hostJID && game.stanza.name == selectedGame.stanza.name) selectedGameIndex = i; @@ -176,7 +173,6 @@ gamesBox.list_mapSize = this.list_mapSize; gamesBox.list_mapType = this.list_mapType; gamesBox.list_maxnbp = this.list_maxnbp; - gamesBox.list_gameRating = this.list_gameRating; // Change these last, otherwise crash gamesBox.list = this.list; Index: binaries/data/mods/public/gui/lobby/LobbyPage/GameList.xml =================================================================== --- binaries/data/mods/public/gui/lobby/LobbyPage/GameList.xml +++ binaries/data/mods/public/gui/lobby/LobbyPage/GameList.xml @@ -8,11 +8,11 @@ font="sans-stroke-13" > - - + + Name - + Map Name @@ -21,10 +21,7 @@ Type - - Players + + Players (Rating) - - Rating - Index: binaries/data/mods/public/gui/lobby/LobbyPage/LobbyPage.xml =================================================================== --- binaries/data/mods/public/gui/lobby/LobbyPage/LobbyPage.xml +++ binaries/data/mods/public/gui/lobby/LobbyPage/LobbyPage.xml @@ -15,7 +15,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -41,7 +41,7 @@ - + Index: binaries/data/mods/public/gui/lobby/LobbyPage/PlayerList.js =================================================================== --- binaries/data/mods/public/gui/lobby/LobbyPage/PlayerList.js +++ binaries/data/mods/public/gui/lobby/LobbyPage/PlayerList.js @@ -1,8 +1,11 @@ + +var g_PlayerStateSymbol = "●"; + /** * This class is concerned with displaying players who are online and * triggering handlers when selecting or doubleclicking on a player. */ -class PlayerList + class PlayerList { constructor(xmppMessages, buddyButton, gameList) { @@ -30,7 +33,11 @@ this.playersBox.onSelectionColumnChange = this.rebuildPlayerList.bind(this); this.playersBox.onMouseLeftClickItem = this.onMouseLeftClickItem.bind(this); this.playersBox.onMouseLeftDoubleClickItem = this.onMouseLeftDoubleClickItem.bind(this); + + for (var key in this.PlayerStatuses) + this.playersBox.tooltip += "[font=\"sans-bold-14\"]" + "[color=\"" + this.PlayerStatuses[key].tags.color + "\"]" + g_PlayerStateSymbol + "[/color] " + key[0].toUpperCase() + key.substring(1) + "\n" + "[/font]"; + buddyButton.registerBuddyChangeHandler(this.onBuddyChange.bind(this)); xmppMessages.registerPlayerListUpdateHandler(this.rebuildPlayerList.bind(this)); this.registerSelectionChangeHandler(buddyButton.onPlayerSelectionChange.bind(buddyButton)); @@ -123,7 +130,7 @@ */ rebuildPlayerList() { - Engine.ProfileStart("rebuildPlaersList"); + Engine.ProfileStart("rebuildPlayersList"); Engine.ProfileStart("getPlayerList"); let playerList = Engine.GetPlayerList(); @@ -194,25 +201,25 @@ */ PlayerList.prototype.PlayerStatuses = { "available": { - "status": translate("Online"), + "status": g_PlayerStateSymbol, "tags": { "color": "0 219 0" } }, "away": { - "status": translate("Away"), + "status": g_PlayerStateSymbol, "tags": { "color": "255 127 0" } }, "playing": { - "status": translate("Busy"), + "status": g_PlayerStateSymbol, "tags": { "color": "200 0 0" } }, "offline": { - "status": translate("Offline"), + "status": g_PlayerStateSymbol, "tags": { "color": "0 0 0" } Index: binaries/data/mods/public/gui/lobby/LobbyPage/PlayerList.xml =================================================================== --- binaries/data/mods/public/gui/lobby/LobbyPage/PlayerList.xml +++ binaries/data/mods/public/gui/lobby/LobbyPage/PlayerList.xml @@ -13,14 +13,12 @@ sortable="true" font="sans-bold-stroke-13" > - - - Status - - + + + Name - + Rating Index: source/gui/ObjectTypes/COList.h =================================================================== --- source/gui/ObjectTypes/COList.h +++ source/gui/ObjectTypes/COList.h @@ -29,7 +29,7 @@ { public: COListColumn(IGUIObject* owner, const CStr& cid) - : m_Width(0), m_Id(cid), m_List(owner, "list_" + cid), m_Hidden(owner, "hidden_" + cid, false) + :m_Width(0), m_Id(cid), m_List(owner, "list_" + cid), m_Heading(owner, "heading_" + cid), m_Hidden(owner, "hidden_" + cid, false) {} // Avoid copying the strings. NONCOPYABLE(COListColumn); @@ -37,7 +37,7 @@ CGUIColor m_TextColor; CStr m_Id; float m_Width; - CStrW m_Heading; // CGUIString?? + CGUISimpleSetting m_Heading; // CGUIString?? CGUISimpleSetting m_List; CGUISimpleSetting m_Hidden; }; Index: source/gui/ObjectTypes/COList.cpp =================================================================== --- source/gui/ObjectTypes/COList.cpp +++ source/gui/ObjectTypes/COList.cpp @@ -234,7 +234,7 @@ } else if (attr_name == "heading") { - column.m_Heading = attr_value.FromUTF8(); + column.m_Heading.Set(attr_value.FromUTF8(), false); } } @@ -259,12 +259,12 @@ if (!context.empty()) { CStr translatedValue(g_L10n.TranslateWithContext(context, value)); - column.m_Heading = translatedValue.FromUTF8(); + column.m_Heading.Set(translatedValue.FromUTF8(), false); } else { CStr translatedValue(g_L10n.Translate(value)); - column.m_Heading = translatedValue.FromUTF8(); + column.m_Heading.Set(translatedValue.FromUTF8(), false); } }