Skip to content

Commit

Permalink
feat(match2): add casters display to CrossFire (#4088)
Browse files Browse the repository at this point in the history
* feat: Add casters display to CrossFire M2

* Add the required extradata so that it actually displayed
  • Loading branch information
Hesketh2 authored Mar 26, 2024
1 parent 601d2d2 commit 7fdc494
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ end

function matchFunctions.getExtraData(match)
match.extradata = {
mvp = MatchGroupInput.readMvp(match)
mvp = MatchGroupInput.readMvp(match),
casters = MatchGroupInput.readCasters(match, {noSort = true})
}
return match
end
Expand Down
12 changes: 12 additions & 0 deletions components/match2/wikis/crossfire/match_summary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

local DateExt = require('Module:Date/Ext')
local Icon = require('Module:Icon')
local Json = require('Module:Json')
local Logic = require('Module:Logic')
local Lua = require('Module:Lua')
local MapModes = require('Module:MapModes')
Expand Down Expand Up @@ -79,6 +80,17 @@ function CustomMatchSummary.createBody(match)

end

-- casters
if String.isNotEmpty(match.extradata.casters) then
local casters = Json.parseIfString(match.extradata.casters)
local casterRow = MatchSummary.Casters()
for _, caster in pairs(casters) do
casterRow:addCaster(caster)
end

body:addRow(casterRow)
end

return body
end

Expand Down

0 comments on commit 7fdc494

Please sign in to comment.