Merge branch 'main' into new-editors

This commit is contained in:
Ne_Eo
2024-08-02 22:54:34 +02:00
9 changed files with 74 additions and 22 deletions
+28 -13
View File
@@ -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<String>) {
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<String> = lib.global == "true" ? "--global" : null;
var globalSuffix = globalism != null ? ' $globalism' : '';
var globalSuffix:Null<String> = 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;
+17 -5
View File
@@ -14,18 +14,30 @@
<!-- Other Libraries -->
<git name="hscript-improved" url="https://github.com/FNF-CNE-Devs/hscript-improved" ref="custom-classes" />
<git name="flxanimate" url="https://github.com/FNF-CNE-Devs/flxanimate" />
<git name="hxdiscord_rpc" url="https://github.com/FNF-CNE-Devs/hxdiscord_rpc" />
<lib name="hxvlc" />
<git name="hxdiscord_rpc" url="https://github.com/FNF-CNE-Devs/hxdiscord_rpc" skipDeps="true" />
<lib name="hxvlc" skipDeps="true" />
<!-- Documentation and other features -->
<git name="away3d" url="https://github.com/FNF-CNE-Devs/away3d" />
<!-- <lib name="dox" /> -->
<lib name="format" />
<lib name="markdown" />
<!-- For building lime -->
<lib global="true" name="hxp" />
<lib global="true" name="format" />
<lib global="true" name="hxp" /> <lib name="hxp" />
<lib global="true" name="format" /> <lib name="format" />
<!-- Extras -->
<!-- TODO: Remove this when hxcpp is updated -->
<!-- Adds a progress counter to compilation -->
<git name="hxcpp" url="https://github.com/NeeEoo/hxcpp" ref="codename" />
</if>
<!-- Hxcpp Building -->
<if cond="build-hxcpp || all">
<print pretty="true">Rebuilding Hxcpp...</print>
<!-- Build hxcpp -->
<cmd inLib="hxcpp" dir="tools/hxcpp" cmd="haxe compile.hxml" />
</if>
<!-- Lime Building -->
+12
View File
@@ -6,6 +6,18 @@
<line>mkdir dev-libs</line>
</cmd>
<if cond="hxcpp || all">
<cmd>
<line>cd dev-libs</line>
<line>git clone https://github.com/NeeEoo/hxcpp hxcpp</line>
<line>cd ..</line>
<line>haxelib dev hxcpp dev-libs/hxcpp</line>
</cmd>
<!-- Build hxcpp -->
<cmd inLib="hxcpp" dir="tools/hxcpp" cmd="haxe compile.hxml" />
</if>
<if cond="openfl || all">
<cmd>
<line>cd dev-libs</line>
+1
View File
@@ -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);
+1
View File
@@ -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;
@@ -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<String>;
var ?events:Array<Dynamic>;
var ?needsVoices:Bool;
var player1:String;
var player2:String;
+10 -2
View File
@@ -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
}
}
}
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -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();