Lua-Modules icon indicating copy to clipboard operation
Lua-Modules copied to clipboard

feat(infobox): show platform on valorant

Open iamentry opened this issue 1 year ago • 6 comments

Summary

Adds platform param to use for Console tournaments (by default set to PC)

There has been discussion in the Valorant channel about whether or not they should cover Console tournaments since they don't have a way to differentiate. Convo: https://discord.com/channels/93055209017729024/684060921898860569/1270099131913867284

I will open this pr then ask the Valorant channel if they want any other aliases added (imo it is best just to use 1)

How did you test this change?

dev

iamentry avatar Aug 05 '24 20:08 iamentry

imo

  • parse it in customParseArguments (kick the lookup function altogether)

Which function should I use to set the default platform?

  • use self.data.platform from there
  • build the cell directly in parse instead of an extra function
			Cell{name = 'Platform', content = {PageLink.makeInternalLink(
				caller.data.platform,
				caller.data.platform and (':Category:' .. caller.data.platform) or nil)
			}},

caller is supposed to be set to self, right?

  • why not store it in lpdb (extradata)?

Not sure I did this right

  • the category building you do doesn't make much sense, rather use
function CustomLeague:getWikiCategories(args)
	return Array.append({self.data.platform .. ' Tournaments'},
		Logic.readBool(args.female) and 'Female Tournaments' or nil,
	)
end

Tests aren't working so I know I messed something up

iamentry avatar Aug 06 '24 04:08 iamentry

Got it to function but not as intended. I didn't really do the display right, it doesn't pick up on PLATFORMS i.e. console = console instead of console = Console (with caps)

iamentry avatar Aug 06 '24 05:08 iamentry

Test still failing at Line 71: attempt to index field 'data' (a nil value)

iamentry avatar Aug 06 '24 05:08 iamentry

All tests pass, thanks Hjp

iamentry avatar Aug 06 '24 05:08 iamentry

I will open this pr then ask the Valorant channel if they want any other aliases added (imo it is best just to use 1)

No aliases is preferred, it just creates headaches later on

Rathoz avatar Aug 06 '24 08:08 Rathoz

I'll wait to merge this until there are console tournaments live on the wiki

Rathoz avatar Aug 06 '24 08:08 Rathoz

Closing as stale, feel free to reopen is that changes

Rathoz avatar Feb 21 '25 12:02 Rathoz