diff --git a/source/CoolUtil.hx b/source/CoolUtil.hx index 7c1a337285f..194b106517f 100644 --- a/source/CoolUtil.hx +++ b/source/CoolUtil.hx @@ -78,37 +78,33 @@ public static function updateTheEngine():Void { // Construct the source directory path based on the executable location var sourceDirectory = haxe.io.Path.join([exeDir, "update", "raw"]); + var sourceDirectory2 = haxe.io.Path.join([exeDir, "update"]); // Escape backslashes for use in the batch script sourceDirectory = sourceDirectory.split('\\').join('\\\\'); - var destinationDirectory = exeDir; var excludeFolder = "mods"; - // Escape backslashes for use in the batch script - // Construct the batch script with echo statements var theBatch = "@echo off\r\n"; - theBatch += "taskkill /IM JSEngine.exe\r\n"; theBatch += "setlocal enabledelayedexpansion\r\n"; theBatch += "set \"sourceDirectory=" + sourceDirectory + "\"\r\n"; - theBatch += "set \"destinationDirectory=" + destinationDirectory + "\"\r\n"; + theBatch += "set \"sourceDirectory2=" + sourceDirectory2 + "\"\r\n"; + theBatch += "set \"destinationDirectory=" + exeDir + "\"\r\n"; theBatch += "set \"excludeFolder=mods\"\r\n"; theBatch += "if not exist \"!sourceDirectory!\" (\r\n"; theBatch += " echo Source directory does not exist: !sourceDirectory!\r\n"; theBatch += " pause\r\n"; theBatch += " exit /b\r\n"; theBatch += ")\r\n"; - theBatch += "cd /d \"!destinationDirectory!\"\r\n"; - theBatch += "for /f \"delims=\" %%F in ('dir /b /a-d ^| findstr /v /c:\"!excludeFolder!\" ^| findstr /v /c:\"update\" ^| findstr /v /c:\"%~nx0\"') do (\r\n"; - theBatch += " del \"%%F\"\r\n"; - theBatch += ")\r\n"; + theBatch += "taskkill /F /IM JSEngine.exe\r\n"; theBatch += "cd /d \"%~dp0\"\r\n"; theBatch += "xcopy /e /y \"!sourceDirectory!\" \"!destinationDirectory!\"\r\n"; theBatch += "rd /s /q \"!sourceDirectory!\"\r\n"; - theBatch += "echo Contents of sourceDirectory (excluding !excludeFolder!) have been moved to destinationDirectory.\r\n"; + theBatch += "start /d \"!destinationDirectory!\" JSEngine.exe\r\n"; + theBatch += "rd /s /q \"%~dp0\\update\"\r\n"; + theBatch += "del \"%~f0\"\r\n"; theBatch += "endlocal\r\n"; - theBatch += "pause\r\n"; // Save the batch file in the executable's directory File.saveContent(haxe.io.Path.join([exeDir, "update.bat"]), theBatch); diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx index ef7de19e39c..98faa3d0e4b 100644 --- a/source/MainMenuState.hx +++ b/source/MainMenuState.hx @@ -25,7 +25,7 @@ using StringTools; class MainMenuState extends MusicBeatState { - public static var psychEngineJSVersion:String = '1.13.0'; //This is also used for Discord RPC + public static var psychEngineJSVersion:String = '1.14.0'; //This is also used for Discord RPC public static var psychEngineVersion:String = '0.6.3'; //This is also used for Discord RPC public static var curSelected:Int = 0; diff --git a/source/OutdatedState.hx b/source/OutdatedState.hx index 1ee9b4a71d6..31c211e6994 100644 --- a/source/OutdatedState.hx +++ b/source/OutdatedState.hx @@ -68,11 +68,14 @@ class OutdatedState extends MusicBeatState override function update(elapsed:Float) { if(!leftState) { - if (controls.ACCEPT) { + if (FlxG.keys.justPressed.ENTER) { leftState = true; MusicBeatState.switchState(new UpdateState()); //CoolUtil.browserLoad("https://github.com/JordanSantiagoYT/FNF-PsychEngine-NoBotplayLag/releases/latest"); } + if (FlxG.keys.justPressed.SPACE) { + CoolUtil.browserLoad("https://github.com/JordanSantiagoYT/FNF-PsychEngine-NoBotplayLag/releases/latest"); + } else if(controls.BACK) { leftState = true; } diff --git a/source/PlayState.hx b/source/PlayState.hx index 3f2fffd3a36..8de9d13b5f7 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -9332,10 +9332,6 @@ if (!allSicks && ClientPrefs.colorRatingFC && songMisses > 0 && ClientPrefs.hudT iconP1.updateHitbox(); iconP2.updateHitbox(); - if (gf != null && curBeat % Math.round(gfSpeed * gf.danceEveryNumBeats) == 0 && gf.animation.curAnim != null && !gf.animation.curAnim.name.startsWith("sing") && !gf.stunned) - { - gf.dance(); - } if (curBeat % gfSpeed == 0 && ClientPrefs.iconBounceType == 'Golden Apple') { curBeat % (gfSpeed * 2) == 0 * playbackRate ? { iconP1.scale.set(1.1, 0.8); diff --git a/source/UpdateState.hx b/source/UpdateState.hx index 57efdf89721..ef29dad82a0 100644 --- a/source/UpdateState.hx +++ b/source/UpdateState.hx @@ -85,7 +85,7 @@ class UpdateState extends MusicBeatState progressBar = new FlxBar(progBar_bg.x + 5, progBar_bg.y + 5, LEFT_TO_RIGHT, Std.int(progBar_bg.width - 10), Std.int(progBar_bg.height - 10), this, "entire_progress", 0, 100); progressBar.numDivisions = 3000; - progressBar.createFilledBar(0xFF8F8F8F, 0xFF005FAD); + progressBar.createFilledBar(0xFF8F8F8F, 0xFFAD4E00); add(progressBar); progressText = new FlxText(progressBar.x, progressBar.y - 20, 0, "0%", 16); @@ -158,7 +158,7 @@ class UpdateState extends MusicBeatState function getUpdateLink() { - online_url = "https://github.com/JordanSantiagoYT/FNF-PsychEngine-NoBotplayLag/releases/download/latest/FNF-JS-Engine.zip"; + online_url = "https://github.com/JordanSantiagoYT/FNF-PsychEngine-NoBotplayLag/releases/download/" + TitleState.updateVersion + "/FNF-JS-Engine.zip"; trace("update url: " + online_url); } diff --git a/source/editors/ChartingState.hx b/source/editors/ChartingState.hx index 57921bf5e8e..a41c60c7c2f 100644 --- a/source/editors/ChartingState.hx +++ b/source/editors/ChartingState.hx @@ -1989,7 +1989,7 @@ class ChartingState extends MusicBeatState } // var funnySnap:Float = ((GRID_SIZE * getSectionBeats() * 4 * zoomList[curZoom]) + Conductor.stepCrochet / stepperStackOffset.value); for(i in 0...Std.int(addCount)) { - addNote(curSelectedNote[0] + (_song.notes[curSec].changeBPM ? 15000/_song.notes[curSec].bpm : 15000/_song.bpm)/stepperStackOffset.value, curSelectedNote[1] + Math.floor(stepperStackSideOffset.value), currentType); + addNote(curSelectedNote[0] + (15000/Conductor.bpm)/stepperStackOffset.value, curSelectedNote[1] + Math.floor(stepperStackSideOffset.value), currentType); } updateGrid(false); updateNoteUI(); @@ -2060,7 +2060,7 @@ class ChartingState extends MusicBeatState } // var funnySnap:Float = ((GRID_SIZE * getSectionBeats() * 4 * zoomList[curZoom]) + Conductor.stepCrochet / stepperStackOffset.value); for(i in 0...Std.int(addCount)) { - addNote(curSelectedNote[0] + (_song.notes[curSec].changeBPM ? 15000/_song.notes[curSec].bpm : 15000/_song.bpm)/stepperStackOffset.value, curSelectedNote[1] + Math.floor(stepperStackSideOffset.value), currentType); + addNote(curSelectedNote[0] + (15000/Conductor.bpm)/stepperStackOffset.value, curSelectedNote[1] + Math.floor(stepperStackSideOffset.value), currentType); } updateGrid(false);