Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
LilyRoss19 committed Sep 22, 2024
2 parents eb3ecf5 + 9a76cdc commit d1134a6
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mobile-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
automatic_release_tag: "0.7.7"
title: "0.7.7"
title: "0.7.8"
files: |
/home/runner/*.apk
/home/runner/*.zip
2 changes: 1 addition & 1 deletion gitVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.7
0.7.8
2 changes: 1 addition & 1 deletion source/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Main extends Sprite
public static var stage3D:AwayStage;
#end

public static final PSYCH_ONLINE_VERSION:String = "0.7.7";
public static final PSYCH_ONLINE_VERSION:String = "0.7.8";
public static final CLIENT_PROTOCOL:Float = 3;
public static final GIT_COMMIT:String = online.Macros.getGitCommitHash();

Expand Down
4 changes: 2 additions & 2 deletions source/online/replay/ReplayPlayer.hx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class ReplayPlayer extends FlxBasic {

if (Conductor.judgeSongPosition - Conductor.songPosition <= -50) {
Conductor.songPosition = events[0][0] + (ClientPrefs.data.noteOffset - data.note_offset);
state.resyncVocals(false);
state.resyncVocals();
}

if (ReplayRecorder.REGISTER_BINDS.contains(_key)) {
Expand Down Expand Up @@ -146,4 +146,4 @@ enum ReplayPressStatus {
JUST_PRESSED;
PRESSED;
JUST_RELEASED;
}
}
48 changes: 23 additions & 25 deletions source/states/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1825,7 +1825,7 @@ class PlayState extends MusicBeatState
vocals.play();
opponentVocals.play();

if(startOnTime > 0) setSongTime(startOnTime - 500);
setSongTime(Math.max(0, startOnTime - 500));
startOnTime = 0;

if(paused) {
Expand Down Expand Up @@ -2252,28 +2252,27 @@ class PlayState extends MusicBeatState
#end
}

public function resyncVocals(?updateConductor = true):Void
public function resyncVocals():Void
{
if(finishTimer != null) return;

vocals.pause();
opponentVocals.pause();
trace('resynced vocals at ' + Math.floor(Conductor.songPosition));

FlxG.sound.music.play();
#if FLX_PITCH FlxG.sound.music.pitch = playbackRate; #end
if (updateConductor)
Conductor.songPosition = FlxG.sound.music.time;
if (Conductor.songPosition <= vocals.length)
Conductor.songPosition = FlxG.sound.music.time;

var checkVocals = [vocals, opponentVocals];
for (voc in checkVocals)
{
vocals.time = Conductor.songPosition;
#if FLX_PITCH vocals.pitch = playbackRate; #end
}
if (Conductor.songPosition <= opponentVocals.length) {
opponentVocals.time = Conductor.songPosition;
#if FLX_PITCH opponentVocals.pitch = playbackRate; #end
if (Conductor.songPosition <= vocals.length)
{
voc.time = Conductor.songPosition;
#if FLX_PITCH voc.pitch = playbackRate; #end
voc.play();
}

}
vocals.play();
opponentVocals.play();
}

public var paused:Bool = false;
Expand Down Expand Up @@ -2405,7 +2404,16 @@ class PlayState extends MusicBeatState
openCharacterEditor();

if (startedCountdown && !paused)
{
Conductor.songPosition += FlxG.elapsed * 1000 * playbackRate;
if (Conductor.songPosition >= 0)
{
var timeDiff:Float = Math.abs(FlxG.sound.music.time - Conductor.songPosition - Conductor.offset);
Conductor.songPosition = FlxMath.lerp(Conductor.songPosition, FlxG.sound.music.time, FlxMath.bound(elapsed * 2.5, 0, 1));
if (timeDiff > 1000 * playbackRate)
Conductor.songPosition = Conductor.songPosition + 1000 * FlxMath.signOf(timeDiff);
}
}

if (!paused && startingSong)
{
Expand Down Expand Up @@ -4247,16 +4255,6 @@ class PlayState extends MusicBeatState
return;
}

if(FlxG.sound.music.time >= -ClientPrefs.data.noteOffset)
{
if (Math.abs(FlxG.sound.music.time - (Conductor.songPosition - Conductor.offset)) > (50 * playbackRate)
|| (vocals.length > 0 && Math.abs(vocals.time - (Conductor.songPosition - Conductor.offset)) > (50 * playbackRate))
|| (opponentVocals.length > 0 && SONG.needsVoices && Math.abs(opponentVocals.time - (Conductor.songPosition - Conductor.offset)) > (50 * playbackRate))
) {
resyncVocals();
}
}

super.stepHit();

if(curStep == lastStepHit) {
Expand Down

0 comments on commit d1134a6

Please sign in to comment.