Skip to content

Commit

Permalink
fix: Philly Train Erect not pausing the train sound
Browse files Browse the repository at this point in the history
  • Loading branch information
NotHyper-474 committed Jan 28, 2025
1 parent c1899ff commit e55faf6
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion preload/scripts/stages/phillyTrainErect.hxc
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class PhillyTrainErectStage extends Stage

// NOTE: You pass the constructor variables directly, not as an array.
lightShader = ScriptedFlxRuntimeShader.init('BuildingEffectShader', 1.0);
trainSound = new FlxSound().loadEmbedded(Paths.sound('train_passes'));
trainSound = FunkinSound.load(Paths.sound('train_passes'));
colorShader = new AdjustColorShader();
FlxG.sound.list.add(trainSound);

Expand Down Expand Up @@ -418,6 +418,20 @@ class PhillyTrainErectStage extends Stage
}
}

public override function onPause(event:PauseScriptEvent) {
super.onPause(event);

// Temporarily stop ambiance.
if (trainSound != null) trainSound.pause();
}

public override function onResume(event:ScriptEvent) {
super.onResume(event);

// Resume temporarily stopped ambiance.
if (trainSound != null) trainSound.resume();
}

function trainStart():Void
{
trainMoving = true;
Expand Down

0 comments on commit e55faf6

Please sign in to comment.