ScriptSettings

open class ScriptSettings

Contains utility methods for saving/loading script settings. Note that any settings object that is saved/loaded must have the @DoNotRename annotation applied to all fields that should be saved/loaded. To skip a field, you can make it transient. Gson is used internally to serialize and deserialize the objects.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun delete(name: String): Boolean
Attempts to delete the settings file at the specified path
Link copied to clipboard
Creates a default script settings handler
Link copied to clipboard
open fun getDirectory(): File
Gets the base directory where script settings will save/load, based on the config.
Link copied to clipboard
open fun getSaveNames(): List<String>
Lists all the file names in the base directory where script settings will save/load.
Link copied to clipboard
open fun <T> load(name: String, settingsType: Class<T>): Optional<T>
Attempts to load the specified settings type at the specified path.
Link copied to clipboard
open fun <T> save(name: String, scriptSettings: T): Boolean
Attempts to save the specified script settings object to the specified path