Skip to content

Commit

Permalink
feat: infobox patch for fortnite (#3457)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rathoz authored Nov 2, 2023
1 parent f8cdf67 commit 01fb466
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions components/infobox/wikis/fortnite/infobox_patch_custom.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
-- @Liquipedia
-- wiki=fortnite
-- page=Module:Infobox/Patch/Custom
--
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute
--

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

local Patch = Lua.import('Module:Infobox/Patch', {requireDevIfEnabled = true})

local CustomPatch = Class.new()

---@param frame Frame
---@return Html
function CustomPatch.run(frame)
local patch = Patch(frame)
patch.args.informationType = 'Version'

patch.getChronologyData = CustomPatch.getChronologyData

return patch:createInfobox()
end

---@param args table
---@return {previous: string?, next: string?}
function CustomPatch:getChronologyData(args)
local data = {}
if args.previous then
data.previous = 'Version ' .. args.previous .. '|' .. args.previous
end
if args.next then
data.next = 'Version ' .. args.next .. '|' .. args.next
end
return data
end

return CustomPatch

0 comments on commit 01fb466

Please sign in to comment.