From 2d9c7716240099dc23d777c0e5418ccaff258f96 Mon Sep 17 00:00:00 2001 From: Frakits <90983918+Frakits@users.noreply.github.com> Date: Tue, 5 Nov 2024 21:21:48 +0200 Subject: [PATCH 1/2] Update Character.hx --- source/funkin/game/Character.hx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/funkin/game/Character.hx b/source/funkin/game/Character.hx index 874ccf7c..c56096d5 100644 --- a/source/funkin/game/Character.hx +++ b/source/funkin/game/Character.hx @@ -278,15 +278,14 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset @:noCompletion var __reverseTrailProcedure:Bool = false; - // When using trails on characters you should do `trail.beforeCache = char.beforeTrailCache;` + // When using trails on characters you should do `trail.beforeCache = char.beforeTrailCache;` and `trail.afterCache = char.afterTrailCache;` public dynamic function beforeTrailCache() if (isFlippedOffsets()) { flipX = !flipX; scale.x *= -1; __reverseTrailProcedure = true; } - - // When using trails on characters you should do `trail.afterCache = char.afterTrailCache;` + public dynamic function afterTrailCache() if (__reverseTrailProcedure) { flipX = !flipX; @@ -543,4 +542,4 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset list.push(CoolUtil.getFilename(path)); return list; } -} \ No newline at end of file +} From 21bba98923307fe75667e1395781d068a7ec47ad Mon Sep 17 00:00:00 2001 From: Ne_Eo Date: Tue, 5 Nov 2024 21:28:01 +0100 Subject: [PATCH 2/2] Fast download libs --- commandline/commands/Setup.hx | 47 ++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/commandline/commands/Setup.hx b/commandline/commands/Setup.hx index 4e97e989..f93645e0 100644 --- a/commandline/commands/Setup.hx +++ b/commandline/commands/Setup.hx @@ -18,11 +18,32 @@ class Setup { FileSystem.deleteDirectory(path); } + public static function addMissingFolders(path:String):String { + #if sys + var folders:Array = path.split("/"); + var currentPath:String = ""; + + for (folder in folders) { + currentPath += folder + "/"; + if (!FileSystem.exists(currentPath)) + FileSystem.createDirectory(currentPath); + } + #end + return path; + } + public static function main(args:Array) { - var args = ArgParser.parse(args, ["s" => "silent-progress", "S" => "silent-progress", "silent" => "silent-progress"]); + var args = ArgParser.parse(args, [ + "s" => "silent-progress", + "S" => "silent-progress", + "silent" => "silent-progress", + "f" => "fast", + "F" => "fast" + ]); var CHECK_VSTUDIO = !args.existsOption("no-vscheck"); var REINSTALL_ALL = args.existsOption("reinstall"); var SILENT = args.existsOption("silent-progress"); + var FAST = args.existsOption("fast"); // to prevent messing with currently installed libs if (!FileSystem.exists('.haxelib')) @@ -134,6 +155,11 @@ class Setup { var commandSuffix = " --always"; if (SILENT) commandSuffix += " --quiet"; + function command(cmd:String) { + Sys.println(cmd); // TODO: ansi color + Sys.command(cmd); + } + for(event in events) { switch(event.type) { case INSTALL: @@ -144,10 +170,23 @@ class Setup { switch(lib.type) { case "lib": prettyPrint((lib.global == "true" ? "Globally installing" : "Locally installing") + ' "${lib.name}"...'); - Sys.command('haxelib$commandPrefix install ${lib.name} ${lib.version != null ? " " + lib.version : " "}'); + command('haxelib$commandPrefix install ${lib.name} ${lib.version != null ? " " + lib.version : " "}'); case "git": prettyPrint((lib.global == "true" ? "Globally installing" : "Locally installing") + ' "${lib.name}" from git url "${lib.url}"'); - Sys.command('haxelib$commandPrefix git ${lib.name} ${lib.url}${lib.ref != null ? ' ${lib.ref}' : ''}'); + if(FAST) { + var oldcwd = Sys.getCwd(); + var newCwd = oldcwd + "/.haxelib/" + lib.name + "/"; + var newCwdGit = newCwd + "git/"; + addMissingFolders(newCwdGit); + Sys.setCwd(newCwd); + File.saveContent(".current", "git"); + if(FileSystem.exists(newCwdGit)) recursiveDelete(newCwdGit); + command('git clone ${lib.url} ${lib.name} --depth 1${lib.ref != null ? " --branch " + lib.ref : ""} --progress'); + FileSystem.rename(newCwd + lib.name, newCwdGit); + Sys.setCwd(oldcwd); + } else { + command('haxelib$commandPrefix git ${lib.name} ${lib.url}${lib.ref != null ? ' ${lib.ref}' : ''}'); + } default: prettyPrint('Cannot resolve library of type "${lib.type}"'); } @@ -188,7 +227,7 @@ class Setup { for(line in cmd.lines) { var line = StringTools.replace(line, "$PLATFORM", platform); //Sys.println(line); - Sys.command(line); + command(line); } Sys.setCwd(oldCwd); case PRINT: