@famibee/skynovel 1.64.11 → 1.64.13

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.
Files changed (75) hide show
  1. package/dist/CmnTween.js +118 -125
  2. package/dist/CmnTween.js.map +1 -1
  3. package/dist/EventMng.js +91 -92
  4. package/dist/EventMng.js.map +1 -1
  5. package/dist/GrpLayer.js +16 -11
  6. package/dist/GrpLayer.js.map +1 -1
  7. package/dist/LayerMng.js +92 -93
  8. package/dist/LayerMng.js.map +1 -1
  9. package/dist/Main.js.map +1 -1
  10. package/dist/PropParser.js +60 -58
  11. package/dist/PropParser.js.map +1 -1
  12. package/dist/Reading.js +5 -4
  13. package/dist/Reading.js.map +1 -1
  14. package/dist/ScriptIterator.js +97 -97
  15. package/dist/ScriptIterator.js.map +1 -1
  16. package/dist/SndBuf.js +37 -35
  17. package/dist/SndBuf.js.map +1 -1
  18. package/dist/Variable.js +89 -94
  19. package/dist/Variable.js.map +1 -1
  20. package/dist/sn/CmnTween.d.ts +4 -15
  21. package/dist/sn/CmnTween.d.ts.map +1 -1
  22. package/dist/sn/EventMng.d.ts.map +1 -1
  23. package/dist/sn/GrpLayer.d.ts +1 -1
  24. package/dist/sn/GrpLayer.d.ts.map +1 -1
  25. package/dist/sn/Layer.d.ts +1 -1
  26. package/dist/sn/Layer.d.ts.map +1 -1
  27. package/dist/sn/LayerMng.d.ts.map +1 -1
  28. package/dist/sn/Main.d.ts.map +1 -1
  29. package/dist/sn/PropParser.d.ts +7 -4
  30. package/dist/sn/PropParser.d.ts.map +1 -1
  31. package/dist/sn/Reading.d.ts +1 -1
  32. package/dist/sn/Reading.d.ts.map +1 -1
  33. package/dist/sn/ScriptIterator.d.ts.map +1 -1
  34. package/dist/sn/SndBuf.d.ts.map +1 -1
  35. package/dist/sn/Variable.d.ts.map +1 -1
  36. package/dist/web2.js +3 -3
  37. package/dist/web2.js.map +1 -1
  38. package/dist_app/CmnTween.js +118 -125
  39. package/dist_app/CmnTween.js.map +1 -1
  40. package/dist_app/EventMng.js +244 -245
  41. package/dist_app/EventMng.js.map +1 -1
  42. package/dist_app/GrpLayer.js +16 -11
  43. package/dist_app/GrpLayer.js.map +1 -1
  44. package/dist_app/LayerMng.js +59 -60
  45. package/dist_app/LayerMng.js.map +1 -1
  46. package/dist_app/Main.js.map +1 -1
  47. package/dist_app/PropParser.js +37 -35
  48. package/dist_app/PropParser.js.map +1 -1
  49. package/dist_app/Reading.js +5 -4
  50. package/dist_app/Reading.js.map +1 -1
  51. package/dist_app/ScriptIterator.js +151 -151
  52. package/dist_app/ScriptIterator.js.map +1 -1
  53. package/dist_app/SndBuf.js +37 -35
  54. package/dist_app/SndBuf.js.map +1 -1
  55. package/dist_app/Variable.js +89 -94
  56. package/dist_app/Variable.js.map +1 -1
  57. package/dist_app/app2.js +3 -3
  58. package/dist_app/app2.js.map +1 -1
  59. package/dist_app/sn/CmnTween.d.ts +4 -15
  60. package/dist_app/sn/CmnTween.d.ts.map +1 -1
  61. package/dist_app/sn/EventMng.d.ts.map +1 -1
  62. package/dist_app/sn/GrpLayer.d.ts +1 -1
  63. package/dist_app/sn/GrpLayer.d.ts.map +1 -1
  64. package/dist_app/sn/Layer.d.ts +1 -1
  65. package/dist_app/sn/Layer.d.ts.map +1 -1
  66. package/dist_app/sn/LayerMng.d.ts.map +1 -1
  67. package/dist_app/sn/Main.d.ts.map +1 -1
  68. package/dist_app/sn/PropParser.d.ts +7 -4
  69. package/dist_app/sn/PropParser.d.ts.map +1 -1
  70. package/dist_app/sn/Reading.d.ts +1 -1
  71. package/dist_app/sn/Reading.d.ts.map +1 -1
  72. package/dist_app/sn/ScriptIterator.d.ts.map +1 -1
  73. package/dist_app/sn/SndBuf.d.ts.map +1 -1
  74. package/dist_app/sn/Variable.d.ts.map +1 -1
  75. package/package.json +5 -5
