The Beginning of the End (Old Custom Class)

This commit is contained in:
Jaime Humberto Macias Bustamante
2025-05-04 23:20:56 -07:00
parent bf602f758b
commit 742b40c86c
3 changed files with 89 additions and 62 deletions
+16 -1
View File
@@ -7,6 +7,10 @@ import hscript.Expr.FieldDecl;
import hscript.Expr.VarDecl;
import hscript.Expr.FunctionDecl;
/**
* The ACTUAL "StaticHandler"
* @author Jamextreme140
*/
@:access(hscript.Interp)
@:structInit
class CustomClassDecl implements IHScriptCustomAccessBehaviour {
@@ -129,7 +133,12 @@ class CustomClassDecl implements IHScriptCustomAccessBehaviour {
extendString = this.pkg.join(".") + "." + extendString;
}
superClassDecl = ProxyType.resolveClass(extendString);
var cls:Dynamic = Type.resolveClass('${extendString}_HSX');
if(cls == null)
cls = ProxyType.resolveClass(extendString);
superClassDecl = cls;
if(superClassDecl == null)
staticInterp.error(ECustom("could not resolve super class: " + extendString));
}
@@ -234,6 +243,12 @@ class CustomClassDecl implements IHScriptCustomAccessBehaviour {
__allowSetGet = true;
return r;
}
public function toString():String {
var pkg = pkg != null ? '${pkg.join(".")}.' : "";
var name = classDecl.name;
return '$pkg$name';
}
}
typedef CustomClassImport = {