mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-14 19:25:16 -05:00
build macro
This commit is contained in:
parent
b26b1bf4e8
commit
c75112b998
3 changed files with 7 additions and 2 deletions
|
@ -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() {
|
||||
|
|
|
@ -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
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -8,8 +8,10 @@ using StringTools;
|
|||
|
||||
class PolymodMacro
|
||||
{
|
||||
public static macro function buildPolymodAbstracts():Void
|
||||
public static macro function buildPolymodAbstracts():Array<Field>
|
||||
{
|
||||
var fields:Array<Field> = 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
|
||||
|
|
Loading…
Reference in a new issue