package/dist/SndBuf.js CHANGED
@@ -24,13 +24,13 @@ var V = function() {
24
24
  for (var e, t = 1, s = arguments.length; t < s; t++) for (var o in e = arguments[t]) Object.prototype.hasOwnProperty.call(e, o) && (n[o] = e[o]);
25
25
  return n;
26
26
  }).apply(this, arguments);
27
- }, se = ["mp3", "ogg", "oga", "opus", "mpeg", "wav", "m4a", "aiff", "wma", "mid", "caf"], U = {};
27
+ }, se = ["mp3", "ogg", "oga", "opus", "mpeg", "wav", "m4a", "aiff", "wma", "mid", "caf"], K = {};
28
28
  function fe(n) {
29
29
  var e = V({ m4a: "audio/mp4", oga: "audio/ogg", opus: 'audio/ogg; codecs="opus"', caf: 'audio/x-caf; codecs="opus"' }, n || {}), t = document.createElement("audio"), s = {}, o = /^no$/;
30
30
  se.forEach(function(r) {
31
31
  var i = t.canPlayType("audio/".concat(r)).replace(o, ""), u = e[r] ? t.canPlayType(e[r]).replace(o, "") : "";
32
32
  s[r] = !!i || !!u;
33
- }), Object.assign(U, s);
33
+ }), Object.assign(K, s);
34
34
  }
35
35
  fe();
36
36
  var de = /\.(\{([^\}]+)\})(\?.*)?$/;
