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,19 +26,14 @@ 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 = []; this.list_private = []; this.list_gameName = []; this.list_mapName = []; this.list_mapSize = []; this.list_mapType = []; this.list_maxnbp = []; - this.list_gameRating = []; this.list = []; this.filters = []; @@ -136,29 +131,28 @@ 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; this.list_private.length = length; this.list_gameName.length = length; this.list_mapName.length = length; 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) => { 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 || ""; 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} ${displayData.buddy} (${game.gameRating})` || "" : `${displayData.playerCount} ${displayData.buddy}`|| ""; this.list[i] = ""; if (selectedGame && game.stanza.hostJID == selectedGame.stanza.hostJID && game.stanza.name == selectedGame.stanza.name) selectedGameIndex = i; @@ -170,13 +164,11 @@ 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; 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 @@ -6,13 +6,13 @@ type="olist" sortable="true" font="sans-stroke-13" + size="0 0 100% 100%" > - - - + + 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) { @@ -11,7 +14,6 @@ this.statusOrder = Object.keys(this.PlayerStatuses); // Avoid repeated array construction for performance - this.buddyStatusList = []; this.playerList = []; this.presenceList = []; this.nickList = []; @@ -30,7 +32,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 +129,7 @@ */ rebuildPlayerList() { - Engine.ProfileStart("rebuildPlaersList"); + Engine.ProfileStart("rebuildPlayersList"); Engine.ProfileStart("getPlayerList"); let playerList = Engine.GetPlayerList(); @@ -139,7 +145,6 @@ Engine.ProfileStart("prepareList"); let length = playerList.length; - this.buddyStatusList.length = length; this.playerList.length = length; this.presenceList.length = length; this.nickList.length = length; @@ -154,16 +159,14 @@ warn("Unknown presence:" + player.presence); let statusTags = this.PlayerStatuses[presence].tags; - this.buddyStatusList[i] = player.isBuddy ? setStringTags(g_BuddySymbol, statusTags) : ""; this.playerList[i] = PlayerColor.ColorPlayerName(player.name, "", player.role); - this.presenceList[i] = setStringTags(this.PlayerStatuses[presence].status, statusTags); + this.presenceList[i] = player.isBuddy ? setStringTags(g_BuddySymbol, statusTags) : setStringTags(this.PlayerStatuses[presence].status, statusTags); this.ratingList[i] = setStringTags(rating, statusTags); this.nickList[i] = escapeText(player.name); }); Engine.ProfileStop(); Engine.ProfileStart("copyToGUI"); - this.playersBox.list_buddy = this.buddyStatusList; this.playersBox.list_name = this.playerList; this.playersBox.list_status = this.presenceList; this.playersBox.list_rating = this.ratingList; @@ -194,25 +197,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,11 @@ 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); } }