← back to roto on ba3a.dev

Settings

@Serializable
data class Settings(val library: String? = null, val project: String? = null, val editor: String? = null, val folders: Map<String, String> = emptyMap(), val recent: List<RecentProject> = emptyList(), val appearance: Appearance = Appearance.System, val window: WindowSettings? = null, val exportScale: Int = DEFAULT_EXPORT_SCALE)

The artist's own Roto settings on this machine: the library folder that holds every profile, the project folder last opened, the editor program handoffs open in, if they chose one over the system's default, the folders each kind of file chooser last used, the recent projects, the appearance of the app, the window it was left in and the exportScale last chosen. All paths are absolute paths: they describe this machine, not any consuming project, so the rule that project paths are relative does not apply.

Constructors

Link copied to clipboard
constructor(library: String? = null, project: String? = null, editor: String? = null, folders: Map<String, String> = emptyMap(), recent: List<RecentProject> = emptyList(), appearance: Appearance = Appearance.System, window: WindowSettings? = null, exportScale: Int = DEFAULT_EXPORT_SCALE)

Properties

Link copied to clipboard

the colour scheme the app shows; the system's by default

Link copied to clipboard

the editor program, or null for the system's default

Link copied to clipboard

The editor program chosen, or null for the system's default.

Link copied to clipboard

the scale of the last animated export, NearestScale.MIN_FACTOR to NearestScale.MAX_FACTOR; DEFAULT_EXPORT_SCALE until one is chosen

Link copied to clipboard

the last path chosen in each kind of file chooser, by the kind's name

Link copied to clipboard

the library folder as an absolute path, or null until chosen

Link copied to clipboard

The library folder, or null until one is chosen.

Link copied to clipboard

the project folder last opened, or null

Link copied to clipboard

The project folder last opened, or null.

Link copied to clipboard

the projects opened before, newest first, at most MAX_RECENT_PROJECTS

Link copied to clipboard

the window's last size and position, or null on a first run

Functions

Link copied to clipboard
fun folder(kind: String): Path?

The last path chosen in the kind of file chooser called kind, or null when there is none.

Link copied to clipboard

These settings with the colour scheme chosen.

Link copied to clipboard
fun withEditor(program: Path): Settings

These settings with the editor program chosen.

Link copied to clipboard

These settings with scale remembered as the last export scale chosen.

Link copied to clipboard
fun withFolder(kind: String, path: Path): Settings

These settings with path remembered as the last one chosen in the kind of file chooser called kind.

Link copied to clipboard
fun withLibrary(folder: Path): Settings

These settings with the library folder chosen; the open project is remembered with it.

Link copied to clipboard
fun withProject(folder: Path): Settings

These settings with the project folder last opened and first in recent. A project opened before brings back the library it was worked on in; a new one keeps the current library.

Link copied to clipboard

These settings with the window left as state.