Wren classes are known without the Wren import
It doesn't make sense to me, but it seems you can forget to import a class from "widgets", and it still work. (!!?)
I've noticed that Wren knows about any class exported in a @ScriptExport section, and you do not need to "import" from your wren script.
Conversely, I have some classes that I explicitly import in Wren without needing a @ScriptExport, but that actually doesn't work, so I'm forced to use a @ScriptExport anyways! This has led to the following code in my project:
@ScriptExport
{
...
UISeparator ForceScriptToImportSeparators; // For some reason importing directly in the script isn't enough
}
@ScriptExport is indeed always needed (unless you use context.wrenSupport.registerUIElementClass!UISeparator to do it for each class manually, this is equivalent).
It makes the class UISeparator declared, with its properties, in the "widget" pseudo-module, it then allows to use it from script.
Without that, this class doesn't exist for the point of view of the Wren VM.
Something else annoying with Wren?
@ScriptExportis indeed always needed (unless you usecontext.wrenSupport.registerUIElementClass!UISeparatorto do it for each class manually, this is equivalent).
Ah! That makes sense! I should have taken more time to understand how this works, thank you.
Well this isn't really disrupting.