@famibee/skynovel 1.64.17 → 1.64.18
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.
- package/dist/CmnTween.js +15 -15
- package/dist/CmnTween.js.map +1 -1
- package/dist/LayerMng.js +248 -250
- package/dist/LayerMng.js.map +1 -1
- package/dist/SndBuf.js +32 -27
- package/dist/SndBuf.js.map +1 -1
- package/dist/sn/CmnInterface.d.ts.map +1 -1
- package/dist/sn/CmnTween.d.ts +1 -1
- package/dist/sn/CmnTween.d.ts.map +1 -1
- package/dist/sn/FrameMng.d.ts.map +1 -1
- package/dist/sn/SndBuf.d.ts.map +1 -1
- package/dist/web2.js +4 -4
- package/dist/web2.js.map +1 -1
- package/dist_app/CmnTween.js +15 -15
- package/dist_app/CmnTween.js.map +1 -1
- package/dist_app/LayerMng.js +248 -250
- package/dist_app/LayerMng.js.map +1 -1
- package/dist_app/SndBuf.js +32 -27
- package/dist_app/SndBuf.js.map +1 -1
- package/dist_app/app2.js +4 -4
- package/dist_app/app2.js.map +1 -1
- package/dist_app/sn/CmnInterface.d.ts.map +1 -1
- package/dist_app/sn/CmnTween.d.ts +1 -1
- package/dist_app/sn/CmnTween.d.ts.map +1 -1
- package/dist_app/sn/FrameMng.d.ts.map +1 -1
- package/dist_app/sn/SndBuf.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/LayerMng.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { e as
|
|
2
|
-
import { C as
|
|
1
|
+
import { e as g, S as H, L as F, n as B, l as x, a as _, p as M, G, q as U, E as A, f as tt, r as et, t as st, v as W, w as it, x as q, y as at, F as nt, u as O, z as J } from "./web2.js";
|
|
2
|
+
import { C as w, T as R } from "./CmnTween.js";
|
|
3
3
|
import { G as X, D as Y } from "./GrpLayer.js";
|
|
4
|
-
import { S as
|
|
5
|
-
import { T as
|
|
4
|
+
import { S as E } from "./SpritesMng.js";
|
|
5
|
+
import { T as N, a as rt } from "./TxtLayer.js";
|
|
6
6
|
import { R as ot } from "./RubySpliter.js";
|
|
7
7
|
import { P as ct, b as K } from "./Main.js";
|
|
8
|
-
import { a as
|
|
8
|
+
import { a as $ } from "./Reading.js";
|
|
9
9
|
import { Button as Q } from "./Button.js";
|
|
10
|
-
class
|
|
11
|
-
constructor(t, e, s, i, n, o, r,
|
|
12
|
-
this.cls = e, this.hArg = n, this.sys = o, this.val = r, this.ret =
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
r.setVal_Nochk("tmp",
|
|
10
|
+
class I {
|
|
11
|
+
constructor(t, e, s, i, n, o, r, c) {
|
|
12
|
+
this.cls = e, this.hArg = n, this.sys = o, this.val = r, this.ret = c;
|
|
13
|
+
const h = o.hFactoryCls[e];
|
|
14
|
+
if (!h) throw `属性 class【${e}】が不正です`;
|
|
15
|
+
const f = h(), l = h();
|
|
16
|
+
f.layname = l.layname = t;
|
|
17
|
+
const d = n[":id_tag"] = `layer:${t} cls:${e} page:`;
|
|
18
|
+
f.ctn.name = f.name = d + "A", l.ctn.name = l.name = d + "B", s.addChild(f.ctn), i.addChild(l.ctn), g(n, "visible", !0), g(n, "visible", !0), c.isWait = f.lay(n) || l.lay(n), this.#e = { fore: f, back: l }, i.visible = !1;
|
|
19
|
+
const u = `const.sn.lay.${t}`;
|
|
20
|
+
r.setVal_Nochk("tmp", u, !0), r.defTmp(u + ".fore.alpha", () => this.#e.fore.alpha), r.defTmp(u + ".back.alpha", () => this.#e.back.alpha), r.defTmp(u + ".fore.height", () => this.#e.fore.height), r.defTmp(u + ".back.height", () => this.#e.back.height), r.defTmp(u + ".fore.visible", () => this.#e.fore.ctn.visible), r.defTmp(u + ".back.visible", () => this.#e.back.ctn.visible), r.defTmp(u + ".fore.width", () => this.#e.fore.width), r.defTmp(u + ".back.width", () => this.#e.back.width), r.defTmp(u + ".fore.x", () => this.#e.fore.x), r.defTmp(u + ".back.x", () => this.#e.back.x), r.defTmp(u + ".fore.y", () => this.#e.fore.y), r.defTmp(u + ".back.y", () => this.#e.back.y);
|
|
21
21
|
}
|
|
22
22
|
#e;
|
|
23
23
|
destroy() {
|
|
24
24
|
this.#e.fore.destroy(), this.#e.back.destroy();
|
|
25
25
|
}
|
|
26
26
|
lay = (t) => this.getPage(t).lay(t);
|
|
27
|
-
getPage = (t) =>
|
|
27
|
+
getPage = (t) => I.argChk_page(t, "fore") !== "back" ? this.#e.fore : this.#e.back;
|
|
28
28
|
static argChk_page(t, e) {
|
|
29
29
|
const s = t.page ?? e;
|
|
30
30
|
if (s === "fore" || s === "back")
|
|
@@ -41,7 +41,7 @@ class R {
|
|
|
41
41
|
[this.#e.back, this.#e.fore] = [this.#e.fore, this.#e.back], this.#e.back.copy(this.#e.fore, t);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
class
|
|
44
|
+
class p {
|
|
45
45
|
constructor(t, e, s) {
|
|
46
46
|
this.appPixi = e, this.val = s, t.add_frame = (i) => this.#k(i), t.let_frame = (i) => this.#d(i), t.set_frame = (i) => this.#N(i), t.frame = (i) => this.#S(i), t.tsy_frame = (i) => this.#w(i);
|
|
47
47
|
}
|
|
@@ -49,7 +49,7 @@ class u {
|
|
|
49
49
|
static #t;
|
|
50
50
|
static #i;
|
|
51
51
|
static init(t, e, s) {
|
|
52
|
-
|
|
52
|
+
p.#e = t, p.#t = e, p.#i = s;
|
|
53
53
|
}
|
|
54
54
|
#o;
|
|
55
55
|
setEvtMng(t) {
|
|
@@ -80,35 +80,35 @@ class u {
|
|
|
80
80
|
const { id: e, src: s, alpha: i = 1, scale_x: n = 1, scale_y: o = 1, rotate: r = 0 } = t;
|
|
81
81
|
if (!e) throw "idは必須です";
|
|
82
82
|
if (!s) throw "srcは必須です";
|
|
83
|
-
const
|
|
84
|
-
if (this.val.getVal(`tmp:${
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
return
|
|
83
|
+
const c = "const.sn.frm." + e;
|
|
84
|
+
if (this.val.getVal(`tmp:${c}`)) throw `frame【${e}】はすでにあります`;
|
|
85
|
+
const h = g(t, "visible", !0), f = t.b_color ? ` background-color: ${t.b_color};` : "", l = this.#b(t);
|
|
86
|
+
p.#i.cvs.insertAdjacentHTML("beforebegin", `<iframe id="${e}" style="opacity: ${i}; ${f} position: absolute; left:${p.#t.ofsLeft4elm + l.x * p.#t.cvsScale}px; top: ${p.#t.ofsTop4elm + l.y * p.#t.cvsScale}px; z-index: 1; border: 0px; overflow: hidden; display: ${h ? "inline" : "none"}; transform: scale(${n}, ${o}) rotate(${r}deg);" width="${l.width * p.#t.cvsScale}" height="${l.height * p.#t.cvsScale}"></iframe>`);
|
|
87
|
+
const d = $.procID + `add_frame id:${e}`;
|
|
88
|
+
$.beginProc(d);
|
|
89
|
+
const u = p.#e.searchPath(s, H.HTML), a = new F().add({ name: s, url: u, xhrType: B.XHR_RESPONSE_TYPE.TEXT });
|
|
90
|
+
return p.#t.arg.crypto && a.use(
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
92
|
-
(
|
|
93
|
-
|
|
94
|
-
}).catch((
|
|
95
|
-
|
|
92
|
+
(b, k) => void p.#t.dec(b.extension, b.data).then((v) => {
|
|
93
|
+
b.data = v, k();
|
|
94
|
+
}).catch((v) => {
|
|
95
|
+
p.#i.errScript(`[add_frame]Html ロード失敗です src:${b.name} ${v}`, !1), k();
|
|
96
96
|
})
|
|
97
|
-
), a.load((
|
|
98
|
-
const
|
|
99
|
-
this.#c[e] =
|
|
100
|
-
const
|
|
101
|
-
|
|
97
|
+
), a.load((b, k) => {
|
|
98
|
+
const v = document.getElementById(e);
|
|
99
|
+
this.#c[e] = v, this.#y[e] = !1;
|
|
100
|
+
const C = u.lastIndexOf("/") + 1, V = u.slice(0, C), m = V.slice(0, C);
|
|
101
|
+
v.srcdoc = String(k[s]?.data).replace("sn_repRes();", "").replaceAll(
|
|
102
102
|
/\s(?:src|href)=(["'])(\S+?)\1/g,
|
|
103
103
|
// 【\s】が大事、data-src弾く
|
|
104
|
-
(
|
|
105
|
-
),
|
|
104
|
+
(y, S, T) => T.startsWith("../") ? m + y.slice(3) : y.replace("./", "").replace(S, S + V)
|
|
105
|
+
), v.srcdoc.includes("true/*WEBP*/;") && (v.srcdoc = v.srcdoc.replaceAll(
|
|
106
106
|
/data-src="(.+?\.)(?:jpe?g|png)/g,
|
|
107
|
-
(
|
|
108
|
-
)),
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
this.#o.resvFlameEvent(
|
|
107
|
+
(y, S) => `data-src="${S}webp`
|
|
108
|
+
)), v.onload = () => {
|
|
109
|
+
$.endProc(d), this.val.setVal_Nochk("tmp", c, !0), this.val.setVal_Nochk("tmp", c + ".alpha", i), this.val.setVal_Nochk("tmp", c + ".x", l.x), this.val.setVal_Nochk("tmp", c + ".y", l.y), this.val.setVal_Nochk("tmp", c + ".scale_x", n), this.val.setVal_Nochk("tmp", c + ".scale_y", o), this.val.setVal_Nochk("tmp", c + ".rotate", r), this.val.setVal_Nochk("tmp", c + ".width", l.width), this.val.setVal_Nochk("tmp", c + ".height", l.height), this.val.setVal_Nochk("tmp", c + ".visible", h);
|
|
110
|
+
const y = v.contentWindow;
|
|
111
|
+
this.#o.resvFlameEvent(y.document.body), y.sn_repRes?.((S) => p.#_(S.dataset.src ?? "", S));
|
|
112
112
|
};
|
|
113
113
|
}), !0;
|
|
114
114
|
}
|
|
@@ -120,10 +120,10 @@ class u {
|
|
|
120
120
|
#b(t) {
|
|
121
121
|
const e = { ...t };
|
|
122
122
|
return new DOMRect(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
x(e, "x", 0),
|
|
124
|
+
x(e, "y", 0),
|
|
125
|
+
x(e, "width", _.stageW),
|
|
126
|
+
x(e, "height", _.stageH)
|
|
127
127
|
);
|
|
128
128
|
}
|
|
129
129
|
static #_(t, e, s) {
|
|
@@ -138,24 +138,24 @@ class u {
|
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
140
|
this.#m[t] = [e];
|
|
141
|
-
const [o = "", r = ""] = t.split("?"),
|
|
142
|
-
|
|
143
|
-
if (
|
|
144
|
-
|
|
141
|
+
const [o = "", r = ""] = t.split("?"), c = p.#e.searchPath(o, H.SP_GSM), h = new F().add({ name: t, url: c, xhrType: B.XHR_RESPONSE_TYPE.BUFFER });
|
|
142
|
+
p.#t.use4ViteElectron(t, c, h, p.#i) || p.#t.arg.crypto && c.endsWith(".bin") && h.use((f, l) => {
|
|
143
|
+
if (f.extension !== "bin") {
|
|
144
|
+
l();
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}).catch((
|
|
150
|
-
|
|
147
|
+
p.#t.decAB(f.data).then((d) => {
|
|
148
|
+
f.data = d, d instanceof HTMLImageElement && (f.type = B.TYPE.IMAGE), l();
|
|
149
|
+
}).catch((d) => {
|
|
150
|
+
p.#i.errScript(`FrameMng loadPic ロード失敗です fn:${f.name} ${d}`, !1), l();
|
|
151
151
|
});
|
|
152
|
-
}),
|
|
153
|
-
for (const [
|
|
154
|
-
const a = this.#f[
|
|
155
|
-
(
|
|
156
|
-
if (
|
|
157
|
-
|
|
158
|
-
delete this.#m[
|
|
152
|
+
}), h.load((f, l) => {
|
|
153
|
+
for (const [d, { data: { src: u } }] of Object.entries(l)) {
|
|
154
|
+
const a = this.#f[d] = u + // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
155
|
+
(u.startsWith("blob:") || u.startsWith("data:") ? "" : r ? "?" + r : ""), b = this.#m[d];
|
|
156
|
+
if (b) for (const k of b)
|
|
157
|
+
k.src = a, s && (k.onload = () => s(k));
|
|
158
|
+
delete this.#m[d];
|
|
159
159
|
}
|
|
160
160
|
});
|
|
161
161
|
}
|
|
@@ -164,7 +164,7 @@ class u {
|
|
|
164
164
|
cvsResize() {
|
|
165
165
|
for (const [t, e] of Object.entries(this.#c)) {
|
|
166
166
|
const s = "const.sn.frm." + t, i = Number(this.val.getVal(s + ".x")), n = Number(this.val.getVal(s + ".y")), o = Number(this.val.getVal(s + ".width")), r = Number(this.val.getVal(s + ".height"));
|
|
167
|
-
e.style.left = `${
|
|
167
|
+
e.style.left = `${p.#t.ofsLeft4elm + i * p.#t.cvsScale}px`, e.style.top = `${p.#t.ofsTop4elm + n * p.#t.cvsScale}px`, e.width = String(o * p.#t.cvsScale), e.height = String(r * p.#t.cvsScale);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
// フレーム変数を取得
|
|
@@ -183,7 +183,7 @@ class u {
|
|
|
183
183
|
"tmp",
|
|
184
184
|
n + "." + s,
|
|
185
185
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call
|
|
186
|
-
|
|
186
|
+
g(t, "function", !1) ? r() : r
|
|
187
187
|
), !1;
|
|
188
188
|
}
|
|
189
189
|
// フレーム変数に設定
|
|
@@ -210,64 +210,62 @@ class u {
|
|
|
210
210
|
const i = "const.sn.frm." + e;
|
|
211
211
|
if (!this.val.getVal("tmp:" + i)) throw `frame【${e}】が読み込まれていません`;
|
|
212
212
|
const n = s.style;
|
|
213
|
-
if (
|
|
213
|
+
if (g(t, "float", !1) ? n.zIndex = `${++this.#n}` : "index" in t ? n.zIndex = `${x(t, "index", 0)}` : t.dive && (n.zIndex = `-${++this.#n}`), "alpha" in t) {
|
|
214
214
|
const r = n.opacity = String(t.alpha);
|
|
215
215
|
this.val.setVal_Nochk("tmp", i + ".alpha", r);
|
|
216
216
|
}
|
|
217
217
|
const o = this.#b(t);
|
|
218
|
-
if (("x" in t || "y" in t) && (n.left = `${
|
|
219
|
-
const r =
|
|
220
|
-
n.transform = `scale(${r}, ${
|
|
218
|
+
if (("x" in t || "y" in t) && (n.left = `${p.#t.ofsLeft4elm + o.x * p.#t.cvsScale}px`, n.top = `${p.#t.ofsTop4elm + o.y * p.#t.cvsScale}px`, this.val.setVal_Nochk("tmp", i + ".x", o.x), this.val.setVal_Nochk("tmp", i + ".y", o.y)), "scale_x" in t || "scale_y" in t || "rotate" in t) {
|
|
219
|
+
const r = x(t, "scale_x", 1), c = x(t, "scale_y", 1), h = x(t, "rotate", 0);
|
|
220
|
+
n.transform = `scale(${r}, ${c}) rotate(${h}deg)`, this.val.setVal_Nochk("tmp", i + ".scale_x", r), this.val.setVal_Nochk("tmp", i + ".scale_y", c), this.val.setVal_Nochk("tmp", i + ".rotate", h);
|
|
221
221
|
}
|
|
222
|
-
if ("width" in t && (s.width = String(o.width *
|
|
223
|
-
const r =
|
|
222
|
+
if ("width" in t && (s.width = String(o.width * p.#t.cvsScale), this.val.setVal_Nochk("tmp", i + ".width", o.width)), "height" in t && (s.height = String(o.height * p.#t.cvsScale), this.val.setVal_Nochk("tmp", i + ".height", o.height)), "visible" in t) {
|
|
223
|
+
const r = g(t, "visible", !0);
|
|
224
224
|
n.display = r ? "inline" : "none", this.val.setVal_Nochk("tmp", i + ".visible", r);
|
|
225
225
|
}
|
|
226
226
|
if ("b_color" in t && (n.backgroundColor = t.b_color), "disabled" in t) {
|
|
227
|
-
const r = this.#y[e] =
|
|
228
|
-
for (const
|
|
229
|
-
...Array.from(
|
|
230
|
-
...Array.from(
|
|
231
|
-
])
|
|
227
|
+
const r = this.#y[e] = g(t, "disabled", !0), c = s.contentDocument.body;
|
|
228
|
+
for (const h of [
|
|
229
|
+
...Array.from(c.getElementsByTagName("input")),
|
|
230
|
+
...Array.from(c.getElementsByTagName("select"))
|
|
231
|
+
]) h.disabled = r;
|
|
232
232
|
}
|
|
233
233
|
return !1;
|
|
234
234
|
}
|
|
235
235
|
// フレームをトゥイーン開始
|
|
236
236
|
#w(t) {
|
|
237
|
-
const { id: e, alpha: s, x: i, y: n, scale_x: o, scale_y: r, rotate:
|
|
237
|
+
const { id: e, alpha: s, x: i, y: n, scale_x: o, scale_y: r, rotate: c, width: h, height: f } = t;
|
|
238
238
|
if (!e) throw "idは必須です";
|
|
239
|
-
const
|
|
240
|
-
if (!
|
|
241
|
-
const
|
|
242
|
-
if (!this.val.getVal(`tmp:${
|
|
243
|
-
const
|
|
244
|
-
s && (
|
|
245
|
-
const a =
|
|
246
|
-
let
|
|
239
|
+
const l = document.getElementById(e);
|
|
240
|
+
if (!l) throw `id【${e}】はフレームではありません`;
|
|
241
|
+
const d = "const.sn.frm." + e;
|
|
242
|
+
if (!this.val.getVal(`tmp:${d}`, 0)) throw `frame【${e}】が読み込まれていません`;
|
|
243
|
+
const u = {};
|
|
244
|
+
s && (u.a = Number(l.style.opacity)), (i || n || o || r || c) && (u.x = Number(this.val.getVal(`tmp:${d}.x`)), u.y = Number(this.val.getVal(`tmp:${d}.y`)), u.sx = Number(this.val.getVal(`tmp:${d}.scale_x`)), u.sy = Number(this.val.getVal(`tmp:${d}.scale_y`)), u.r = Number(this.val.getVal(`tmp:${d}.rotate`))), h && (u.w = Number(this.val.getVal(`tmp:${d}.width`))), f && (u.h = Number(this.val.getVal(`tmp:${d}.height`)));
|
|
245
|
+
const a = w.cnvTweenArg(t, u);
|
|
246
|
+
let b = (m) => {
|
|
247
247
|
};
|
|
248
|
-
s && (
|
|
249
|
-
|
|
248
|
+
s && (x(a, "alpha", 0), b = (m) => {
|
|
249
|
+
l.style.opacity = String(m.a), this.val.setVal_Nochk("tmp", "alpha", m.a);
|
|
250
250
|
});
|
|
251
|
-
let
|
|
251
|
+
let k = (m) => {
|
|
252
252
|
};
|
|
253
|
-
const
|
|
254
|
-
(i || n || o || r ||
|
|
255
|
-
|
|
256
|
-
u.#t.ofsLeft4elm + c.x * u.#t.cvsScale} px`, h.style.top = `${// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
257
|
-
u.#t.ofsTop4elm + c.y * u.#t.cvsScale} px`, h.style.transform = `scale(${c.sx}, ${c.sy}) rotate(${c.r}deg)`, this.val.setVal_Nochk("tmp", p + ".x", c.x), this.val.setVal_Nochk("tmp", p + ".y", c.y), this.val.setVal_Nochk("tmp", p + ".scale_x", c.sx), this.val.setVal_Nochk("tmp", p + ".scale_y", c.sy), this.val.setVal_Nochk("tmp", p + ".rotate", c.r);
|
|
253
|
+
const v = this.#b(a);
|
|
254
|
+
(i || n || o || r || c) && (v.x, v.y, x(a, "scale_x", 1), x(a, "scale_y", 1), x(a, "rotate", 0), k = (m) => {
|
|
255
|
+
l.style.left = `${p.#t.ofsLeft4elm + m.x * p.#t.cvsScale} px`, l.style.top = `${p.#t.ofsTop4elm + m.y * p.#t.cvsScale} px`, l.style.transform = `scale(${m.sx}, ${m.sy}) rotate(${m.r}deg)`, this.val.setVal_Nochk("tmp", d + ".x", m.x), this.val.setVal_Nochk("tmp", d + ".y", m.y), this.val.setVal_Nochk("tmp", d + ".scale_x", m.sx), this.val.setVal_Nochk("tmp", d + ".scale_y", m.sy), this.val.setVal_Nochk("tmp", d + ".rotate", m.r);
|
|
258
256
|
});
|
|
259
|
-
let
|
|
257
|
+
let C = (m) => {
|
|
260
258
|
};
|
|
261
|
-
|
|
262
|
-
|
|
259
|
+
h && (v.width, C = (m) => {
|
|
260
|
+
l.width = `${m.w * p.#t.cvsScale} px`, this.val.setVal_Nochk("tmp", d + ".width", m.w);
|
|
263
261
|
});
|
|
264
|
-
let
|
|
262
|
+
let V = (m) => {
|
|
265
263
|
};
|
|
266
|
-
return
|
|
267
|
-
|
|
268
|
-
}), this.appPixi.stage.interactive = !1,
|
|
269
|
-
${e}`, t,
|
|
270
|
-
|
|
264
|
+
return f && (v.height, V = (m) => {
|
|
265
|
+
l.height = `${m.h * p.#t.cvsScale} px`, this.val.setVal_Nochk("tmp", d + ".height", m.h);
|
|
266
|
+
}), this.appPixi.stage.interactive = !1, w.tween(`frm
|
|
267
|
+
${e}`, t, u, w.cnvTweenArg(t, u), (m) => {
|
|
268
|
+
b(m), k(m), C(m), V(m);
|
|
271
269
|
}, () => {
|
|
272
270
|
this.appPixi.stage.interactive = !0;
|
|
273
271
|
}, () => {
|
|
@@ -335,46 +333,46 @@ class lt {
|
|
|
335
333
|
this.#t = JSON.parse(String(this.val.getVal("save:const.sn.sLog"))), this.#e = { text: "" };
|
|
336
334
|
}
|
|
337
335
|
}
|
|
338
|
-
function
|
|
339
|
-
return encodeURIComponent(JSON.stringify(
|
|
336
|
+
function L(j) {
|
|
337
|
+
return encodeURIComponent(JSON.stringify(j));
|
|
340
338
|
}
|
|
341
339
|
class Z {
|
|
342
340
|
//MARK: コンストラクタ
|
|
343
|
-
constructor(t, e, s, i, n, o, r,
|
|
341
|
+
constructor(t, e, s, i, n, o, r, c, h) {
|
|
344
342
|
this.cfg = t, this.hTag = e, this.appPixi = s, this.val = i, this.main = n, this.scrItr = o, this.sys = r;
|
|
345
|
-
const
|
|
343
|
+
const f = () => {
|
|
346
344
|
if (r.cvsResize(), this.cvsResizeDesign(), this.#_) for (const a of this.#r)
|
|
347
345
|
this.#s[a].fore.cvsResizeChildren();
|
|
348
346
|
else for (const a of this.#r)
|
|
349
347
|
this.#s[a].fore.cvsResize();
|
|
350
348
|
this.#o.cvsResize(), this.#d.cvsResize();
|
|
351
349
|
};
|
|
352
|
-
if (
|
|
353
|
-
this.#k.add(globalThis, "orientationchange",
|
|
350
|
+
if (_.isMobile)
|
|
351
|
+
this.#k.add(globalThis, "orientationchange", f, { passive: !0 });
|
|
354
352
|
else {
|
|
355
353
|
let a;
|
|
356
354
|
this.#k.add(globalThis, "resize", () => {
|
|
357
355
|
a || (a = setTimeout(() => {
|
|
358
|
-
a = void 0,
|
|
356
|
+
a = void 0, f();
|
|
359
357
|
}, 1e3 / 60 * 10));
|
|
360
358
|
}, { passive: !0 });
|
|
361
359
|
}
|
|
362
|
-
r.cvsResize(), this.#l = new lt(this.cfg.oCfg, e, i),
|
|
363
|
-
delete a.visible, a.id = "break", a.pic = "breakline", this.#n("grp|" +
|
|
360
|
+
r.cvsResize(), this.#l = new lt(this.cfg.oCfg, e, i), N.init(t, e, i, this.#l, (a) => this.#s[a.layname].fore === a, s), X.init(n, t, s, r, c, i), p.init(t, r, n), this.#o = new p(e, s, i), e.loadplugin = (a) => this.#O(a), e.snapshot = (a) => this.#S(a), this.#w = this.sys.isApp ? (a, b, k, v, C) => this.#B(a, b, k, v, C) : (a, b, k, v, C) => this.#W(a, b, k, v, C), e.add_lay = (a) => this.#j(a), e.clear_lay = (a) => this.#H(a), e.finish_trans = () => !1, e.lay = (a) => this.#z(a), e.trans = (a) => this.#G(a), e.wt = (a) => w.wt(a), e.quake = (a) => this.#q(a), e.stop_quake = e.finish_trans, e.wq = e.wt, e.pause_tsy = (a) => w.pause_tsy(a), e.resume_tsy = (a) => w.resume_tsy(a), e.stop_tsy = (a) => w.stop_tsy(a), e.tsy = (a) => this.#J(a), e.wait_tsy = (a) => w.wait_tsy(a), e.add_filter = (a) => this.#X(a), e.clear_filter = (a) => this.#Y(a), e.enable_filter = (a) => this.#K(a), e.ch = (a) => this.#I(a), e.clear_text = (a) => this.#M(a), e.current = (a) => this.#D(a), e.endlink = (a) => this.#A(a), e.er = (a) => this.#tt(a), e.graph = (a) => this.#et(a), e.link = (a) => this.#st(a), e.r = (a) => this.#it(a), e.ruby2 = (a) => this.#at(a), e.span = (a) => this.#nt(a), e.tcy = (a) => this.#rt(a), e.add_face = (a) => E.add_face(a), e.wv = (a) => E.wv(a), e.dump_lay = (a) => this.#ot(a), e.enable_event = (a) => this.#ct(a), e.button = (a) => this.#lt(a), t.existsBreakline && (this.breakLine = (a) => {
|
|
361
|
+
delete a.visible, a.id = "break", a.pic = "breakline", this.#n("grp|" + L(a));
|
|
364
362
|
}), t.existsBreakpage && (this.breakPage = (a) => {
|
|
365
|
-
delete a.visible, a.id = "break", a.pic = "breakpage", this.#n("grp|" +
|
|
363
|
+
delete a.visible, a.id = "break", a.pic = "breakpage", this.#n("grp|" + L(a));
|
|
366
364
|
}), this.#c = M(String(t.oCfg.init.bg_color));
|
|
367
|
-
const
|
|
368
|
-
|
|
369
|
-
const
|
|
370
|
-
this.#N(Number(
|
|
365
|
+
const l = new G();
|
|
366
|
+
l.beginFill(this.#c).lineStyle(0, this.#c).drawRect(0, 0, _.stageW, _.stageH).endFill(), this.#t.addChild(l.clone()), this.#i.addChild(l), this.#i.visible = !1, this.#t.name = "page:A", this.#i.name = "page:B", this.#e = s.stage, this.#e.addChild(this.#i), this.#e.addChild(this.#t), this.#e.addChild(this.#T), this.#e.addChild(this.#a), this.#e.name = "stage";
|
|
367
|
+
const d = (a, b) => {
|
|
368
|
+
this.#N(Number(b));
|
|
371
369
|
};
|
|
372
|
-
|
|
373
|
-
const
|
|
374
|
-
Q.fontFamily =
|
|
370
|
+
d("", i.getVal("sys:TextLayer.Back.Alpha", 1)), i.defValTrg("sys:TextLayer.Back.Alpha", d);
|
|
371
|
+
const u = (a, b) => {
|
|
372
|
+
Q.fontFamily = b;
|
|
375
373
|
};
|
|
376
|
-
|
|
377
|
-
this.#y[a]?.(a,
|
|
374
|
+
u("", i.getVal("tmp:sn.button.fontFamily", Q.fontFamily)), i.defValTrg("tmp:sn.button.fontFamily", u), i.defTmp("const.sn.last_page_text", () => this.currentTxtlayFore?.pageText ?? ""), i.defTmp("const.sn.last_page_plain_text", () => this.currentTxtlayFore?.pagePlainText ?? ""), _.isDbg && (Y.init(s, r, o, h, t, this.#s), this.cvsResizeDesign = () => Y.cvsResizeDesign(), r.addHook((a, b) => {
|
|
375
|
+
this.#y[a]?.(a, b) && delete this.#y[a];
|
|
378
376
|
}));
|
|
379
377
|
}
|
|
380
378
|
#e;
|
|
@@ -412,22 +410,22 @@ class Z {
|
|
|
412
410
|
#f = void 0;
|
|
413
411
|
cover(t, e = 0) {
|
|
414
412
|
this.#f && (this.#e.removeChild(this.#f), this.#f.destroy(), this.#f = void 0), t && this.#e.addChild(
|
|
415
|
-
(this.#f = new G()).beginFill(e).lineStyle(0, e).drawRect(0, 0,
|
|
413
|
+
(this.#f = new G()).beginFill(e).lineStyle(0, e).drawRect(0, 0, _.stageW, _.stageH).endFill()
|
|
416
414
|
);
|
|
417
415
|
}
|
|
418
416
|
#d;
|
|
419
417
|
setEvtMng(t) {
|
|
420
|
-
this.#d = t, this.#o.setEvtMng(t),
|
|
418
|
+
this.#d = t, this.#o.setEvtMng(t), E.setEvtMng(t), w.init(t, this.appPixi);
|
|
421
419
|
}
|
|
422
420
|
destroy() {
|
|
423
421
|
for (const t of Object.values(this.#s)) t.destroy();
|
|
424
|
-
this.#k.clear(), X.destroy(), ot.destroy(), rt.destroy(),
|
|
422
|
+
this.#k.clear(), X.destroy(), ot.destroy(), rt.destroy(), N.destroy(), this.#o.destroy(), w.destroy(), N.msecChWait = 10;
|
|
425
423
|
}
|
|
426
424
|
// 既存の全文字レイヤの実際のバック不透明度、を再計算
|
|
427
425
|
#N(t) {
|
|
428
426
|
for (const e of this.#r) {
|
|
429
427
|
const { fore: s, back: i } = this.#s[e];
|
|
430
|
-
s instanceof
|
|
428
|
+
s instanceof N && (s.chgBackAlpha(t), i.chgBackAlpha(t));
|
|
431
429
|
}
|
|
432
430
|
}
|
|
433
431
|
#n = (t, e = this.currentTxtlayForeNeedErr, s = !0) => e.tagCh("| 《" + t + "》");
|
|
@@ -444,54 +442,54 @@ class Z {
|
|
|
444
442
|
this.currentTxtlayFore && (this.clearBreak = () => this.#n("del|break"), this.clearBreak());
|
|
445
443
|
}
|
|
446
444
|
clickTxtLay() {
|
|
447
|
-
return this.currentTxtlayFore ? this.#r.map((t) => this.#s[t].fore).some((t) => t instanceof
|
|
445
|
+
return this.currentTxtlayFore ? this.#r.map((t) => this.#s[t].fore).some((t) => t instanceof N && t.click()) : !1;
|
|
448
446
|
}
|
|
449
447
|
// // システム
|
|
450
448
|
//MARK: スナップショット
|
|
451
449
|
#S(t) {
|
|
452
|
-
const e = tt("-", "_", "", "_"), s = t.fn ? t.fn.startsWith(ct) ? t.fn : `${K + t.fn + e}.png` : `${K}snapshot${e}.png`, i = this.cfg.searchPath(s), n =
|
|
450
|
+
const e = tt("-", "_", "", "_"), s = t.fn ? t.fn.startsWith(ct) ? t.fn : `${K + t.fn + e}.png` : `${K}snapshot${e}.png`, i = this.cfg.searchPath(s), n = x(t, "width", _.stageW), o = x(t, "height", _.stageH);
|
|
453
451
|
return this.#w(t, i, n, o, `snapshot dt:${e}`);
|
|
454
452
|
}
|
|
455
453
|
#w = () => !1;
|
|
456
454
|
#B({ layer: t }, e, s, i, n) {
|
|
457
|
-
if (this.#o.hideAllFrame(),
|
|
455
|
+
if (this.#o.hideAllFrame(), $.beginProc(n), !t)
|
|
458
456
|
return this.sys.capturePage(e, s, i, () => {
|
|
459
|
-
this.#o.restoreAllFrame(),
|
|
457
|
+
this.#o.restoreAllFrame(), $.endProc(n);
|
|
460
458
|
}), !0;
|
|
461
459
|
const o = this.#r.map((r) => {
|
|
462
|
-
const { ctn:
|
|
463
|
-
return
|
|
460
|
+
const { ctn: c } = this.#s[r].fore, h = [c, c.visible];
|
|
461
|
+
return c.visible = !1, h;
|
|
464
462
|
});
|
|
465
463
|
for (const r of this.#p(t)) this.#s[r].fore.ctn.visible = !0;
|
|
466
464
|
return this.sys.capturePage(e, s, i, () => {
|
|
467
|
-
for (const [r,
|
|
468
|
-
this.#o.restoreAllFrame(),
|
|
465
|
+
for (const [r, c] of o) r.visible = c;
|
|
466
|
+
this.#o.restoreAllFrame(), $.endProc(n);
|
|
469
467
|
}), !0;
|
|
470
468
|
}
|
|
471
469
|
#W(t, e, s, i, n) {
|
|
472
|
-
|
|
470
|
+
$.beginProc(n);
|
|
473
471
|
const o = et(t, "b_color", this.#c), r = st({
|
|
474
472
|
width: s,
|
|
475
473
|
height: i,
|
|
476
474
|
backgroundAlpha: o > 16777216 && e.endsWith(".png") ? 0 : 1,
|
|
477
|
-
antialias:
|
|
475
|
+
antialias: g(t, "smoothing", !1),
|
|
478
476
|
preserveDrawingBuffer: !0,
|
|
479
477
|
backgroundColor: o & 16777215,
|
|
480
478
|
autoDensity: !0
|
|
481
|
-
}),
|
|
479
|
+
}), c = t.page !== "back" ? "fore" : "back", { layer: h } = t;
|
|
482
480
|
return Promise.allSettled(
|
|
483
|
-
this.#p(
|
|
484
|
-
(
|
|
481
|
+
this.#p(h).map((f) => new Promise(
|
|
482
|
+
(l) => this.#s[f][c].snapshot(r, l)
|
|
485
483
|
))
|
|
486
484
|
).then(async () => {
|
|
487
|
-
const
|
|
488
|
-
r.render(this.#e, { renderTexture:
|
|
485
|
+
const f = W.create({ width: r.width, height: r.height });
|
|
486
|
+
r.render(this.#e, { renderTexture: f }), await this.sys.savePic(
|
|
489
487
|
e,
|
|
490
488
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
491
|
-
r.plugins.extract.base64(
|
|
492
|
-
),
|
|
493
|
-
for (const
|
|
494
|
-
r.destroy(!0),
|
|
489
|
+
r.plugins.extract.base64(f)
|
|
490
|
+
), f.destroy();
|
|
491
|
+
for (const l of this.#p(h)) this.#s[l][c].snapshot_end();
|
|
492
|
+
r.destroy(!0), $.endProc(n);
|
|
495
493
|
}), !0;
|
|
496
494
|
}
|
|
497
495
|
//MARK: プラグインの読み込み
|
|
@@ -499,11 +497,11 @@ class Z {
|
|
|
499
497
|
const { fn: e } = t;
|
|
500
498
|
if (!e) throw "fnは必須です";
|
|
501
499
|
if (!e.endsWith(".css")) throw "サポートされない拡張子です";
|
|
502
|
-
const s =
|
|
503
|
-
return s &&
|
|
500
|
+
const s = g(t, "join", !0), i = $.procID + `loadplugin fn:${e}`;
|
|
501
|
+
return s && $.beginProc(i), (async () => {
|
|
504
502
|
const n = await fetch(e);
|
|
505
503
|
if (!n.ok) throw new Error("Network response was not ok.");
|
|
506
|
-
it(await n.text()), s &&
|
|
504
|
+
it(await n.text()), s && $.endProc(i);
|
|
507
505
|
})(), s;
|
|
508
506
|
}
|
|
509
507
|
// // レイヤ共通
|
|
@@ -515,14 +513,14 @@ class Z {
|
|
|
515
513
|
if (e in this.#s) throw `layer【${e}】はすでにあります`;
|
|
516
514
|
if (!s) throw "clsは必須です";
|
|
517
515
|
const i = { isWait: !1 };
|
|
518
|
-
switch (this.#s[e] = new
|
|
516
|
+
switch (this.#s[e] = new I(e, s, this.#t, this.#i, t, this.sys, this.val, i), this.#r.push(e), s) {
|
|
519
517
|
case "txt":
|
|
520
518
|
this.#v || (this.#$ = () => {
|
|
521
519
|
}, this.#h = (n) => this.#Q(n), this.#D = (n) => this.#Z(n), this.hTag.current({ layer: e }), this.goTxt = () => {
|
|
522
|
-
this.#d.isSkipping ?
|
|
520
|
+
this.#d.isSkipping ? N.msecChWait = 0 : this.setNormalChWait();
|
|
523
521
|
for (const n of this.#r) {
|
|
524
522
|
const o = this.#s[n].fore;
|
|
525
|
-
o instanceof
|
|
523
|
+
o instanceof N && this.#n("gotxt|", o, !1);
|
|
526
524
|
}
|
|
527
525
|
}), this.val.setVal_Nochk("save", "const.sn.layer." + e + ".enabled", !0);
|
|
528
526
|
break;
|
|
@@ -543,18 +541,18 @@ class Z {
|
|
|
543
541
|
#E = "";
|
|
544
542
|
#z(t) {
|
|
545
543
|
const e = this.#u(t), s = this.#s[e], i = s.back.ctn, n = s.fore.ctn;
|
|
546
|
-
if (
|
|
544
|
+
if (g(t, "float", !1))
|
|
547
545
|
this.#i.setChildIndex(i, this.#i.children.length - 1), this.#t.setChildIndex(n, this.#t.children.length - 1), this.#V();
|
|
548
546
|
else if (t.index)
|
|
549
|
-
|
|
547
|
+
x(t, "index", 0) && (this.#i.setChildIndex(i, t.index), this.#t.setChildIndex(n, t.index), this.#V());
|
|
550
548
|
else if (t.dive) {
|
|
551
549
|
const { dive: o } = t;
|
|
552
550
|
let r = 0;
|
|
553
551
|
if (e === o) throw "[lay] 属性 layerとdiveが同じ【" + o + "】です";
|
|
554
|
-
const
|
|
555
|
-
if (!
|
|
556
|
-
const
|
|
557
|
-
r =
|
|
552
|
+
const c = this.#s[o];
|
|
553
|
+
if (!c) throw "[lay] 属性 dive【" + o + "】が不正です。レイヤーがありません";
|
|
554
|
+
const h = c.back, f = c.fore, l = this.#i.getChildIndex(h.ctn), d = this.#t.getChildIndex(f.ctn);
|
|
555
|
+
r = l < d ? l : d, r > this.#i.getChildIndex(i) && --r, this.#t.setChildIndex(n, r), this.#i.setChildIndex(i, r), this.#V();
|
|
558
556
|
}
|
|
559
557
|
return t[":id_tag"] = s.fore.name.slice(0, -7), this.scrItr.recodeDesign(t), s.lay(t);
|
|
560
558
|
}
|
|
@@ -616,92 +614,92 @@ void main() {
|
|
|
616
614
|
★GLSL : don't use "if"|Nobu note.com/nobuhirosaijo/n/n606a3f5d8e89
|
|
617
615
|
> if文はあまり使わない方がいいらしい (処理負荷が高い)
|
|
618
616
|
*/
|
|
619
|
-
#L =
|
|
620
|
-
width:
|
|
621
|
-
height:
|
|
617
|
+
#L = W.create({
|
|
618
|
+
width: _.stageW,
|
|
619
|
+
height: _.stageH
|
|
622
620
|
});
|
|
623
621
|
#T = new q(this.#L);
|
|
624
|
-
#g =
|
|
625
|
-
width:
|
|
626
|
-
height:
|
|
622
|
+
#g = W.create({
|
|
623
|
+
width: _.stageW,
|
|
624
|
+
height: _.stageH
|
|
627
625
|
});
|
|
628
626
|
#a = new q(this.#g);
|
|
629
627
|
//MARK: ページ裏表を交換
|
|
630
628
|
#G(t) {
|
|
631
|
-
const { layer: e } = t, s = /* @__PURE__ */ new Set(), i = this.#p(e).map((
|
|
629
|
+
const { layer: e } = t, s = /* @__PURE__ */ new Set(), i = this.#p(e).map((y) => (s.add(y), this.#s[y].fore)), n = () => {
|
|
632
630
|
[this.#t, this.#i] = [this.#i, this.#t];
|
|
633
|
-
const
|
|
634
|
-
for (const [
|
|
635
|
-
if (s.has(
|
|
636
|
-
|
|
631
|
+
const y = [];
|
|
632
|
+
for (const [S, T] of Object.entries(this.#s)) {
|
|
633
|
+
if (s.has(S)) {
|
|
634
|
+
T.transPage(y);
|
|
637
635
|
continue;
|
|
638
636
|
}
|
|
639
|
-
const { fore: { ctn:
|
|
640
|
-
this.#t.removeChild(
|
|
637
|
+
const { fore: { ctn: P }, back: { ctn: D } } = T, z = this.#t.getChildIndex(D);
|
|
638
|
+
this.#t.removeChild(D), this.#i.removeChild(P), this.#t.addChildAt(P, z), this.#i.addChildAt(D, z);
|
|
641
639
|
}
|
|
642
|
-
Promise.allSettled(
|
|
643
|
-
this.#t.visible = !0, this.#i.visible = !1, this.#T.visible = !1, this.#a.visible = !1,
|
|
640
|
+
Promise.allSettled(y).then(() => {
|
|
641
|
+
this.#t.visible = !0, this.#i.visible = !1, this.#T.visible = !1, this.#a.visible = !1, $.notifyEndProc(R);
|
|
644
642
|
});
|
|
645
643
|
};
|
|
646
|
-
if (this.#a.filters = [], this.#a.alpha = 1,
|
|
644
|
+
if (this.#a.filters = [], this.#a.alpha = 1, x(t, "time", 0) === 0 || this.#d.isSkipping)
|
|
647
645
|
return n(), !1;
|
|
648
|
-
const r = [],
|
|
649
|
-
const { fore:
|
|
650
|
-
return
|
|
651
|
-
}), { ticker:
|
|
652
|
-
|
|
653
|
-
let
|
|
654
|
-
for (const
|
|
655
|
-
|
|
646
|
+
const r = [], c = this.#r.map((y) => {
|
|
647
|
+
const { fore: S, back: T } = this.#s[y], P = s.has(y) ? T : S;
|
|
648
|
+
return P.ctn.visible && r.push(P.ctn), P;
|
|
649
|
+
}), { ticker: h, renderer: f } = this.appPixi;
|
|
650
|
+
f.render(this.#i, { renderTexture: this.#L });
|
|
651
|
+
let l = () => {
|
|
652
|
+
for (const y of r) f.render(
|
|
653
|
+
y,
|
|
656
654
|
{ renderTexture: this.#L, clear: !1 }
|
|
657
655
|
);
|
|
658
656
|
};
|
|
659
|
-
if (!
|
|
660
|
-
const
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
},
|
|
657
|
+
if (!c.some((y) => y.containMovement)) {
|
|
658
|
+
const y = l;
|
|
659
|
+
l = () => {
|
|
660
|
+
l = () => {
|
|
661
|
+
}, y();
|
|
664
662
|
};
|
|
665
663
|
}
|
|
666
|
-
const
|
|
667
|
-
|
|
668
|
-
let
|
|
669
|
-
this.#t.visible = !0,
|
|
664
|
+
const d = () => f.render(this.#t, { renderTexture: this.#g });
|
|
665
|
+
d();
|
|
666
|
+
let u = () => {
|
|
667
|
+
this.#t.visible = !0, d(), this.#t.visible = !1;
|
|
670
668
|
};
|
|
671
|
-
if (!i.some((
|
|
672
|
-
const
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
},
|
|
669
|
+
if (!i.some((y) => y.containMovement)) {
|
|
670
|
+
const y = u;
|
|
671
|
+
u = () => {
|
|
672
|
+
u = () => {
|
|
673
|
+
}, y();
|
|
676
674
|
};
|
|
677
675
|
}
|
|
678
676
|
const a = () => {
|
|
679
|
-
|
|
680
|
-
}, { glsl:
|
|
681
|
-
|
|
677
|
+
l(), this.#T.visible = !0, u(), this.#a.visible = !0;
|
|
678
|
+
}, { glsl: b, rule: k } = t, v = () => {
|
|
679
|
+
h.remove(a), n();
|
|
682
680
|
};
|
|
683
|
-
if (!
|
|
684
|
-
return
|
|
685
|
-
},
|
|
686
|
-
}),
|
|
687
|
-
const
|
|
681
|
+
if (!b && !k)
|
|
682
|
+
return w.tween(R, t, this.#a, { alpha: 0 }, () => {
|
|
683
|
+
}, v, () => {
|
|
684
|
+
}), h.add(a), !1;
|
|
685
|
+
const C = {
|
|
688
686
|
rule: at.EMPTY,
|
|
689
|
-
vague:
|
|
687
|
+
vague: x(t, "vague", 0.04),
|
|
690
688
|
tick: 0
|
|
691
689
|
};
|
|
692
690
|
this.#a.filters = [new nt(
|
|
693
691
|
void 0,
|
|
694
|
-
|
|
695
|
-
|
|
692
|
+
b ?? Z.#F,
|
|
693
|
+
C
|
|
696
694
|
)];
|
|
697
|
-
const
|
|
698
|
-
},
|
|
699
|
-
}, !
|
|
700
|
-
return
|
|
701
|
-
|
|
702
|
-
}, (
|
|
703
|
-
|
|
704
|
-
}).ret : (
|
|
695
|
+
const V = w.tween(R, t, C, { tick: 1 }, () => {
|
|
696
|
+
}, v, () => {
|
|
697
|
+
}, !k);
|
|
698
|
+
return k ? new E(k, void 0, (y) => {
|
|
699
|
+
C.rule = y.texture, y.destroy(), V.start(), h.add(a);
|
|
700
|
+
}, (y) => {
|
|
701
|
+
y && this.main.resume();
|
|
702
|
+
}).ret : (h.add(a), !1);
|
|
705
703
|
}
|
|
706
704
|
#p(t = "") {
|
|
707
705
|
return t ? t.split(",") : this.#r;
|
|
@@ -724,34 +722,34 @@ void main() {
|
|
|
724
722
|
setAllStyle2TxtLay(t) {
|
|
725
723
|
for (const e of this.#r) {
|
|
726
724
|
const s = this.#s[e].fore;
|
|
727
|
-
s instanceof
|
|
725
|
+
s instanceof N && s.lay({ style: t });
|
|
728
726
|
}
|
|
729
727
|
}
|
|
730
728
|
//MARK: 画面を揺らす
|
|
731
729
|
#q(t) {
|
|
732
|
-
if (
|
|
733
|
-
const e = this.#p(t.layer).map((
|
|
734
|
-
this.#g.resize(
|
|
730
|
+
if (x(t, "time", NaN) === 0) return !1;
|
|
731
|
+
const e = this.#p(t.layer).map((f) => this.#s[f].fore.ctn), { renderer: s, ticker: i } = this.appPixi;
|
|
732
|
+
this.#g.resize(_.stageW, _.stageH);
|
|
735
733
|
const n = () => {
|
|
736
734
|
this.#t.visible = !0;
|
|
737
|
-
for (const
|
|
738
|
-
|
|
735
|
+
for (const f of e) s.render(
|
|
736
|
+
f,
|
|
739
737
|
{ renderTexture: this.#g, clear: !1 }
|
|
740
738
|
);
|
|
741
739
|
this.#t.visible = !1;
|
|
742
740
|
};
|
|
743
741
|
this.#a.visible = !0, this.#a.alpha = 1;
|
|
744
|
-
const o =
|
|
742
|
+
const o = O(x(t, "hmax", 10)), r = O(x(t, "vmax", 10)), c = o === 0 ? () => {
|
|
745
743
|
} : () => {
|
|
746
744
|
this.#a.x = Math.round(Math.random() * o * 2) - o;
|
|
747
|
-
},
|
|
745
|
+
}, h = r === 0 ? () => {
|
|
748
746
|
} : () => {
|
|
749
747
|
this.#a.y = Math.round(Math.random() * r * 2) - r;
|
|
750
748
|
};
|
|
751
|
-
return this.#a.filters = [],
|
|
752
|
-
|
|
749
|
+
return this.#a.filters = [], w.tween(R, t, this.#a, { x: 0, y: 0 }, () => {
|
|
750
|
+
c(), h();
|
|
753
751
|
}, () => {
|
|
754
|
-
i.remove(n), this.#t.visible = !0, this.#a.visible = !1, this.#a.x = 0, this.#a.y = 0,
|
|
752
|
+
i.remove(n), this.#t.visible = !0, this.#a.visible = !1, this.#a.x = 0, this.#a.y = 0, $.notifyEndProc(R);
|
|
755
753
|
}, () => {
|
|
756
754
|
}), i.add(n), !1;
|
|
757
755
|
}
|
|
@@ -763,10 +761,10 @@ void main() {
|
|
|
763
761
|
let r = () => {
|
|
764
762
|
};
|
|
765
763
|
s && (this.#d.isSkipping ? o.renderStart(!0) : (o.renderStart(!1), r = () => o.renderEnd()));
|
|
766
|
-
const
|
|
767
|
-
return
|
|
764
|
+
const c = w.cnvTweenArg(t, o), h = g(t, "arrive", !1), f = g(t, "backlay", !1), l = n.back.ctn;
|
|
765
|
+
return w.tween(i ?? e, t, o, w.cnvTweenArg(t, o), () => {
|
|
768
766
|
}, r, () => {
|
|
769
|
-
if (
|
|
767
|
+
if (h && Object.assign(o, c), f) for (const d of w.aLayerPrpNm) l[d] = o[d];
|
|
770
768
|
}), "filter" in t && (o.ctn.filters = [J.bldFilters(t)], o.aFltHArg = [t]), !1;
|
|
771
769
|
}
|
|
772
770
|
//MARK: フィルター追加
|
|
@@ -813,9 +811,9 @@ void main() {
|
|
|
813
811
|
#R(t, e) {
|
|
814
812
|
const s = t.ctn;
|
|
815
813
|
if (!s.filters) throw "フィルターがありません";
|
|
816
|
-
const i =
|
|
814
|
+
const i = O(x(e, "index", 0)), n = s.filters.length;
|
|
817
815
|
if (n <= i) throw `フィルターの個数(${String(n)})を越えています`;
|
|
818
|
-
t.aFltHArg[i].enabled = s.filters[i].enabled =
|
|
816
|
+
t.aFltHArg[i].enabled = s.filters[i].enabled = g(e, "enabled", !0);
|
|
819
817
|
}
|
|
820
818
|
// // 文字・文字レイヤ
|
|
821
819
|
//MARK: 文字を追加する
|
|
@@ -823,8 +821,8 @@ void main() {
|
|
|
823
821
|
const { text: e } = t;
|
|
824
822
|
if (!e) throw "textは必須です";
|
|
825
823
|
const s = this.#h(t);
|
|
826
|
-
delete t.text, this.setNormalChWait(), this.#d.isSkipping ? t.wait = 0 : "wait" in t &&
|
|
827
|
-
const i =
|
|
824
|
+
delete t.text, this.setNormalChWait(), this.#d.isSkipping ? t.wait = 0 : "wait" in t && x(t, "wait", NaN), this.#n("add|" + L(t), s);
|
|
825
|
+
const i = g(t, "record", !0), n = this.val.doRecLog();
|
|
828
826
|
return i || this.val.setVal_Nochk("save", "sn.doRecLog", i), s.tagCh(e.replaceAll("[r]", `
|
|
829
827
|
`)), this.val.setVal_Nochk("save", "sn.doRecLog", n), this.#n("add_close|", s), !1;
|
|
830
828
|
}
|
|
@@ -833,11 +831,11 @@ void main() {
|
|
|
833
831
|
};
|
|
834
832
|
#Q(t) {
|
|
835
833
|
const e = this.#u(t, this.#v), i = this.#s[e].getPage(t);
|
|
836
|
-
if (!(i instanceof
|
|
834
|
+
if (!(i instanceof N)) throw e + "はTxtLayerではありません";
|
|
837
835
|
return i;
|
|
838
836
|
}
|
|
839
837
|
setNormalChWait() {
|
|
840
|
-
|
|
838
|
+
N.msecChWait = this.scrItr.normalWait;
|
|
841
839
|
}
|
|
842
840
|
//MARK: 操作対象のメッセージレイヤの指定
|
|
843
841
|
#D = (t) => {
|
|
@@ -847,11 +845,11 @@ void main() {
|
|
|
847
845
|
const { layer: e } = t;
|
|
848
846
|
if (!e) throw "[current] layerは必須です";
|
|
849
847
|
const s = this.#s[e];
|
|
850
|
-
if (!s || !(s.getPage(t) instanceof
|
|
848
|
+
if (!s || !(s.getPage(t) instanceof N)) throw `${e}はTxtLayerではありません`;
|
|
851
849
|
this.#x = s, this.#l.pagebreak(), this.#v = e, this.val.setVal_Nochk("save", "const.sn.mesLayer", e);
|
|
852
850
|
for (const i of this.#r) {
|
|
853
851
|
const { fore: n, back: o } = this.#s[i];
|
|
854
|
-
n instanceof
|
|
852
|
+
n instanceof N && (n.isCur = o.isCur = i === e);
|
|
855
853
|
}
|
|
856
854
|
return !1;
|
|
857
855
|
}
|
|
@@ -886,17 +884,17 @@ void main() {
|
|
|
886
884
|
}
|
|
887
885
|
//MARK: ページ両面の文字消去
|
|
888
886
|
#tt(t) {
|
|
889
|
-
return
|
|
887
|
+
return g(t, "rec_page_break", !0) && this.#l.pagebreak(), this.#x && (this.#x.fore.clearLay(t), this.#x.back.clearLay(t)), !1;
|
|
890
888
|
}
|
|
891
889
|
//MARK: インライン画像表示
|
|
892
890
|
#et(t) {
|
|
893
891
|
if (!t.pic) throw "[graph] picは必須です";
|
|
894
|
-
return this.#n("grp|" +
|
|
892
|
+
return this.#n("grp|" + L(t), this.#h(t)), !1;
|
|
895
893
|
}
|
|
896
894
|
//MARK: ハイパーリンク
|
|
897
895
|
#st(t) {
|
|
898
896
|
if (!t.fn && !t.label && !t.url) throw "fn,label,url いずれかは必須です";
|
|
899
|
-
return t.fn ??= this.scrItr.scriptFn, t.style ??= "background-color: rgba(255,0,0,0.5);", t.style_hover ??= "background-color: rgba(255,0,0,0.9);", t.style_clicked ??= t.style, this.#n("link|" +
|
|
897
|
+
return t.fn ??= this.scrItr.scriptFn, t.style ??= "background-color: rgba(255,0,0,0.5);", t.style_hover ??= "background-color: rgba(255,0,0,0.9);", t.style_clicked ??= t.style, this.#n("link|" + L(t), this.#h(t)), !1;
|
|
900
898
|
}
|
|
901
899
|
//MARK: 改行
|
|
902
900
|
#it(t) {
|
|
@@ -912,12 +910,12 @@ void main() {
|
|
|
912
910
|
}
|
|
913
911
|
//MARK: インラインスタイル設定
|
|
914
912
|
#nt(t) {
|
|
915
|
-
return this.#n("span|" +
|
|
913
|
+
return this.#n("span|" + L(t), this.#h(t)), !1;
|
|
916
914
|
}
|
|
917
915
|
//MARK: tcy縦中横を表示する
|
|
918
916
|
#rt(t) {
|
|
919
917
|
if (!t.t) throw "[tcy] tは必須です";
|
|
920
|
-
return this.#n("tcy|" +
|
|
918
|
+
return this.#n("tcy|" + L(t), this.#h(t)), !1;
|
|
921
919
|
}
|
|
922
920
|
//MARK: レイヤのダンプ
|
|
923
921
|
#ot({ layer: t }) {
|
|
@@ -927,7 +925,7 @@ void main() {
|
|
|
927
925
|
try {
|
|
928
926
|
console.info(
|
|
929
927
|
`%c${s.name.slice(0, -7)} %o`,
|
|
930
|
-
`color:#${
|
|
928
|
+
`color:#${_.isDarkMode ? "49F" : "05A"};`,
|
|
931
929
|
JSON.parse(`{"back":{${i.dump()}}, "fore":{${s.dump()}}}`)
|
|
932
930
|
);
|
|
933
931
|
} catch (n) {
|
|
@@ -938,12 +936,12 @@ void main() {
|
|
|
938
936
|
}
|
|
939
937
|
//MARK: イベント有無の切替
|
|
940
938
|
#ct(t) {
|
|
941
|
-
const e = this.#u(t, this.#v), s =
|
|
939
|
+
const e = this.#u(t, this.#v), s = g(t, "enabled", !0);
|
|
942
940
|
return this.#h(t).enabled = s, this.val.setVal_Nochk("save", "const.sn.layer." + e + ".enabled", s), !1;
|
|
943
941
|
}
|
|
944
942
|
//MARK: ボタンを表示
|
|
945
943
|
#lt(t) {
|
|
946
|
-
return
|
|
944
|
+
return I.argChk_page(t, "back"), t.fn ??= this.scrItr.scriptFn, this.#h(t).addButton(t), this.scrItr.recodeDesign(t), !1;
|
|
947
945
|
}
|
|
948
946
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
949
947
|
record() {
|
|
@@ -961,18 +959,18 @@ void main() {
|
|
|
961
959
|
playback(t) {
|
|
962
960
|
this.#l.playback();
|
|
963
961
|
const e = [], s = [];
|
|
964
|
-
for (const [n, { fore: o, fore: { idx: r }, back:
|
|
962
|
+
for (const [n, { fore: o, fore: { idx: r }, back: c, cls: h }] of Object.entries(t)) {
|
|
965
963
|
s.push({ ln: n, idx: r });
|
|
966
|
-
const
|
|
967
|
-
|
|
964
|
+
const f = this.#s[n] ??= new I(n, h, this.#t, this.#i, {}, this.sys, this.val, { isWait: !1 });
|
|
965
|
+
f.fore.playback(o, e), f.back.playback(c, e);
|
|
968
966
|
}
|
|
969
967
|
const i = this.#t.children.length;
|
|
970
968
|
return e.push(new Promise((n) => {
|
|
971
|
-
for (const { ln: o, idx: r } of s.sort(({ idx:
|
|
972
|
-
const
|
|
973
|
-
if (!
|
|
974
|
-
const
|
|
975
|
-
this.#t.setChildIndex(
|
|
969
|
+
for (const { ln: o, idx: r } of s.sort(({ idx: c }, { idx: h }) => c === h ? 0 : c < h ? -1 : 1)) {
|
|
970
|
+
const c = this.#s[o];
|
|
971
|
+
if (!c) continue;
|
|
972
|
+
const h = i > r ? r : i - 1, { fore: f, back: l } = c;
|
|
973
|
+
this.#t.setChildIndex(f.ctn, h), this.#i.setChildIndex(l.ctn, h);
|
|
976
974
|
}
|
|
977
975
|
n();
|
|
978
976
|
})), e;
|