MovingBlocks/Terasology — pull request #1118 by Josharias (2014-05-29 04:12:26+00:00)
Title: Allow retrieval of UIWidget assets from code

Likely this is not the best way to do this. Exposing UIElement (and its friends) to the modding API also did not seem like a good idea. There could also be concerns regarding disposing and reloading the underlying UIElement.

This would be useful when using a common window and inserting json defined UI parts based on external input.

In my case, I have a block that brings up a default window when activated. The window has the character's inventory and the block's inventory. I want to add a component on the block that can specify another .ui asset to insert on to a specific spot on the window. This would allow the same window to provide base UI elements and entity hookup for multiple blocks that have the same general functionality.