Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: switch from female to game changer on valorant #4856

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
--

local Class = require('Module:Class')
local Logic = require('Module:Logic')
local Lua = require('Module:Lua')
local Tier = require('Module:Tier/Custom')
local Variables = require('Module:Variables')
Expand Down Expand Up @@ -39,7 +40,8 @@ function CustomHiddenDataBox.addCustomVariables(args, queryResult)
Variables.varDefine('tournament_ticker_name', Variables.varDefault('tournament_tickername'))
Variables.varDefine('tournament_icon_darkmode', Variables.varDefault('tournament_icondark'))
Variables.varDefine('mode', Variables.varDefault('tournament_mode', 'team'))
Variables.varDefine('female', queryResult.extradata.female or args.female and 'true' or 'false')
Variables.varDefine('gamechanger', queryResult.extradata.gamechanger
or tostring(Logic.readBool(args.gc or args.female)))
BasicHiddenDataBox.checkAndAssign('patch', args.patch, queryResult.patch)
BasicHiddenDataBox.checkAndAssign('tournament_riot_premier', queryResult.tournament_riot_premier, args.riotpremier)
end
Expand Down
10 changes: 6 additions & 4 deletions components/infobox/wikis/valorant/infobox_league_custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ end
---@param args table
function CustomLeague:customParseArguments(args)
self.data.mode = (args.individual or args.player_number) and '1v1' or 'team'
-- female as a temp alias to bot the old input over
self.data.gameChanger = Logic.readBool(args.gc or args.female)
self.data.publishertier = Logic.readBool(args['riot-highlighted']) and 'highlighted'
or Logic.readBool(args['riot-sponsored']) and 'sponsored'
or nil
Expand Down Expand Up @@ -89,8 +91,8 @@ end
function CustomLeague:getWikiCategories(args)
local categories = {}

if Logic.readBool(args.female) then
table.insert(categories, 'Female Tournaments')
if self.data.gameChanger then
table.insert(categories, 'Game Changers Tournaments')
hjpalpha marked this conversation as resolved.
Show resolved Hide resolved
end

return categories
Expand All @@ -105,7 +107,7 @@ function CustomLeague:addToLpdb(lpdbData, args)
lpdbData.extradata.region = Template.safeExpand(mw.getCurrentFrame(), 'Template:Player region', {args.country})
lpdbData.extradata.startdate_raw = args.sdate or args.date
lpdbData.extradata.enddate_raw = args.edate or args.date
lpdbData.extradata.female = args.female or 'false'
lpdbData.extradata.gamechangers = tostring(self.data.gameChanger)
hjpalpha marked this conversation as resolved.
Show resolved Hide resolved

return lpdbData
end
Expand Down Expand Up @@ -146,7 +148,7 @@ end
---@param args table
function CustomLeague:defineCustomPageVariables(args)
-- Wiki Custom
Variables.varDefine('female', args.female or 'false')
Variables.varDefine('gamechanger', tostring(self.data.gameChanger))
Variables.varDefine('tournament_riot_premier', args.riotpremier and 'true' or '')
Variables.varDefine('patch', args.patch or '')

Expand Down
2 changes: 1 addition & 1 deletion components/match2/wikis/valorant/match_legacy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function MatchLegacy._convertParameters(match2)
local extradata = Json.parseIfString(match2.extradata)

match.extradata.matchsection = extradata.matchsection
match.extradata.female = Variables.varDefault('female')
match.extradata.gamechanger = Variables.varDefault('gamechanger')
match.extradata.hidden = Logic.readBool(Variables.varDefault('match_hidden')) and '1' or '0'
match.extradata.cancelled = Logic.readBool(Variables.varDefault('cancelled')) and '1' or '0'
match.extradata.bestofx = match2.bestof ~= 0 and tostring(match2.bestof) or ''
Expand Down
Loading