-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: infobox patch for fortnite (#3457)
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
components/infobox/wikis/fortnite/infobox_patch_custom.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |