Skip to content

Commit

Permalink
fix transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
haya3218 committed Sep 21, 2021
1 parent ecd0324 commit 23c7cc4
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions source/gameFolder/meta/state/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class PlayState extends MusicBeatState
var lastReportedPlayheadPosition:Int = 0;
var songTime:Float = 0;

public static var uiRCam:FlxCamera;
public static var camHUD:FlxCamera;
public static var camGame:FlxCamera;

Expand Down Expand Up @@ -317,6 +318,11 @@ class PlayState extends MusicBeatState
}
add(strumLines);

// create the TRUE receptor camera
uiRCam = new FlxCamera();
uiRCam.bgColor.alpha = 0;
FlxG.cameras.add(uiRCam);

// set strumHUD cams to separate positions if not centered notefields
if (!Init.trueSettings.get('Centered Notefield'))
{
Expand All @@ -325,6 +331,12 @@ class PlayState extends MusicBeatState
strumHUD[1].x += truePlacement;
}

// sets the receptor cameras to a separate camera
for (i in 0...strumLines.length)
{
strumHUD[i].cameras = [uiRCam];
}

uiHUD = new ClassHUD();
add(uiHUD);
uiHUD.cameras = [camHUD];
Expand Down Expand Up @@ -1318,11 +1330,6 @@ class PlayState extends MusicBeatState
// trace('ui shit break');
if ((startTimer != null) && (!startTimer.finished))
startTimer.active = false;

for (i in 0...strumHUD.length)
{
strumHUD[i].filtersEnabled = false;
}
}

// trace('open substate');
Expand All @@ -1344,11 +1351,6 @@ class PlayState extends MusicBeatState
///*
updateRPC(false);
// */

for (i in 0...strumHUD.length)
{
strumHUD[i].filtersEnabled = true;
}
}

super.closeSubState();
Expand Down Expand Up @@ -1415,6 +1417,7 @@ class PlayState extends MusicBeatState
blackShit.scrollFactor.set();
add(blackShit);
camHUD.visible = false;
uiRCam.visible = false;

// oooo spooky
FlxG.sound.play(Paths.sound('Lights_Shut_off'));
Expand Down Expand Up @@ -1454,6 +1457,7 @@ class PlayState extends MusicBeatState
add(blackScreen);
blackScreen.scrollFactor.set();
camHUD.visible = false;
uiRCam.visible = false;

new FlxTimer().start(0.1, function(tmr:FlxTimer)
{
Expand All @@ -1467,6 +1471,7 @@ class PlayState extends MusicBeatState
new FlxTimer().start(0.8, function(tmr:FlxTimer)
{
camHUD.visible = true;
uiRCam.visible = true;
remove(blackScreen);
FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom}, 2.5, {
ease: FlxEase.quadInOut,
Expand Down

0 comments on commit 23c7cc4

Please sign in to comment.