Skip to content

Commit 9a6629a

Browse files
Merge pull request #765 from OpenWebGAL/dev
4.5.15
2 parents ed495af + 7a2cb15 commit 9a6629a

File tree

114 files changed

+1591
-1452
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+1591
-1452
lines changed

packages/parser/src/config/scriptConfig.ts

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,58 @@
11
import {commandType} from '../interface/sceneInterface';
22

33
export const SCRIPT_CONFIG = [
4-
{ scriptString: 'intro', scriptType: commandType.intro },
4+
{ scriptString: 'say', scriptType: commandType.say },
55
{ scriptString: 'changeBg', scriptType: commandType.changeBg },
66
{ scriptString: 'changeFigure', scriptType: commandType.changeFigure },
7+
{ scriptString: 'bgm', scriptType: commandType.bgm },
8+
{ scriptString: 'playVideo', scriptType: commandType.video },
9+
{ scriptString: 'pixiPerform', scriptType: commandType.pixi },
10+
{ scriptString: 'pixiInit', scriptType: commandType.pixiInit },
11+
{ scriptString: 'intro', scriptType: commandType.intro },
712
{ scriptString: 'miniAvatar', scriptType: commandType.miniAvatar },
813
{ scriptString: 'changeScene', scriptType: commandType.changeScene },
914
{ scriptString: 'choose', scriptType: commandType.choose },
1015
{ scriptString: 'end', scriptType: commandType.end },
11-
{ scriptString: 'bgm', scriptType: commandType.bgm },
12-
{ scriptString: 'playVideo', scriptType: commandType.video },
1316
{
1417
scriptString: 'setComplexAnimation',
1518
scriptType: commandType.setComplexAnimation,
1619
},
1720
{ scriptString: 'setFilter', scriptType: commandType.setFilter },
18-
{ scriptString: 'pixiInit', scriptType: commandType.pixiInit },
19-
{ scriptString: 'pixiPerform', scriptType: commandType.pixi },
2021
{ scriptString: 'label', scriptType: commandType.label },
2122
{ scriptString: 'jumpLabel', scriptType: commandType.jumpLabel },
23+
{ scriptString: 'chooseLabel', scriptType: commandType.chooseLabel },
2224
{ scriptString: 'setVar', scriptType: commandType.setVar },
25+
{ scriptString: 'if', scriptType: commandType.if },
2326
{ scriptString: 'callScene', scriptType: commandType.callScene },
2427
{ scriptString: 'showVars', scriptType: commandType.showVars },
2528
{ scriptString: 'unlockCg', scriptType: commandType.unlockCg },
2629
{ scriptString: 'unlockBgm', scriptType: commandType.unlockBgm },
27-
{ scriptString: 'say', scriptType: commandType.say },
2830
{ scriptString: 'filmMode', scriptType: commandType.filmMode },
29-
{ scriptString: 'callScene', scriptType: commandType.callScene },
3031
{ scriptString: 'setTextbox', scriptType: commandType.setTextbox },
3132
{ scriptString: 'setAnimation', scriptType: commandType.setAnimation },
3233
{ scriptString: 'playEffect', scriptType: commandType.playEffect },
34+
{ scriptString: 'setTempAnimation', scriptType: commandType.setTempAnimation },
35+
// comment?
36+
{ scriptString: 'setTransform', scriptType: commandType.setTransform },
37+
{ scriptString: 'setTransition', scriptType: commandType.setTransition },
38+
{ scriptString: 'getUserInput', scriptType: commandType.getUserInput },
3339
{ scriptString: 'applyStyle', scriptType: commandType.applyStyle },
3440
{ scriptString: 'wait', scriptType: commandType.wait },
3541
];
3642
export const ADD_NEXT_ARG_LIST = [
3743
commandType.bgm,
3844
commandType.pixi,
3945
commandType.pixiInit,
46+
commandType.miniAvatar,
4047
commandType.label,
4148
commandType.if,
42-
commandType.miniAvatar,
4349
commandType.setVar,
44-
commandType.unlockBgm,
4550
commandType.unlockCg,
51+
commandType.unlockBgm,
4652
commandType.filmMode,
4753
commandType.playEffect,
54+
commandType.setTransition,
55+
commandType.applyStyle,
4856
];
4957

5058
export type ConfigMap = Map<string, ConfigItem>;

