1
Extension Ideas / Having trouble with extension blocks using 'anything' type. [QUESTION]
« on: January 04, 2013, 05:45:48 am »
Not yet sure if this is a bug, or if I'm not doing something right. I'd think if it was a bug someone would have noticed it by now since it's a pretty major part of the extension system - and I didn't see it when poking through the assigned and unassigned bugs sections, so I'm guessing the latter.
I have this in my blocks.xml file (among other blocks, but these are the ones that are causing the issue)
The code these reference looks like this;
When I open my game, these two blocks don't show up (but the other block in the same blocks.xml file does - so it's not a formatting error, or a missing close tag or something).
The error that shows up in my log;
Now 'anything' does show up as a type in the help information that's commented out, so I would expect it to work. I'm trying to make it so that when my classed objects are used stencyl-side they are passed around as Lists (so I can store them in an attribute, since there's no such thing as an 'anything' attribute).
I have this in my blocks.xml file (among other blocks, but these are the ones that are causing the issue)
Code: [Select]
<block tag="listWrap" spec="List Wrap %0" code="ShivaInterface.listWrap(~)" type="normal" color="gray" returns="list">
<fields>
<anything order="0"></anything>
</fields>
</block>
<block tag="listUnwrap" spec="List Unwrap %0" code="ShivaInterface.listUnwrap(~)" type="normal" color="gray" returns="anything">
<fields>
<list order="0"></list>
</fields>
</block>
The code these reference looks like this;
Code: [Select]
public static inline function listWrap(v0:Dynamic):Array<Dynamic> {
var Arra:Array<Dynamic> = new Array<Dynamic>();
Arra.push(Type.getClassName(Type.getClass(v0)).split(".").pop());
Arra.push(v0);
return Arra;
}
public static inline function listUnwrap(v0:Array<Dynamic>):Dynamic {
return v0[1];
}
When I open my game, these two blocks don't show up (but the other block in the same blocks.xml file does - so it's not a formatting error, or a missing close tag or something).
The error that shows up in my log;
Code: [Select]
[ERR] java.lang.IllegalArgumentException: No enum const class stencyl.sw.editors.snippet.designer.Definition$Type.ANYTHING
Now 'anything' does show up as a type in the help information that's commented out, so I would expect it to work. I'm trying to make it so that when my classed objects are used stencyl-side they are passed around as Lists (so I can store them in an attribute, since there's no such thing as an 'anything' attribute).