CinematicFiles beta
Class of @v12-engine/editor
export declare class CinematicFilesThe cinematics of a game as files (cinematics/<id>.json), through editor.files: what is written is a change until the map is saved (Ctrl+S), as every panel's file is. Read with the game's lanes (LaneDef), so that what is wrong in a file is said with its path
Members
constructor
constructor(files: EditorGameFiles, lanes?: () => readonly LaneDef[]);Constructs a new instance of the CinematicFiles class
freeId
freeId(id: string): Promise<string>;An id not taken: the one asked, else with a number after it (td.intro-2)
importTracks
importTracks(tracks: Record<string, CinematicTrack>): Promise<string[]>;Brings every track of tracks.json (the model before cinematics) in, each as a cinematic of its name (trackToCinematic), once: a track whose cinematic is there already is left (run again, it makes nothing), and nothing is deleted. Gives back the ids made
list
list(): Promise<string[]>;The ids of the game's cinematics, by name
read
read(id: string): Promise<CinematicDef | undefined>;A cinematic by its id, read and checked: nothing for one that is not there; what is wrong with one, thrown
remove
remove(id: string): Promise<void>;Takes a cinematic's file away
rename
rename(def: CinematicDef, id: string): Promise<CinematicDef>;Gives a cinematic another id: written under the new, the old file taken away. Refused for an id taken
watch
watch(id: string, listener: (text: string | undefined) => void): () => void;Told what a cinematic's file holds each time it changes (here, on disk, in another tab). Gives back what stops it
write
write(def: CinematicDef): Promise<void>;Writes a cinematic to its file (by its id), as writeCinematic has it