From cbd688b47b282161c85c3ac71543c1ffc8c73acc Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 15 May 2026 21:02:26 +0200 Subject: [PATCH 1/9] Update Roster.lua --- 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..09271f384ea 100644 --- a/lua/wikis/commons/Widget/Participants/Team/Roster.lua +++ b/lua/wikis/commons/Widget/Participants/Team/Roster.lua @@ -56,7 +56,7 @@ end -- * 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) @@ -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 @@ -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 7273a7e12b7b54fe5539727d3e0a706ad5cf3a2a Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 15 May 2026 21:13:55 +0200 Subject: [PATCH 2/9] Update Role/Util.lua --- lua/wikis/commons/Role/Util.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lua/wikis/commons/Role/Util.lua b/lua/wikis/commons/Role/Util.lua index 7cbafd93112..2f7331375a0 100644 --- a/lua/wikis/commons/Role/Util.lua +++ b/lua/wikis/commons/Role/Util.lua @@ -12,6 +12,8 @@ local String = Lua.import('Module:StringUtils') local Roles = Lua.import('Module:Roles') +local IconFa = Lua.import('Module:Widget/Image/Icon/Fontawesome') + --- TODO: In the future this should be moved to role data entry local POSITION_ICON_DATA = Lua.requireIfExists('Module:PositionIcon/data', {loadData = true}) @@ -21,11 +23,13 @@ local RoleUtil = {} ---@field display string ---@field category string ---@field sortOrder integer? +---@field iconFa string? +---@field icon string? ---@class RoleData: RoleBaseData ---@field key string? ---@field type RoleTypes ----@field icon string? +---@field icon VNode|string? ---@enum RoleTypes RoleUtil.ROLE_TYPE = { @@ -86,7 +90,10 @@ function RoleUtil._createRoleData(roleKey) key = key, type = roleType(), sortOrder = roleData.sortOrder, - icon = POSITION_ICON_DATA and POSITION_ICON_DATA[key] or nil, + icon = roleData.iconFa and IconFa{} + or roleData.icon + or POSITION_ICON_DATA and POSITION_ICON_DATA[key] + or nil, } end From ab497fd116738c96f9447b389da4e26127b784b3 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 15 May 2026 21:16:11 +0200 Subject: [PATCH 3/9] Create InGameRoles.lua --- lua/wikis/starcraft2/InGameRoles.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lua/wikis/starcraft2/InGameRoles.lua diff --git a/lua/wikis/starcraft2/InGameRoles.lua b/lua/wikis/starcraft2/InGameRoles.lua new file mode 100644 index 00000000000..4b476003ad8 --- /dev/null +++ b/lua/wikis/starcraft2/InGameRoles.lua @@ -0,0 +1,13 @@ +--- +-- @Liquipedia +-- page=Module:InGameRoles +-- +-- Please see https://github.com/Liquipedia/Lua-Modules to contribute +-- + +---@type table +local inGameRoles = { + ['captain'] = {category = 'Captain', display = 'Captain', iconFa = 'captain'}, +} + +return inGameRoles From 961e12d7b23d2ee356844a27bda5a51d87f5acbf Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 15 May 2026 21:19:41 +0200 Subject: [PATCH 4/9] Update Util.lua --- lua/wikis/commons/Role/Util.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/Role/Util.lua b/lua/wikis/commons/Role/Util.lua index 2f7331375a0..3866c1ff72d 100644 --- a/lua/wikis/commons/Role/Util.lua +++ b/lua/wikis/commons/Role/Util.lua @@ -90,7 +90,7 @@ function RoleUtil._createRoleData(roleKey) key = key, type = roleType(), sortOrder = roleData.sortOrder, - icon = roleData.iconFa and IconFa{} + icon = roleData.iconFa and IconFa{iconName = roleData.iconFa, hover = roleData.display} or roleData.icon or POSITION_ICON_DATA and POSITION_ICON_DATA[key] or nil, From ae958d5d9d5fc913043c8900c4b83eb2dd940c9a Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 15 May 2026 21:22:52 +0200 Subject: [PATCH 5/9] Update Data.lua --- lua/wikis/commons/Icon/Data.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/wikis/commons/Icon/Data.lua b/lua/wikis/commons/Icon/Data.lua index ee81020d514..4ceb0c043fe 100644 --- a/lua/wikis/commons/Icon/Data.lua +++ b/lua/wikis/commons/Icon/Data.lua @@ -282,4 +282,7 @@ return { -- Usage: Info button ['general-info'] = 'fas fa-info-circle', + + -- Usage: Role icon for captain / ingame leader + captain = 'far fa-crown' } From 60217d4aa32602fdebd50fd99547d06acaa3414f Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 15 May 2026 21:26:17 +0200 Subject: [PATCH 6/9] nvm seems like captain icon was already set :) --- lua/wikis/commons/Icon/Data.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/lua/wikis/commons/Icon/Data.lua b/lua/wikis/commons/Icon/Data.lua index 4ceb0c043fe..ee81020d514 100644 --- a/lua/wikis/commons/Icon/Data.lua +++ b/lua/wikis/commons/Icon/Data.lua @@ -282,7 +282,4 @@ return { -- Usage: Info button ['general-info'] = 'fas fa-info-circle', - - -- Usage: Role icon for captain / ingame leader - captain = 'far fa-crown' } From c2430c1531ccc6c2800b88277bc6002cca4c1180 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Mon, 18 May 2026 12:33:57 +0200 Subject: [PATCH 7/9] undo the split out changes --- lua/wikis/commons/Role/Util.lua | 11 ++--------- lua/wikis/starcraft2/InGameRoles.lua | 13 ------------- 2 files changed, 2 insertions(+), 22 deletions(-) delete mode 100644 lua/wikis/starcraft2/InGameRoles.lua diff --git a/lua/wikis/commons/Role/Util.lua b/lua/wikis/commons/Role/Util.lua index 3866c1ff72d..7cbafd93112 100644 --- a/lua/wikis/commons/Role/Util.lua +++ b/lua/wikis/commons/Role/Util.lua @@ -12,8 +12,6 @@ local String = Lua.import('Module:StringUtils') local Roles = Lua.import('Module:Roles') -local IconFa = Lua.import('Module:Widget/Image/Icon/Fontawesome') - --- TODO: In the future this should be moved to role data entry local POSITION_ICON_DATA = Lua.requireIfExists('Module:PositionIcon/data', {loadData = true}) @@ -23,13 +21,11 @@ local RoleUtil = {} ---@field display string ---@field category string ---@field sortOrder integer? ----@field iconFa string? ----@field icon string? ---@class RoleData: RoleBaseData ---@field key string? ---@field type RoleTypes ----@field icon VNode|string? +---@field icon string? ---@enum RoleTypes RoleUtil.ROLE_TYPE = { @@ -90,10 +86,7 @@ function RoleUtil._createRoleData(roleKey) key = key, type = roleType(), sortOrder = roleData.sortOrder, - icon = roleData.iconFa and IconFa{iconName = roleData.iconFa, hover = roleData.display} - or roleData.icon - or POSITION_ICON_DATA and POSITION_ICON_DATA[key] - or nil, + icon = POSITION_ICON_DATA and POSITION_ICON_DATA[key] or nil, } end diff --git a/lua/wikis/starcraft2/InGameRoles.lua b/lua/wikis/starcraft2/InGameRoles.lua deleted file mode 100644 index 4b476003ad8..00000000000 --- a/lua/wikis/starcraft2/InGameRoles.lua +++ /dev/null @@ -1,13 +0,0 @@ ---- --- @Liquipedia --- page=Module:InGameRoles --- --- Please see https://github.com/Liquipedia/Lua-Modules to contribute --- - ----@type table -local inGameRoles = { - ['captain'] = {category = 'Captain', display = 'Captain', iconFa = 'captain'}, -} - -return inGameRoles From 78c0ddb84c9e53e6dba44a2f4073695294800c05 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Mon, 18 May 2026 12:34:41 +0200 Subject: [PATCH 8/9] use icon over display if role has an icon --- 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 09271f384ea..0ebe8de1373 100644 --- a/lua/wikis/commons/Widget/Participants/Team/Roster.lua +++ b/lua/wikis/commons/Widget/Participants/Team/Roster.lua @@ -85,7 +85,7 @@ local function getRoleDisplays(player) -- Add non-ingame role if present for _, role in ipairs(roles) do if role.type ~= RoleUtil.ROLE_TYPE.INGAME then - table.insert(rightRoles, role.display) + table.insert(rightRoles, role.icon or role.display) break end end From 9e0e2d5c25d1752443d7c69c9a4aa3a4c3093e81 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 19 May 2026 11:49:17 +0200 Subject: [PATCH 9/9] as per product (...) use abbr instead of icon --- lua/wikis/commons/Role/Util.lua | 8 ++++++++ lua/wikis/commons/Widget/Participants/Team/Roster.lua | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lua/wikis/commons/Role/Util.lua b/lua/wikis/commons/Role/Util.lua index 7cbafd93112..6b8e58535d3 100644 --- a/lua/wikis/commons/Role/Util.lua +++ b/lua/wikis/commons/Role/Util.lua @@ -12,6 +12,8 @@ local String = Lua.import('Module:StringUtils') local Roles = Lua.import('Module:Roles') +local Html = Lua.import('Module:Widget/Html') + --- TODO: In the future this should be moved to role data entry local POSITION_ICON_DATA = Lua.requireIfExists('Module:PositionIcon/data', {loadData = true}) @@ -21,10 +23,12 @@ local RoleUtil = {} ---@field display string ---@field category string ---@field sortOrder integer? +---@field abbreviation string? ---@class RoleData: RoleBaseData ---@field key string? ---@field type RoleTypes +---@field abbreviation string? ---@field icon string? ---@enum RoleTypes @@ -86,6 +90,10 @@ function RoleUtil._createRoleData(roleKey) key = key, type = roleType(), sortOrder = roleData.sortOrder, + abbreviation = roleData.abbreviation and Html.Abbr{ + children = roleData.abbreviation, + title = roleData.display, + } or nil, icon = POSITION_ICON_DATA and POSITION_ICON_DATA[key] or nil, } end diff --git a/lua/wikis/commons/Widget/Participants/Team/Roster.lua b/lua/wikis/commons/Widget/Participants/Team/Roster.lua index 0ebe8de1373..0b8cf195a96 100644 --- a/lua/wikis/commons/Widget/Participants/Team/Roster.lua +++ b/lua/wikis/commons/Widget/Participants/Team/Roster.lua @@ -85,7 +85,7 @@ local function getRoleDisplays(player) -- Add non-ingame role if present for _, role in ipairs(roles) do if role.type ~= RoleUtil.ROLE_TYPE.INGAME then - table.insert(rightRoles, role.icon or role.display) + table.insert(rightRoles, role.abbreviation or role.display) break end end