Skip to content

Commit

Permalink
wildcard imports probably
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored Nov 13, 2024
1 parent e9d42de commit 6d64486
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions source/modding/Hscript.hx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,21 @@ class Hscript extends FlxBasic {
} else {
if (asDa != null && asDa != '')
setVariable(asDa, daClass);
else
setVariable(splitClassName[splitClassName.length - 1], daClass);
else {
var daClassName = splitClassName[splitClassName.length - 1];
if (daClassName == '*') {
while (splitClassName.length > 0 && daClass != null) {
daClassName = splitClassName.pop();
daClass = Type.resolveClass(splitClassName.join('.'));
if (daClass != null) break;
}

if (daClass != null)
for (field in Reflect.fields(daClass))
setVariable(field, Reflect.field(daClass, field));
} else
setVariable(daClassName, daClass);
}
}
}
});
Expand Down Expand Up @@ -249,10 +262,7 @@ class Hscript extends FlxBasic {
"fromRGB": FlxColor.fromRGB,
"fromRGBFloat": FlxColor.fromRGBFloat,
"fromString": FlxColor.fromString,
"interpolate": FlxColor.interpolate,
"to24Bit": function(color:Int) {
return color & 0xffffff;
},
"interpolate": FlxColor.interpolate
};
}

Expand Down

0 comments on commit 6d64486

Please sign in to comment.