Skip to content

Commit

Permalink
Add fighters series infobox (#3776)
Browse files Browse the repository at this point in the history
* copy from live .........

* clean up

* do not display totalprizepool as per https://discord.com/channels/93055209017729024/268719633366777856/1195151415325245450

* add injector require and class

* kick redundant

* Update infobox_series_custom.lua
  • Loading branch information
hjpalpha authored Jan 15, 2024
1 parent ebb9f58 commit e6f0a71
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions components/infobox/wikis/fighters/infobox_series_custom.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
-- @Liquipedia
-- wiki=fighters
-- page=Module:Infobox/Series/Custom
--
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute
--

local Class = require('Module:Class')
local Lua = require('Module:Lua')

local Injector = Lua.import('Module:Infobox/Widget/Injector')
local Series = Lua.import('Module:Infobox/Series')

---@class FightersSeriesInfobox: SeriesInfobox
local CustomSeries = Class.new(Series)
local CustomInjector = Class.new(Injector)

---@param frame Frame
---@return Html
function CustomSeries.run(frame)
local series = CustomSeries(frame)
series:setWidgetInjector(CustomInjector(series))

return series:createInfobox()
end

---@param id string
---@param widgets Widget[]
---@return Widget[]
function CustomInjector:parse(id, widgets)
if id == 'totalprizepool' then return {} end

return widgets
end

---@param lpdbData table
---@param args table
---@return table
function CustomSeries:addToLpdb(lpdbData, args)
lpdbData.extradata = {
parentseries = args.parentseries
}

return lpdbData
end

return CustomSeries

0 comments on commit e6f0a71

Please sign in to comment.