From dbce6545c396e3971d5d31526c5433fdc90f8c99 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 15:43:19 +0200 Subject: [PATCH 1/3] feat(TeamParticipants): display ingame roles only on left if they have icon --- lua/wikis/commons/Widget/Participants/Team/Roster.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lua/wikis/commons/Widget/Participants/Team/Roster.lua b/lua/wikis/commons/Widget/Participants/Team/Roster.lua index 071f33ea6dd..dc32fc49f45 100644 --- a/lua/wikis/commons/Widget/Participants/Team/Roster.lua +++ b/lua/wikis/commons/Widget/Participants/Team/Roster.lua @@ -69,8 +69,8 @@ local function getRoleDisplays(player) return firstRole.icon end for _, role in ipairs(roles) do - if role.type == RoleUtil.ROLE_TYPE.INGAME then - return role.icon or role.display + if role.type == RoleUtil.ROLE_TYPE.INGAME and role.icon then + return role.icon end end end @@ -84,7 +84,7 @@ local function getRoleDisplays(player) end -- Add non-ingame role if present for _, role in ipairs(roles) do - if role.type ~= RoleUtil.ROLE_TYPE.INGAME then + if role.type ~= RoleUtil.ROLE_TYPE.INGAME or not role.icon then table.insert(rightRoles, role.display) break end @@ -138,6 +138,7 @@ function ParticipantsTeamRoster:render() end ---@param groups {label: string?, players: table[]}[] + ---@return Widget local makeRostersDisplay = function(groups) local children = {} for _, group in ipairs(groups) do From f5872f777ea63c3bf5e5804b425bcf4faefed55b Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 16:15:36 +0200 Subject: [PATCH 2/3] adjust comment --- lua/wikis/commons/Widget/Participants/Team/Roster.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/Participants/Team/Roster.lua b/lua/wikis/commons/Widget/Participants/Team/Roster.lua index dc32fc49f45..80cd9b494a5 100644 --- a/lua/wikis/commons/Widget/Participants/Team/Roster.lua +++ b/lua/wikis/commons/Widget/Participants/Team/Roster.lua @@ -53,10 +53,11 @@ end -- * Right-role: -- * If the person has a specific status (did not play/former), display it first -- * If there's a non-ingame role assigned, display it after the status +-- * Displays the remianing ingame roles (which are not displayed on the left) also. -- * Returns an array of labels to display (can be multiple) -- * Left-role: -- * If the first role has an icon, we use that to render the left-role --- * If not then we instead display the icon or text of the first ingame role +-- * If not then we instead display the icon of the first ingame role with icon ---@param player table ---@return string?, string[]? local function getRoleDisplays(player) From 8546b87712df12d7326e633c3287691fb2689e10 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Tue, 12 May 2026 17:34:44 +0200 Subject: [PATCH 3/3] Update lua/wikis/commons/Widget/Participants/Team/Roster.lua Co-authored-by: SyntacticSalt --- lua/wikis/commons/Widget/Participants/Team/Roster.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/Widget/Participants/Team/Roster.lua b/lua/wikis/commons/Widget/Participants/Team/Roster.lua index 80cd9b494a5..0aae22c74e3 100644 --- a/lua/wikis/commons/Widget/Participants/Team/Roster.lua +++ b/lua/wikis/commons/Widget/Participants/Team/Roster.lua @@ -53,7 +53,7 @@ end -- * Right-role: -- * If the person has a specific status (did not play/former), display it first -- * If there's a non-ingame role assigned, display it after the status --- * Displays the remianing ingame roles (which are not displayed on the left) also. +-- * Displays the remaining ingame roles (which are not displayed on the left) also. -- * Returns an array of labels to display (can be multiple) -- * Left-role: -- * If the first role has an icon, we use that to render the left-role