Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
EZ Spam now adapts to BPM changes!!
fixed beat hits making gf bop twice
edited the update state to be different
updates are now fully automatic
  • Loading branch information
JordanSantiagoYT committed Nov 7, 2023
1 parent e8281a7 commit 7c7ee41
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 21 deletions.
18 changes: 7 additions & 11 deletions source/CoolUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion source/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
5 changes: 4 additions & 1 deletion source/OutdatedState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 0 additions & 4 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions source/UpdateState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions source/editors/ChartingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7c7ee41

Please sign in to comment.