User Tools

Site Tools


addons:using_libs:settings

Settings Library

The settings library allows addons to manage json settings files with ease.

The following functions are exposed by this library:

string file.normalize_path(string path);

  • Parameters
    • path - The path to normalize the slashes of.
  • Returns
    • The normalized path string.

string file.path_from_dir(string dir);

  • Parameters
    • dir - The directory to obtain the path from.
  • Returns
    • The path pulled from the given directory.

boolean settings:save(string name, table settings);

  • Parameters
    • name - The full path and file name of the settings file to save.
    • settings - A table containing the settings to save.
  • Returns
    • True on success, false otherwise.

table settings:load(string name);

  • Parameters
    • name - The full path and file name of the settings file to load.
  • Returns
    • The table of settings on success, nil otherwise.
addons/using_libs/settings.txt · Last modified: 2015/11/19 23:17 by atom0s