diff --git a/package.json b/package.json index 5bb78e8..b5b893e 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "sac-overlays", "version": "0.0.0", - "compatibleDashboardVersion": "^4.0.0", + "compatibleDashboardVersion": "^4.4.0", "compatibleGameVersions": [ "SPLATOON_2", "SPLATOON_3" diff --git a/src/graphics/assets/stages/S2_Stage_Ancho-V_Games.png b/src/graphics/assets/stages/S2_Stage_Ancho-V_Games.png deleted file mode 100755 index 912a676..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Ancho-V_Games.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Arowana_Mall.png b/src/graphics/assets/stages/S2_Stage_Arowana_Mall.png deleted file mode 100755 index 6ac5773..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Arowana_Mall.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Blackbelly_Skatepark.png b/src/graphics/assets/stages/S2_Stage_Blackbelly_Skatepark.png deleted file mode 100755 index 1c2a926..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Blackbelly_Skatepark.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Camp_Triggerfish.png b/src/graphics/assets/stages/S2_Stage_Camp_Triggerfish.png deleted file mode 100755 index e2bd3bf..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Camp_Triggerfish.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Goby_Arena.png b/src/graphics/assets/stages/S2_Stage_Goby_Arena.png deleted file mode 100755 index ee17569..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Goby_Arena.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Humpback_Pump_Track.png b/src/graphics/assets/stages/S2_Stage_Humpback_Pump_Track.png deleted file mode 100755 index 49ca7d8..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Humpback_Pump_Track.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Inkblot_Art_Academy.png b/src/graphics/assets/stages/S2_Stage_Inkblot_Art_Academy.png deleted file mode 100755 index 5afb8f1..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Inkblot_Art_Academy.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Kelp_Dome.png b/src/graphics/assets/stages/S2_Stage_Kelp_Dome.png deleted file mode 100755 index 8437e97..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Kelp_Dome.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_MakoMart.png b/src/graphics/assets/stages/S2_Stage_MakoMart.png deleted file mode 100755 index a13e813..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_MakoMart.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Manta_Maria.png b/src/graphics/assets/stages/S2_Stage_Manta_Maria.png deleted file mode 100755 index 39ae807..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Manta_Maria.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Moray_Towers.png b/src/graphics/assets/stages/S2_Stage_Moray_Towers.png deleted file mode 100755 index 871e245..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Moray_Towers.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Musselforge_Fitness.png b/src/graphics/assets/stages/S2_Stage_Musselforge_Fitness.png deleted file mode 100755 index caa1cd4..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Musselforge_Fitness.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_New_Albacore_Hotel.png b/src/graphics/assets/stages/S2_Stage_New_Albacore_Hotel.png deleted file mode 100755 index 75f958e..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_New_Albacore_Hotel.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Piranha_Pit.png b/src/graphics/assets/stages/S2_Stage_Piranha_Pit.png deleted file mode 100755 index 669fd05..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Piranha_Pit.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Port_Mackerel.png b/src/graphics/assets/stages/S2_Stage_Port_Mackerel.png deleted file mode 100755 index ceeb29a..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Port_Mackerel.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Shellendorf_Institute.png b/src/graphics/assets/stages/S2_Stage_Shellendorf_Institute.png deleted file mode 100755 index 2dd86c8..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Shellendorf_Institute.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Shifty_Station.png b/src/graphics/assets/stages/S2_Stage_Shifty_Station.png deleted file mode 100755 index b597dab..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Shifty_Station.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Skipper_Pavilion.png b/src/graphics/assets/stages/S2_Stage_Skipper_Pavilion.png deleted file mode 100755 index 4f108ec..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Skipper_Pavilion.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Snapper_Canal.png b/src/graphics/assets/stages/S2_Stage_Snapper_Canal.png deleted file mode 100755 index 892a685..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Snapper_Canal.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Starfish_Mainstage.png b/src/graphics/assets/stages/S2_Stage_Starfish_Mainstage.png deleted file mode 100755 index 7352fd0..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Starfish_Mainstage.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Sturgeon_Shipyard.png b/src/graphics/assets/stages/S2_Stage_Sturgeon_Shipyard.png deleted file mode 100755 index 11c76ca..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Sturgeon_Shipyard.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_The_Reef.png b/src/graphics/assets/stages/S2_Stage_The_Reef.png deleted file mode 100755 index 1a34fdf..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_The_Reef.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Wahoo_World.png b/src/graphics/assets/stages/S2_Stage_Wahoo_World.png deleted file mode 100755 index 9db6f96..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Wahoo_World.png and /dev/null differ diff --git a/src/graphics/assets/stages/S2_Stage_Walleye_Warehouse.png b/src/graphics/assets/stages/S2_Stage_Walleye_Warehouse.png deleted file mode 100755 index bdced8d..0000000 Binary files a/src/graphics/assets/stages/S2_Stage_Walleye_Warehouse.png and /dev/null differ diff --git a/src/graphics/assets/stages/S3_Brinewater_Springs.png b/src/graphics/assets/stages/S3_Brinewater_Springs.png deleted file mode 100644 index a458b0d..0000000 Binary files a/src/graphics/assets/stages/S3_Brinewater_Springs.png and /dev/null differ diff --git a/src/graphics/assets/stages/S3_Stage_Barnacle_&_Dime.png b/src/graphics/assets/stages/S3_Stage_Barnacle_&_Dime.png deleted file mode 100644 index b99b075..0000000 Binary files a/src/graphics/assets/stages/S3_Stage_Barnacle_&_Dime.png and /dev/null differ diff --git a/src/graphics/assets/stages/S3_Stage_Eeltail_Alley.jpg b/src/graphics/assets/stages/S3_Stage_Eeltail_Alley.jpg deleted file mode 100644 index 6948264..0000000 Binary files a/src/graphics/assets/stages/S3_Stage_Eeltail_Alley.jpg and /dev/null differ diff --git a/src/graphics/assets/stages/S3_Stage_Flounder_Heights.png b/src/graphics/assets/stages/S3_Stage_Flounder_Heights.png deleted file mode 100644 index 17eb203..0000000 Binary files a/src/graphics/assets/stages/S3_Stage_Flounder_Heights.png and /dev/null differ diff --git a/src/graphics/assets/stages/S3_Stage_Hagglefish_Market.webp b/src/graphics/assets/stages/S3_Stage_Hagglefish_Market.webp deleted file mode 100644 index 724bd19..0000000 Binary files a/src/graphics/assets/stages/S3_Stage_Hagglefish_Market.webp and /dev/null differ diff --git a/src/graphics/assets/stages/S3_Stage_Hammerhead_Bridge.jpg b/src/graphics/assets/stages/S3_Stage_Hammerhead_Bridge.jpg deleted file mode 100644 index 6160266..0000000 Binary files a/src/graphics/assets/stages/S3_Stage_Hammerhead_Bridge.jpg and /dev/null differ diff --git a/src/graphics/assets/stages/S3_Stage_Humpback_Pump_Track.png b/src/graphics/assets/stages/S3_Stage_Humpback_Pump_Track.png deleted file mode 100644 index 815e801..0000000 Binary files a/src/graphics/assets/stages/S3_Stage_Humpback_Pump_Track.png and /dev/null differ diff --git a/src/graphics/assets/stages/S3_Stage_Inkblot_Art_Academy.jpg b/src/graphics/assets/stages/S3_Stage_Inkblot_Art_Academy.jpg deleted file mode 100644 index 5152537..0000000 Binary files a/src/graphics/assets/stages/S3_Stage_Inkblot_Art_Academy.jpg and /dev/null differ diff --git a/src/graphics/assets/stages/S3_Stage_Mahi_Mahi_Resort.jpg b/src/graphics/assets/stages/S3_Stage_Mahi_Mahi_Resort.jpg deleted file mode 100644 index de1e7c9..0000000 Binary files a/src/graphics/assets/stages/S3_Stage_Mahi_Mahi_Resort.jpg and /dev/null differ diff --git a/src/graphics/assets/stages/S3_Stage_Mako_Mart.jpg b/src/graphics/assets/stages/S3_Stage_Mako_Mart.jpg deleted file mode 100644 index 2eb0f3a..0000000 Binary files a/src/graphics/assets/stages/S3_Stage_Mako_Mart.jpg and /dev/null differ diff --git a/src/graphics/assets/stages/S3_Stage_Manta_Maria.png b/src/graphics/assets/stages/S3_Stage_Manta_Maria.png deleted file mode 100644 index bf7914c..0000000 Binary files a/src/graphics/assets/stages/S3_Stage_Manta_Maria.png and /dev/null differ diff --git a/src/graphics/assets/stages/S3_Stage_Mincemeat_Metalworks.png b/src/graphics/assets/stages/S3_Stage_Mincemeat_Metalworks.png deleted file mode 100644 index 3a9b0d2..0000000 Binary files a/src/graphics/assets/stages/S3_Stage_Mincemeat_Metalworks.png and /dev/null differ diff --git a/src/graphics/assets/stages/S3_Stage_Museum_dAlfonsino.jpg b/src/graphics/assets/stages/S3_Stage_Museum_dAlfonsino.jpg deleted file mode 100644 index 8cf1626..0000000 Binary files a/src/graphics/assets/stages/S3_Stage_Museum_dAlfonsino.jpg and /dev/null differ diff --git a/src/graphics/assets/stages/S3_Stage_Scorch_Gorge.jpg b/src/graphics/assets/stages/S3_Stage_Scorch_Gorge.jpg deleted file mode 100644 index 0eea56b..0000000 Binary files a/src/graphics/assets/stages/S3_Stage_Scorch_Gorge.jpg and /dev/null differ diff --git a/src/graphics/assets/stages/S3_Stage_Sturgeon_Shipyard.jpg b/src/graphics/assets/stages/S3_Stage_Sturgeon_Shipyard.jpg deleted file mode 100644 index 62c27c5..0000000 Binary files a/src/graphics/assets/stages/S3_Stage_Sturgeon_Shipyard.jpg and /dev/null differ diff --git a/src/graphics/assets/stages/S3_Stage_Umami_Ruins.png b/src/graphics/assets/stages/S3_Stage_Umami_Ruins.png deleted file mode 100644 index 97e6eea..0000000 Binary files a/src/graphics/assets/stages/S3_Stage_Umami_Ruins.png and /dev/null differ diff --git a/src/graphics/assets/stages/S3_Stage_Undertow_Spillway.jpg b/src/graphics/assets/stages/S3_Stage_Undertow_Spillway.jpg deleted file mode 100644 index 54f6bae..0000000 Binary files a/src/graphics/assets/stages/S3_Stage_Undertow_Spillway.jpg and /dev/null differ diff --git a/src/graphics/assets/stages/S3_Stage_Wahoo_World.jpg b/src/graphics/assets/stages/S3_Stage_Wahoo_World.jpg deleted file mode 100644 index 677e281..0000000 Binary files a/src/graphics/assets/stages/S3_Stage_Wahoo_World.jpg and /dev/null differ diff --git a/src/graphics/assets/stages/unknown-stage.png b/src/graphics/assets/unknown-stage.png similarity index 100% rename from src/graphics/assets/stages/unknown-stage.png rename to src/graphics/assets/unknown-stage.png diff --git a/src/graphics/break/scripts/stages.ts b/src/graphics/break/scripts/stages.ts index 4787621..7c8e87d 100644 --- a/src/graphics/break/scripts/stages.ts +++ b/src/graphics/break/scripts/stages.ts @@ -1,4 +1,4 @@ -import { activeBreakScene, activeRound } from '../../helpers/replicants'; +import { activeBreakScene, activeRound, assetPaths } from '../../helpers/replicants'; import { getUpdatedGames, getUpdatedWinners, @@ -7,7 +7,6 @@ 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'; @@ -15,19 +14,21 @@ 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): Promise { diff --git a/src/graphics/helpers/constants.ts b/src/graphics/helpers/constants.ts index 213603d..4471679 100755 --- a/src/graphics/helpers/constants.ts +++ b/src/graphics/helpers/constants.ts @@ -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 = { - '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' -}; diff --git a/src/graphics/helpers/replicants.ts b/src/graphics/helpers/replicants.ts index 8e7c7d2..62fff43 100755 --- a/src/graphics/helpers/replicants.ts +++ b/src/graphics/helpers/replicants.ts @@ -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', DASHBOARD_BUNDLE_NAME); export const nowPlaying = nodecg.Replicant('nowPlaying', DASHBOARD_BUNDLE_NAME); @@ -11,3 +11,4 @@ export const mainFlavorText = nodecg.Replicant('mainFlavorText', export const nextRoundTime = nodecg.Replicant('nextRoundStartTime', DASHBOARD_BUNDLE_NAME); export const scoreboardData = nodecg.Replicant('scoreboardData', DASHBOARD_BUNDLE_NAME); export const nextRound = nodecg.Replicant('nextRound', DASHBOARD_BUNDLE_NAME); +export const assetPaths = nodecg.Replicant('assetPaths', DASHBOARD_BUNDLE_NAME);