-
-
Notifications
You must be signed in to change notification settings - Fork 337
Expand file tree
/
Copy pathsceneInterface.ts
More file actions
109 lines (102 loc) · 2.38 KB
/
sceneInterface.ts
File metadata and controls
109 lines (102 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/**
* 语句类型
*/
import { sceneEntry, ISceneEntry } from './runtimeInterface';
import { fileType } from './assets';
export enum commandType {
say, // 对话
changeBg, // 更改背景
changeFigure, // 更改立绘
bgm, // 更改背景音乐
video, // 播放视频
pixi, // pixi演出
pixiInit, // pixi初始化
intro, // 黑屏文字演示
miniAvatar, // 小头像
changeScene, // 切换场景
choose, // 分支选择
end, // 结束游戏
setComplexAnimation, // 动画演出
setFilter, // 设置效果
label, // 标签
jumpLabel, // 跳转标签
chooseLabel, // 选择标签
setVar, // 设置变量
if, // 条件跳转
callScene, // 调用场景
showVars,
unlockCg,
unlockBgm,
filmMode,
setTextbox,
setAnimation,
playEffect,
setTempAnimation,
comment,
setTransform,
setTransition,
getUserInput,
applyStyle,
wait,
callSteam, // 调用Steam功能
setStatusBar, // 设置顶部状态框
}
/**
* 单个参数接口
* @interface arg
*/
export interface arg {
key: string; // 参数键
value: string | boolean | number; // 参数值
}
/**
* 资源接口
* @interface IAsset
*/
export interface IAsset {
name: string; // 资源名称
type: fileType; // 资源类型
url: string; // 资源url
lineNumber: number; // 触发资源语句的行号
}
/**
* 单条语句接口
* @interface ISentence
*/
export interface ISentence {
command: commandType; // 语句类型
commandRaw: string; // 命令的原始内容,方便调试
content: string; // 语句内容
args: Array<arg>; // 参数列表
sentenceAssets: Array<IAsset>; // 语句携带的资源列表
subScene: Array<string>; // 语句包含子场景列表
inlineComment: string; // 行内注释
}
/**
* 场景接口
* @interface IScene
*/
export interface IScene {
sceneName: string; // 场景名称
sceneUrl: string; // 场景url
sentenceList: Array<ISentence>; // 语句列表
assetsList: Array<IAsset>; // 资源列表
subSceneList: Array<string>; // 子场景的url列表
}
/**
* 当前的场景数据
* @interface ISceneData
*/
export interface ISceneData {
currentSentenceId: number; // 当前语句ID
sceneStack: Array<ISceneEntry>; // 场景栈
currentScene: IScene; // 当前场景数据
}
/**
* 处理后的命令接口
* @interface parsedCommand
*/
export interface parsedCommand {
type: commandType;
additionalArgs: Array<arg>;
}