1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 05:53:02 +01:00

Add title sequence API

This commit is contained in:
Ted John
2021-01-24 16:46:16 +00:00
parent e5b412fb5f
commit 55ebebb869
4 changed files with 271 additions and 0 deletions

View File

@@ -37,6 +37,11 @@ declare global {
var park: Park;
/** APIs for the current scenario. */
var scenario: Scenario;
/**
* APIs for creating and editing title sequences.
* These will only be available to clients that are not running headless mode.
*/
var titleSequenceManager: TitleSequenceManager;
/**
* APIs for controlling the user interface.
* These will only be available to servers and clients that are not running headless mode.
@@ -2168,4 +2173,82 @@ declare global {
off(event: 'error', callback: (hadError: boolean) => void): Socket;
off(event: 'data', callback: (data: string) => void): Socket;
}
interface TitleSequence {
/**
* The name of the title sequence.
*/
name: string;
/**
* The full path of the title sequence.
*/
readonly path: string;
/**
* Whether the title sequence is a single file or directory.
*/
readonly isDirectory: boolean;
/**
* Whether or not the title sequence is read-only (e.g. a pre-installed sequence).
*/
readonly isReadOnly: boolean;
/**
* The parks stored within this title sequence.
*/
parks: string[];
/**
* The commands that describe how to play the title sequence.
*/
commands: TitleSequenceCommand[];
/**
* Creates a new title sequence identical to this one.
* @param name The name of the new title sequence.
*/
clone(name: string): TitleSequence;
/**
* Deletes this title sequence from disc.
*/
delete(): void;
}
type TitleSequenceCommandType =
'load' |
'loadsc' |
'location' |
'rotate' |
'zoom' |
'speed' |
'follow' |
'wait' |
'restart' |
'end';
interface TitleSequenceCommand {
type: TitleSequenceCommandType;
}
interface LocationTitleSequenceCommand extends TitleSequenceCommand {
type: 'location';
x: number;
y: number;
}
interface TitleSequenceManager {
/**
* Gets all the available title sequences.
*/
readonly titleSequences: TitleSequence[];
/**
* Creates a new blank title sequence.
* @param name The name of the title sequence.
*/
create(name: string): TitleSequence;
}
}