diff --git a/Project.xml b/Project.xml index fbca56c..c04ae8e 100644 --- a/Project.xml +++ b/Project.xml @@ -41,7 +41,7 @@ - + diff --git a/source/backend/MacrosUtil.hx b/source/backend/MacrosUtil.hx index ca68b8c..d7f1f63 100644 --- a/source/backend/MacrosUtil.hx +++ b/source/backend/MacrosUtil.hx @@ -1,5 +1,6 @@ package backend; +import haxe.macro.Expr; import sys.io.Process; class MacrosUtil { diff --git a/source/modding/ModHandler.hx b/source/modding/ModHandler.hx index 82d5162..c2f307f 100644 --- a/source/modding/ModHandler.hx +++ b/source/modding/ModHandler.hx @@ -54,9 +54,13 @@ class ModHandler { }, parseRules: getParseRules(), extensionMap: extensions, - ignoredFiles: Polymod.getDefaultIgnoreList() + ignoredFiles: Polymod.getDefaultIgnoreList(), + useScriptedClasses: true, + loadScriptsAsync: #if html5 true #else false #end, }); + buildImports(); + if (loadedModlist == null) return; @@ -66,6 +70,13 @@ class ModHandler { trace('Name: ${mod.title}, [${mod.id}]'); } + public static function buildImports():Void { + Polymod.addImportAlias("Paths", backend.Paths); + Polymod.blacklistImport('Sys'); + Polymod.blacklistImport('Reflect'); + Polymod.blacklistImport('Type'); + } + public static function getMods():Array { trackedMods = []; @@ -97,7 +108,7 @@ class ModHandler { public static function getParseRules():ParseRules { final output:ParseRules = ParseRules.getDefault(); output.addType("txt", TextFileFormat.LINES); - output.addType("hxs", TextFileFormat.PLAINTEXT); + output.addType("hxc", TextFileFormat.PLAINTEXT); return output != null ? output : null; }