diff --git a/project.hxp b/project.hxp index 12588302f..2ec8ba445 100644 --- a/project.hxp +++ b/project.hxp @@ -588,7 +588,6 @@ class Project extends HXProject { function configureCustomMacros() { // This macro allows addition of new functionality to existing Flixel. --> addHaxeMacro("addMetadata('@:build(funkin.util.macro.FlxMacro.buildFlxBasic())', 'flixel.FlxBasic')"); - addHaxeMacro("funkin.util.macro.PolymodMacro.buildPolymodAbstracts()"); } function configureOutputDir() { diff --git a/source/funkin/modding/PolymodHandler.hx b/source/funkin/modding/PolymodHandler.hx index 8852d06d8..007df38bf 100644 --- a/source/funkin/modding/PolymodHandler.hx +++ b/source/funkin/modding/PolymodHandler.hx @@ -24,6 +24,7 @@ import polymod.Polymod; /** * A class for interacting with Polymod, the atomic modding framework for Haxe. */ +@:build(funkin.util.macro.PolymodMacro.buildPolymodAbstracts()) class PolymodHandler { /** diff --git a/source/funkin/util/macro/PolymodMacro.hx b/source/funkin/util/macro/PolymodMacro.hx index 02085f553..ef60c4172 100644 --- a/source/funkin/util/macro/PolymodMacro.hx +++ b/source/funkin/util/macro/PolymodMacro.hx @@ -8,8 +8,10 @@ using StringTools; class PolymodMacro { - public static macro function buildPolymodAbstracts():Void + public static macro function buildPolymodAbstracts():Array { + var fields:Array = Context.getBuildFields(); + Context.onAfterTyping((types) -> { for (type in types) { @@ -17,11 +19,14 @@ class PolymodMacro { case ModuleType.TAbstract(a): var cls = a.get(); + trace(cls.name); default: // do nothing } } }); + + return fields; } #if macro