Skip to content

Commit

Permalink
Update PlayState.hx
Browse files Browse the repository at this point in the history
  • Loading branch information
JVNpixels authored Feb 19, 2025
1 parent 56e41a6 commit aaf87ff
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions source/funkin/play/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,6 @@ class PlayState extends MusicBeatSubState
*/
public var disableKeys:Bool = false;

/**
* The previous difficulty the player was playing on.
*/
public var previousDifficulty:String = Constants.DEFAULT_DIFFICULTY;

public var isSubState(get, never):Bool;

function get_isSubState():Bool
Expand Down Expand Up @@ -608,7 +603,6 @@ class PlayState extends MusicBeatSubState
// Apply parameters.
currentSong = params.targetSong;
if (params.targetDifficulty != null) currentDifficulty = params.targetDifficulty;
previousDifficulty = currentDifficulty;
if (params.targetVariation != null) currentVariation = params.targetVariation;
if (params.targetInstrumental != null) currentInstrumental = params.targetInstrumental;
isPracticeMode = params.practiceMode ?? false;
Expand Down Expand Up @@ -819,11 +813,7 @@ class PlayState extends MusicBeatSubState

prevScrollTargets = [];

var retryEvent = new SongRetryEvent(currentDifficulty);

previousDifficulty = currentDifficulty;

dispatchEvent(retryEvent);
dispatchEvent(new ScriptEvent(SONG_RETRY));

resetCamera();

Expand Down Expand Up @@ -916,7 +906,7 @@ class PlayState extends MusicBeatSubState
Conductor.instance.formatOffset = 0.0;
}

Conductor.instance.update(Conductor.instance.songPosition + elapsed * 1000, false); // Normal conductor update.
Conductor.instance.update(); // Normal conductor update.
}

var androidPause:Bool = false;
Expand Down Expand Up @@ -1457,9 +1447,7 @@ class PlayState extends MusicBeatSubState
}

if (!startingSong
&& (Math.abs(FlxG.sound.music.time - correctSync) > 100
|| Math.abs(playerVoicesError) > 100
|| Math.abs(opponentVoicesError) > 100))
&& (Math.abs(FlxG.sound.music.time - correctSync) > 5 || Math.abs(playerVoicesError) > 5 || Math.abs(opponentVoicesError) > 5))
{
trace("VOCALS NEED RESYNC");
if (vocals != null)
Expand Down Expand Up @@ -1590,7 +1578,7 @@ class PlayState extends MusicBeatSubState
scoreText = new FlxText(healthBarBG.x + healthBarBG.width - 190, healthBarBG.y + 30, 0, '', 20);
scoreText.setFormat(Paths.font('vcr.ttf'), 16, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
scoreText.scrollFactor.set();
scoreText.zIndex = 802;
scoreText.zIndex = 810;
add(scoreText);

// Move the health bar to the HUD camera.
Expand Down Expand Up @@ -2620,7 +2608,10 @@ class PlayState extends MusicBeatSubState
if (playSound)
{
vocals.playerVolume = 0;
FunkinSound.playOnce(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.5, 0.6));
if (Preferences.playMissSound)
{
FunkinSound.playOnce(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.5, 0.6));
}
}
}

Expand Down Expand Up @@ -2675,7 +2666,10 @@ class PlayState extends MusicBeatSubState
if (event.playSound)
{
vocals.playerVolume = 0;
FunkinSound.playOnce(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.1, 0.2));
if (Preferences.playMissSound)
{
FunkinSound.playOnce(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.1, 0.2));
}
}
}

Expand Down

0 comments on commit aaf87ff

Please sign in to comment.