diff --git a/Project.hxp b/Project.hxp index c94ba6b5..2c8498e0 100644 --- a/Project.hxp +++ b/Project.hxp @@ -179,7 +179,7 @@ class EngineAsset { // script related if (scriptSupport.exists()) { canHaxeScript.enable(); - canLuaScript.enable(); + // canLuaScript.enable(); disableDCE.enable(); scriptedStates.enable(); @@ -284,7 +284,7 @@ class EngineAsset { // chart converter addHaxelib('moonchart', 'git'); - if ( canHaxeScript.exists()) addHaxelib('hscript-improved', 'git'); + if ( canHaxeScript.exists()) addHaxelib('rulescript'); if ( canLuaScript .exists()) addHaxelib('linc_luajit', 'git'); if ( discordRPC .exists()) addHaxelib('hxdiscord_rpc'); if (allowVideos .exists()) addHaxelib('hxvlc', 'git'); diff --git a/commands/setup/Setup.hx b/commands/setup/Setup.hx index 808662ae..59359db5 100644 --- a/commands/setup/Setup.hx +++ b/commands/setup/Setup.hx @@ -45,13 +45,10 @@ class Setup { Sys.println('The libraries json doesn\'t exist!\nPlease make one in the setup folder.\nHere\'s an example of one.\n${Json.stringify([ { dependencies: [ - {name: 'thx.semver'}, { - global: false, - name: 'hscript-improved', + name: 'rulescript', version: 'git', - url: 'https://github.com/CodenameCrew/hscript-improved', - branch: 'custom-classes' + url: 'https://github.com/Kriptel/RuleScript' } ], questions: [ diff --git a/commands/setup/data.json b/commands/setup/data.json index 98524b13..86f1736a 100644 --- a/commands/setup/data.json +++ b/commands/setup/data.json @@ -27,10 +27,7 @@ "url": "https://github.com/Funkin-Imaginative/moonchart" }, - { - "name": "hscript-improved", "version": "git", "branch": "custom-classes", - "url": "https://github.com/CodenameCrew/hscript-improved" - }, + {"name": "rulescript"}, { "name": "linc_luajit", "version": "git", "url": "https://github.com/superpowers04/linc_luajit" @@ -50,7 +47,7 @@ ], "questions": [ { - "name": "hscript-improved", + "name": "rulescript", "description": "include haxe scripting support" }, { diff --git a/engine/source/imaginative/backend/scripting/Script.hx b/engine/source/imaginative/backend/scripting/Script.hx index 6dac2e54..17809fca 100644 --- a/engine/source/imaginative/backend/scripting/Script.hx +++ b/engine/source/imaginative/backend/scripting/Script.hx @@ -5,7 +5,7 @@ import imaginative.backend.scripting.types.InvalidScript; import imaginative.backend.scripting.types.LuaScript; /** - * Help's clarify a script language instance. + * Helps clarify a script language instance. */ enum abstract ScriptType(String) from String to String { /** @@ -36,12 +36,20 @@ enum abstract ScriptType(String) from String to String { /** * All your scripting needs are right here! - * @author Class started by @Zyflx. Expanded on by @rodney528. + * Class started by @Zyflx, expanded on by @rodney528. + * @author @Zyflx & @rodney528 */ -class Script extends FlxBasic implements IScript { - @:allow(imaginative.backend.system.Main) - inline static function init():Void { - exts = [ +class Script implements IFlxDestroyable implements IScript { + /** + * Every script instance that currently exists. + */ + public static var scripts:Array = []; + /** + * All possible script extension types. + */ + public static var exts(get, never):Array; + inline static function get_exts():Array { + return [ for (exts in [HaxeScript.exts, LuaScript.exts]) for (ext in exts) ext @@ -49,32 +57,22 @@ class Script extends FlxBasic implements IScript { } /** - * Every script instance created. - */ - public static var scripts:Array