Skip to content

Commit

Permalink
feat(infobox): add matchticker/tournaments to player on Overwatch (#4484
Browse files Browse the repository at this point in the history
)

* Add matchticker/tournaments to player infobox

* Update components/infobox/wikis/overwatch/infobox_person_player_custom.lua

Co-authored-by: hjpalpha <[email protected]>

---------

Co-authored-by: hjpalpha <[email protected]>
  • Loading branch information
ThatMoonshot and hjpalpha authored Aug 13, 2024
1 parent 4090fca commit 003deff
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ local CharacterIcon = require('Module:CharacterIcon')
local CharacterNames = mw.loadData('Module:CharacterNames')
local GameAppearances = require('Module:GetGameAppearances')
local Lua = require('Module:Lua')
local MatchTicker = require('Module:MatchTicker/Custom')
local Page = require('Module:Page')
local String = require('Module:StringUtils')
local Team = require('Module:Team')
local Variables = require('Module:Variables')
local Template = require('Module:Template')

Expand Down Expand Up @@ -177,4 +179,19 @@ function CustomPlayer:_isPlayerOrStaff()
end
end

---@return string?
function CustomPlayer:createBottomContent()
if self:shouldStoreData(self.args) and String.isNotEmpty(self.args.team) then
local teamPage = Team.page(mw.getCurrentFrame(), self.args.team)
local team2Page = Team.page(mw.getCurrentFrame(), self.args.team2)
return
tostring(MatchTicker.player{recentLimit = 3}) ..
Template.safeExpand(
mw.getCurrentFrame(),
'Upcoming and ongoing tournaments of',
{team = teamPage}, {team2 = team2Page}
)
end
end

return CustomPlayer

0 comments on commit 003deff

Please sign in to comment.