From bfb6d74cc42c8dcaf73412da175eeed8163d653d Mon Sep 17 00:00:00 2001 From: Hesketh2 <88981446+Hesketh2@users.noreply.github.com> Date: Tue, 12 Sep 2023 01:04:05 +0700 Subject: [PATCH] Add Patch support for PUBG (PC) --- .../infobox/wikis/pubg/infobox_league_custom.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/components/infobox/wikis/pubg/infobox_league_custom.lua b/components/infobox/wikis/pubg/infobox_league_custom.lua index 8ca65717f66..d506a2804ab 100644 --- a/components/infobox/wikis/pubg/infobox_league_custom.lua +++ b/components/infobox/wikis/pubg/infobox_league_custom.lua @@ -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') @@ -91,6 +92,10 @@ function CustomInjector:parse(id, widgets) CustomLeague:_getGameMode() } }, + Cell{name = 'Patch', content = { + CustomLeague._getPatchVersion() + } + }, Cell{name = 'Platform', content = { CustomLeague:_getPlatform() } @@ -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