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

Improve title sequence API

This commit is contained in:
Ted John
2021-01-26 23:18:48 +00:00
parent fcb5f51c4a
commit 8cfdbd871d
2 changed files with 21 additions and 13 deletions

View File

@@ -2243,51 +2243,55 @@ declare global {
'restart' |
'end';
interface TitleSequenceCommandBase {
type: TitleSequenceCommandType;
}
interface LoadTitleSequenceCommand extends TitleSequenceCommandBase {
interface LoadTitleSequenceCommand {
type: 'load';
index: number;
}
interface LocationTitleSequenceCommand extends TitleSequenceCommandBase {
interface LocationTitleSequenceCommand {
type: 'location';
x: number;
y: number;
}
interface RotateTitleSequenceCommand extends TitleSequenceCommandBase {
interface RotateTitleSequenceCommand {
type: 'rotate';
rotations: number;
}
interface ZoomTitleSequenceCommand extends TitleSequenceCommandBase {
interface ZoomTitleSequenceCommand {
type: 'zoom';
zoom: number;
}
interface FollowTitleSequenceCommand extends TitleSequenceCommandBase {
interface FollowTitleSequenceCommand {
type: 'follow';
id: number | null;
}
interface SpeedTitleSequenceCommand extends TitleSequenceCommandBase {
interface SpeedTitleSequenceCommand {
type: 'speed';
speed: number;
}
interface WaitTitleSequenceCommand extends TitleSequenceCommandBase {
interface WaitTitleSequenceCommand {
type: 'wait';
duration: number;
}
interface LoadScenarioTitleSequenceCommand extends TitleSequenceCommandBase {
interface LoadScenarioTitleSequenceCommand {
type: 'loadsc';
scenario: string;
}
interface RestartTitleSequenceCommand {
type: 'restart';
}
interface EndTitleSequenceCommand {
type: 'end';
}
type TitleSequenceCommand =
LoadTitleSequenceCommand |
LocationTitleSequenceCommand |
@@ -2296,7 +2300,9 @@ declare global {
FollowTitleSequenceCommand |
SpeedTitleSequenceCommand |
WaitTitleSequenceCommand |
LoadScenarioTitleSequenceCommand;
LoadScenarioTitleSequenceCommand |
RestartTitleSequenceCommand |
EndTitleSequenceCommand;
interface TitleSequenceManager {
/**

View File

@@ -29,6 +29,8 @@ namespace OpenRCT2::Scripting
{ "speed", TitleScript::Speed },
{ "wait", TitleScript::Wait },
{ "loadsc", TitleScript::LoadSc },
{ "restart", TitleScript::Restart },
{ "end", TitleScript::End },
});
template<> DukValue ToDuk(duk_context* ctx, const TitleScript& value)