Merge branch 'main' into translations-system

This commit is contained in:
NeeEoo
2024-04-10 16:14:55 +02:00
59 changed files with 345 additions and 162 deletions
@@ -19,6 +19,7 @@ class CommandLineHandler {
#end
Sys.println("-nocolor | Disables colors in the terminal");
Sys.println("-nogpubitmap | Forces GPU only bitmaps off");
Sys.println("-nocwdfix | Turns off automatic working directory fix");
Sys.exit(0);
#if MOD_SUPPORT
case "-m" | "-mod" | "-currentmod":
@@ -59,6 +60,8 @@ class CommandLineHandler {
Main.noTerminalColor = true;
case "-nogpubitmap":
Main.forceGPUOnlyBitmapsOff = true;
case "-nocwdfix":
Main.noCwdFix = true;
case "-livereload":
// do nothing
default:
+1 -1
View File
@@ -585,7 +585,7 @@ class Controls extends FlxActionSet
#else
for (gamepad in controls.gamepadsAdded)
if (gamepadsAdded.indexOf(gamepad) == -1)
gamepadsAdded.push(gamepad);
gamepadsAdded.push(gamepad);
#end
mergeKeyboardScheme(controls.keyboardScheme);
+10 -10
View File
@@ -32,11 +32,11 @@ class Logs {
var prefix = "[FLIXEL]";
var color:ConsoleColor = LIGHTGRAY;
var level:Level = INFO;
if (Style == LogStyle.CONSOLE) {prefix = "> "; color = WHITE; level = INFO; } else
if (Style == LogStyle.ERROR) {prefix = "[FLIXEL]"; color = RED; level = ERROR; } else
if (Style == LogStyle.NORMAL) {prefix = "[FLIXEL]"; color = WHITE; level = INFO; } else
if (Style == LogStyle.NOTICE) {prefix = "[FLIXEL]"; color = GREEN; level = VERBOSE;} else
if (Style == LogStyle.WARNING) {prefix = "[FLIXEL]"; color = YELLOW; level = WARNING;}
if (Style == LogStyle.CONSOLE) {prefix = "> "; color = WHITE; level = INFO; } else
if (Style == LogStyle.ERROR) {prefix = "[FLIXEL]"; color = RED; level = ERROR; } else
if (Style == LogStyle.NORMAL) {prefix = "[FLIXEL]"; color = WHITE; level = INFO; } else
if (Style == LogStyle.NOTICE) {prefix = "[FLIXEL]"; color = GREEN; level = VERBOSE;} else
if (Style == LogStyle.WARNING) {prefix = "[FLIXEL]"; color = YELLOW; level = WARNING;}
var d:Dynamic = Data;
if (!(d is Array))
@@ -56,11 +56,11 @@ class Logs {
logText('${Std.string(time.getHours()).addZeros(2)}:${Std.string(time.getMinutes()).addZeros(2)}:${Std.string(time.getSeconds()).addZeros(2)}', DARKMAGENTA),
logText(' |'),
switch(level) {
case WARNING: logText(' WARNING ', DARKYELLOW);
case ERROR: logText(' ERROR ', DARKRED);
case TRACE: logText(' TRACE ', GRAY);
case VERBOSE: logText(' VERBOSE ', DARKMAGENTA);
default: logText(' INFORMATION ', CYAN);
case WARNING: logText(' WARNING ', DARKYELLOW);
case ERROR: logText(' ERROR ', DARKRED);
case TRACE: logText(' TRACE ', GRAY);
case VERBOSE: logText(' VERBOSE ', DARKMAGENTA);
default: logText(' INFORMATION ', CYAN);
},
logText('] ')
];
+18
View File
@@ -24,6 +24,10 @@ import sys.thread.Thread;
import sys.io.File;
#end
import funkin.backend.assets.ModsFolder;
#if android
import android.content.Context;
import android.os.Build;
#end
class Main extends Sprite
{
@@ -198,9 +202,23 @@ class Main extends Sprite
for(b in pool.clear())
b.destroy();
}
openfl.display3D.utils.UInt8Buff._pools.clear();
}
MemoryUtil.clearMajor();
}
public static var noCwdFix:Bool = false;
public static function fixWorkingDirectory() {
#if windows
if (!noCwdFix && !sys.FileSystem.exists('manifest/default.json')) {
Sys.setCwd(haxe.io.Path.directory(Sys.programPath()));
}
#elseif android
Sys.setCwd(Path.addTrailingSlash(VERSION.SDK_INT > 30 ? Context.getObbDir() : Context.getExternalFilesDir()));
#elseif (ios || switch)
Sys.setCwd(Path.addTrailingSlash(openfl.filesystem.File.applicationStorageDirectory.nativePath));
#end
}
}
@@ -3,7 +3,7 @@ package funkin.backend.system.macros;
#if macro
class NewHaxeWarning {
public static function warn() {
#if (haxe >= "4.3.0")
#if (haxe >= "4.3.0" && !display)
Sys.println("====================");
Sys.println("[ WARNING ]");
Sys.println("Compiling with Haxe 4.3.0 isnt fully recommended yet, but it does work.");
@@ -101,7 +101,7 @@ class AsyncUpdater {
progress.files = files.length;
progress.step = DOWNLOADING_ASSETS;
trace('starting assets download');
doFile([for(e in files) e], [for(e in fileNames) e], function() {
doFile([for(e in files) e], fileNames.copy(), function() {
progress.curFile = -1;
progress.curFileName = null;
progress.files = 1;