Added support for Eggstra Work schedules in Splatoon 3.
This commit is contained in:
parent
c83feef79e
commit
db5dc0e507
1 changed files with 46 additions and 2 deletions
|
@ -15,7 +15,7 @@ define('SP3_FESTS', SP3_DOMAIN . '/data/festivals.json');
|
|||
define('SP3_TYPES', [SP_TYPE_SCHED, SP_TYPE_FESTS]);
|
||||
define('SP3_SCHED_FILTER', [
|
||||
'regular', 'bankara', 'series', 'open', 'x',
|
||||
'league', 'coop', 'bigrun', 'fest',
|
||||
'league', 'coop', 'bigrun', 'fest', 'eggstra',
|
||||
]);
|
||||
|
||||
define('SP2_DEFAULT_LOCALE', 'en');
|
||||
|
@ -179,6 +179,8 @@ function splatoon3_ruleset_short(string $id): string {
|
|||
return 'RM';
|
||||
if($id === 'TURF_WAR')
|
||||
return 'TW';
|
||||
if($id === 'TEAM_CONTEST')
|
||||
return 'EW';
|
||||
if($id === 'coop')
|
||||
return 'SR';
|
||||
if($id === 'bigrun')
|
||||
|
@ -252,6 +254,7 @@ if($typeId === SP_TYPE_SCHED) { // SCHEDULE SHIT
|
|||
$includeX = $filterAll || in_array('x', $filters);
|
||||
$includeLeague = $filterAll || in_array('league', $filters);
|
||||
$includeSalmon = $filterAll || in_array('coop', $filters);
|
||||
$includeEggstra = $filterAll || in_array('eggstra', $filters);
|
||||
$includeBigRun = $filterAll || in_array('bigrun', $filters);
|
||||
$includeFest = $filterAll || in_array('fest', $filters);
|
||||
$includeSeries = $includeSeries || $includeRanked;
|
||||
|
@ -491,6 +494,47 @@ if($typeId === SP_TYPE_SCHED) { // SCHEDULE SHIT
|
|||
}
|
||||
}
|
||||
|
||||
if($includeEggstra && !empty($data->coopGroupingSchedule->teamContestSchedules->nodes)) {
|
||||
$schedule = [];
|
||||
|
||||
$nodes = $data->coopGroupingSchedule->teamContestSchedules->nodes;
|
||||
foreach($nodes as $node) {
|
||||
if(empty($node->setting))
|
||||
continue;
|
||||
|
||||
$schedule[] = $item = new stdClass;
|
||||
splatoon3_schedule_gen($item, $node);
|
||||
$item->variant = 'coop';
|
||||
|
||||
$item->stages = [
|
||||
[
|
||||
'name' => $node->setting->coopStage->name,
|
||||
'image' => $node->setting->coopStage->image->url,
|
||||
],
|
||||
];
|
||||
|
||||
$item->weapons = [];
|
||||
foreach($node->setting->weapons as $weapon)
|
||||
$item->weapons[] = [
|
||||
'name' => $localeInfo->weapons->{$weapon->__splatoon3ink_id}?->name ?? $weapon->name,
|
||||
'image' => $weapon->image->url,
|
||||
];
|
||||
}
|
||||
|
||||
if(!empty($schedule)) {
|
||||
$gameModes[] = [
|
||||
'id' => 'eggstra',
|
||||
'name' => 'Eggstra Work',
|
||||
'colour' => 0xFFBE8800,
|
||||
];
|
||||
|
||||
$schedules[] = [
|
||||
'mode' => 'eggstra',
|
||||
'schedule' => $schedule,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
if($includeBigRun && !empty($data->coopGroupingSchedule->bigRunSchedules->nodes)) {
|
||||
$schedule = [];
|
||||
|
||||
|
@ -522,7 +566,7 @@ if($typeId === SP_TYPE_SCHED) { // SCHEDULE SHIT
|
|||
$gameModes[] = [
|
||||
'id' => 'bigrun',
|
||||
'name' => 'Big Run',
|
||||
'colour' => 0xFFFF5600, // reinvestigate this
|
||||
'colour' => 0xFFB322FF,
|
||||
];
|
||||
|
||||
$schedules[] = [
|
||||
|
|
Reference in a new issue