From a67ce3e425a395ce459738ad93bc22775e774c40 Mon Sep 17 00:00:00 2001 From: Yoshman29 <81191621+YoshiCrafter29@users.noreply.github.com> Date: Fri, 17 Feb 2023 19:02:25 +0100 Subject: [PATCH] :sparkles: actions tab for downloads :sparkles: --- buildnumber.txt | 2 +- source/funkin/game/StrumLine.hx | 2 +- source/funkin/macros/ScriptsMacro.hx | 4 +++- source/funkin/options/Options.hx | 2 ++ source/funkin/scripting/MultiThreadedScript.hx | 11 ++++++++++- source/funkin/scripting/Script.hx | 2 +- source/funkin/utils/DiscordUtil.hx | 2 +- source/funkin/utils/ZipUtil.hx | 4 +++- 8 files changed, 22 insertions(+), 7 deletions(-) diff --git a/buildnumber.txt b/buildnumber.txt index 4c97b937..a311f3e7 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -2239 \ No newline at end of file +2246 \ No newline at end of file diff --git a/source/funkin/game/StrumLine.hx b/source/funkin/game/StrumLine.hx index fa92dafd..15f05e8a 100644 --- a/source/funkin/game/StrumLine.hx +++ b/source/funkin/game/StrumLine.hx @@ -27,7 +27,7 @@ class StrumLine extends FlxTypedGroup { /** * Whenever Ghost Tapping is enabled. */ - @:isVar public var ghostTapping(get, set):Null = false; + @:isVar public var ghostTapping(get, set):Null = null; private function get_ghostTapping() { if (this.ghostTapping != null) return this.ghostTapping; diff --git a/source/funkin/macros/ScriptsMacro.hx b/source/funkin/macros/ScriptsMacro.hx index 681627b5..f9e7a925 100644 --- a/source/funkin/macros/ScriptsMacro.hx +++ b/source/funkin/macros/ScriptsMacro.hx @@ -13,7 +13,7 @@ class ScriptsMacro { Compiler.include("flixel"); Compiler.include("away3d"); Compiler.include("flx3d"); - #if sys + #if (sys && !web) Compiler.include("sys"); #end @@ -24,7 +24,9 @@ class ScriptsMacro { Compiler.include("haxe.crypto"); Compiler.include("haxe.display"); Compiler.include("haxe.exceptions"); + #if !web Compiler.include("haxe.extern"); + #end Compiler.include("scripting"); diff --git a/source/funkin/options/Options.hx b/source/funkin/options/Options.hx index 13d12a2c..f63d460a 100644 --- a/source/funkin/options/Options.hx +++ b/source/funkin/options/Options.hx @@ -27,6 +27,7 @@ class Options public static var week6PixelPerfect:Bool = true; public static var betaUpdates:Bool = false; public static var hitWindow:Float = 250; + public static var framerate:Int = 1000; public static var lastLoadedMod:String = null; @@ -104,6 +105,7 @@ class Options applyKeybinds(); FlxG.game.stage.quality = (FlxG.forceNoAntialiasing = !antialiasing) ? LOW : BEST; FlxG.autoPause = autoPause; + FlxG.drawFramerate = FlxG.updateFramerate = framerate; } public static function applyKeybinds() { diff --git a/source/funkin/scripting/MultiThreadedScript.hx b/source/funkin/scripting/MultiThreadedScript.hx index 81ba6457..9bbff124 100644 --- a/source/funkin/scripting/MultiThreadedScript.hx +++ b/source/funkin/scripting/MultiThreadedScript.hx @@ -2,10 +2,10 @@ package funkin.scripting; #if ALLOW_MULTITHREADING import sys.thread.Thread; -import flixel.util.FlxDestroyUtil; #end import hscript.IHScriptCustomBehaviour; +import flixel.util.FlxDestroyUtil; class MultiThreadedScript implements IFlxDestroyable implements IHScriptCustomBehaviour { var thread:#if ALLOW_MULTITHREADING Thread #else Dynamic #end; @@ -47,10 +47,12 @@ class MultiThreadedScript implements IFlxDestroyable implements IHScriptCustomBe script.load(); + #if ALLOW_MULTITHREADING thread = Thread.createWithEventLoop(function() { // Prevent the thread from being auto deleted Thread.current().events.promise(); }); + #end __variables = Type.getInstanceFields(Type.getClass(this)); } @@ -67,11 +69,16 @@ class MultiThreadedScript implements IFlxDestroyable implements IHScriptCustomBe } public function call(func:String, args:Array) { + #if ALLOW_MULTITHREADING thread.events.run(function() { callEnded = false; returnValue = script.call(func, args); callEnded = true; }); + #else + returnValue = script.call(func, args); + callEnded = true; + #end } public function destroy() { @@ -80,10 +87,12 @@ class MultiThreadedScript implements IFlxDestroyable implements IHScriptCustomBe script.destroy(); } + #if ALLOW_MULTITHREADING if (thread != null) { thread.events.runPromised(function() { // close the thing }); } + #end } } \ No newline at end of file diff --git a/source/funkin/scripting/Script.hx b/source/funkin/scripting/Script.hx index 4b86a769..030a24af 100644 --- a/source/funkin/scripting/Script.hx +++ b/source/funkin/scripting/Script.hx @@ -84,7 +84,7 @@ class Script extends FlxBasic implements IFlxDestroyable { "CoolUtil" => funkin.utils.CoolUtil, "IniUtil" => funkin.utils.IniUtil, "XMLUtil" => funkin.utils.XMLUtil, - "ZipUtil" => funkin.utils.ZipUtil, + #if sys "ZipUtil" => funkin.utils.ZipUtil, #end "MarkdownUtil" => funkin.utils.MarkdownUtil, "EngineUtil" => funkin.utils.EngineUtil, ]; diff --git a/source/funkin/utils/DiscordUtil.hx b/source/funkin/utils/DiscordUtil.hx index 3438c417..67f1319a 100644 --- a/source/funkin/utils/DiscordUtil.hx +++ b/source/funkin/utils/DiscordUtil.hx @@ -3,12 +3,12 @@ package funkin.utils; import funkin.scripting.events.DiscordPresenceUpdateEvent; import haxe.Json; import openfl.utils.Assets; +import flixel.system.FlxSound; #if DISCORD_RPC import discord_rpc.DiscordRpc; import sys.thread.Thread; import Sys; import lime.app.Application; -import flixel.system.FlxSound; #end class DiscordUtil { diff --git a/source/funkin/utils/ZipUtil.hx b/source/funkin/utils/ZipUtil.hx index 5c5a8b93..99594616 100644 --- a/source/funkin/utils/ZipUtil.hx +++ b/source/funkin/utils/ZipUtil.hx @@ -1,5 +1,6 @@ package funkin.utils; +#if sys #if (!macro && sys) import openfl.display.BitmapData; #end @@ -263,4 +264,5 @@ class StrNameLabel { this.name = name; this.label = label; } -} \ No newline at end of file +} +#end \ No newline at end of file