mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-14 19:25:16 -05:00
Compare commits
24 commits
693d8c4ae4
...
4a11e3ec78
Author | SHA1 | Date | |
---|---|---|---|
|
4a11e3ec78 | ||
|
e9a1ee42b2 | ||
|
9ee4b0b94e | ||
|
907f300267 | ||
|
ba1dbb5f68 | ||
|
d27433318d | ||
|
ee63e8d8d6 | ||
|
ba72fee609 | ||
|
42d93c616a | ||
|
374f6837eb | ||
|
f3b4cac92d | ||
|
918292d5a8 | ||
|
07749285f1 | ||
|
dcc58e9e33 | ||
|
6d35d07245 | ||
|
807373c2d2 | ||
|
c75112b998 | ||
|
b26b1bf4e8 | ||
|
0e36e9261d | ||
|
c00e4e8316 | ||
|
2d68f60c9b | ||
|
a01a5907e7 | ||
|
ad23a1c6d0 | ||
|
d105686251 |
2 changed files with 22 additions and 17 deletions
|
@ -590,9 +590,11 @@ class Project extends HXProject {
|
|||
addHaxeMacro("addMetadata('@:build(funkin.util.macro.FlxMacro.buildFlxBasic())', 'flixel.FlxBasic')");
|
||||
|
||||
var abstracts:Array<String> = [
|
||||
'funkin.*',
|
||||
'flixel.*',
|
||||
'haxe.*'
|
||||
'.*',
|
||||
'!thx.Set',
|
||||
'!cpp.*',
|
||||
'!lime.*',
|
||||
'!openfl.*'
|
||||
];
|
||||
addHaxeMacro("funkin.util.macro.PolymodMacro.buildPolymodAbstracts(['" + abstracts.join("', '") + "'])");
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ class PolymodMacro
|
|||
}
|
||||
}
|
||||
|
||||
abstractAliases.set('${packTypePath(cls)}', 'polymod.abstracts.${packTypePath(cls)}');
|
||||
abstractAliases.set('${packTypePath(cls)}', 'polymod.abstracts.${packTypePath(cls)}${classSuffix}');
|
||||
buildAbstract(cls);
|
||||
break;
|
||||
}
|
||||
|
@ -126,6 +126,7 @@ class PolymodMacro
|
|||
}
|
||||
|
||||
#if macro
|
||||
static var classSuffix:String = '_';
|
||||
static var alreadyCalled:Bool = false;
|
||||
static var skipFields:Array<String> = [];
|
||||
|
||||
|
@ -160,7 +161,7 @@ class PolymodMacro
|
|||
{
|
||||
pos: Context.currentPos(),
|
||||
pack: ['polymod', 'abstracts'].concat(abstractCls.pack),
|
||||
name: abstractCls.name,
|
||||
name: abstractCls.name + classSuffix,
|
||||
kind: TypeDefKind.TDClass(null, [], false, false, false),
|
||||
fields: fields,
|
||||
}, null);
|
||||
|
@ -202,7 +203,7 @@ class PolymodMacro
|
|||
funcArgs.push(
|
||||
{
|
||||
name: arg.name,
|
||||
type: (macro :Dynamic),
|
||||
type: null,
|
||||
opt: arg.opt
|
||||
});
|
||||
funcArgNames.push(arg.name);
|
||||
|
@ -219,7 +220,7 @@ class PolymodMacro
|
|||
kind: FieldType.FFun(
|
||||
{
|
||||
args: funcArgs,
|
||||
ret: (macro :Dynamic),
|
||||
ret: null,
|
||||
expr: macro
|
||||
{
|
||||
@:privateAccess
|
||||
|
@ -290,23 +291,25 @@ class PolymodMacro
|
|||
fieldArgs.push(
|
||||
{
|
||||
name: arg.name,
|
||||
type: (macro :Dynamic),
|
||||
type: null,
|
||||
opt: arg.opt,
|
||||
});
|
||||
}
|
||||
|
||||
var returnStr:String = 'return ';
|
||||
var returnType:ComplexType = (macro :Dynamic);
|
||||
switch (ret)
|
||||
var returnStr:String = switch (ret)
|
||||
{
|
||||
case Type.TAbstract(t, _):
|
||||
if (t.get().name == 'Void')
|
||||
{
|
||||
returnStr = '';
|
||||
returnType = (macro :Void);
|
||||
'';
|
||||
}
|
||||
else
|
||||
{
|
||||
'return ';
|
||||
}
|
||||
default:
|
||||
}
|
||||
'return ';
|
||||
};
|
||||
|
||||
var expr:String = '${returnStr}${moduleTypePath(cls)}.${field.name}(${exprArgs.join(', ')})';
|
||||
|
||||
|
@ -318,7 +321,7 @@ class PolymodMacro
|
|||
kind: FieldType.FFun(
|
||||
{
|
||||
args: fieldArgs,
|
||||
ret: returnType,
|
||||
ret: null,
|
||||
expr: macro
|
||||
{
|
||||
@:privateAccess
|
||||
|
@ -348,7 +351,7 @@ class PolymodMacro
|
|||
kind: FieldType.FFun(
|
||||
{
|
||||
args: [],
|
||||
ret: (macro :Dynamic),
|
||||
ret: null,
|
||||
expr: macro
|
||||
{
|
||||
@:privateAccess
|
||||
|
@ -378,7 +381,7 @@ class PolymodMacro
|
|||
kind: FieldType.FFun(
|
||||
{
|
||||
args: [],
|
||||
ret: (macro :Dynamic),
|
||||
ret: null,
|
||||
expr: macro
|
||||
{
|
||||
@:privateAccess
|
||||
|
|
Loading…
Reference in a new issue