webgal-parser 4.5.16 → 4.5.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,6 +38,7 @@ var commandType;
38
38
  commandType[commandType["getUserInput"] = 31] = "getUserInput";
39
39
  commandType[commandType["applyStyle"] = 32] = "applyStyle";
40
40
  commandType[commandType["wait"] = 33] = "wait";
41
+ commandType[commandType["callSteam"] = 34] = "callSteam";
41
42
  })(commandType || (commandType = {}));
42
43
 
43
44
  const SCRIPT_CONFIG = [
@@ -78,6 +79,7 @@ const SCRIPT_CONFIG = [
78
79
  { scriptString: 'getUserInput', scriptType: commandType.getUserInput },
79
80
  { scriptString: 'applyStyle', scriptType: commandType.applyStyle },
80
81
  { scriptString: 'wait', scriptType: commandType.wait },
82
+ { scriptString: 'callSteam', scriptType: commandType.callSteam },
81
83
  ];
82
84
  const ADD_NEXT_ARG_LIST = [
83
85
  commandType.bgm,
@@ -93,6 +95,7 @@ const ADD_NEXT_ARG_LIST = [
93
95
  commandType.playEffect,
94
96
  commandType.setTransition,
95
97
  commandType.applyStyle,
98
+ commandType.callSteam,
96
99
  ];
97
100
 
98
101
  /**
@@ -448,10 +451,10 @@ const scriptParser = (sentenceRaw, assetSetter, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG
448
451
  // 正式开始解析
449
452
  // 去分号
450
453
  const commentSplit = sentenceRaw.split(/(?<!\\);/);
451
- let newSentenceRaw = commentSplit[0].trim();
454
+ let newSentenceRaw = commentSplit[0];
452
455
  newSentenceRaw = newSentenceRaw.replaceAll('\\;', ';');
453
456
  const sentenceComment = commentSplit[1] ?? '';
454
- if (newSentenceRaw === '') {
457
+ if (newSentenceRaw.trim() === '') {
455
458
  // 注释提前返回
456
459
  return {
457
460
  command: commandType.comment,
@@ -37,7 +37,8 @@ export declare enum commandType {
37
37
  setTransition = 30,
38
38
  getUserInput = 31,
39
39
  applyStyle = 32,
40
- wait = 33
40
+ wait = 33,
41
+ callSteam = 34
41
42
  }
42
43
  /**
43
44
  * 单个参数接口
package/build/es/index.js CHANGED
@@ -34,6 +34,7 @@ var commandType;
34
34
  commandType[commandType["getUserInput"] = 31] = "getUserInput";
35
35
  commandType[commandType["applyStyle"] = 32] = "applyStyle";
36
36
  commandType[commandType["wait"] = 33] = "wait";
37
+ commandType[commandType["callSteam"] = 34] = "callSteam";
37
38
  })(commandType || (commandType = {}));
38
39
 
39
40
  const SCRIPT_CONFIG = [
@@ -74,6 +75,7 @@ const SCRIPT_CONFIG = [
74
75
  { scriptString: 'getUserInput', scriptType: commandType.getUserInput },
75
76
  { scriptString: 'applyStyle', scriptType: commandType.applyStyle },
76
77
  { scriptString: 'wait', scriptType: commandType.wait },
78
+ { scriptString: 'callSteam', scriptType: commandType.callSteam },
77
79
  ];
78
80
  const ADD_NEXT_ARG_LIST = [
79
81
  commandType.bgm,
@@ -89,6 +91,7 @@ const ADD_NEXT_ARG_LIST = [
89
91
  commandType.playEffect,
90
92
  commandType.setTransition,
91
93
  commandType.applyStyle,
94
+ commandType.callSteam,
92
95
  ];
93
96
 
94
97
  /**
@@ -444,10 +447,10 @@ const scriptParser = (sentenceRaw, assetSetter, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG
444
447
  // 正式开始解析
445
448
  // 去分号
446
449
  const commentSplit = sentenceRaw.split(/(?<!\\);/);
447
- let newSentenceRaw = commentSplit[0].trim();
450
+ let newSentenceRaw = commentSplit[0];
448
451
  newSentenceRaw = newSentenceRaw.replaceAll('\\;', ';');
449
452
  const sentenceComment = commentSplit[1] ?? '';
450
- if (newSentenceRaw === '') {
453
+ if (newSentenceRaw.trim() === '') {
451
454
  // 注释提前返回
452
455
  return {
453
456
  command: commandType.comment,
@@ -37,7 +37,8 @@ export declare enum commandType {
37
37
  setTransition = 30,
38
38
  getUserInput = 31,
39
39
  applyStyle = 32,
40
- wait = 33
40
+ wait = 33,
41
+ callSteam = 34
41
42
  }
42
43
  /**
43
44
  * 单个参数接口
@@ -37,7 +37,8 @@ export declare enum commandType {
37
37
  setTransition = 30,
38
38
  getUserInput = 31,
39
39
  applyStyle = 32,
40
- wait = 33
40
+ wait = 33,
41
+ callSteam = 34
41
42
  }
42
43
  /**
43
44
  * 单个参数接口
@@ -37,6 +37,7 @@ var webgalParser = (function (exports) {
37
37
  commandType[commandType["getUserInput"] = 31] = "getUserInput";
38
38
  commandType[commandType["applyStyle"] = 32] = "applyStyle";
39
39
  commandType[commandType["wait"] = 33] = "wait";
40
+ commandType[commandType["callSteam"] = 34] = "callSteam";
40
41
  })(commandType || (commandType = {}));
41
42
 
42
43
  const SCRIPT_CONFIG = [
@@ -77,6 +78,7 @@ var webgalParser = (function (exports) {
77
78
  { scriptString: 'getUserInput', scriptType: commandType.getUserInput },
78
79
  { scriptString: 'applyStyle', scriptType: commandType.applyStyle },
79
80
  { scriptString: 'wait', scriptType: commandType.wait },
81
+ { scriptString: 'callSteam', scriptType: commandType.callSteam },
80
82
  ];
81
83
  const ADD_NEXT_ARG_LIST = [
82
84
  commandType.bgm,
@@ -92,6 +94,7 @@ var webgalParser = (function (exports) {
92
94
  commandType.playEffect,
93
95
  commandType.setTransition,
94
96
  commandType.applyStyle,
97
+ commandType.callSteam,
95
98
  ];
96
99
 
97
100
  /**
@@ -447,10 +450,10 @@ var webgalParser = (function (exports) {
447
450
  // 正式开始解析
448
451
  // 去分号
449
452
  const commentSplit = sentenceRaw.split(/(?<!\\);/);
450
- let newSentenceRaw = commentSplit[0].trim();
453
+ let newSentenceRaw = commentSplit[0];
451
454
  newSentenceRaw = newSentenceRaw.replaceAll('\\;', ';');
452
455
  const sentenceComment = commentSplit[1] ?? '';
453
- if (newSentenceRaw === '') {
456
+ if (newSentenceRaw.trim() === '') {
454
457
  // 注释提前返回
455
458
  return {
456
459
  command: commandType.comment,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webgal-parser",
3
- "version": "4.5.16",
3
+ "version": "4.5.17",
4
4
  "description": "WebGAL script parser",
5
5
  "scripts": {
6
6
  "test": "vitest",
@@ -38,6 +38,7 @@ export const SCRIPT_CONFIG = [
38
38
  { scriptString: 'getUserInput', scriptType: commandType.getUserInput },
39
39
  { scriptString: 'applyStyle', scriptType: commandType.applyStyle },
40
40
  { scriptString: 'wait', scriptType: commandType.wait },
41
+ { scriptString: 'callSteam', scriptType: commandType.callSteam },
41
42
  ];
42
43
  export const ADD_NEXT_ARG_LIST = [
43
44
  commandType.bgm,
@@ -53,6 +54,7 @@ export const ADD_NEXT_ARG_LIST = [
53
54
  commandType.playEffect,
54
55
  commandType.setTransition,
55
56
  commandType.applyStyle,
57
+ commandType.callSteam,
56
58
  ];
57
59
 
58
60
  export type ConfigMap = Map<string, ConfigItem>;
@@ -39,6 +39,7 @@ export enum commandType {
39
39
  getUserInput,
40
40
  applyStyle,
41
41
  wait,
42
+ callSteam, // 调用Steam功能
42
43
  }
43
44
 
44
45
  /**
@@ -37,10 +37,10 @@ export const scriptParser = (
37
37
 
38
38
  // 去分号
39
39
  const commentSplit = sentenceRaw.split(/(?<!\\);/);
40
- let newSentenceRaw = commentSplit[0].trim();
40
+ let newSentenceRaw = commentSplit[0];
41
41
  newSentenceRaw = newSentenceRaw.replaceAll('\\;',';');
42
42
  const sentenceComment = commentSplit[1] ?? '';
43
- if (newSentenceRaw === '') {
43
+ if (newSentenceRaw.trim() === '') {
44
44
  // 注释提前返回
45
45
  return {
46
46
  command: commandType.comment, // 语句类型