Skip to content

Config

Load TOML files from mounted paths. Tables become Maps, arrays become Lists, primitives as-is; dates/times are strings. All methods are static.

Returns: Map, List, or primitive — Root value of the TOML file. Top-level table → Map (string keys), array → List, numbers/strings/bools as-is.

Parameters:

  • path (String) — Path to the TOML file relative to the mounted project (e.g. "game.toml", "channels.toml").

Use the returned structure to read your config. Map keys are strings; nested tables are Maps, nested arrays are Lists.

var config = Config.load("channels.toml")
var channels = config["channels"]
if (channels != null) {
for (ch in channels) {
var name = ch["name"]
var path = ch["path"]
var freq = ch["frequency"]
// ...
}
}
var gameConfig = Config.load("game.toml")
var windowW = gameConfig["Window"]["width"]