diff --git a/.gitignore b/.gitignore index 43d2c37c..7b2a0583 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,6 @@ latest/windows/obj/ latest/windows/haxe/ .vscode/* !.vscode/settings.json +!.vscode/tasks.json .haxelib/ mods/Baldi's Basics in Funkin'/ \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..6f963b57 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,32 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "type": "lime", + "command": "test", + "problemMatcher": [ + "$haxe-absolute", + "$haxe", + "$haxe-error", + "$haxe-trace" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "label": "lime: test (active configuration)" + }, + { + "type": "lime", + "command": "build", + "problemMatcher": [ + "$haxe-absolute", + "$haxe", + "$haxe-error", + "$haxe-trace" + ], + "group": "build", + "label": "lime: build (active configuration)" + } + ] +} \ No newline at end of file diff --git a/source/funkin/backend/system/framerate/SystemInfo.hx b/source/funkin/backend/system/framerate/SystemInfo.hx index 974b578b..e4c8c389 100644 --- a/source/funkin/backend/system/framerate/SystemInfo.hx +++ b/source/funkin/backend/system/framerate/SystemInfo.hx @@ -18,10 +18,43 @@ class SystemInfo extends FramerateCategory { static var __formattedSysText:String = ""; public static inline function init() { + #if linux + var process = new HiddenProcess("cat", ["/etc/os-release"]); + if (process.exitCode() != 0) Logs.trace('Unable to grab OS Label', ERROR, RED); + else { + var osName = ""; + var osVersion = ""; + for (line in process.stdout.readAll().toString().split("\n")) { + if (line.startsWith("PRETTY_NAME=")) { + var index = line.indexOf('"'); + if (index != -1) + osName = line.substring(index + 1, line.lastIndexOf('"')); + else { + var arr = line.split("="); + arr.shift(); + osName = arr.join("="); + } + } + if (line.startsWith("VERSION=")) { + var index = line.indexOf('"'); + if (index != -1) + osVersion = line.substring(index + 1, line.lastIndexOf('"')); + else { + var arr = line.split("="); + arr.shift(); + osVersion = arr.join("="); + } + } + } + if (osName != "") + osInfo = '${osName} ${osVersion}'.trim(); + } + #else if (lime.system.System.platformLabel != null && lime.system.System.platformLabel != "" && lime.system.System.platformVersion != null && lime.system.System.platformVersion != "") osInfo = '${lime.system.System.platformLabel.replace(lime.system.System.platformVersion, "").trim()} ${lime.system.System.platformVersion}'; else Logs.trace('Unable to grab OS Label', ERROR, RED); + #end try { #if windows @@ -38,7 +71,7 @@ class SystemInfo extends FramerateCategory { var process = new HiddenProcess("cat", ["/proc/cpuinfo"]); if (process.exitCode() != 0) throw 'Could not fetch CPU information'; - for (line in process.stdout.readAll().toString().split("\n")) { + for (line in process.stdout.readAll().toString().split("\n")) { if (line.indexOf("model name") == 0) { cpuName = line.substring(line.indexOf(":") + 2); break; diff --git a/update.sh b/update.sh old mode 100644 new mode 100755