shdwcat / YUI

YUI - A UI system for GMS2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

make a proper YuiTemplateDefinition constructor for YUI templates

shdwcat opened this issue · comments

Currently templates largely exist as raw struct resources that get applied to a template element as it gets instantiated in yui_create_template_element. Some of the raw data gets modified on the first call per template, and stored in the template_def property one the resulting element, so that it can be re-used if that element is recreated. However this code is very messy and hard to debug when things go wrong.

Instead when a template is loaded from a resource, we should create a YuiTemplateDefinition that performs all the template initialization logic once, with a function to create the an element from the template definition, similar to the DCS model in my game project.

This would also allow templates to use another template as the root element, as currently the system assumes that the root element must be a core YUI element, and it's too difficult to modify the existing code to support this.

Back to 0.5.0 since it's needed to finish listbox properly