Improve title sequence API

This commit is contained in:
Ted John committed 2021-02-08 22:27:28 +00:00
1 parent fcb5f51c4a
commit 8cfdbd871d
2 files changed
+21 -13

No files matched your search

+19 -13
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 {
/**
@@ -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)