Skip to content

Commit

Permalink
Get stage images from the dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
inkfarer committed Sep 2, 2023
1 parent cd24fdf commit 10ea921
Show file tree
Hide file tree
Showing 47 changed files with 14 additions and 53 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sac-overlays",
"version": "0.0.0",
"compatibleDashboardVersion": "^4.0.0",
"compatibleDashboardVersion": "^4.4.0",
"compatibleGameVersions": [
"SPLATOON_2",
"SPLATOON_3"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed src/graphics/assets/stages/S2_Stage_Goby_Arena.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed src/graphics/assets/stages/S2_Stage_Kelp_Dome.png
Binary file not shown.
Binary file removed src/graphics/assets/stages/S2_Stage_MakoMart.png
Binary file not shown.
Binary file removed src/graphics/assets/stages/S2_Stage_Manta_Maria.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed src/graphics/assets/stages/S2_Stage_Piranha_Pit.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed src/graphics/assets/stages/S2_Stage_The_Reef.png
Binary file not shown.
Binary file removed src/graphics/assets/stages/S2_Stage_Wahoo_World.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed src/graphics/assets/stages/S3_Stage_Mako_Mart.jpg
Diff not rendered.
Binary file removed src/graphics/assets/stages/S3_Stage_Manta_Maria.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed src/graphics/assets/stages/S3_Stage_Umami_Ruins.png
Diff not rendered.
Diff not rendered.
Binary file removed src/graphics/assets/stages/S3_Stage_Wahoo_World.jpg
Diff not rendered.
File renamed without changes
21 changes: 11 additions & 10 deletions src/graphics/break/scripts/stages.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { activeBreakScene, activeRound } from '../../helpers/replicants';
import { activeBreakScene, activeRound, assetPaths } from '../../helpers/replicants';
import {
getUpdatedGames,
getUpdatedWinners,
Expand All @@ -7,27 +7,28 @@ import {
UpdatedWinner
} from '../../helpers/stage';
import gsap from 'gsap';
import { mapNameToImagePath } from '../../helpers/constants';
import { loadImage } from '../../helpers/image';
import { elementById } from '../../helpers/elem';
import { textOpacitySwap } from '../../helpers/anim';
import { sceneSwitchTl } from './sceneSwitcher';

const stagesLayout = elementById('stages-layout');

activeRound.on('change', (newValue, oldValue) => {
const games = getUpdatedGames(newValue, oldValue);
const winners = getUpdatedWinners(newValue, oldValue);
NodeCG.waitForReplicants(activeRound, assetPaths).then(() => {
activeRound.on('change', (newValue, oldValue) => {
const games = getUpdatedGames(newValue, oldValue);
const winners = getUpdatedWinners(newValue, oldValue);

updateGames(games, winners);
updateGames(games, winners);

if (!games.isNewMatch) {
setWinners(winners);
}
if (!games.isNewMatch) {
setWinners(winners);
}
});
});

function getStageUrl(stageName: string): string {
return `assets/stages/${mapNameToImagePath[stageName]}`;
return assetPaths.value.stageImages[stageName] ?? 'assets/unknown-stage.png';
}

async function updateGames(games: UpdatedGames, winners: Array<UpdatedWinner>): Promise<void> {
Expand Down
41 changes: 0 additions & 41 deletions src/graphics/helpers/constants.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,3 @@
export const APP_WIDTH = 1920;
export const APP_HEIGHT = 1080;
export const DASHBOARD_BUNDLE_NAME = 'ipl-overlay-controls';

export const mapNameToImagePath: Record<string, string> = {
'Ancho-V Games': 'S2_Stage_Ancho-V_Games.png',
'Arowana Mall': 'S2_Stage_Arowana_Mall.png',
'Blackbelly Skatepark': 'S2_Stage_Blackbelly_Skatepark.png',
'Camp Triggerfish': 'S2_Stage_Camp_Triggerfish.png',
'Goby Arena': 'S2_Stage_Goby_Arena.png',
'Humpback Pump Track': 'S3_Stage_Humpback_Pump_Track.png',
'Inkblot Art Academy': 'S3_Stage_Inkblot_Art_Academy.jpg',
'Kelp Dome': 'S2_Stage_Kelp_Dome.png',
MakoMart: 'S3_Stage_Mako_Mart.jpg',
'Manta Maria': 'S3_Stage_Manta_Maria.png',
'Moray Towers': 'S2_Stage_Moray_Towers.png',
'Musselforge Fitness': 'S2_Stage_Musselforge_Fitness.png',
'New Albacore Hotel': 'S2_Stage_New_Albacore_Hotel.png',
'Piranha Pit': 'S2_Stage_Piranha_Pit.png',
'Port Mackerel': 'S2_Stage_Port_Mackerel.png',
'Shellendorf Institute': 'S2_Stage_Shellendorf_Institute.png',
'Shifty Station': 'S2_Stage_Shifty_Station.png',
'Snapper Canal': 'S2_Stage_Snapper_Canal.png',
'Starfish Mainstage': 'S2_Stage_Starfish_Mainstage.png',
'Sturgeon Shipyard': 'S3_Stage_Sturgeon_Shipyard.jpg',
'The Reef': 'S2_Stage_The_Reef.png',
'Wahoo World': 'S3_Stage_Wahoo_World.jpg',
'Walleye Warehouse': 'S2_Stage_Walleye_Warehouse.png',
'Skipper Pavilion': 'S2_Stage_Skipper_Pavilion.png',
'Eeltail Alley':'S3_Stage_Eeltail_Alley.jpg',
'Hagglefish Market':'S3_Stage_Hagglefish_Market.webp',
'Hammerhead Bridge':'S3_Stage_Hammerhead_Bridge.jpg',
'Mahi-Mahi Resort': 'S3_Stage_Mahi_Mahi_Resort.jpg',
'Mincemeat Metalworks': 'S3_Stage_Mincemeat_metalworks.png',
'Museum d\'Alfonsino': 'S3_Stage_Museum_dAlfonsino.jpg',
'Scorch Gorge':'S3_Stage_Scorch_Gorge.jpg',
'Flounder Heights': 'S3_Stage_Flounder_Heights.png',
'Brinewater Springs': 'S3_Brinewater_Springs.png',
'Undertow Spillway':'S3_Stage_Undertow_Spillway.jpg',
'Um\'ami Ruins': 'S3_Stage_Umami_Ruins.png',
'Barnacle & Dime': 'S3_Stage_Barnacle_&_Dime.png',
'Unknown Stage': 'unknown-stage.png',
Counterpick: 'unknown-stage.png'
};
3 changes: 2 additions & 1 deletion src/graphics/helpers/replicants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DASHBOARD_BUNDLE_NAME } from './constants';
import { MusicShown, NowPlaying, Casters, ActiveRound, PredictionStore, ActiveBreakScene, MainFlavorText, NextRoundStartTime, ScoreboardData, NextRound } from 'schemas';
import { MusicShown, NowPlaying, Casters, ActiveRound, PredictionStore, ActiveBreakScene, MainFlavorText, NextRoundStartTime, ScoreboardData, NextRound, AssetPaths } from 'schemas';

export const musicShown = nodecg.Replicant<MusicShown>('musicShown', DASHBOARD_BUNDLE_NAME);
export const nowPlaying = nodecg.Replicant<NowPlaying>('nowPlaying', DASHBOARD_BUNDLE_NAME);
Expand All @@ -11,3 +11,4 @@ export const mainFlavorText = nodecg.Replicant<MainFlavorText>('mainFlavorText',
export const nextRoundTime = nodecg.Replicant<NextRoundStartTime>('nextRoundStartTime', DASHBOARD_BUNDLE_NAME);
export const scoreboardData = nodecg.Replicant<ScoreboardData>('scoreboardData', DASHBOARD_BUNDLE_NAME);
export const nextRound = nodecg.Replicant<NextRound>('nextRound', DASHBOARD_BUNDLE_NAME);
export const assetPaths = nodecg.Replicant<AssetPaths>('assetPaths', DASHBOARD_BUNDLE_NAME);

0 comments on commit 10ea921

Please sign in to comment.