Skip to content

Commit 3267a2c

Browse files
ComedyLostHonton129TechnikTil
authored
\[ENHANCEMENT] Make Bumpers transition into In-Game Cutscenes better (#27)
* Make bumper transition better for week 7 * oh yea winter horrorland too * Apply suggestion from @TechnikTil * Apply suggestion from @TechnikTil * Apply suggestion from @TechnikTil Co-authored-by: Honton129 <85850584+Honton129@users.noreply.github.com> Co-authored-by: TechnikTil <techniktil@tilnotdrip.org>
1 parent 6ebcba4 commit 3267a2c

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

scripts/gameplay/RemnantsBumpers.hxc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ class RemnantsBumpers extends Module
8282
"grieving" => grievingList
8383
];
8484

85+
// Make fade from black and countdown start at the same time for these weeks.
86+
public var skipTransitionWeeks:Array<String> = ['week5-scary', 'week7'];
87+
8588
public function new()
8689
{
8790
super('remnantsBumpers', -1000, {state: PlayState});
@@ -144,6 +147,11 @@ class RemnantsBumpers extends Module
144147
trace("Playing the bumper '" + currentWeek + "'");
145148

146149
VideoCutscene.play(Paths.videos(currentWeek));
150+
if (skipTransitionWeeks.contains(currentWeek))
151+
{
152+
VideoCutscene.vid.bitmap.onEncounteredError.add(cutsceneFinishVideo);
153+
VideoCutscene.vid.bitmap.onEndReached.add(cutsceneFinishVideo);
154+
}
147155
VideoCutscene.onVideoEnded.add(() -> {
148156
isPlaying = false;
149157
});
@@ -158,6 +166,30 @@ class RemnantsBumpers extends Module
158166
return false;
159167
}
160168

169+
public function cutsceneFinishVideo():Void
170+
{
171+
FlxTween.cancelTweensOf(FlxG.camera, ["zoom"]);
172+
FlxTween.cancelTweensOf(VideoCutscene.blackScreen, ["alpha"]);
173+
174+
var cutsceneType:CutsceneType = VideoCutscene.cutsceneType;
175+
176+
FlxTween.tween(VideoCutscene.blackScreen, {alpha: 0}, 0.5, {
177+
ease: FlxEase.quadInOut,
178+
onComplete: function(twn:FlxTween)
179+
{
180+
PlayState.instance.remove(VideoCutscene.blackScreen);
181+
VideoCutscene.blackScreen = null;
182+
}
183+
});
184+
VideoCutscene.onVideoEnded.dispatch();
185+
VideoCutscene.onCutsceneFinish(cutsceneType);
186+
}
187+
188+
public function onResume(event:ScriptEvent):Void
189+
{
190+
if (!isPlaying || !skipTransitionWeeks.contains(currentWeek) || VideoCutscene.vid != null) return;
191+
cutsceneFinishVideo();
192+
}
161193
/**
162194
* Checks and sets if ??isFirstOfWeek?? is the first song being played of the week.
163195
*/

0 commit comments

Comments
 (0)