Skip to content

luxe: save


import "luxe: save" for Save

A cross platform save system with a Key/Value store and file storage for a user, and save slots.

//create a new save profile. loads the default save slot for single save use
var save = Save.create("organization", "game")
//OR
//create a new slot and set it as the active save slot
Save.new_slot(save)
//OR
//Load a save slot from e.g Save.list()
var list = Save.list(save)
//activate the first slot
Save.set_slot(save, list[0])
//Set some slot specific values
Save.set(save, "key", "value")
//Set some user specific values
Save.set(save, "key", "value", SaveScope.user)
//Get some values from the slot
var name = Save.get(save, "name", "default_name")
//get user values, like settings
var setting = Save.get(save, "setting", false, SaveScope.user)

Save.create(org : String, app : String) : Save

Create a save slot for the given organization/app name pair. Defaults to ‘user’ for user id

Save.create(org : String, app : String, user_id : String) : Save

Create a save slot for the given user and organization/app name pair. e.g If you have a steam user ID, you’d pass it in here as a string.

Save.save(save : Save) : unknown

Flush the data for this profile to storage. Unless auto save on key change is off, unnecessary

Save.new_slot(save : Save) : None

Set the current active save slot to a new slot ID.

Save.set_slot(save : Save, slot : String) : unknown

Set the current active save slot to a Slot ID (from Save.list or otherwise).

Save.list(save : Save) : unknown

Return a list of save slot uuids for use with the slot query apis, sorted by modified time (latest first)

Save.file_exists(save : Save, file_id : String) : unknown

Returns true if the given file path can be found for the active save slot

Save.file_exists(save : Save, file_id : String, kind : SaveScope) : unknown

Returns true if the given file path can be found

Save.set_file(save : Save, file_id : String, file_contents : String) : unknown

Save the contents of a file at the given path for the active save slot. The path is a relative style path, like some/file/here

Save.set_file(save : Save, file_id : String, file_contents : String, kind : SaveScope) : unknown

Save the contents of a file at the given path. The path is a relative style path, like some/file/here

Save.get_file(save : Save, file_id : String) : unknown

Return the contents of the file with the given path for the active save slot. If not found, returns null

Save.get_file(save : Save, file_id : String, kind : SaveScope) : unknown

Return the contents of the file with the given path. If not found, returns null

Save.set(save : Save, key : String, value : Any) : unknown

Set the value for a key to the given value, for the active save slot

Save.set(save : Save, key : String, value : Any, kind : SaveScope) : unknown

Set the value for a key to the given value

Save.get(save : Save, key : String, default : Any) : unknown

Returns the value for the given key if found, otherwise returns the default provided, for the active save slot

Save.get(save : Save, key : String, default : Any, kind : SaveScope) : unknown

Returns the value for the given key if found, otherwise returns the default provided

Save.has(save : Save, key : String) : unknown

Returns true if the given key can be found, for the active save slot

Save.has(save : Save, key : String, kind : SaveScope) : unknown

Returns true if the given key can be found

Save.get_keys(save : Save) : unknown

Returns a list of knowns keys, for the active save slot

Save.get_keys(save : Save, kind : SaveScope) : unknown

Returns a list of knowns keys

Save.slot_clear(save : Save, slot : String) : Bool

Slot query. Delete a save slot, return true or false for success

Save.slot_backup(save : Save, slot : String) : String

Slot query. Makes a backup of the slot, returns a slot ID of the backup if successful, null if false

Save.slot_modified_time(save : Save, slot : String) : unknown

Slot query. Returns the modified time for the given save slot ID

Save.slot_file_exists(save : Save, slot : String, file_id : String) : unknown

Slot query. Returns true if the given file path can be found for the given save slot ID

Save.slot_set_file(save : Save, slot : String, file_id : String, file_contents : String) : unknown

Slot query. Save the contents of a file at the given path for the given slot ID. The path is a relative style path, like some/file/here

Save.slot_get_file(save : Save, slot : String, file_id : String) : unknown

Slot query. Return the contents of the file with the given path for the given slot ID. If not found, returns null

import "luxe: save" for SaveScope

no docs found

SaveScope.slot : unknown

no docs found

SaveScope.user : unknown

no docs found