diff --git a/commandline/commands/Setup.hx b/commandline/commands/Setup.hx index 2a1d041b..23e289cb 100644 --- a/commandline/commands/Setup.hx +++ b/commandline/commands/Setup.hx @@ -7,18 +7,29 @@ import sys.io.Process; import sys.FileSystem; class Setup { + private static function recursiveDelete(path:String) { + for(file in FileSystem.readDirectory(path)) { + var p = '$path/$file'; + if(FileSystem.isDirectory(p)) + recursiveDelete(p); + else + FileSystem.deleteFile(p); + } + FileSystem.deleteDirectory(path); + } + public static function main(args:Array) { - final args = ArgParser.parse(args, ["S" => "silent-progress", "silent" => "silent-progress"]); - final CHECK_VSTUDIO = !args.existsOption("no-vscheck"); - final REINSTALL_ALL = args.existsOption("reinstall"); - final SILENT = args.existsOption("silent-progress"); + var args = ArgParser.parse(args, ["s" => "silent-progress", "S" => "silent-progress", "silent" => "silent-progress"]); + var CHECK_VSTUDIO = !args.existsOption("no-vscheck"); + var REINSTALL_ALL = args.existsOption("reinstall"); + var SILENT = args.existsOption("silent-progress"); // to prevent messing with currently installed libs if (!FileSystem.exists('.haxelib')) FileSystem.createDirectory('.haxelib'); if (REINSTALL_ALL) { - FileSystem.deleteDirectory('.haxelib'); + recursiveDelete('.haxelib'); FileSystem.createDirectory('.haxelib'); } @@ -46,6 +57,7 @@ class Setup { type: libNode.name }; if (libNode.has.global) lib.global = libNode.att.global; + if (libNode.has.skipDeps) lib.skipDeps = libNode.att.skipDeps; switch (lib.type) { case "lib": if (libNode.has.version) lib.version = libNode.att.version; @@ -102,9 +114,9 @@ class Setup { if(args.args.length == 0) defines.push("all"); function parse(libNode:Access) { - if(libNode.name == "if") { - final cond = libNode.att.cond; - if(!Utils.evaluateArgsCondition(cond, defines)) { + if(libNode.name == "if" || libNode.name == "unless") { + var cond = libNode.att.cond; + if(Utils.evaluateArgsCondition(cond, defines) != (libNode.name == "if")) { return; } @@ -123,21 +135,22 @@ class Setup { } var commandSuffix = " --always"; - if (SILENT) commandSuffix += " --silent"; + if (SILENT) commandSuffix += " --quiet"; for(event in events) { switch(event.type) { case INSTALL: var lib:Library = event.data; - var globalism:Null = lib.global == "true" ? "--global" : null; - var globalSuffix = globalism != null ? ' $globalism' : ''; + var globalSuffix:Null = lib.global == "true" ? " --global" : ""; + var skipDeps = lib.skipDeps == "true" ? " --skip-dependencies" : ""; + var commandPrefix = commandSuffix + globalSuffix + skipDeps;// + " --no-timeout"; switch(lib.type) { case "lib": prettyPrint((lib.global == "true" ? "Globally installing" : "Locally installing") + ' "${lib.name}"...'); - Sys.command('haxelib install ${lib.name} ${lib.version != null ? " " + lib.version : " "}$globalSuffix$commandSuffix'); + Sys.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 git ${lib.name} ${lib.url}${lib.ref != null ? ' ${lib.ref}' : ''}$globalSuffix$commandSuffix'); + Sys.command('haxelib$commandPrefix git ${lib.name} ${lib.url}${lib.ref != null ? ' ${lib.ref}' : ''}'); default: prettyPrint('Cannot resolve library of type "${lib.type}"'); } @@ -265,6 +278,8 @@ typedef Library = { var name:String; var type:String; var ?global:String; + var ?skipDeps:String; + var ?recursive:String; var ?version:String; var ?ref:String; var ?url:String; diff --git a/libs.xml b/libs.xml index e62e7c0d..72839c56 100644 --- a/libs.xml +++ b/libs.xml @@ -14,18 +14,30 @@ - - + + - - - + + + + + + + + + + + + Rebuilding Hxcpp... + + + diff --git a/setup-dev.xml b/setup-dev.xml index a6559cdb..3f8b70ac 100644 --- a/setup-dev.xml +++ b/setup-dev.xml @@ -6,6 +6,18 @@ mkdir dev-libs + + + cd dev-libs + git clone https://github.com/NeeEoo/hxcpp hxcpp + cd .. + haxelib dev hxcpp dev-libs/hxcpp + + + + + + cd dev-libs diff --git a/source/funkin/backend/chart/Chart.hx b/source/funkin/backend/chart/Chart.hx index 9eabd626..87302b71 100644 --- a/source/funkin/backend/chart/Chart.hx +++ b/source/funkin/backend/chart/Chart.hx @@ -56,6 +56,7 @@ class Chart { data.setFieldDefault("name", songName); data.setFieldDefault("beatsPerMeasure", 4); data.setFieldDefault("stepsPerBeat", 4); + data.setFieldDefault("needsVoices", true); data.setFieldDefault("icon", "face"); data.setFieldDefault("difficulties", []); data.setFieldDefault("coopAllowed", false); diff --git a/source/funkin/backend/chart/ChartData.hx b/source/funkin/backend/chart/ChartData.hx index b3b4e86d..ecb102df 100644 --- a/source/funkin/backend/chart/ChartData.hx +++ b/source/funkin/backend/chart/ChartData.hx @@ -27,6 +27,7 @@ typedef ChartMetaData = { public var ?coopAllowed:Bool; public var ?opponentModeAllowed:Bool; public var ?customValues:Dynamic; + public var ?needsVoices:Bool; // NOT TO BE EXPORTED public var ?parsedColor:FlxColor; diff --git a/source/funkin/backend/chart/FNFLegacyParser.hx b/source/funkin/backend/chart/FNFLegacyParser.hx index 3bd0dfad..0e5f55df 100644 --- a/source/funkin/backend/chart/FNFLegacyParser.hx +++ b/source/funkin/backend/chart/FNFLegacyParser.hx @@ -41,6 +41,7 @@ class FNFLegacyParser { } result.meta.bpm = data.bpm; + result.meta.needsVoices = data.needsVoices.getDefault(true); var camFocusedBF:Bool = false; var altAnims:Bool = false; @@ -145,6 +146,7 @@ class FNFLegacyParser { notes: null, bpm: chart.meta.bpm, speed: chart.scrollSpeed, + needsVoices: chart.meta.needsVoices, player1: null, player2: null, @@ -208,6 +210,7 @@ typedef SwagSong = var ?stage:String; var ?noteTypes:Array; var ?events:Array; + var ?needsVoices:Bool; var player1:String; var player2:String; diff --git a/source/funkin/backend/system/macros/Macros.hx b/source/funkin/backend/system/macros/Macros.hx index 9183e4a4..d40855b3 100644 --- a/source/funkin/backend/system/macros/Macros.hx +++ b/source/funkin/backend/system/macros/Macros.hx @@ -28,13 +28,21 @@ class Macros { var isHl = Context.defined("hl"); + var compathx4 = [ + "sys.db.Sqlite", + "sys.db.Mysql", + "sys.db.Connection", + "sys.db.ResultSet", + "haxe.remoting.Proxy", + ]; + if(Context.defined("sys")) { for(inc in ["sys", "openfl.net", "funkin.backend.system.net"]) { if(!isHl) - Compiler.include(inc); + Compiler.include(inc, compathx4); else { // TODO: Hashlink - //Compiler.include(inc, ["sys.net.UdpSocket", "openfl.net.DatagramSocket"]); // fixes FATAL ERROR : Failed to load function std@socket_set_broadcast + //Compiler.include(inc, compathx4.concat(["sys.net.UdpSocket", "openfl.net.DatagramSocket"]); // fixes FATAL ERROR : Failed to load function std@socket_set_broadcast } } } diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index e7532f31..342bf8cf 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -526,7 +526,7 @@ class Charter extends UIState { noteTypes = PlayState.SONG.noteTypes; FlxG.sound.setMusic(FlxG.sound.load(Paths.inst(__song, __diff))); - if (Assets.exists(Paths.voices(__song, __diff))) // null or true + if (PlayState.SONG.meta.needsVoices != false && Assets.exists(Paths.voices(__song, __diff))) // null or true vocals = FlxG.sound.load(Paths.voices(__song, __diff)); else vocals = new FlxSound(); diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 5137bb67..be06c3e6 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -1000,7 +1000,7 @@ class PlayState extends MusicBeatState curSong = songData.meta.name.toLowerCase(); inst = FlxG.sound.load(Paths.inst(SONG.meta.name, difficulty)); - if (Assets.exists(Paths.voices(SONG.meta.name, difficulty))) // null or true + if (SONG.meta.needsVoices != false && Assets.exists(Paths.voices(SONG.meta.name, difficulty))) // null or true vocals = FlxG.sound.load(Paths.voices(SONG.meta.name, difficulty)); else vocals = new FlxSound();