@@ -39,7 +39,7 @@ function ne(n) {
39
39
  if (!e.test(t)) return t;
40
40
  for (var s = e.exec(t), o = s[2].split(","), r = o[o.length - 1], i = 0, u = o.length; i < u; i++) {
41
41
  var a = o[i];
42
- if (U[a]) {
42
+ if (K[a]) {
43
43
  r = a;
44
44
  break;
45
45
  }
@@ -52,7 +52,7 @@ function ne(n) {
52
52
  return l;
53
53
  }
54
54
  var q = se.filter(function(n) {
55
- return U[n];
55
+ return K[n];
56
56
  }), oe = function() {
57
57
  function n() {
58
58
  }
@@ -294,8 +294,8 @@ var q = se.filter(function(n) {
294
294
  }, e.prototype.play = function(t) {
295
295
  var s = t.start, o = t.end, r = t.speed, i = t.loop, u = t.volume, a = t.muted, l = t.filters;
296
296
  this._paused = !1;
297
- var h = this._media.nodes.cloneBufferSource(), m = h.source, y = h.gain;
298
- this._source = m, this._gain = y, this._speed = r, this._volume = u, this._loop = !!i, this._muted = a, this._filters = l, this.refresh();
297
+ var h = this._media.nodes.cloneBufferSource(), y = h.source, m = h.gain;
298
+ this._source = y, this._gain = m, this._speed = r, this._volume = u, this._loop = !!i, this._muted = a, this._filters = l, this.refresh();
299
299
  var g = this._source.buffer.duration;
300
300
  this._duration = g, this._end = o, this._lastUpdate = this._now(), this._elapsed = s, this._source.onended = this._onComplete.bind(this), this._loop ? (this._source.loopEnd = o, this._source.loopStart = s, this._source.start(0, s)) : o ? this._source.start(0, s, o - s) : this._source.start(0, s), this.emit("start"), this._update(!0), this.enableTicker(!0);
301
301
  }, e.prototype.enableTicker = function(t) {
@@ -496,8 +496,8 @@ var q = se.filter(function(n) {
496
496
  s.start = i.start + (s.start || 0), s.end = i.end, s.speed = i.speed || 1, s.loop = i.loop || s.loop, delete s.sprite;
497
497
  }
498
498
  if (s.offset && (s.start = s.offset), !this.isLoaded) return new Promise(function(a, l) {
499
- o.autoPlay = !0, o._autoPlayOptions = s, o._preload(function(h, m, y) {
500
- h ? l(h) : (s.loaded && s.loaded(h, m, y), a(y));
499
+ o.autoPlay = !0, o._autoPlayOptions = s, o._preload(function(h, y, m) {
500
+ h ? l(h) : (s.loaded && s.loaded(h, y, m), a(m));
501
501
  });
502
502
  });
503
503
  (this.singleInstance || s.singleInstance) && this._removeInstances();
@@ -728,22 +728,22 @@ var q = se.filter(function(n) {
728
728
  this.disconnect(), this.destination = null, this.source = null;
729
729
  }, n;
730
730
  }(), B = { __proto__: null, EqualizerFilter: function(n) {
731
- function e(t, s, o, r, i, u, a, l, h, m) {
732
- t === void 0 && (t = 0), s === void 0 && (s = 0), o === void 0 && (o = 0), r === void 0 && (r = 0), i === void 0 && (i = 0), u === void 0 && (u = 0), a === void 0 && (a = 0), l === void 0 && (l = 0), h === void 0 && (h = 0), m === void 0 && (m = 0);
733
- var y = this;
731
+ function e(t, s, o, r, i, u, a, l, h, y) {
732
+ t === void 0 && (t = 0), s === void 0 && (s = 0), o === void 0 && (o = 0), r === void 0 && (r = 0), i === void 0 && (i = 0), u === void 0 && (u = 0), a === void 0 && (a = 0), l === void 0 && (l = 0), h === void 0 && (h = 0), y === void 0 && (y = 0);
733
+ var m = this;
734
734
  if (!_().useLegacy) {
735
- var g = [{ f: e.F32, type: "lowshelf", gain: t }, { f: e.F64, type: "peaking", gain: s }, { f: e.F125, type: "peaking", gain: o }, { f: e.F250, type: "peaking", gain: r }, { f: e.F500, type: "peaking", gain: i }, { f: e.F1K, type: "peaking", gain: u }, { f: e.F2K, type: "peaking", gain: a }, { f: e.F4K, type: "peaking", gain: l }, { f: e.F8K, type: "peaking", gain: h }, { f: e.F16K, type: "highshelf", gain: m }].map(function($) {
735
+ var g = [{ f: e.F32, type: "lowshelf", gain: t }, { f: e.F64, type: "peaking", gain: s }, { f: e.F125, type: "peaking", gain: o }, { f: e.F250, type: "peaking", gain: r }, { f: e.F500, type: "peaking", gain: i }, { f: e.F1K, type: "peaking", gain: u }, { f: e.F2K, type: "peaking", gain: a }, { f: e.F4K, type: "peaking", gain: l }, { f: e.F8K, type: "peaking", gain: h }, { f: e.F16K, type: "highshelf", gain: y }].map(function($) {
736
736
  var p = _().context.audioContext.createBiquadFilter();
737
737
  return p.type = $.type, v.setParamValue(p.Q, 1), p.frequency.value = $.f, v.setParamValue(p.gain, $.gain), p;
738
738
  });
739
- (y = n.call(this, g[0], g[g.length - 1]) || this).bands = g, y.bandsMap = {};
740
- for (var f = 0; f < y.bands.length; f++) {
741
- var x = y.bands[f];
742
- f > 0 && y.bands[f - 1].connect(x), y.bandsMap[x.frequency.value] = x;
739
+ (m = n.call(this, g[0], g[g.length - 1]) || this).bands = g, m.bandsMap = {};
740
+ for (var f = 0; f < m.bands.length; f++) {
741
+ var x = m.bands[f];
742
+ f > 0 && m.bands[f - 1].connect(x), m.bandsMap[x.frequency.value] = x;
743
743
  }
744
- return y;
744
+ return m;
745
745
  }
746
- y = n.call(this, null) || this;
746
+ m = n.call(this, null) || this;
747
747
  }
748
748
  return b(e, n), e.prototype.setGain = function(t, s) {
749
749
  if (s === void 0 && (s = 0), !this.bandsMap[t]) throw new Error("No band found for frequency ".concat(t));
@@ -897,7 +897,7 @@ var q = se.filter(function(n) {
897
897
  n.call(this, null);
898
898
  }
899
899
  return b(e, n), e;
900
- }(S) }, Ae = { __proto__: null, supported: U }, z = function(n) {
900
+ }(S) }, Ae = { __proto__: null, supported: K }, z = function(n) {
901
901
  return ee = n, n;
902
902
  }(new Oe());
903
903
  ue.add(oe);
@@ -953,7 +953,7 @@ class j {
953
953
  destroy() {
954
954
  }
955
955
  }
956
- let J, c, E, Z, X, K;
956
+ let J, c, E, Z, X, U;
957
957
  const H = "BGM", D = "SE", Q = "VOICE";
958
958
  class d {
959
959
  constructor(e, t, s) {
@@ -969,8 +969,8 @@ class d {
969
969
  c.setVal_Nochk("save", l + "fn", s);
970
970
  const h = d.getVol(e, 1);
971
971
  c.setVal_Nochk("save", l + "volume", h);
972
- const m = h * Number(c.getVal("sys:" + l + "volume", 1, !0)), y = A(e, "loop", !1);
973
- y ? (d.#t[t] = s, c.setVal_Nochk("save", "const.sn.loopPlaying", JSON.stringify(d.#t))) : d.delLoopPlay(t), c.setVal_Nochk("save", l + "start_ms", o), c.setVal_Nochk("save", l + "end_ms", r), c.setVal_Nochk("save", l + "ret_ms", i), c.setVal_Nochk("tmp", l + "playing", !0), c.flush();
972
+ const y = h * Number(c.getVal("sys:" + l + "volume", 1, !0)), m = A(e, "loop", !1);
973
+ m ? (d.#t[t] = s, c.setVal_Nochk("save", "const.sn.loopPlaying", JSON.stringify(d.#t))) : d.delLoopPlay(t), c.setVal_Nochk("save", l + "start_ms", o), c.setVal_Nochk("save", l + "end_ms", r), c.setVal_Nochk("save", l + "ret_ms", i), c.setVal_Nochk("tmp", l + "playing", !0), c.flush();
974
974
  const g = z.find(s);
975
975
  this.#e = new j(
976
976
  s,
@@ -978,14 +978,14 @@ class d {
978
978
  o,
979
979
  r,
980
980
  i,
981
- m,
981
+ y,
982
982
  u,
983
983
  g
984
984
  );
985
985
  const f = {
986
- loop: y,
986
+ loop: m,
987
987
  speed: a,
988
- volume: m,
988
+ volume: y,
989
989
  loaded: (p, P) => {
990
990
  if (!this.#e.stt.isDestroy) {
991
991
  if (p) {
@@ -1012,7 +1012,7 @@ class d {
1012
1012
  p.end < 0 && (p.end += T, I.removeSprites(x), I.addSprites(x, p)), p.end <= p.start && E.errScript(`[playse] end_ms:${r}(${p.end * 1e3}) >= start_ms:${o} は異常値です`), p.end * 1e3 <= i && E.errScript(`[playse] end_ms:${r}(${p.end * 1e3}) <= ret_ms:${i} は異常値です`), T <= p.start && E.errScript(`[playse] 音声ファイル再生時間:${T * 1e3} <= start_ms:${o} は異常値です`), r !== d.#s && T <= p.end && E.errScript(`[playse] 音声ファイル再生時間:${T * 1e3} <= end_ms:${r} は異常値です`), I.play(x, (ie) => f.complete?.(ie));
1013
1013
  };
1014
1014
  } else f.autoPlay = !0;
1015
- if (y ? i !== 0 && (f.loop = !1, f.complete = (p) => {
1015
+ if (m ? i !== 0 && (f.loop = !1, f.complete = (p) => {
1016
1016
  const P = p.duration, C = i / 1e3, O = r / 1e3;
1017
1017
  P <= C && E.errScript(`[playse] 音声ファイル再生時間:${P * 1e3} <= ret_ms:${i} は異常値です`), p.play({
1018
1018
  // 一周目はループなし、なのでキャッシュされてる
@@ -1032,7 +1032,7 @@ class d {
1032
1032
  }) : f.complete = () => {
1033
1033
  W(this.#e, t), this.#e.onPlayEnd();
1034
1034
  }, this.#n(), g) {
1035
- if (g.volume = m, x) this.#o(s, f);
1035
+ if (g.volume = y, x) this.#o(s, f);
1036
1036
  else if (g.isPlayable) {
1037
1037
  const p = g.options.source;
1038
1038
  !(p instanceof ArrayBuffer) || p.byteLength === 0 ? g.play(f) : this.#e.addSnd(N.from({
@@ -1059,7 +1059,7 @@ class d {
1059
1059
  d.#t = {}, J = e, c = t, E = s, Z = o, X = r;
1060
1060
  }
1061
1061
  static setEvtMng(e) {
1062
- K = e;
1062
+ U = e;
1063
1063
  }
1064
1064
  static delLoopPlay(e) {
1065
1065
  delete d.#t[e];
@@ -1153,7 +1153,7 @@ class G {
1153
1153
  if (e.loop) return !1;
1154
1154
  e.stt = new Fe(e);
1155
1155
  const s = A(t, "canskip", !1), o = A(t, "stop", !0);
1156
- if (s && K.isSkipping)
1156
+ if (s && U.isSkipping)
1157
1157
  return o ? e.stt.stopse(e) : e.stt.onPlayEnd = () => {
1158
1158
  }, !1;
1159
1159
  const { buf: r = D } = t, i = () => {
@@ -1171,14 +1171,16 @@ class G {
1171
1171
  const u = i * Number(c.getVal("sys:" + r, 1)), a = A(t, "stop", i === 0);
1172
1172
  a && d.delLoopPlay(s), c.flush();
1173
1173
  const l = F(t, "time", NaN), h = F(t, "delay", 0);
1174
- if (l === 0 && h === 0 || K.isSkipping) {
1174
+ if (l === 0 && h === 0 || U.isSkipping) {
1175
1175
  e.setVol(u), e.stt = a ? new k(e) : new G(e);
1176
1176
  return;
1177
1177
  }
1178
- const m = e.tw();
1179
- m && (ce.setTwProp(m, t).to({ volume: u }, l).onComplete(() => {
1180
- he(m), e.stt.compFade(s), e.stt = a ? new k(e) : new G(e);
1181
- }).start(), e.stt = new je(m, e));
1178
+ const y = e.tw();
1179
+ y && (ce.setTwProp(y, t).to({ volume: u }, l).onUpdate(() => {
1180
+ e.snd?.isPlaying || (y.stop(), y.onComplete());
1181
+ }).onComplete(() => {
1182
+ he(y), e.stt.compFade(s), e.stt = a ? new k(e) : new G(e);
1183
+ }).start(), e.stt = new je(y, e));
1182
1184
  }
1183
1185
  wf = () => !1;
1184
1186
  // ok
@@ -1240,7 +1242,7 @@ class je {
1240
1242
  wf(e, t) {
1241
1243
  e.stt = new Se(e);
1242
1244
  const s = A(t, "canskip", !1);
1243
- if (s && K.isSkipping)
1245
+ if (s && U.isSkipping)
1244
1246
  return this.stopfadese(), !1;
1245
1247
  const o = () => this.stopfadese();
1246
1248
  return L.beginProc(e.procID + "wf", o, !0, s ? o : void 0), !0;