diff --git a/source/backend/ClientPrefs.hx b/source/backend/ClientPrefs.hx index ed79c904..422dd17b 100644 --- a/source/backend/ClientPrefs.hx +++ b/source/backend/ClientPrefs.hx @@ -211,8 +211,8 @@ class ClientPrefs { #end if (ClientPrefs.data.unlockFramerate) { - FlxG.updateFramerate = 999; - FlxG.drawFramerate = 999; + FlxG.updateFramerate = 1000; + FlxG.drawFramerate = 1000; } else if(data.framerate > FlxG.drawFramerate) { FlxG.updateFramerate = data.framerate; FlxG.drawFramerate = data.framerate; diff --git a/source/openfl/display/FPS.hx b/source/openfl/display/FPS.hx index a8161992..29e2e75d 100644 --- a/source/openfl/display/FPS.hx +++ b/source/openfl/display/FPS.hx @@ -81,7 +81,7 @@ class FPS extends TextField var currentCount = times.length; currentFPS = Math.round((currentCount + cacheCount) / 2); - var optionFramerate = ClientPrefs.data.unlockFramerate ? 999 : ClientPrefs.data.framerate; + var optionFramerate = ClientPrefs.data.unlockFramerate ? 1000 : ClientPrefs.data.framerate; if (currentFPS > optionFramerate) currentFPS = optionFramerate; if (currentCount != cacheCount /*&& visible*/) diff --git a/source/options/GameplaySettingsSubState.hx b/source/options/GameplaySettingsSubState.hx index c9b2ccea..c7abe6d8 100644 --- a/source/options/GameplaySettingsSubState.hx +++ b/source/options/GameplaySettingsSubState.hx @@ -109,6 +109,13 @@ class GameplaySettingsSubState extends BaseOptionsMenu option.changeValue = 0.1; addOption(option); + var option:Option = new Option('Max FPS', //Name + "If checked, the FPS limit will be set to 1000.\nThis setting makes the input timing more accurate, but in cost of minor graphical issues.", //Description + 'unlockFramerate', + 'bool'); + option.onChange = onChangeFramerate; + addOption(option); + var option:Option = new Option('Disable Note Modchart', 'If checked, strum notes will no longer move or change their opacity to invisible.', 'disableStrumMovement', @@ -130,6 +137,27 @@ class GameplaySettingsSubState extends BaseOptionsMenu super(); } + function onChangeFramerate() + { + if (ClientPrefs.data.unlockFramerate) { + FlxG.updateFramerate = 1000; + FlxG.drawFramerate = 1000; + return; + } + + + if(ClientPrefs.data.framerate > FlxG.drawFramerate) + { + FlxG.updateFramerate = ClientPrefs.data.framerate; + FlxG.drawFramerate = ClientPrefs.data.framerate; + } + else + { + FlxG.drawFramerate = ClientPrefs.data.framerate; + FlxG.updateFramerate = ClientPrefs.data.framerate; + } + } + function onChangeHitsoundVolume() { FlxG.sound.play(Paths.sound('hitsound'), ClientPrefs.data.hitsoundVolume); diff --git a/source/options/GraphicsSettingsSubState.hx b/source/options/GraphicsSettingsSubState.hx index 49b7fa3c..b002889d 100644 --- a/source/options/GraphicsSettingsSubState.hx +++ b/source/options/GraphicsSettingsSubState.hx @@ -47,15 +47,6 @@ class GraphicsSettingsSubState extends BaseOptionsMenu #if !html5 //Apparently other framerates isn't correctly supported on Browser? Probably it has some V-Sync shit enabled by default, idk - if (ClientPrefs.data.debugMode) { - var option:Option = new Option('Unlock FPS', //Name - "If checked, the FPS timer will be set to 999 (this can't be infinite for obvious reasons)", //Description - 'unlockFramerate', - 'bool'); - option.onChange = onChangeFramerate; - addOption(option); - } - var option:Option = new Option('Framerate', "Pretty self explanatory, isn't it?", 'framerate', @@ -86,8 +77,8 @@ class GraphicsSettingsSubState extends BaseOptionsMenu function onChangeFramerate() { if (ClientPrefs.data.unlockFramerate) { - FlxG.updateFramerate = 999; - FlxG.drawFramerate = 999; + FlxG.updateFramerate = 1000; + FlxG.drawFramerate = 1000; return; } diff --git a/source/psychlua/FunkinLua.hx b/source/psychlua/FunkinLua.hx index 77e5f2ba..0bad9f1e 100644 --- a/source/psychlua/FunkinLua.hx +++ b/source/psychlua/FunkinLua.hx @@ -176,7 +176,7 @@ class FunkinLua { // Some settings, no jokes set('downscroll', ClientPrefs.data.downScroll); set('middlescroll', ClientPrefs.data.middleScroll); - set('framerate', ClientPrefs.data.unlockFramerate ? 999 : ClientPrefs.data.framerate); + set('framerate', ClientPrefs.data.unlockFramerate ? 1000 : ClientPrefs.data.framerate); set('ghostTapping', ClientPrefs.getGhostTapping()); set('hideHud', ClientPrefs.data.hideHud); set('timeBarType', ClientPrefs.data.timeBarType); diff --git a/source/states/FreeplayState.hx b/source/states/FreeplayState.hx index 774294e9..97c8d0d8 100644 --- a/source/states/FreeplayState.hx +++ b/source/states/FreeplayState.hx @@ -621,14 +621,6 @@ class FreeplayState extends MusicBeatState listenToSong(); } - else if (controls.UI_LEFT_P) { - changeDiff(-1); - _updateSongLastDifficulty(); - } - else if (controls.UI_RIGHT_P) { - changeDiff(1); - _updateSongLastDifficulty(); - } else if (controls.ACCEPT) { if (curSelected == -1) { @@ -1150,6 +1142,9 @@ class FreeplayState extends MusicBeatState if (curDifficulty >= Difficulty.list.length) curDifficulty = 0; + if (songs[curSelected] == null) + return; + #if !switch intendedScore = Highscore.getScore(songs[curSelected].songName, curDifficulty); intendedRating = Highscore.getRating(songs[curSelected].songName, curDifficulty); diff --git a/source/states/PlayState.hx b/source/states/PlayState.hx index 2df36207..024443d7 100644 --- a/source/states/PlayState.hx +++ b/source/states/PlayState.hx @@ -1937,7 +1937,9 @@ class PlayState extends MusicBeatState makeEvent(event, i); } - var densLast:Float = -1; + var tension:Float = 0; + var tenseCombo:Float = 0; + var densLastStrumTime:Float = -1; for (section in noteData) { for (songNotes in section.sectionNotes) @@ -1978,11 +1980,29 @@ class PlayState extends MusicBeatState } if (songNotes[2] <= 0 && playsAsBF() ? gottaHitNote : !gottaHitNote) { - var lastNoteDiff = (songNotes[0] - densLast) / playbackRate; - if (densLast != -1 && lastNoteDiff > 1 && lastNoteDiff <= 150) { - denseNotes += (150 - (lastNoteDiff)) * 0.00005 / (1 + denseNotes); + var noteDiff = (daStrumTime - densLastStrumTime) / playbackRate; + + if (densLastStrumTime != -1 && noteDiff > 10) { + var keepCombo = tenseCombo < 2 || 150 - noteDiff <= tension / tenseCombo + 10; + + if (noteDiff <= 150) { + if (keepCombo) { + tenseCombo++; + tension += 150 - noteDiff; + } + denseNotes += (150 - noteDiff) / 15000 / (1 + denseNotes); + } + + if (noteDiff > 150 || !keepCombo) { + if (tenseCombo > 0) { + denseNotes += tension / tenseCombo * tenseCombo / 10000 * (1 + Math.max(0, tension / tenseCombo - 60) / 50); + } + tenseCombo = 0; + tension = 0; + } } - densLast = songNotes[0]; + + densLastStrumTime = daStrumTime; } var oldNote:Note;