I've updated your script so it calls things as you'd expect. Before onCreated was only getting called in the parent class, not both the parent then the child class.
Here:
PHP Code:
public function maketype(typename, super, classes) {
temp.i = 0;
if ((@"T"@typename) != null) {
(@"T"@typename).destroy();
}
this.(@ "type_" @ typename) = (super.type() == 2) ? new super("T"@typename) : new TStaticVar("T"@typename);
for (i: classes) {
this.(@ "type_" @ typename).join(i);
}
if (this.types.index("T"@typename) < 0) {
this.types.add("T"@typename);
}
}
I actually did this in an attempt to get function inheritance working, but I don't think that it's possible using this method because theres no way to know from what class in the original object to inherit from. You use parentobject.joinedclasses[0] but this wont work:
parent::function
where parent is a string variable because it expects a class name before ::.
edit:
Although that does the onCreateds in the right order, when you go to call a function on the object it will look for it in the parent class first. This is a problem, I don't think it's possible to have onCreated's in the correct order *and* have function calling work upwards.
So either: onCreated gets called in the child then the parent and functions get called in the parent when the same function name exists in both the parent and the child
or: onCreated gets called in the parent then the child (as you'd hope) and functions are looked for in the parent before the child.