Utilities

Saving settings

Keep control values and your own data between sessions.

  • Controls created with ui.* or gui.* save their values by themselves in scripts\<name>.values and get them back on the next load.
  • Give a control an id ({id = "radius", label = "Radius"}) to keep its value when you rename the label.
  • For anything else use database.read / database.write (or database.load / database.save for a whole table). Values must be JSON-serializable; save a color as {c.r, c.g, c.b, c.a}.