From 52409e6bae931a29d05ef969e8cf478e16e2c1ef Mon Sep 17 00:00:00 2001 From: Eetu Rantanen Date: Tue, 2 Jun 2026 12:57:41 +0300 Subject: [PATCH 1/5] custom for hok --- lua/wikis/honorofkings/InGameRoles.lua | 10 ++-- .../honorofkings/TeamCard/Legacy/Custom.lua | 54 +++++++++++++++++++ 2 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 lua/wikis/honorofkings/TeamCard/Legacy/Custom.lua diff --git a/lua/wikis/honorofkings/InGameRoles.lua b/lua/wikis/honorofkings/InGameRoles.lua index f6be20ec8da..bbea22918c3 100644 --- a/lua/wikis/honorofkings/InGameRoles.lua +++ b/lua/wikis/honorofkings/InGameRoles.lua @@ -8,11 +8,11 @@ ---@type table local inGameRoles = { ['top'] = {category = 'Top Laners', display = 'Top Lane', sortOrder = 1}, - ['bottom'] = {category = 'Bottom Laners', display = 'Bottom Laner', sortOrder = 5}, - ['mid'] = {category = 'Mid Laners', display = 'Mid Laner', sortOrder = 4}, - ['side lane'] = {category = 'Side Laners', display = 'Side Laner', sortOrder = 2}, - ['jungler'] = {category = 'Junglers', display = 'Jungler', sortOrder = 3}, - ['roamer'] = {category = 'Roamers', display = 'Roamer', sortOrder = 6}, + ['bottom'] = {category = 'Bottom Laners', display = 'Bottom Laner', sortOrder = 4}, + ['mid'] = {category = 'Mid Laners', display = 'Mid Laner', sortOrder = 3}, + ['side lane'] = {category = 'Side Laners', display = 'Side Laner', sortOrder = 6}, + ['jungler'] = {category = 'Junglers', display = 'Jungler', sortOrder = 2}, + ['roamer'] = {category = 'Roamers', display = 'Roamer', sortOrder = 5}, ['flex'] = {category = 'Flex', display = 'Flex', sortOrder = 7}, } diff --git a/lua/wikis/honorofkings/TeamCard/Legacy/Custom.lua b/lua/wikis/honorofkings/TeamCard/Legacy/Custom.lua new file mode 100644 index 00000000000..836a838771b --- /dev/null +++ b/lua/wikis/honorofkings/TeamCard/Legacy/Custom.lua @@ -0,0 +1,54 @@ +--- +-- @Liquipedia +-- page=Module:TeamCard/Legacy/Custom +-- +-- Please see https://github.com/Liquipedia/Lua-Modules to contribute +-- + +local Lua = require('Module:Lua') + +local Array = Lua.import('Module:Array') +local InGameRoles = Lua.import('Module:InGameRoles', {loadData = true}) +local LegacyTeamCard = Lua.import('Module:TeamCard/Legacy') +local Logic = Lua.import('Module:Logic') +local Table = Lua.import('Module:Table') + +local DEFAULT_MAX_PLAYER_INDEX = 10 +local INGAME_ROLES_BY_ORDER = Table.map(InGameRoles, function(_, roleData) + return roleData.sortOrder, roleData.display +end) + +local CustomLegacyTeamCard = {} + +-- Template entry point +---@return Widget +function CustomLegacyTeamCard.run() + return LegacyTeamCard.run(CustomLegacyTeamCard) +end + +---@param card table +---@return table +function CustomLegacyTeamCard.preprocessCard(card) + Array.forEach(Array.range(1, DEFAULT_MAX_PLAYER_INDEX), function(index) + local key = 'p' .. index + card[key .. 'pos'] = Logic.emptyOr( + card[key .. 'pos'], + Table.extract(card, 'pos' .. index), + INGAME_ROLES_BY_ORDER[index] + ) + end) + + for tabIndex = 2, 3 do + Array.forEach(Array.range(1, DEFAULT_MAX_PLAYER_INDEX), function(index) + local key = 't' .. tabIndex .. 'p' .. index + card[key .. 'pos'] = Logic.emptyOr( + card[key .. 'pos'], + Table.extract(card, 't' .. tabIndex .. 'pos' .. index) + ) + end) + end + + return card +end + +return CustomLegacyTeamCard From b7c2fc99fb1af01ee41ed588806ad56a68b43544 Mon Sep 17 00:00:00 2001 From: Eetu Rantanen Date: Tue, 2 Jun 2026 13:05:20 +0300 Subject: [PATCH 2/5] cap slot-index role default to the 5-man lineup --- lua/wikis/honorofkings/TeamCard/Legacy/Custom.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/wikis/honorofkings/TeamCard/Legacy/Custom.lua b/lua/wikis/honorofkings/TeamCard/Legacy/Custom.lua index 836a838771b..69a00b23b04 100644 --- a/lua/wikis/honorofkings/TeamCard/Legacy/Custom.lua +++ b/lua/wikis/honorofkings/TeamCard/Legacy/Custom.lua @@ -14,6 +14,7 @@ local Logic = Lua.import('Module:Logic') local Table = Lua.import('Module:Table') local DEFAULT_MAX_PLAYER_INDEX = 10 +local DEFAULT_LINEUP_SIZE = 5 local INGAME_ROLES_BY_ORDER = Table.map(InGameRoles, function(_, roleData) return roleData.sortOrder, roleData.display end) @@ -34,7 +35,7 @@ function CustomLegacyTeamCard.preprocessCard(card) card[key .. 'pos'] = Logic.emptyOr( card[key .. 'pos'], Table.extract(card, 'pos' .. index), - INGAME_ROLES_BY_ORDER[index] + index <= DEFAULT_LINEUP_SIZE and INGAME_ROLES_BY_ORDER[index] or nil ) end) From 77b59b8ae1e7848926b6cc29c5be73e3e8ec71a9 Mon Sep 17 00:00:00 2001 From: Eetu Rantanen Date: Tue, 2 Jun 2026 13:08:12 +0300 Subject: [PATCH 3/5] reorder InGameRoles entries to match sortOrder --- lua/wikis/honorofkings/InGameRoles.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/wikis/honorofkings/InGameRoles.lua b/lua/wikis/honorofkings/InGameRoles.lua index bbea22918c3..23a2ef144aa 100644 --- a/lua/wikis/honorofkings/InGameRoles.lua +++ b/lua/wikis/honorofkings/InGameRoles.lua @@ -8,11 +8,11 @@ ---@type table local inGameRoles = { ['top'] = {category = 'Top Laners', display = 'Top Lane', sortOrder = 1}, - ['bottom'] = {category = 'Bottom Laners', display = 'Bottom Laner', sortOrder = 4}, - ['mid'] = {category = 'Mid Laners', display = 'Mid Laner', sortOrder = 3}, - ['side lane'] = {category = 'Side Laners', display = 'Side Laner', sortOrder = 6}, ['jungler'] = {category = 'Junglers', display = 'Jungler', sortOrder = 2}, + ['mid'] = {category = 'Mid Laners', display = 'Mid Laner', sortOrder = 3}, + ['bottom'] = {category = 'Bottom Laners', display = 'Bottom Laner', sortOrder = 4}, ['roamer'] = {category = 'Roamers', display = 'Roamer', sortOrder = 5}, + ['side lane'] = {category = 'Side Laners', display = 'Side Laner', sortOrder = 6}, ['flex'] = {category = 'Flex', display = 'Flex', sortOrder = 7}, } From 8a1d858b668f57ea57f9147c062d00d98f64c4ee Mon Sep 17 00:00:00 2001 From: Eetu Rantanen Date: Tue, 2 Jun 2026 13:48:37 +0300 Subject: [PATCH 4/5] add missing aliases --- lua/wikis/honorofkings/InGameRoles.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/wikis/honorofkings/InGameRoles.lua b/lua/wikis/honorofkings/InGameRoles.lua index 23a2ef144aa..4aedcd9be8b 100644 --- a/lua/wikis/honorofkings/InGameRoles.lua +++ b/lua/wikis/honorofkings/InGameRoles.lua @@ -29,10 +29,13 @@ inGameRoles['adc'] = inGameRoles.bottom inGameRoles['bot'] = inGameRoles.bottom inGameRoles['carry'] = inGameRoles.bottom inGameRoles['farm'] = inGameRoles.bottom +inGameRoles['bottom lane'] = inGameRoles.bottom inGameRoles['mid laner'] = inGameRoles.mid +inGameRoles['middle'] = inGameRoles.mid inGameRoles['ds lane'] = inGameRoles.top inGameRoles['dsl'] = inGameRoles.top inGameRoles['dark slayer lane'] = inGameRoles.top +inGameRoles['top lane'] = inGameRoles.top inGameRoles['confront'] = inGameRoles.top inGameRoles['clash'] = inGameRoles.top inGameRoles['fill'] = inGameRoles.flex From dab5785d0ce1e1e1a7330f7bbdf5511a53247d5c Mon Sep 17 00:00:00 2001 From: Eetu Rantanen Date: Tue, 2 Jun 2026 14:01:12 +0300 Subject: [PATCH 5/5] fix display name to render icons for mid and bot --- lua/wikis/honorofkings/InGameRoles.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/wikis/honorofkings/InGameRoles.lua b/lua/wikis/honorofkings/InGameRoles.lua index 4aedcd9be8b..d5cd96911aa 100644 --- a/lua/wikis/honorofkings/InGameRoles.lua +++ b/lua/wikis/honorofkings/InGameRoles.lua @@ -9,8 +9,8 @@ local inGameRoles = { ['top'] = {category = 'Top Laners', display = 'Top Lane', sortOrder = 1}, ['jungler'] = {category = 'Junglers', display = 'Jungler', sortOrder = 2}, - ['mid'] = {category = 'Mid Laners', display = 'Mid Laner', sortOrder = 3}, - ['bottom'] = {category = 'Bottom Laners', display = 'Bottom Laner', sortOrder = 4}, + ['mid'] = {category = 'Mid Laners', display = 'Middle', sortOrder = 3}, + ['bottom'] = {category = 'Bottom Laners', display = 'Bottom Lane', sortOrder = 4}, ['roamer'] = {category = 'Roamers', display = 'Roamer', sortOrder = 5}, ['side lane'] = {category = 'Side Laners', display = 'Side Laner', sortOrder = 6}, ['flex'] = {category = 'Flex', display = 'Flex', sortOrder = 7},