Changes

Jump to navigation Jump to search
Line 183: Line 183:  
Note that the '''parent''' parameter of '''GenerateUI''' call is null, because all the UI will be added as a child to the parent object, but since we are spawning a window, this is not necessary to define. You can use '''WindowManager.Spawn*''' to spawn UI elements to put your UI into. I'm using '''this''' for the '''callback''' parameter, so when you click the button, the method '''ShowMessage''' from the current class will be called.
 
Note that the '''parent''' parameter of '''GenerateUI''' call is null, because all the UI will be added as a child to the parent object, but since we are spawning a window, this is not necessary to define. You can use '''WindowManager.Spawn*''' to spawn UI elements to put your UI into. I'm using '''this''' for the '''callback''' parameter, so when you click the button, the method '''ShowMessage''' from the current class will be called.
   −
Note that creating UI like this is done on the fly, so you could add functionality to reload the XML when you want for rapid testing.
+
Note that creating UI like this is done on the fly, so you could add functionality in your mod to reload UI from an XML while the mod is still running for rapid testing.
    
These are the current object tags that will allow you to create a new UI element:
 
These are the current object tags that will allow you to create a new UI element:

Navigation menu