packages/parser/test/debug.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ async function debug() {
1616
const configFesult = parser.parseConfig(`
1717
Game_name:欢迎使用WebGAL!;
1818
Game_key:0f86dstRf;
19-
Title_img:WebGAL_New_Enter_Image.png;
19+
Title_img:WebGAL_New_Enter_Image.webp;
2020
Title_bgm:s_Title.mp3;
2121
Title_logos: 1.png | 2.png | Image Logo.png| -show -active=false -add=op! -count=3;This is a fake config, do not reference anything.
2222
`)

packages/parser/test/parser.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ test("config", async () => {
134134
const configFesult = parser.parseConfig(`
135135
Game_name:欢迎使用WebGAL!;
136136
Game_key:0f86dstRf;
137-
Title_img:WebGAL_New_Enter_Image.png;
137+
Title_img:WebGAL_New_Enter_Image.webp;
138138
Title_bgm:s_Title.mp3;
139139
Title_logos: 1.png | 2.png | Image Logo.png| -show -active=false -add=op! -count=3;This is a fake config, do not reference anything.
140140
`);
@@ -159,7 +159,7 @@ test("config-stringify", async () => {
159159
const configFesult = parser.parseConfig(`
160160
Game_name:欢迎使用WebGAL!;
161161
Game_key:0f86dstRf;
162-
Title_img:WebGAL_New_Enter_Image.png;
162+
Title_img:WebGAL_New_Enter_Image.webp;
163163
Title_bgm:s_Title.mp3;
164164
Title_logos: 1.png | 2.png | Image Logo.png| -show -active=false -add=op! -count=3;This is a fake config, do not reference anything.
165165
`);
@@ -218,17 +218,17 @@ test("changeFigure with duration and animation args", async () => {
218218
return fileName;
219219
}, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG);
220220

221-
const result = parser.parse(`changeFigure:stand.png -duration=1000 -enter=fadeIn -exit=fadeOut;`, 'test', 'test');
221+
const result = parser.parse(`changeFigure:stand.webp -duration=1000 -enter=fadeIn -exit=fadeOut;`, 'test', 'test');
222222
expect(result.sentenceList).toContainEqual({
223223
command: commandType.changeFigure,
224224
commandRaw: "changeFigure",
225-
content: "stand.png",
225+
content: "stand.webp",
226226
args: [
227227
{ key: 'duration', value: 1000 },
228228
{ key: 'enter', value: 'fadeIn' },
229229
{ key: 'exit', value: 'fadeOut' }
230230
],
231-
sentenceAssets: [{ name: "stand.png", url: 'stand.png', type: fileType.figure, lineNumber: 0 }],
231+
sentenceAssets: [{ name: "stand.webp", url: 'stand.webp', type: fileType.figure, lineNumber: 0 }],
232232
subScene: []
233233
});
234234
});

packages/parser/test/parserMultiline.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ bgm:s_Title.mp3;
8585
unlockBgm:s_Title.mp3 -name=雲を追いかけて;
8686
intro:你好
8787
|欢迎来到 WebGAL 的世界;
88-
changeBg:bg.png -next;
89-
unlockCg:bg.png -name=良夜; // 解锁CG并赋予名称
90-
changeFigure:stand.png -left -next;
88+
changeBg:bg.webp -next;
89+
unlockCg:bg.webp -name=良夜; // 解锁CG并赋予名称
90+
changeFigure:stand.webp -left -next;
9191
setAnimation:enter-from-left
9292
-target=fig-left -next;
9393
WebGAL:欢迎使用 WebGAL!这是一款全新的网页端视觉小说引擎。
9494
-v1.wav;
95-
changeFigure:stand2.png
95+
changeFigure:stand2.webp
9696
-right -next;
9797
WebGAL 是使用 Web 技术开发的引擎,因此在网页端有良好的表现。 -v2.wav;
9898
由于这个特性,如果你将 WebGAL 部署到服务器或网页托管平台上,玩家只需要一串链接就可以开始游玩! -v3.wav;
@@ -121,14 +121,14 @@ bgm:s_Title.mp3;
121121
unlockBgm:s_Title.mp3 -name=雲を追いかけて;
122122
intro:你好
123123
|欢迎来到 WebGAL 的世界;
124-
changeBg:bg.png -next;
125-
unlockCg:bg.png -name=良夜; // 解锁CG并赋予名称
126-
changeFigure:stand.png -left -next;
124+
changeBg:bg.webp -next;
125+
unlockCg:bg.webp -name=良夜; // 解锁CG并赋予名称
126+
changeFigure:stand.webp -left -next;
127127
setAnimation:enter-from-left -target=fig-left -next;
128128
;_WEBGAL_LINE_BREAK_ -target=fig-left -next;
129129
WebGAL:欢迎使用 WebGAL!这是一款全新的网页端视觉小说引擎。 -v1.wav;
130130
;_WEBGAL_LINE_BREAK_ -v1.wav;
131-
changeFigure:stand2.png -right -next;
131+
changeFigure:stand2.webp -right -next;
132132
;_WEBGAL_LINE_BREAK_ -right -next;
133133
WebGAL 是使用 Web 技术开发的引擎,因此在网页端有良好的表现。 -v2.wav;
134134
由于这个特性,如果你将 WebGAL 部署到服务器或网页托管平台上,玩家只需要一串链接就可以开始游玩! -v3.wav;

packages/parser/test/test-resources/line-break.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ bgm:s_Title.mp3;
1414
unlockBgm:s_Title.mp3 -name=雲を追いかけて;
1515
intro:你好
1616
|欢迎来到 WebGAL 的世界;
17-
changeBg:bg.png -next;
18-
unlockCg:bg.png -name=良夜; // 解锁CG并赋予名称
19-
changeFigure:stand.png -left -next;
17+
changeBg:bg.webp -next;
18+
unlockCg:bg.webp -name=良夜; // 解锁CG并赋予名称
19+
changeFigure:stand.webp -left -next;
2020
setAnimation:enter-from-left
2121
-target=fig-left -next;
2222
WebGAL:欢迎使用 WebGAL!这是一款全新的网页端视觉小说引擎。
2323
-v1.wav;
24-
changeFigure:stand2.png
24+
changeFigure:stand2.webp
2525
-right -next;
2626
WebGAL 是使用 Web 技术开发的引擎,因此在网页端有良好的表现。 -v2.wav;
2727
由于这个特性,如果你将 WebGAL 部署到服务器或网页托管平台上,玩家只需要一串链接就可以开始游玩! -v3.wav;

0 commit comments

Comments
 (0)