However, with this I also want to make it possible to add custom UI elements to the interface for controlling these custom scripts, i.e. being able to write "Speed = new Slider(0, 10, 0.1, 5);" which would create a new slider in the interface which goes from 0 to 10 in 0.1 steps and has a initial value of 5, and passes this value on to the variable Speed which is then useable within the user-written script.
I’ve currently written this quite awkwardly (I’m used to switching to written languages when things get complicated), where there’s a set of UI elements that all pass on the variables, but are each hidden or shown depending on what the user defines within the script. The downside of this is that it’s fixed, you can only use as much variables as I’ve pre-programmed, as to speak.
I’ve thought about doing this with JSUI, and actually drawing the UI elements when requested, which would allow more dynamic use of UI elements, but it would also be quite a chore and a potentially CPU-heavy, which I’m trying to avoid as the rest is already quite heavy.
In what way would I be able to do this the most efficient / best?