¶
luxe
API (2025.1.2
)¶
luxe: save
module¶
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)
- create(org:
String
, app:String
) - create(org:
String
, app:String
, user_id:String
) - save(save:
Save
) - new_slot(save:
Save
) - set_slot(save:
Save
, slot:String
) - list(save:
Save
) - file_exists(save:
Save
, file_id:String
) - file_exists(save:
Save
, file_id:String
, kind:SaveScope
) - set_file(save:
Save
, file_id:String
, file_contents:String
) - set_file(save:
Save
, file_id:String
, file_contents:String
, kind:SaveScope
) - get_file(save:
Save
, file_id:String
) - get_file(save:
Save
, file_id:String
, kind:SaveScope
) - set(save:
Save
, key:String
, value:Any
) - set(save:
Save
, key:String
, value:Any
, kind:SaveScope
) - get(save:
Save
, key:String
, default:Any
) - get(save:
Save
, key:String
, default:Any
, kind:SaveScope
) - has(save:
Save
, key:String
) - has(save:
Save
, key:String
, kind:SaveScope
) - get_keys(save:
Save
) - get_keys(save:
Save
, kind:SaveScope
) - slot_clear(save:
Save
, slot:String
) - slot_backup(save:
Save
, slot:String
) - slot_modified_time(save:
Save
, slot:String
) - slot_file_exists(save:
Save
, slot:String
, file_id:String
) - slot_set_file(save:
Save
, slot:String
, file_id:String
, file_contents:String
) - slot_get_file(save:
Save
, slot:String
, file_id:String
)
String
, app: String
)
¶Save
Create a save slot for the given organization/app name pair. Defaults to 'user' for user id
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
)
¶unknown
Flush the data for this profile to storage. Unless auto save on key change is off, unnecessary
Save
)
¶None
Set the current active save slot to a new slot ID.
Save
, slot: String
)
¶unknown
Set the current active save slot to a Slot ID (from Save.list or otherwise).
Save
)
¶unknown
Return a list of save slot uuids for use with the slot query apis, sorted by modified time (latest first)
Save
, file_id: String
)
¶unknown
Returns true if the given file path can be found for the active save slot
Save
, file_id: String
, kind: SaveScope
)
¶unknown
Returns true if the given file path can be found
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
, 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
, 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
, file_id: String
, kind: SaveScope
)
¶unknown
Return the contents of the file with the given path. If not found, returns null
Save
, key: String
, value: Any
)
¶unknown
Set the value for a key to the given value, for the active save slot
Save
, key: String
, value: Any
, kind: SaveScope
)
¶unknown
Set the value for a key to the given value
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
, key: String
, default: Any
, kind: SaveScope
)
¶unknown
Returns the value for the given key if found, otherwise returns the default provided
Save
, key: String
)
¶unknown
Returns true if the given key can be found, for the active save slot
Save
, key: String
, kind: SaveScope
)
¶unknown
Returns true if the given key can be found
Save
)
¶unknown
Returns a list of knowns keys, for the active save slot
Save
, kind: SaveScope
)
¶unknown
Returns a list of knowns keys
Save
, slot: String
)
¶Bool
Slot query. Delete a save slot, return true or false for success
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: String
)
¶unknown
Slot query. Returns the modified time for the given save slot ID
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: 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: 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
SaveScope¶
import "luxe: save" for SaveScope
no docs found
unknown
no docs found
unknown
no docs found