PDA

View Full Version : addToXML and addToCustomAssets (for UI code)



Unreal_Ed
05-14-2019, 09:56 AM
It would be useful to have addToXML and addToCustomAssets functions.

These UI functions would be similar to setXML() and setCustomAssets() but by ADDING that XML and those CustomAssets instead of replacing that XML or those custom assets. You can currently do it manually but it is annoying to have to do it every time you want to non-destructively add UI code to something

MoreThanTom
05-26-2019, 08:00 AM
I also think that something like this is necessary, but I would like it for the optimisation options it would bring - by making a call like



UI.updateXmlTable {
{
children = {
children = {
{
tag = "Text",
value = var
}
}
}
}


We would be able to tell the UI system the specific elements that are changing, meaning the whole tree wouldn't have to be updated.

This code would also allow UI from different mods to coexist, as if they are both using updateXml, then their trees will be updated separately.

I would imagine this working by keeping track of the table references inside the Xml tree, which would inevitably take up more memory to keep track of (But should only need to be done on host?), when the table passed to updateXml matches one already in the tree, it would instead apply the properties as an update to that table (including children)

Those same tables should also be returned by setXml so as to make this as useful as possible