Skip to content

Commit

Permalink
Add Patch support for PUBG (PC)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hesketh2 authored Sep 11, 2023
1 parent 489a0a2 commit bfb6d74
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions components/infobox/wikis/pubg/infobox_league_custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
local Class = require('Module:Class')
local Logic = require('Module:Logic')
local Lua = require('Module:Lua')
local PageLink = require('Module:Page')
local String = require('Module:StringUtils')
local Template = require('Module:Template')
local Table = require('Module:Table')
Expand Down Expand Up @@ -91,6 +92,10 @@ function CustomInjector:parse(id, widgets)
CustomLeague:_getGameMode()
}
},
Cell{name = 'Patch', content = {
CustomLeague._getPatchVersion()
}
},
Cell{name = 'Platform', content = {
CustomLeague:_getPlatform()
}
Expand Down Expand Up @@ -167,4 +172,15 @@ function CustomLeague:_getPlatform()
return _PLATFORMS[platform] or _PLATFORMS['default']
end

function CustomLeague._getPatchVersion()
if String.isEmpty(_args.patch) then return nil end
local content = PageLink.makeInternalLink(_args.patch, 'Patch ' .. _args.patch)
if not String.isEmpty(_args.epatch) then
content = content .. ' – '
content = content .. PageLink.makeInternalLink(_args.epatch, 'Patch ' .. _args.epatch)
end

return content
end

return CustomLeague

0 comments on commit bfb6d74

Please sign in to comment.