@famibee/skynovel 1.65.0 → 2.0.0
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/README.md +3 -3
- package/dist/Button.js +131 -163
- package/dist/Button.js.map +1 -1
- package/dist/CallStack.js +19 -22
- package/dist/CallStack.js.map +1 -1
- package/dist/CmnInterface.js +91 -0
- package/dist/CmnInterface.js.map +1 -0
- package/dist/CmnLib.js +94 -0
- package/dist/CmnLib.js.map +1 -0
- package/dist/Config.js +26 -0
- package/dist/Config.js.map +1 -0
- package/dist/ConfigBase.js +152 -0
- package/dist/ConfigBase.js.map +1 -0
- package/dist/DebugMng.js +89 -102
- package/dist/DebugMng.js.map +1 -1
- package/dist/EventListenerCtn.js +21 -0
- package/dist/EventListenerCtn.js.map +1 -0
- package/dist/EventMng.js +1435 -1577
- package/dist/EventMng.js.map +1 -1
- package/dist/Grammar.js +194 -0
- package/dist/Grammar.js.map +1 -0
- package/dist/GrpLayer.js +163 -195
- package/dist/GrpLayer.js.map +1 -1
- package/dist/Layer.js +260 -0
- package/dist/Layer.js.map +1 -0
- package/dist/LayerMng.js +810 -991
- package/dist/LayerMng.js.map +1 -1
- package/dist/Main.js +144 -393
- package/dist/Main.js.map +1 -1
- package/dist/PropParser.js +936 -834
- package/dist/PropParser.js.map +1 -1
- package/dist/Reading.js +918 -786
- package/dist/Reading.js.map +1 -1
- package/dist/RubySpliter.js +59 -92
- package/dist/RubySpliter.js.map +1 -1
- package/dist/ScriptIterator.js +805 -1034
- package/dist/ScriptIterator.js.map +1 -1
- package/dist/SndBuf.js +1097 -1332
- package/dist/SndBuf.js.map +1 -1
- package/dist/SoundMng.js +124 -135
- package/dist/SoundMng.js.map +1 -1
- package/dist/SpritesMng.js +220 -232
- package/dist/SpritesMng.js.map +1 -1
- package/dist/SysBase.js +1729 -0
- package/dist/SysBase.js.map +1 -0
- package/dist/TxtLayer.js +1212 -1397
- package/dist/TxtLayer.js.map +1 -1
- package/dist/Variable.js +398 -466
- package/dist/Variable.js.map +1 -1
- package/dist/chunk.js +18 -0
- package/dist/gamepad.js +723 -511
- package/dist/gamepad.js.map +1 -1
- package/dist/pixi.js +13422 -0
- package/dist/pixi.js.map +1 -0
- package/dist/platform.js +424 -369
- package/dist/platform.js.map +1 -1
- package/dist/sn/AnalyzeTagArg.d.ts +1 -1
- package/dist/sn/AnalyzeTagArg.d.ts.map +1 -1
- package/dist/sn/CmnInterface.d.ts +3 -1
- package/dist/sn/CmnInterface.d.ts.map +1 -1
- package/dist/sn/CmnLib.d.ts.map +1 -1
- package/dist/sn/CmnTween.d.ts +3 -3
- package/dist/sn/CmnTween.d.ts.map +1 -1
- package/dist/sn/EventMng.d.ts.map +1 -1
- package/dist/sn/Grammar.d.ts +1 -1
- package/dist/sn/Grammar.d.ts.map +1 -1
- package/dist/sn/PropParser.d.ts +2 -2
- package/dist/sn/PropParser.d.ts.map +1 -1
- package/dist/sn/Reading.d.ts +6 -0
- package/dist/sn/Reading.d.ts.map +1 -1
- package/dist/sn/ScriptIterator.d.ts.map +1 -1
- package/dist/sn/SndBuf.d.ts +27 -16
- package/dist/sn/SndBuf.d.ts.map +1 -1
- package/dist/sn/SoundMng.d.ts +4 -1
- package/dist/sn/SoundMng.d.ts.map +1 -1
- package/dist/sn/SysBase.d.ts.map +1 -1
- package/dist/sn/TxtStage.d.ts +2 -1
- package/dist/sn/TxtStage.d.ts.map +1 -1
- package/dist/test/ValTest.d.ts +1 -1
- package/dist/test/ValTest.d.ts.map +1 -1
- package/dist/web.js +653 -8
- package/dist/web.js.map +1 -1
- package/dist_app/Button.js +131 -163
- package/dist_app/Button.js.map +1 -1
- package/dist_app/CallStack.js +19 -22
- package/dist_app/CallStack.js.map +1 -1
- package/dist_app/CmnInterface.js +91 -0
- package/dist_app/CmnInterface.js.map +1 -0
- package/dist_app/CmnLib.js +94 -0
- package/dist_app/CmnLib.js.map +1 -0
- package/dist_app/Config.js +26 -0
- package/dist_app/Config.js.map +1 -0
- package/dist_app/ConfigBase.js +152 -0
- package/dist_app/ConfigBase.js.map +1 -0
- package/dist_app/DebugMng.js +92 -0
- package/dist_app/DebugMng.js.map +1 -0
- package/dist_app/EventListenerCtn.js +21 -0
- package/dist_app/EventListenerCtn.js.map +1 -0
- package/dist_app/EventMng.js +1435 -1577
- package/dist_app/EventMng.js.map +1 -1
- package/dist_app/Grammar.js +194 -0
- package/dist_app/Grammar.js.map +1 -0
- package/dist_app/GrpLayer.js +163 -195
- package/dist_app/GrpLayer.js.map +1 -1
- package/dist_app/Layer.js +260 -0
- package/dist_app/Layer.js.map +1 -0
- package/dist_app/LayerMng.js +810 -991
- package/dist_app/LayerMng.js.map +1 -1
- package/dist_app/Main.js +144 -392
- package/dist_app/Main.js.map +1 -1
- package/dist_app/PropParser.js +936 -834
- package/dist_app/PropParser.js.map +1 -1
- package/dist_app/Reading.js +918 -786
- package/dist_app/Reading.js.map +1 -1
- package/dist_app/RubySpliter.js +59 -92
- package/dist_app/RubySpliter.js.map +1 -1
- package/dist_app/ScriptIterator.js +805 -1033
- package/dist_app/ScriptIterator.js.map +1 -1
- package/dist_app/SndBuf.js +1097 -1332
- package/dist_app/SndBuf.js.map +1 -1
- package/dist_app/SoundMng.js +124 -135
- package/dist_app/SoundMng.js.map +1 -1
- package/dist_app/SpritesMng.js +220 -231
- package/dist_app/SpritesMng.js.map +1 -1
- package/dist_app/SysBase.js +1729 -0
- package/dist_app/SysBase.js.map +1 -0
- package/dist_app/TxtLayer.js +1212 -1396
- package/dist_app/TxtLayer.js.map +1 -1
- package/dist_app/Variable.js +398 -466
- package/dist_app/Variable.js.map +1 -1
- package/dist_app/app.js +211 -8
- package/dist_app/app.js.map +1 -1
- package/dist_app/appMain.js +20 -21
- package/dist_app/appMain.js.map +1 -1
- package/dist_app/chunk.js +18 -0
- package/dist_app/gamepad.js +723 -511
- package/dist_app/gamepad.js.map +1 -1
- package/dist_app/pixi.js +11181 -0
- package/dist_app/pixi.js.map +1 -0
- package/dist_app/platform.js +424 -369
- package/dist_app/platform.js.map +1 -1
- package/dist_app/preload.js +2 -2
- package/dist_app/preload.js.map +1 -1
- package/dist_app/sn/AnalyzeTagArg.d.ts +1 -1
- package/dist_app/sn/AnalyzeTagArg.d.ts.map +1 -1
- package/dist_app/sn/CmnInterface.d.ts +3 -1
- package/dist_app/sn/CmnInterface.d.ts.map +1 -1
- package/dist_app/sn/CmnLib.d.ts.map +1 -1
- package/dist_app/sn/CmnTween.d.ts +3 -3
- package/dist_app/sn/CmnTween.d.ts.map +1 -1
- package/dist_app/sn/EventMng.d.ts.map +1 -1
- package/dist_app/sn/Grammar.d.ts +1 -1
- package/dist_app/sn/Grammar.d.ts.map +1 -1
- package/dist_app/sn/PropParser.d.ts +2 -2
- package/dist_app/sn/PropParser.d.ts.map +1 -1
- package/dist_app/sn/Reading.d.ts +6 -0
- package/dist_app/sn/Reading.d.ts.map +1 -1
- package/dist_app/sn/ScriptIterator.d.ts.map +1 -1
- package/dist_app/sn/SndBuf.d.ts +27 -16
- package/dist_app/sn/SndBuf.d.ts.map +1 -1
- package/dist_app/sn/SoundMng.d.ts +4 -1
- package/dist_app/sn/SoundMng.d.ts.map +1 -1
- package/dist_app/sn/SysBase.d.ts.map +1 -1
- package/dist_app/sn/TxtStage.d.ts +2 -1
- package/dist_app/sn/TxtStage.d.ts.map +1 -1
- package/dist_app/test/ValTest.d.ts +1 -1
- package/dist_app/test/ValTest.d.ts.map +1 -1
- package/package.json +23 -13
- package/dist/CmnTween.js +0 -1005
- package/dist/CmnTween.js.map +0 -1
- package/dist/web2.js +0 -21644
- package/dist/web2.js.map +0 -1
- package/dist_app/CmnTween.js +0 -1005
- package/dist_app/CmnTween.js.map +0 -1
- package/dist_app/app2.js +0 -18547
- package/dist_app/app2.js.map +0 -1
package/dist_app/LayerMng.js
CHANGED
|
@@ -1,993 +1,812 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
this.appPixi.stage.interactive = !0;
|
|
282
|
-
}, () => {
|
|
283
|
-
}), !1;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
class lt {
|
|
287
|
-
// 🍚
|
|
288
|
-
constructor(t, e, s) {
|
|
289
|
-
this.oCfg = t, this.hTag = e, this.val = s, e.rec_ch = (i) => this.#i(i), e.rec_r = (i) => this.#o(i), e.reset_rec = (i) => this.#c(i), s.defTmp("const.sn.log.json", () => {
|
|
290
|
-
this.#e.text = // 🌾
|
|
291
|
-
this.#e.text.replaceAll("</span><span class='sn_ch'>", "");
|
|
292
|
-
const i = [...this.#t, this.#e];
|
|
293
|
-
return JSON.stringify(i);
|
|
294
|
-
}), this.recText("");
|
|
295
|
-
}
|
|
296
|
-
#e = { text: "" };
|
|
297
|
-
// 🌾
|
|
298
|
-
#t = [];
|
|
299
|
-
// [ch] からコールされる
|
|
300
|
-
// [ch] // 文字を追加する
|
|
301
|
-
// recText(text: string) コール
|
|
302
|
-
// 🌾this.#LastLog = {text}; // 置換でよい
|
|
303
|
-
// 🍊save:const.sn.sLog = 🦀const.sn.log.json // これを起動したい
|
|
304
|
-
recText(t) {
|
|
305
|
-
this.#e.text = t, this.val.setVal_Nochk(
|
|
306
|
-
"save",
|
|
307
|
-
"const.sn.sLog",
|
|
308
|
-
// 🍊 リプレイ時の回復用
|
|
309
|
-
String(this.val.getVal("const.sn.log.json"))
|
|
310
|
-
// これを起動したい
|
|
311
|
-
);
|
|
312
|
-
}
|
|
313
|
-
//MARK: 履歴書き込み
|
|
314
|
-
// 🌾this.#LastLog = {...hArg, text: 🌾this.#LastLog.text};
|
|
315
|
-
#i(t) {
|
|
316
|
-
return this.#e = { ...t, text: this.#e.text }, t.text ? (t.record = !0, t.style ??= "", t.style += "display: none;", t.wait = 0, this.hTag.ch(t)) : (this.val.setVal_Nochk(
|
|
317
|
-
"save",
|
|
318
|
-
"const.sn.sLog",
|
|
319
|
-
// 🍊 リプレイ時の回復用
|
|
320
|
-
String(this.val.getVal("const.sn.log.json"))
|
|
321
|
-
// これを起動したい
|
|
322
|
-
), !1);
|
|
323
|
-
}
|
|
324
|
-
//MARK: 履歴改行
|
|
325
|
-
#o(t) {
|
|
326
|
-
return this.#i({ ...t, text: "[r]" });
|
|
327
|
-
}
|
|
328
|
-
//MARK: 履歴リセット
|
|
329
|
-
// 以下をクリア。text で置き換え値を設定できる
|
|
330
|
-
// 🌾this.#LastLog = {text: hArg.text ?? ''};
|
|
331
|
-
// 🍚this.#aLog = []
|
|
332
|
-
// 🍊save:const.sn.sLog= hArg.text ?[{text:"${hArg.text}"}] : []
|
|
333
|
-
#c(t) {
|
|
334
|
-
return this.#t = [], t.text ??= "", this.#e = { text: t.text }, this.val.setVal_Nochk("save", "const.sn.sLog", JSON.stringify([this.#e])), !1;
|
|
335
|
-
}
|
|
336
|
-
//MARK: 履歴改ページ
|
|
337
|
-
pagebreak() {
|
|
338
|
-
this.#e.text = // 🌾
|
|
339
|
-
this.#e.text.replaceAll("</span><span class='sn_ch'>", ""), this.#e.text && (this.#t.push(this.#e) > this.oCfg.log.max_len && (this.#t = this.#t.slice(-this.oCfg.log.max_len)), this.#e = { text: "" });
|
|
340
|
-
}
|
|
341
|
-
//MARK: 履歴回復
|
|
342
|
-
// save:const.sn.sLog からの復帰
|
|
343
|
-
playback() {
|
|
344
|
-
this.#t = JSON.parse(String(this.val.getVal("save:const.sn.sLog"))), this.#e = { text: "" };
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
function L(j) {
|
|
348
|
-
return encodeURIComponent(JSON.stringify(j));
|
|
349
|
-
}
|
|
350
|
-
class Z {
|
|
351
|
-
//MARK: コンストラクタ
|
|
352
|
-
constructor(t, e, s, i, n, o, r, c, h) {
|
|
353
|
-
this.cfg = t, this.hTag = e, this.appPixi = s, this.val = i, this.main = n, this.scrItr = o, this.sys = r;
|
|
354
|
-
const f = () => {
|
|
355
|
-
if (r.cvsResize(), this.cvsResizeDesign(), this.#_) for (const a of this.#r)
|
|
356
|
-
this.#s[a].fore.cvsResizeChildren();
|
|
357
|
-
else for (const a of this.#r)
|
|
358
|
-
this.#s[a].fore.cvsResize();
|
|
359
|
-
this.#o.cvsResize(), this.#d.cvsResize();
|
|
360
|
-
};
|
|
361
|
-
if (_.isMobile)
|
|
362
|
-
this.#x.add(globalThis, "orientationchange", f, { passive: !0 });
|
|
363
|
-
else {
|
|
364
|
-
let a;
|
|
365
|
-
this.#x.add(globalThis, "resize", () => {
|
|
366
|
-
a || (a = setTimeout(() => {
|
|
367
|
-
a = void 0, f();
|
|
368
|
-
}, 1e3 / 60 * 10));
|
|
369
|
-
}, { passive: !0 });
|
|
370
|
-
}
|
|
371
|
-
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.#$(a), this.#w = this.sys.isApp ? (a, b, x, v, S) => this.#B(a, b, x, v, S) : (a, b, x, v, S) => this.#W(a, b, x, v, S), 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) => {
|
|
372
|
-
delete a.visible, a.id = "break", a.pic = "breakline", this.#n("grp|" + L(a));
|
|
373
|
-
}), t.existsBreakpage && (this.breakPage = (a) => {
|
|
374
|
-
delete a.visible, a.id = "break", a.pic = "breakpage", this.#n("grp|" + L(a));
|
|
375
|
-
}), this.#c = M(String(t.oCfg.init.bg_color));
|
|
376
|
-
const l = new G();
|
|
377
|
-
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";
|
|
378
|
-
const d = (a, b) => {
|
|
379
|
-
this.#N(Number(b));
|
|
380
|
-
};
|
|
381
|
-
d("", i.getVal("sys:TextLayer.Back.Alpha", 1)), i.defValTrg("sys:TextLayer.Back.Alpha", d);
|
|
382
|
-
const u = (a, b) => {
|
|
383
|
-
Q.fontFamily = b;
|
|
384
|
-
};
|
|
385
|
-
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) => {
|
|
386
|
-
this.#y[a]?.(a, b) && delete this.#y[a];
|
|
387
|
-
}));
|
|
388
|
-
}
|
|
389
|
-
#e;
|
|
390
|
-
#t = new U();
|
|
391
|
-
#i = new U();
|
|
392
|
-
#o;
|
|
393
|
-
#c;
|
|
394
|
-
#l;
|
|
395
|
-
#x = new A();
|
|
396
|
-
cvsResizeDesign() {
|
|
397
|
-
}
|
|
398
|
-
#y = {
|
|
399
|
-
attach: (t) => !1,
|
|
400
|
-
continue: (t) => !1,
|
|
401
|
-
disconnect: (t) => !1,
|
|
402
|
-
_enterDesign: (t) => {
|
|
403
|
-
for (const e of this.#r) {
|
|
404
|
-
const s = this.#s[e].fore;
|
|
405
|
-
s.makeDesignCastChildren((i) => i.make()), s.makeDesignCast((i) => i.make());
|
|
406
|
-
}
|
|
407
|
-
return this.#m(this.#v), !1;
|
|
408
|
-
},
|
|
409
|
-
_replaceToken: (t, e) => !1,
|
|
410
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
|
|
411
|
-
_selectNode: (t, e) => (this.#m(e.node), !1)
|
|
412
|
-
};
|
|
413
|
-
#b = "";
|
|
414
|
-
#_ = "";
|
|
415
|
-
#m(t) {
|
|
416
|
-
[this.#b = "", this.#_ = ""] = t.split("/");
|
|
417
|
-
const e = this.#s[this.#b];
|
|
418
|
-
e && (this.#_ ? e.fore.showDesignCastChildren() : e.fore.showDesignCast());
|
|
419
|
-
}
|
|
420
|
-
getFrmDisabled = (t) => this.#o.getFrmDisabled(t);
|
|
421
|
-
#f = void 0;
|
|
422
|
-
cover(t, e = 0) {
|
|
423
|
-
this.#f && (this.#e.removeChild(this.#f), this.#f.destroy(), this.#f = void 0), t && this.#e.addChild(
|
|
424
|
-
(this.#f = new G()).beginFill(e).lineStyle(0, e).drawRect(0, 0, _.stageW, _.stageH).endFill()
|
|
425
|
-
);
|
|
426
|
-
}
|
|
427
|
-
#d;
|
|
428
|
-
setEvtMng(t) {
|
|
429
|
-
this.#d = t, this.#o.setEvtMng(t), E.setEvtMng(t), w.init(t);
|
|
430
|
-
}
|
|
431
|
-
destroy() {
|
|
432
|
-
for (const t of Object.values(this.#s)) t.destroy();
|
|
433
|
-
this.#x.clear(), X.destroy(), ot.destroy(), rt.destroy(), N.destroy(), this.#o.destroy(), w.destroy(), N.msecChWait = 10;
|
|
434
|
-
}
|
|
435
|
-
// 既存の全文字レイヤの実際のバック不透明度、を再計算
|
|
436
|
-
#N(t) {
|
|
437
|
-
for (const e of this.#r) {
|
|
438
|
-
const { fore: s, back: i } = this.#s[e];
|
|
439
|
-
s instanceof N && (s.chgBackAlpha(t), i.chgBackAlpha(t));
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
#n = (t, e = this.currentTxtlayForeNeedErr, s = !0) => e.tagCh("| 《" + t + "》");
|
|
443
|
-
goTxt = () => {
|
|
444
|
-
};
|
|
445
|
-
get needGoTxt() {
|
|
446
|
-
return this.currentTxtlayFore?.needGoTxt ?? !1;
|
|
447
|
-
}
|
|
448
|
-
breakLine = (t) => {
|
|
449
|
-
};
|
|
450
|
-
breakPage = (t) => {
|
|
451
|
-
};
|
|
452
|
-
clearBreak() {
|
|
453
|
-
this.currentTxtlayFore && (this.clearBreak = () => this.#n("del|break"), this.clearBreak());
|
|
454
|
-
}
|
|
455
|
-
clickTxtLay() {
|
|
456
|
-
return this.currentTxtlayFore ? this.#r.map((t) => this.#s[t].fore).some((t) => t instanceof N && t.click()) : !1;
|
|
457
|
-
}
|
|
458
|
-
// // システム
|
|
459
|
-
//MARK: スナップショット
|
|
460
|
-
#$(t) {
|
|
461
|
-
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 = k(t, "width", _.stageW), o = k(t, "height", _.stageH);
|
|
462
|
-
return this.#w(t, i, n, o, `snapshot dt:${e}`);
|
|
463
|
-
}
|
|
464
|
-
#w = () => !1;
|
|
465
|
-
#B({ layer: t }, e, s, i, n) {
|
|
466
|
-
if (this.#o.hideAllFrame(), C.beginProc(n), !t)
|
|
467
|
-
return this.sys.capturePage(e, s, i, () => {
|
|
468
|
-
this.#o.restoreAllFrame(), C.endProc(n);
|
|
469
|
-
}), !0;
|
|
470
|
-
const o = this.#r.map((r) => {
|
|
471
|
-
const { ctn: c } = this.#s[r].fore, h = [c, c.visible];
|
|
472
|
-
return c.visible = !1, h;
|
|
473
|
-
});
|
|
474
|
-
for (const r of this.#p(t)) this.#s[r].fore.ctn.visible = !0;
|
|
475
|
-
return this.sys.capturePage(e, s, i, () => {
|
|
476
|
-
for (const [r, c] of o) r.visible = c;
|
|
477
|
-
this.#o.restoreAllFrame(), C.endProc(n);
|
|
478
|
-
}), !0;
|
|
479
|
-
}
|
|
480
|
-
#W(t, e, s, i, n) {
|
|
481
|
-
C.beginProc(n);
|
|
482
|
-
const o = et(t, "b_color", this.#c), r = st({
|
|
483
|
-
width: s,
|
|
484
|
-
height: i,
|
|
485
|
-
backgroundAlpha: o > 16777216 && e.endsWith(".png") ? 0 : 1,
|
|
486
|
-
antialias: g(t, "smoothing", !1),
|
|
487
|
-
preserveDrawingBuffer: !0,
|
|
488
|
-
backgroundColor: o & 16777215,
|
|
489
|
-
autoDensity: !0
|
|
490
|
-
}), c = t.page !== "back" ? "fore" : "back", { layer: h } = t;
|
|
491
|
-
return Promise.allSettled(
|
|
492
|
-
this.#p(h).map((f) => new Promise(
|
|
493
|
-
(l) => this.#s[f][c].snapshot(r, l)
|
|
494
|
-
))
|
|
495
|
-
).then(async () => {
|
|
496
|
-
const f = W.create({ width: r.width, height: r.height });
|
|
497
|
-
r.render(this.#e, { renderTexture: f }), await this.sys.savePic(
|
|
498
|
-
e,
|
|
499
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
500
|
-
r.plugins.extract.base64(f)
|
|
501
|
-
), f.destroy();
|
|
502
|
-
for (const l of this.#p(h)) this.#s[l][c].snapshot_end();
|
|
503
|
-
r.destroy(!0), C.endProc(n);
|
|
504
|
-
}), !0;
|
|
505
|
-
}
|
|
506
|
-
//MARK: プラグインの読み込み
|
|
507
|
-
#O(t) {
|
|
508
|
-
const { fn: e } = t;
|
|
509
|
-
if (!e) throw "fnは必須です";
|
|
510
|
-
if (!e.endsWith(".css")) throw "サポートされない拡張子です";
|
|
511
|
-
const s = g(t, "join", !0), i = C.procID + `loadplugin fn:${e}`;
|
|
512
|
-
return s && C.beginProc(i), (async () => {
|
|
513
|
-
const n = await fetch(e);
|
|
514
|
-
if (!n.ok) throw new Error("Network response was not ok.");
|
|
515
|
-
it(await n.text()), s && C.endProc(i);
|
|
516
|
-
})(), s;
|
|
517
|
-
}
|
|
518
|
-
// // レイヤ共通
|
|
519
|
-
//MARK: レイヤを追加する
|
|
520
|
-
#j(t) {
|
|
521
|
-
const { layer: e, class: s } = t;
|
|
522
|
-
if (!e) throw "layerは必須です";
|
|
523
|
-
if (e.includes(",")) throw "layer名に「,」は使えません";
|
|
524
|
-
if (e in this.#s) throw `layer【${e}】はすでにあります`;
|
|
525
|
-
if (!s) throw "clsは必須です";
|
|
526
|
-
const i = { isWait: !1 };
|
|
527
|
-
switch (this.#s[e] = new I(e, s, this.#t, this.#i, t, this.sys, this.val, i), this.#r.push(e), s) {
|
|
528
|
-
case "txt":
|
|
529
|
-
this.#v || (this.#C = () => {
|
|
530
|
-
}, this.#h = (n) => this.#Q(n), this.#D = (n) => this.#Z(n), this.hTag.current({ layer: e }), this.goTxt = () => {
|
|
531
|
-
this.#d.isSkipping ? N.msecChWait = 0 : this.setNormalChWait();
|
|
532
|
-
for (const n of this.#r) {
|
|
533
|
-
const o = this.#s[n].fore;
|
|
534
|
-
o instanceof N && this.#n("gotxt|", o, !1);
|
|
535
|
-
}
|
|
536
|
-
}), this.val.setVal_Nochk("save", "const.sn.layer." + e + ".enabled", !0);
|
|
537
|
-
break;
|
|
538
|
-
case "grp":
|
|
539
|
-
if (this.#E) break;
|
|
540
|
-
this.#E = e;
|
|
541
|
-
break;
|
|
542
|
-
}
|
|
543
|
-
return this.scrItr.recodeDesign(t), i.isWait;
|
|
544
|
-
}
|
|
545
|
-
#s = {
|
|
546
|
-
/* empty */
|
|
547
|
-
};
|
|
548
|
-
// しおりLoad時再読込
|
|
549
|
-
#r = [];
|
|
550
|
-
// 最適化用・重なり順つき全レイヤ名
|
|
551
|
-
#v = "";
|
|
552
|
-
#E = "";
|
|
553
|
-
#z(t) {
|
|
554
|
-
const e = this.#u(t), s = this.#s[e], i = s.back.ctn, n = s.fore.ctn;
|
|
555
|
-
if (g(t, "float", !1))
|
|
556
|
-
this.#i.setChildIndex(i, this.#i.children.length - 1), this.#t.setChildIndex(n, this.#t.children.length - 1), this.#V();
|
|
557
|
-
else if (t.index)
|
|
558
|
-
k(t, "index", 0) && (this.#i.setChildIndex(i, t.index), this.#t.setChildIndex(n, t.index), this.#V());
|
|
559
|
-
else if (t.dive) {
|
|
560
|
-
const { dive: o } = t;
|
|
561
|
-
let r = 0;
|
|
562
|
-
if (e === o) throw "[lay] 属性 layerとdiveが同じ【" + o + "】です";
|
|
563
|
-
const c = this.#s[o];
|
|
564
|
-
if (!c) throw "[lay] 属性 dive【" + o + "】が不正です。レイヤーがありません";
|
|
565
|
-
const h = c.back, f = c.fore, l = this.#i.getChildIndex(h.ctn), d = this.#t.getChildIndex(f.ctn);
|
|
566
|
-
r = l < d ? l : d, r > this.#i.getChildIndex(i) && --r, this.#t.setChildIndex(n, r), this.#i.setChildIndex(i, r), this.#V();
|
|
567
|
-
}
|
|
568
|
-
return t[":id_tag"] = s.fore.name.slice(0, -7), this.scrItr.recodeDesign(t), s.lay(t);
|
|
569
|
-
}
|
|
570
|
-
#V() {
|
|
571
|
-
this.#r = this.#U();
|
|
572
|
-
}
|
|
573
|
-
//MARK: レイヤ設定の消去
|
|
574
|
-
#H(t) {
|
|
575
|
-
return this.#S(t, (e) => {
|
|
576
|
-
const s = this.#s[this.#u({ layer: e })];
|
|
577
|
-
if (t.page === "both") {
|
|
578
|
-
s.fore.clearLay(t), s.back.clearLay(t);
|
|
579
|
-
return;
|
|
580
|
-
}
|
|
581
|
-
s.getPage(t).clearLay(t);
|
|
582
|
-
}), !1;
|
|
583
|
-
}
|
|
584
|
-
//===================================================
|
|
585
|
-
//MARK: WebGL フラグメントシェーダー GLSL
|
|
586
|
-
static #F = (
|
|
587
|
-
/* glsl */
|
|
588
|
-
`
|
|
589
|
-
precision mediump float;
|
|
590
|
-
|
|
591
|
-
varying vec2 vTextureCoord;
|
|
592
|
-
uniform sampler2D uSampler;
|
|
593
|
-
|
|
594
|
-
uniform sampler2D rule;
|
|
595
|
-
uniform float vague;
|
|
596
|
-
uniform float tick;
|
|
597
|
-
|
|
598
|
-
uniform vec4 inputPixel;
|
|
599
|
-
uniform highp vec4 outputFrame;
|
|
600
|
-
vec2 getUV(vec2 coord) {
|
|
601
|
-
return coord * inputPixel.xy / outputFrame.zw;
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
void main() {
|
|
605
|
-
vec4 fg = texture2D(uSampler, vTextureCoord);
|
|
606
|
-
vec4 ru = texture2D(rule, getUV(vTextureCoord));
|
|
607
|
-
|
|
608
|
-
float v = ru.r - tick;
|
|
609
|
-
gl_FragColor = abs(v) < vague
|
|
610
|
-
? vec4(fg.rgb, 1) *fg.a *(0.5 +v /vague *0.5)
|
|
611
|
-
: 0.0 <= v ? fg : vec4(0);
|
|
612
|
-
}`
|
|
613
|
-
);
|
|
614
|
-
/*
|
|
615
|
-
末尾が読みづらいが、以下のif文を消して三項演算子にしている。
|
|
616
|
-
|
|
617
|
-
if (abs(v) < vague) {
|
|
618
|
-
float f_a = fg.a *(0.5 +v /vague *0.5);
|
|
619
|
-
gl_FragColor.rgb = fg.rgb *f_a;
|
|
620
|
-
gl_FragColor.a = f_a;
|
|
621
|
-
return;
|
|
622
|
-
}
|
|
623
|
-
gl_FragColor = v >= 0.0 ? fg : vec4(0);
|
|
624
|
-
|
|
625
|
-
★GLSL : don't use "if"|Nobu note.com/nobuhirosaijo/n/n606a3f5d8e89
|
|
626
|
-
> if文はあまり使わない方がいいらしい (処理負荷が高い)
|
|
627
|
-
*/
|
|
628
|
-
#L = W.create({
|
|
629
|
-
width: _.stageW,
|
|
630
|
-
height: _.stageH
|
|
631
|
-
});
|
|
632
|
-
#T = new q(this.#L);
|
|
633
|
-
#g = W.create({
|
|
634
|
-
width: _.stageW,
|
|
635
|
-
height: _.stageH
|
|
636
|
-
});
|
|
637
|
-
#a = new q(this.#g);
|
|
638
|
-
//MARK: ページ裏表を交換
|
|
639
|
-
#G(t) {
|
|
640
|
-
const { layer: e } = t, s = /* @__PURE__ */ new Set(), i = this.#p(e).map((y) => (s.add(y), this.#s[y].fore)), n = () => {
|
|
641
|
-
[this.#t, this.#i] = [this.#i, this.#t];
|
|
642
|
-
const y = [];
|
|
643
|
-
for (const [$, T] of Object.entries(this.#s)) {
|
|
644
|
-
if (s.has($)) {
|
|
645
|
-
T.transPage(y);
|
|
646
|
-
continue;
|
|
647
|
-
}
|
|
648
|
-
const { fore: { ctn: P }, back: { ctn: D } } = T, z = this.#t.getChildIndex(D);
|
|
649
|
-
this.#t.removeChild(D), this.#i.removeChild(P), this.#t.addChildAt(P, z), this.#i.addChildAt(D, z);
|
|
650
|
-
}
|
|
651
|
-
Promise.allSettled(y).then(() => {
|
|
652
|
-
this.#t.visible = !0, this.#i.visible = !1, this.#T.visible = !1, this.#a.visible = !1, C.notifyEndProc(R);
|
|
653
|
-
});
|
|
654
|
-
};
|
|
655
|
-
if (this.#a.filters = [], this.#a.alpha = 1, k(t, "time", 0) === 0 || this.#d.isSkipping)
|
|
656
|
-
return n(), !1;
|
|
657
|
-
const r = [], c = this.#r.map((y) => {
|
|
658
|
-
const { fore: $, back: T } = this.#s[y], P = s.has(y) ? T : $;
|
|
659
|
-
return P.ctn.visible && r.push(P.ctn), P;
|
|
660
|
-
}), { ticker: h, renderer: f } = this.appPixi;
|
|
661
|
-
f.render(this.#i, { renderTexture: this.#L });
|
|
662
|
-
let l = () => {
|
|
663
|
-
for (const y of r) f.render(
|
|
664
|
-
y,
|
|
665
|
-
{ renderTexture: this.#L, clear: !1 }
|
|
666
|
-
);
|
|
667
|
-
};
|
|
668
|
-
if (!c.some((y) => y.containMovement)) {
|
|
669
|
-
const y = l;
|
|
670
|
-
l = () => {
|
|
671
|
-
l = () => {
|
|
672
|
-
}, y();
|
|
673
|
-
};
|
|
674
|
-
}
|
|
675
|
-
const d = () => f.render(this.#t, { renderTexture: this.#g });
|
|
676
|
-
d();
|
|
677
|
-
let u = () => {
|
|
678
|
-
this.#t.visible = !0, d(), this.#t.visible = !1;
|
|
679
|
-
};
|
|
680
|
-
if (!i.some((y) => y.containMovement)) {
|
|
681
|
-
const y = u;
|
|
682
|
-
u = () => {
|
|
683
|
-
u = () => {
|
|
684
|
-
}, y();
|
|
685
|
-
};
|
|
686
|
-
}
|
|
687
|
-
const a = () => {
|
|
688
|
-
l(), this.#T.visible = !0, u(), this.#a.visible = !0;
|
|
689
|
-
}, { glsl: b, rule: x } = t, v = () => {
|
|
690
|
-
h.remove(a), n();
|
|
691
|
-
};
|
|
692
|
-
if (!b && !x)
|
|
693
|
-
return w.tween(R, t, this.#a, { alpha: 0 }, () => {
|
|
694
|
-
}, v, () => {
|
|
695
|
-
}), h.add(a), !1;
|
|
696
|
-
const S = {
|
|
697
|
-
rule: at.EMPTY,
|
|
698
|
-
vague: k(t, "vague", 0.04),
|
|
699
|
-
tick: 0
|
|
700
|
-
};
|
|
701
|
-
this.#a.filters = [new nt(
|
|
702
|
-
void 0,
|
|
703
|
-
b ?? Z.#F,
|
|
704
|
-
S
|
|
705
|
-
)];
|
|
706
|
-
const V = w.tween(R, t, S, { tick: 1 }, () => {
|
|
707
|
-
}, v, () => {
|
|
708
|
-
}, !x);
|
|
709
|
-
return x ? new E(x, void 0, (y) => {
|
|
710
|
-
S.rule = y.texture, y.destroy(), V.start(), h.add(a);
|
|
711
|
-
}, (y) => {
|
|
712
|
-
y && this.main.resume();
|
|
713
|
-
}).ret : (h.add(a), !1);
|
|
714
|
-
}
|
|
715
|
-
#p(t = "") {
|
|
716
|
-
return t ? t.split(",") : this.#r;
|
|
717
|
-
}
|
|
718
|
-
#S(t, e) {
|
|
719
|
-
const s = this.#p(t.layer);
|
|
720
|
-
for (const i of s) {
|
|
721
|
-
const n = this.#s[i];
|
|
722
|
-
if (!n) throw `存在しないlayer【${i}】です`;
|
|
723
|
-
e(i, n);
|
|
724
|
-
}
|
|
725
|
-
return s;
|
|
726
|
-
}
|
|
727
|
-
#U(t = "") {
|
|
728
|
-
return this.#p(t).sort((e, s) => {
|
|
729
|
-
const i = this.#t.getChildIndex(this.#s[e].fore.ctn), n = this.#t.getChildIndex(this.#s[s].fore.ctn);
|
|
730
|
-
return i < n ? -1 : i > n ? 1 : 0;
|
|
731
|
-
});
|
|
732
|
-
}
|
|
733
|
-
setAllStyle2TxtLay(t) {
|
|
734
|
-
for (const e of this.#r) {
|
|
735
|
-
const s = this.#s[e].fore;
|
|
736
|
-
s instanceof N && s.lay({ style: t });
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
//MARK: 画面を揺らす
|
|
740
|
-
#q(t) {
|
|
741
|
-
if (k(t, "time", NaN) === 0) return !1;
|
|
742
|
-
const e = this.#p(t.layer).map((f) => this.#s[f].fore.ctn), { renderer: s, ticker: i } = this.appPixi;
|
|
743
|
-
this.#g.resize(_.stageW, _.stageH);
|
|
744
|
-
const n = () => {
|
|
745
|
-
this.#t.visible = !0;
|
|
746
|
-
for (const f of e) s.render(
|
|
747
|
-
f,
|
|
748
|
-
{ renderTexture: this.#g, clear: !1 }
|
|
749
|
-
);
|
|
750
|
-
this.#t.visible = !1;
|
|
751
|
-
};
|
|
752
|
-
this.#a.visible = !0, this.#a.alpha = 1;
|
|
753
|
-
const o = O(k(t, "hmax", 10)), r = O(k(t, "vmax", 10)), c = o === 0 ? () => {
|
|
754
|
-
} : () => {
|
|
755
|
-
this.#a.x = Math.round(Math.random() * o * 2) - o;
|
|
756
|
-
}, h = r === 0 ? () => {
|
|
757
|
-
} : () => {
|
|
758
|
-
this.#a.y = Math.round(Math.random() * r * 2) - r;
|
|
759
|
-
};
|
|
760
|
-
return this.#a.filters = [], w.tween(R, t, this.#a, { x: 0, y: 0 }, () => {
|
|
761
|
-
c(), h();
|
|
762
|
-
}, () => {
|
|
763
|
-
i.remove(n), this.#t.visible = !0, this.#a.visible = !1, this.#a.x = 0, this.#a.y = 0, C.notifyEndProc(R);
|
|
764
|
-
}, () => {
|
|
765
|
-
}), i.add(n), !1;
|
|
766
|
-
}
|
|
767
|
-
//MARK: トゥイーン開始
|
|
768
|
-
#J(t) {
|
|
769
|
-
const { layer: e, render: s, name: i } = t;
|
|
770
|
-
if (!e) throw "layerは必須です";
|
|
771
|
-
const n = this.#s[this.#u(t)], o = n.fore;
|
|
772
|
-
let r = () => {
|
|
773
|
-
};
|
|
774
|
-
s && (this.#d.isSkipping ? o.renderStart(!0) : (o.renderStart(!1), r = () => o.renderEnd()));
|
|
775
|
-
const c = w.cnvTweenArg(t, o), h = g(t, "arrive", !1), f = g(t, "backlay", !1), l = n.back.ctn;
|
|
776
|
-
return w.tween(i ?? e, t, o, w.cnvTweenArg(t, o), () => {
|
|
777
|
-
}, r, () => {
|
|
778
|
-
if (h && Object.assign(o, c), f) for (const d of w.aLayerPrpNm) l[d] = o[d];
|
|
779
|
-
}), "filter" in t && (o.ctn.filters = [J.bldFilters(t)], o.aFltHArg = [t]), !1;
|
|
780
|
-
}
|
|
781
|
-
//MARK: フィルター追加
|
|
782
|
-
#X(t) {
|
|
783
|
-
return this.#S(t, (e) => {
|
|
784
|
-
const s = this.#s[this.#u({ layer: e })];
|
|
785
|
-
if (t.page === "both") {
|
|
786
|
-
this.#P(s.fore, t), this.#P(s.back, t);
|
|
787
|
-
return;
|
|
788
|
-
}
|
|
789
|
-
const i = s.getPage(t);
|
|
790
|
-
this.#P(i, t);
|
|
791
|
-
}), !1;
|
|
792
|
-
}
|
|
793
|
-
#P(t, e) {
|
|
794
|
-
const s = t.ctn;
|
|
795
|
-
s.filters ??= [], s.filters = [...s.filters, J.bldFilters(e)], t.aFltHArg.push(e);
|
|
796
|
-
}
|
|
797
|
-
//MARK: フィルター全削除
|
|
798
|
-
#Y(t) {
|
|
799
|
-
return this.#S(t, (e) => {
|
|
800
|
-
const s = this.#s[this.#u({ layer: e })];
|
|
801
|
-
if (t.page === "both") {
|
|
802
|
-
const n = s.fore, o = s.back;
|
|
803
|
-
n.ctn.filters = null, o.ctn.filters = null, n.aFltHArg = [], o.aFltHArg = [];
|
|
804
|
-
return;
|
|
805
|
-
}
|
|
806
|
-
const i = s.getPage(t);
|
|
807
|
-
i.ctn.filters = null, i.aFltHArg = [];
|
|
808
|
-
}), !1;
|
|
809
|
-
}
|
|
810
|
-
//MARK: フィルター個別切替
|
|
811
|
-
#K(t) {
|
|
812
|
-
return this.#S(t, (e) => {
|
|
813
|
-
const s = this.#s[this.#u({ layer: e })];
|
|
814
|
-
if (t.page === "both") {
|
|
815
|
-
this.#R(s.fore, t), this.#R(s.back, t);
|
|
816
|
-
return;
|
|
817
|
-
}
|
|
818
|
-
const i = s.getPage(t);
|
|
819
|
-
this.#R(i, t);
|
|
820
|
-
}), !1;
|
|
821
|
-
}
|
|
822
|
-
#R(t, e) {
|
|
823
|
-
const s = t.ctn;
|
|
824
|
-
if (!s.filters) throw "フィルターがありません";
|
|
825
|
-
const i = O(k(e, "index", 0)), n = s.filters.length;
|
|
826
|
-
if (n <= i) throw `フィルターの個数(${String(n)})を越えています`;
|
|
827
|
-
t.aFltHArg[i].enabled = s.filters[i].enabled = g(e, "enabled", !0);
|
|
828
|
-
}
|
|
829
|
-
// // 文字・文字レイヤ
|
|
830
|
-
//MARK: 文字を追加する
|
|
831
|
-
#I(t) {
|
|
832
|
-
const { text: e } = t;
|
|
833
|
-
if (!e) throw "textは必須です";
|
|
834
|
-
const s = this.#h(t);
|
|
835
|
-
delete t.text, this.setNormalChWait(), this.#d.isSkipping ? t.wait = 0 : "wait" in t && k(t, "wait", NaN), this.#n("add|" + L(t), s);
|
|
836
|
-
const i = g(t, "record", !0), n = this.val.doRecLog();
|
|
837
|
-
return i || this.val.setVal_Nochk("save", "sn.doRecLog", i), s.tagCh(e.replaceAll("[r]", `
|
|
838
|
-
`)), this.val.setVal_Nochk("save", "sn.doRecLog", n), this.#n("add_close|", s), !1;
|
|
839
|
-
}
|
|
840
|
-
#h = (t) => {
|
|
841
|
-
throw this.#C(), 0;
|
|
842
|
-
};
|
|
843
|
-
#Q(t) {
|
|
844
|
-
const e = this.#u(t, this.#v), i = this.#s[e].getPage(t);
|
|
845
|
-
if (!(i instanceof N)) throw e + "はTxtLayerではありません";
|
|
846
|
-
return i;
|
|
847
|
-
}
|
|
848
|
-
setNormalChWait() {
|
|
849
|
-
N.msecChWait = this.scrItr.normalWait;
|
|
850
|
-
}
|
|
851
|
-
//MARK: 操作対象のメッセージレイヤの指定
|
|
852
|
-
#D = (t) => {
|
|
853
|
-
throw this.#C(), 0;
|
|
854
|
-
};
|
|
855
|
-
#Z(t) {
|
|
856
|
-
const { layer: e } = t;
|
|
857
|
-
if (!e) throw "[current] layerは必須です";
|
|
858
|
-
const s = this.#s[e];
|
|
859
|
-
if (!s || !(s.getPage(t) instanceof N)) throw `${e}はTxtLayerではありません`;
|
|
860
|
-
this.#k = s, this.#l.pagebreak(), this.#v = e, this.val.setVal_Nochk("save", "const.sn.mesLayer", e);
|
|
861
|
-
for (const i of this.#r) {
|
|
862
|
-
const { fore: n, back: o } = this.#s[i];
|
|
863
|
-
n instanceof N && (n.isCur = o.isCur = i === e);
|
|
864
|
-
}
|
|
865
|
-
return !1;
|
|
866
|
-
}
|
|
867
|
-
get currentTxtlayForeNeedErr() {
|
|
868
|
-
return this.#C(), this.currentTxtlayFore;
|
|
869
|
-
}
|
|
870
|
-
get currentTxtlayFore() {
|
|
871
|
-
return this.#k ? this.#k.fore : null;
|
|
872
|
-
}
|
|
873
|
-
#k = void 0;
|
|
874
|
-
// カレントテキストレイヤ
|
|
875
|
-
#C = () => {
|
|
876
|
-
throw "文字レイヤーがありません。文字表示や操作する前に、[add_lay layer=(レイヤ名) class=txt]で文字レイヤを追加して下さい";
|
|
877
|
-
};
|
|
878
|
-
#u(t, e = "") {
|
|
879
|
-
const s = t.layer ?? e;
|
|
880
|
-
if (s.includes(",")) throw "layer名に「,」は使えません";
|
|
881
|
-
if (!(s in this.#s)) throw "属性 layer【" + s + "】が不正です。レイヤーがありません";
|
|
882
|
-
return t.layer = s, s;
|
|
883
|
-
}
|
|
884
|
-
recPagebreak() {
|
|
885
|
-
this.#l.pagebreak();
|
|
886
|
-
}
|
|
887
|
-
//MARK: 文字消去
|
|
888
|
-
#M(t) {
|
|
889
|
-
const e = this.#h(t);
|
|
890
|
-
return t.layer === this.#v && t.page === "fore" && this.#l.pagebreak(), e.clearText(), !1;
|
|
891
|
-
}
|
|
892
|
-
//MARK: ハイパーリンクの終了
|
|
893
|
-
#A(t) {
|
|
894
|
-
return this.#n("endlink|", this.#h(t)), !1;
|
|
895
|
-
}
|
|
896
|
-
//MARK: ページ両面の文字消去
|
|
897
|
-
#tt(t) {
|
|
898
|
-
return g(t, "rec_page_break", !0) && this.#l.pagebreak(), this.#k && (this.#k.fore.clearLay(t), this.#k.back.clearLay(t)), !1;
|
|
899
|
-
}
|
|
900
|
-
//MARK: インライン画像表示
|
|
901
|
-
#et(t) {
|
|
902
|
-
if (!t.pic) throw "[graph] picは必須です";
|
|
903
|
-
return this.#n("grp|" + L(t), this.#h(t)), !1;
|
|
904
|
-
}
|
|
905
|
-
//MARK: ハイパーリンク
|
|
906
|
-
#st(t) {
|
|
907
|
-
if (!t.fn && !t.label && !t.url) throw "fn,label,url いずれかは必須です";
|
|
908
|
-
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;
|
|
909
|
-
}
|
|
910
|
-
//MARK: 改行
|
|
911
|
-
#it(t) {
|
|
912
|
-
return this.#I({ ...t, text: `
|
|
913
|
-
` });
|
|
914
|
-
}
|
|
915
|
-
//MARK: 文字列と複数ルビの追加
|
|
916
|
-
#at(t) {
|
|
917
|
-
const { t: e, r: s } = t;
|
|
918
|
-
if (!e) throw "[ruby2] tは必須です";
|
|
919
|
-
if (!s) throw "[ruby2] rは必須です";
|
|
920
|
-
return t.text = "|" + encodeURIComponent(e) + "《" + encodeURIComponent(s) + "》", delete t.t, delete t.r, this.#I(t);
|
|
921
|
-
}
|
|
922
|
-
//MARK: インラインスタイル設定
|
|
923
|
-
#nt(t) {
|
|
924
|
-
return this.#n("span|" + L(t), this.#h(t)), !1;
|
|
925
|
-
}
|
|
926
|
-
//MARK: tcy縦中横を表示する
|
|
927
|
-
#rt(t) {
|
|
928
|
-
if (!t.t) throw "[tcy] tは必須です";
|
|
929
|
-
return this.#n("tcy|" + L(t), this.#h(t)), !1;
|
|
930
|
-
}
|
|
931
|
-
//MARK: レイヤのダンプ
|
|
932
|
-
#ot({ layer: t }) {
|
|
933
|
-
console.group("🥟 [dump_lay]");
|
|
934
|
-
for (const e of this.#p(t)) {
|
|
935
|
-
const { fore: s, back: i } = this.#s[e];
|
|
936
|
-
try {
|
|
937
|
-
console.info(
|
|
938
|
-
`%c${s.name.slice(0, -7)} %o`,
|
|
939
|
-
`color:#${_.isDarkMode ? "49F" : "05A"};`,
|
|
940
|
-
JSON.parse(`{"back":{${i.dump()}}, "fore":{${s.dump()}}}`)
|
|
941
|
-
);
|
|
942
|
-
} catch (n) {
|
|
943
|
-
console.error("dump_lay err:%o", n), console.error(` back:${i.dump()}`), console.error(` fore:${s.dump()}`);
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
return console.groupEnd(), !1;
|
|
947
|
-
}
|
|
948
|
-
//MARK: イベント有無の切替
|
|
949
|
-
#ct(t) {
|
|
950
|
-
const e = this.#u(t, this.#v), s = g(t, "enabled", !0);
|
|
951
|
-
return this.#h(t).enabled = s, this.val.setVal_Nochk("save", "const.sn.layer." + e + ".enabled", s), !1;
|
|
952
|
-
}
|
|
953
|
-
//MARK: ボタンを表示
|
|
954
|
-
#lt(t) {
|
|
955
|
-
return I.argChk_page(t, "back"), t.fn ??= this.scrItr.scriptFn, this.#h(t).addButton(t), this.scrItr.recodeDesign(t), !1;
|
|
956
|
-
}
|
|
957
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
958
|
-
record() {
|
|
959
|
-
const t = {};
|
|
960
|
-
for (const e of this.#r) {
|
|
961
|
-
const s = this.#s[e];
|
|
962
|
-
t[e] = {
|
|
963
|
-
cls: s.cls,
|
|
964
|
-
fore: s.fore.record(),
|
|
965
|
-
back: s.back.record()
|
|
966
|
-
};
|
|
967
|
-
}
|
|
968
|
-
return t;
|
|
969
|
-
}
|
|
970
|
-
playback(t) {
|
|
971
|
-
this.#l.playback();
|
|
972
|
-
const e = [], s = [];
|
|
973
|
-
for (const [n, { fore: o, fore: { idx: r }, back: c, cls: h }] of Object.entries(t)) {
|
|
974
|
-
s.push({ ln: n, idx: r });
|
|
975
|
-
const f = this.#s[n] ??= new I(n, h, this.#t, this.#i, {}, this.sys, this.val, { isWait: !1 });
|
|
976
|
-
f.fore.playback(o, e), f.back.playback(c, e);
|
|
977
|
-
}
|
|
978
|
-
const i = this.#t.children.length;
|
|
979
|
-
return e.push(new Promise((n) => {
|
|
980
|
-
for (const { ln: o, idx: r } of s.sort(({ idx: c }, { idx: h }) => c === h ? 0 : c < h ? -1 : 1)) {
|
|
981
|
-
const c = this.#s[o];
|
|
982
|
-
if (!c) continue;
|
|
983
|
-
const h = i > r ? r : i - 1, { fore: f, back: l } = c;
|
|
984
|
-
this.#t.setChildIndex(f.ctn, h), this.#i.setChildIndex(l.ctn, h);
|
|
985
|
-
}
|
|
986
|
-
n();
|
|
987
|
-
})), e;
|
|
988
|
-
}
|
|
1
|
+
import { c as argChk_Color, g as uint, h as parseColor, l as argChk_Num, o as addStyle, s as argChk_Boolean, t as CmnLib, u as getDateStr } from "./CmnLib.js";
|
|
2
|
+
import { c as Loader, d as RenderTexture, f as Texture, l as LoaderResource, m as Container, o as Sprite, p as autoDetectRenderer, s as Graphics, u as Filter } from "./pixi.js";
|
|
3
|
+
import { t as EventListenerCtn } from "./EventListenerCtn.js";
|
|
4
|
+
import { n as SEARCH_PATH_ARG_EXT } from "./ConfigBase.js";
|
|
5
|
+
import "./DebugMng.js";
|
|
6
|
+
import { t as Layer } from "./Layer.js";
|
|
7
|
+
import { i as TW_NM_TRANS, r as CmnTween, t as Reading } from "./Reading.js";
|
|
8
|
+
import { t as SpritesMng } from "./SpritesMng.js";
|
|
9
|
+
import { Button } from "./Button.js";
|
|
10
|
+
import { t as RubySpliter } from "./RubySpliter.js";
|
|
11
|
+
import { TxtLayer, t as TxtStage } from "./TxtLayer.js";
|
|
12
|
+
import { GrpLayer, t as DesignCast } from "./GrpLayer.js";
|
|
13
|
+
import { n as PROTOCOL_DL, r as PROTOCOL_USERDATA } from "./Config.js";
|
|
14
|
+
var Pages = class e {
|
|
15
|
+
#e;
|
|
16
|
+
constructor(e, m, h, g, _, y, b, x) {
|
|
17
|
+
this.cls = m, this.hArg = _, this.sys = y, this.val = b, this.ret = x;
|
|
18
|
+
let S = y.hFactoryCls[m];
|
|
19
|
+
if (!S) throw `属性 class【${m}】が不正です`;
|
|
20
|
+
let C = S(), w = S();
|
|
21
|
+
C.layname = w.layname = e;
|
|
22
|
+
let T = _[":id_tag"] = `layer:${e} cls:${m} page:`;
|
|
23
|
+
C.ctn.name = C.name = T + "A", w.ctn.name = w.name = T + "B", h.addChild(C.ctn), g.addChild(w.ctn), argChk_Boolean(_, "visible", !0), argChk_Boolean(_, "visible", !0), x.isWait = C.lay(_) || w.lay(_), this.#e = {
|
|
24
|
+
fore: C,
|
|
25
|
+
back: w
|
|
26
|
+
}, g.visible = !1;
|
|
27
|
+
let E = `const.sn.lay.${e}`;
|
|
28
|
+
b.setVal_Nochk("tmp", E, !0), b.defTmp(E + ".fore.alpha", () => this.#e.fore.alpha), b.defTmp(E + ".back.alpha", () => this.#e.back.alpha), b.defTmp(E + ".fore.height", () => this.#e.fore.height), b.defTmp(E + ".back.height", () => this.#e.back.height), b.defTmp(E + ".fore.visible", () => this.#e.fore.ctn.visible), b.defTmp(E + ".back.visible", () => this.#e.back.ctn.visible), b.defTmp(E + ".fore.width", () => this.#e.fore.width), b.defTmp(E + ".back.width", () => this.#e.back.width), b.defTmp(E + ".fore.x", () => this.#e.fore.x), b.defTmp(E + ".back.x", () => this.#e.back.x), b.defTmp(E + ".fore.y", () => this.#e.fore.y), b.defTmp(E + ".back.y", () => this.#e.back.y);
|
|
29
|
+
}
|
|
30
|
+
destroy() {
|
|
31
|
+
this.#e.fore.destroy(), this.#e.back.destroy();
|
|
32
|
+
}
|
|
33
|
+
lay = (e) => this.getPage(e).lay(e);
|
|
34
|
+
getPage = (m) => e.argChk_page(m, "fore") === "back" ? this.#e.back : this.#e.fore;
|
|
35
|
+
static argChk_page(e, m) {
|
|
36
|
+
let h = e.page ?? m;
|
|
37
|
+
if (h === "fore" || h === "back") return e.page = h, h;
|
|
38
|
+
throw Error("属性 page【" + h + "】が不正です");
|
|
39
|
+
}
|
|
40
|
+
get fore() {
|
|
41
|
+
return this.#e.fore;
|
|
42
|
+
}
|
|
43
|
+
get back() {
|
|
44
|
+
return this.#e.back;
|
|
45
|
+
}
|
|
46
|
+
transPage(e) {
|
|
47
|
+
[this.#e.back, this.#e.fore] = [this.#e.fore, this.#e.back], this.#e.back.copy(this.#e.fore, e);
|
|
48
|
+
}
|
|
49
|
+
}, FrameMng = class e {
|
|
50
|
+
static #e;
|
|
51
|
+
static #t;
|
|
52
|
+
static #n;
|
|
53
|
+
static init(m, h, g) {
|
|
54
|
+
e.#e = m, e.#t = h, e.#n = g;
|
|
55
|
+
}
|
|
56
|
+
constructor(e, m, h) {
|
|
57
|
+
this.appPixi = m, this.val = h, e.add_frame = (e) => this.#o(e), e.let_frame = (e) => this.#f(e), e.set_frame = (e) => this.#p(e), e.frame = (e) => this.#h(e), e.tsy_frame = (e) => this.#g(e);
|
|
58
|
+
}
|
|
59
|
+
#r;
|
|
60
|
+
setEvtMng(e) {
|
|
61
|
+
this.#r = e;
|
|
62
|
+
}
|
|
63
|
+
#i = Object.create(null);
|
|
64
|
+
destroy() {
|
|
65
|
+
for (let e of Object.values(this.#i)) e.parentElement.removeChild(e);
|
|
66
|
+
this.#i = Object.create(null);
|
|
67
|
+
}
|
|
68
|
+
hideAllFrame() {
|
|
69
|
+
for (let [e, { style: m }] of Object.entries(this.#i)) this.#a[e] = m.display !== "none", m.display = "none";
|
|
70
|
+
}
|
|
71
|
+
#a = Object.create(null);
|
|
72
|
+
restoreAllFrame() {
|
|
73
|
+
for (let [e, m] of Object.entries(this.#a)) {
|
|
74
|
+
let h = this.#i[e];
|
|
75
|
+
h && (h.style.display = m ? "inline" : "none");
|
|
76
|
+
}
|
|
77
|
+
this.#a = Object.create(null);
|
|
78
|
+
}
|
|
79
|
+
#o(m) {
|
|
80
|
+
let { id: h, src: g, alpha: _ = 1, scale_x: y = 1, scale_y: b = 1, rotate: S = 0 } = m;
|
|
81
|
+
if (!h) throw "idは必須です";
|
|
82
|
+
if (!g) throw "srcは必須です";
|
|
83
|
+
let C = "const.sn.frm." + h;
|
|
84
|
+
if (this.val.getVal(`tmp:${C}`)) throw `frame【${h}】はすでにあります`;
|
|
85
|
+
let T = argChk_Boolean(m, "visible", !0), E = m.b_color ? ` background-color: ${m.b_color};` : "", D = this.#c(m);
|
|
86
|
+
e.#n.cvs.insertAdjacentHTML("beforebegin", `<iframe id="${h}" style="opacity: ${String(_)}; ${E} position: absolute; left:${String(e.#t.ofsLeft4elm + D.x * e.#t.cvsScale)}px; top: ${String(e.#t.ofsTop4elm + D.y * e.#t.cvsScale)}px; z-index: 1; border: 0px; overflow: hidden; display: ${T ? "inline" : "none"}; transform: scale(${String(y)}, ${String(b)}) rotate(${String(S)}deg);" width="${String(D.width * e.#t.cvsScale)}" height="${String(D.height * e.#t.cvsScale)}"></iframe>`);
|
|
87
|
+
let O = Reading.procID + `add_frame id:${h}`;
|
|
88
|
+
Reading.beginProc(O);
|
|
89
|
+
let k = e.#e.searchPath(g, SEARCH_PATH_ARG_EXT.HTML), A = new Loader().add({
|
|
90
|
+
name: g,
|
|
91
|
+
url: k,
|
|
92
|
+
xhrType: LoaderResource.XHR_RESPONSE_TYPE.TEXT
|
|
93
|
+
});
|
|
94
|
+
return e.#t.arg.crypto && A.use((m, h) => void e.#t.dec(m.extension, m.data).then((e) => {
|
|
95
|
+
m.data = e, h();
|
|
96
|
+
}).catch((g) => {
|
|
97
|
+
e.#n.errScript(`[add_frame]Html ロード失敗です src:${m.name} ${String(g)}`, !1), h();
|
|
98
|
+
})), A.load((m, v) => {
|
|
99
|
+
let x = document.getElementById(h);
|
|
100
|
+
this.#i[h] = x, this.#s[h] = !1;
|
|
101
|
+
let w = k.lastIndexOf("/") + 1, E = k.slice(0, w), A = E.slice(0, w);
|
|
102
|
+
x.srcdoc = String(v[g]?.data).replace("sn_repRes();", "").replaceAll(/\s(?:src|href)=(["'])(\S+?)\1/g, (e, m, h) => h.startsWith("../") ? A + e.slice(3) : e.replace("./", "").replace(m, m + E)), x.srcdoc.includes("true/*WEBP*/;") && (x.srcdoc = x.srcdoc.replaceAll(/data-src="(.+?\.)(?:jpe?g|png)/g, (e, m) => `data-src="${m}webp`)), x.onload = () => {
|
|
103
|
+
Reading.endProc(O), this.val.setVal_Nochk("tmp", C, !0), this.val.setVal_Nochk("tmp", C + ".alpha", _), this.val.setVal_Nochk("tmp", C + ".x", D.x), this.val.setVal_Nochk("tmp", C + ".y", D.y), this.val.setVal_Nochk("tmp", C + ".scale_x", y), this.val.setVal_Nochk("tmp", C + ".scale_y", b), this.val.setVal_Nochk("tmp", C + ".rotate", S), this.val.setVal_Nochk("tmp", C + ".width", D.width), this.val.setVal_Nochk("tmp", C + ".height", D.height), this.val.setVal_Nochk("tmp", C + ".visible", T);
|
|
104
|
+
let m = x.contentWindow;
|
|
105
|
+
this.#r.resvFlameEvent(m.document.body), m.sn_repRes?.((m) => e.#l(m.dataset.src ?? "", m));
|
|
106
|
+
};
|
|
107
|
+
}), !0;
|
|
108
|
+
}
|
|
109
|
+
#s = {};
|
|
110
|
+
getFrmDisabled(e) {
|
|
111
|
+
return this.#s[e];
|
|
112
|
+
}
|
|
113
|
+
#c(e) {
|
|
114
|
+
let m = { ...e };
|
|
115
|
+
return new DOMRect(argChk_Num(m, "x", 0), argChk_Num(m, "y", 0), argChk_Num(m, "width", CmnLib.stageW), argChk_Num(m, "height", CmnLib.stageH));
|
|
116
|
+
}
|
|
117
|
+
static #l(m, h, g) {
|
|
118
|
+
let _ = this.#d[m];
|
|
119
|
+
if (_) {
|
|
120
|
+
h.src = _, g && (h.onload = () => g(h));
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
let v = this.#u[m];
|
|
124
|
+
if (v) {
|
|
125
|
+
v.push(h);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
this.#u[m] = [h];
|
|
129
|
+
let [y = "", b = ""] = m.split("?"), S = e.#e.searchPath(y, SEARCH_PATH_ARG_EXT.SP_GSM), C = new Loader().add({
|
|
130
|
+
name: m,
|
|
131
|
+
url: S,
|
|
132
|
+
xhrType: LoaderResource.XHR_RESPONSE_TYPE.BUFFER
|
|
133
|
+
});
|
|
134
|
+
e.#t.use4ViteElectron(m, S, C, e.#n) || e.#t.arg.crypto && S.endsWith(".bin") && C.use((m, h) => {
|
|
135
|
+
if (m.extension !== "bin") {
|
|
136
|
+
h();
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
e.#t.decAB(m.data).then((e) => {
|
|
140
|
+
m.data = e, e instanceof HTMLImageElement && (m.type = LoaderResource.TYPE.IMAGE), h();
|
|
141
|
+
}).catch((g) => {
|
|
142
|
+
e.#n.errScript(`FrameMng loadPic ロード失敗です fn:${m.name} ${String(g)}`, !1), h();
|
|
143
|
+
});
|
|
144
|
+
}), C.load((e, m) => {
|
|
145
|
+
for (let [e, { data: { src: h } }] of Object.entries(m)) {
|
|
146
|
+
let m = this.#d[e] = h + (h.startsWith("blob:") || h.startsWith("data:") ? "" : b ? "?" + b : ""), _ = this.#u[e];
|
|
147
|
+
if (_) for (let e of _) e.src = m, g && (e.onload = () => g(e));
|
|
148
|
+
delete this.#u[e];
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
static #u = {};
|
|
153
|
+
static #d = {};
|
|
154
|
+
cvsResize() {
|
|
155
|
+
for (let [m, h] of Object.entries(this.#i)) {
|
|
156
|
+
let g = "const.sn.frm." + m, _ = Number(this.val.getVal(g + ".x")), v = Number(this.val.getVal(g + ".y")), y = Number(this.val.getVal(g + ".width")), b = Number(this.val.getVal(g + ".height"));
|
|
157
|
+
h.style.left = `${String(e.#t.ofsLeft4elm + _ * e.#t.cvsScale)}px`, h.style.top = `${String(e.#t.ofsTop4elm + v * e.#t.cvsScale)}px`, h.width = String(y * e.#t.cvsScale), h.height = String(b * e.#t.cvsScale);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
#f(e) {
|
|
161
|
+
let { id: m, var_name: h } = e;
|
|
162
|
+
if (!m) throw "idは必須です";
|
|
163
|
+
let g = document.getElementById(m);
|
|
164
|
+
if (!g) throw `id【${m}】はフレームではありません`;
|
|
165
|
+
let _ = "const.sn.frm." + m;
|
|
166
|
+
if (!this.val.getVal(`tmp:${_}`)) throw `frame【${m}】が読み込まれていません`;
|
|
167
|
+
if (!h) throw "var_nameは必須です";
|
|
168
|
+
let y = g.contentWindow;
|
|
169
|
+
if (!Object.hasOwn(y, h)) throw `frame【${m}】に変数/関数【${h}】がありません。変数は var付きにして下さい`;
|
|
170
|
+
let b = y[h];
|
|
171
|
+
return this.val.setVal_Nochk("tmp", _ + "." + h, argChk_Boolean(e, "function", !1) ? b() : b), !1;
|
|
172
|
+
}
|
|
173
|
+
#p(e) {
|
|
174
|
+
let { id: m, var_name: h, text: g } = e;
|
|
175
|
+
if (!m) throw "idは必須です";
|
|
176
|
+
let _ = document.getElementById(m);
|
|
177
|
+
if (!_) throw `id【${m}】はフレームではありません`;
|
|
178
|
+
let v = "const.sn.frm." + m;
|
|
179
|
+
if (!this.val.getVal(`tmp:${v}`)) throw `frame【${m}】が読み込まれていません`;
|
|
180
|
+
if (!h) throw "var_nameは必須です";
|
|
181
|
+
if (!g) throw "textは必須です";
|
|
182
|
+
this.val.setVal_Nochk("tmp", v + "." + h, g);
|
|
183
|
+
let y = _.contentWindow;
|
|
184
|
+
return y[h] = g, !1;
|
|
185
|
+
}
|
|
186
|
+
#m = 1;
|
|
187
|
+
#h(m) {
|
|
188
|
+
let { id: h } = m;
|
|
189
|
+
if (!h) throw "idは必須です";
|
|
190
|
+
let _ = document.getElementById(h);
|
|
191
|
+
if (!_) throw `id【${h}】はフレームではありません`;
|
|
192
|
+
let y = "const.sn.frm." + h;
|
|
193
|
+
if (!this.val.getVal("tmp:" + y)) throw `frame【${h}】が読み込まれていません`;
|
|
194
|
+
let b = _.style;
|
|
195
|
+
if (argChk_Boolean(m, "float", !1) ? b.zIndex = String(++this.#m) : "index" in m ? b.zIndex = String(argChk_Num(m, "index", 0)) : m.dive && (b.zIndex = String(-++this.#m)), "alpha" in m) {
|
|
196
|
+
let e = b.opacity = String(m.alpha);
|
|
197
|
+
this.val.setVal_Nochk("tmp", y + ".alpha", e);
|
|
198
|
+
}
|
|
199
|
+
let x = this.#c(m);
|
|
200
|
+
if (("x" in m || "y" in m) && (b.left = `${String(e.#t.ofsLeft4elm + x.x * e.#t.cvsScale)}px`, b.top = `${String(e.#t.ofsTop4elm + x.y * e.#t.cvsScale)}px`, this.val.setVal_Nochk("tmp", y + ".x", x.x), this.val.setVal_Nochk("tmp", y + ".y", x.y)), "scale_x" in m || "scale_y" in m || "rotate" in m) {
|
|
201
|
+
let e = argChk_Num(m, "scale_x", 1), h = argChk_Num(m, "scale_y", 1), _ = argChk_Num(m, "rotate", 0);
|
|
202
|
+
b.transform = `scale(${String(e)}, ${String(h)}) rotate(${String(_)}deg)`, this.val.setVal_Nochk("tmp", y + ".scale_x", e), this.val.setVal_Nochk("tmp", y + ".scale_y", h), this.val.setVal_Nochk("tmp", y + ".rotate", _);
|
|
203
|
+
}
|
|
204
|
+
if ("width" in m && (_.width = String(x.width * e.#t.cvsScale), this.val.setVal_Nochk("tmp", y + ".width", x.width)), "height" in m && (_.height = String(x.height * e.#t.cvsScale), this.val.setVal_Nochk("tmp", y + ".height", x.height)), "visible" in m) {
|
|
205
|
+
let e = argChk_Boolean(m, "visible", !0);
|
|
206
|
+
b.display = e ? "inline" : "none", this.val.setVal_Nochk("tmp", y + ".visible", e);
|
|
207
|
+
}
|
|
208
|
+
if ("b_color" in m && (b.backgroundColor = m.b_color), "disabled" in m) {
|
|
209
|
+
let e = this.#s[h] = argChk_Boolean(m, "disabled", !0), g = _.contentDocument.body;
|
|
210
|
+
for (let m of [...Array.from(g.getElementsByTagName("input")), ...Array.from(g.getElementsByTagName("select"))]) m.disabled = e;
|
|
211
|
+
}
|
|
212
|
+
return !1;
|
|
213
|
+
}
|
|
214
|
+
#g(m) {
|
|
215
|
+
let { id: h, alpha: _, x: v, y, scale_x: b, scale_y: x, rotate: S, width: C, height: w } = m;
|
|
216
|
+
if (!h) throw "idは必須です";
|
|
217
|
+
let T = document.getElementById(h);
|
|
218
|
+
if (!T) throw `id【${h}】はフレームではありません`;
|
|
219
|
+
let E = "const.sn.frm." + h;
|
|
220
|
+
if (!this.val.getVal(`tmp:${E}`, 0)) throw `frame【${h}】が読み込まれていません`;
|
|
221
|
+
let D = {};
|
|
222
|
+
_ && (D.a = Number(T.style.opacity)), (v || y || b || x || S) && (D.x = Number(this.val.getVal(`tmp:${E}.x`)), D.y = Number(this.val.getVal(`tmp:${E}.y`)), D.sx = Number(this.val.getVal(`tmp:${E}.scale_x`)), D.sy = Number(this.val.getVal(`tmp:${E}.scale_y`)), D.r = Number(this.val.getVal(`tmp:${E}.rotate`))), C && (D.w = Number(this.val.getVal(`tmp:${E}.width`))), w && (D.h = Number(this.val.getVal(`tmp:${E}.height`)));
|
|
223
|
+
let O = CmnTween.cnvTweenArg(m, D), k = {}, A = (e) => {};
|
|
224
|
+
_ && (k.a = argChk_Num(O, "alpha", 0), A = (e) => {
|
|
225
|
+
T.style.opacity = String(e.a), this.val.setVal_Nochk("tmp", "alpha", e.a);
|
|
226
|
+
});
|
|
227
|
+
let j = (e) => {}, M = this.#c(O);
|
|
228
|
+
(v || y || b || x || S) && (k.x = M.x, k.y = M.y, k.sx = argChk_Num(O, "scale_x", 1), k.sy = argChk_Num(O, "scale_y", 1), k.r = argChk_Num(O, "rotate", 0), j = (m) => {
|
|
229
|
+
T.style.left = `${String(e.#t.ofsLeft4elm + m.x * e.#t.cvsScale)} px`, T.style.top = `${String(e.#t.ofsTop4elm + m.y * e.#t.cvsScale)} px`, T.style.transform = `scale(${String(m.sx)}, ${String(m.sy)}) rotate(${String(m.r)}deg)`, this.val.setVal_Nochk("tmp", E + ".x", m.x), this.val.setVal_Nochk("tmp", E + ".y", m.y), this.val.setVal_Nochk("tmp", E + ".scale_x", m.sx), this.val.setVal_Nochk("tmp", E + ".scale_y", m.sy), this.val.setVal_Nochk("tmp", E + ".rotate", m.r);
|
|
230
|
+
});
|
|
231
|
+
let N = (e) => {};
|
|
232
|
+
C && (k.w = M.width, N = (m) => {
|
|
233
|
+
T.width = `${String(m.w * e.#t.cvsScale)} px`, this.val.setVal_Nochk("tmp", E + ".width", m.w);
|
|
234
|
+
});
|
|
235
|
+
let P = (e) => {};
|
|
236
|
+
return w && (k.h = M.height, P = (m) => {
|
|
237
|
+
T.height = `${String(m.h * e.#t.cvsScale)} px`, this.val.setVal_Nochk("tmp", E + ".height", m.h);
|
|
238
|
+
}), this.appPixi.stage.interactive = !1, CmnTween.tween(`frm\n${h}`, m, D, CmnTween.cnvTweenArg(m, D), (e) => {
|
|
239
|
+
A(e), j(e), N(e), P(e);
|
|
240
|
+
}, () => {
|
|
241
|
+
this.appPixi.stage.interactive = !0;
|
|
242
|
+
}, () => {}), !1;
|
|
243
|
+
}
|
|
244
|
+
}, Log = class {
|
|
245
|
+
#e = { text: "" };
|
|
246
|
+
#t = [];
|
|
247
|
+
constructor(e, m, h) {
|
|
248
|
+
this.oCfg = e, this.hTag = m, this.val = h, m.rec_ch = (e) => this.#n(e), m.rec_r = (e) => this.#r(e), m.reset_rec = (e) => this.#i(e), h.defTmp("const.sn.log.json", () => {
|
|
249
|
+
this.#e.text = this.#e.text.replaceAll("</span><span class='sn_ch'>", "");
|
|
250
|
+
let e = [...this.#t, this.#e];
|
|
251
|
+
return JSON.stringify(e);
|
|
252
|
+
}), this.recText("");
|
|
253
|
+
}
|
|
254
|
+
recText(e) {
|
|
255
|
+
this.#e.text = e, this.val.setVal_Nochk("save", "const.sn.sLog", String(this.val.getVal("const.sn.log.json")));
|
|
256
|
+
}
|
|
257
|
+
#n(e) {
|
|
258
|
+
return this.#e = {
|
|
259
|
+
...e,
|
|
260
|
+
text: this.#e.text
|
|
261
|
+
}, e.text ? (e.record = !0, e.style ??= "", e.style += "display: none;", e.wait = 0, this.hTag.ch(e)) : (this.val.setVal_Nochk("save", "const.sn.sLog", String(this.val.getVal("const.sn.log.json"))), !1);
|
|
262
|
+
}
|
|
263
|
+
#r(e) {
|
|
264
|
+
return this.#n({
|
|
265
|
+
...e,
|
|
266
|
+
text: "[r]"
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
#i(e) {
|
|
270
|
+
return this.#t = [], e.text ??= "", this.#e = { text: e.text }, this.val.setVal_Nochk("save", "const.sn.sLog", JSON.stringify([this.#e])), !1;
|
|
271
|
+
}
|
|
272
|
+
pagebreak() {
|
|
273
|
+
this.#e.text = this.#e.text.replaceAll("</span><span class='sn_ch'>", ""), this.#e.text && (this.#t.push(this.#e) > this.oCfg.log.max_len && (this.#t = this.#t.slice(-this.oCfg.log.max_len)), this.#e = { text: "" });
|
|
274
|
+
}
|
|
275
|
+
playback() {
|
|
276
|
+
this.#t = JSON.parse(String(this.val.getVal("save:const.sn.sLog"))), this.#e = { text: "" };
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
function cnvSArg(e) {
|
|
280
|
+
return encodeURIComponent(JSON.stringify(e));
|
|
989
281
|
}
|
|
990
|
-
|
|
991
|
-
|
|
282
|
+
var LayerMng = class x {
|
|
283
|
+
#e;
|
|
284
|
+
#t = new Container();
|
|
285
|
+
#n = new Container();
|
|
286
|
+
#r;
|
|
287
|
+
#i;
|
|
288
|
+
#a;
|
|
289
|
+
#o = new EventListenerCtn();
|
|
290
|
+
constructor(e, m, g, _, v, b, x, S, C) {
|
|
291
|
+
this.cfg = e, this.hTag = m, this.appPixi = g, this.val = _, this.main = v, this.scrItr = b, this.sys = x;
|
|
292
|
+
let w = () => {
|
|
293
|
+
if (x.cvsResize(), this.cvsResizeDesign(), this.#l) for (let e of this.#S) this.#x[e].fore.cvsResizeChildren();
|
|
294
|
+
else for (let e of this.#S) this.#x[e].fore.cvsResize();
|
|
295
|
+
this.#r.cvsResize(), this.#f.cvsResize();
|
|
296
|
+
};
|
|
297
|
+
if (CmnLib.isMobile) this.#o.add(globalThis, "orientationchange", w, { passive: !0 });
|
|
298
|
+
else {
|
|
299
|
+
let e;
|
|
300
|
+
this.#o.add(globalThis, "resize", () => {
|
|
301
|
+
e ||= setTimeout(() => {
|
|
302
|
+
e = void 0, w();
|
|
303
|
+
}, 1e3 / 60 * 10);
|
|
304
|
+
}, { passive: !0 });
|
|
305
|
+
}
|
|
306
|
+
x.cvsResize(), this.#a = new Log(this.cfg.oCfg, m, _), TxtLayer.init(e, m, _, this.#a, (e) => this.#x[e.layname].fore === e, g), GrpLayer.init(v, e, g, x, S, _), FrameMng.init(e, x, v), this.#r = new FrameMng(m, g, _), m.loadplugin = (e) => this.#y(e), m.snapshot = (e) => this.#h(e), this.#g = this.sys.isApp ? (e, m, h, g, _) => this.#_(e, m, h, g, _) : (e, m, h, g, _) => this.#v(e, m, h, g, _), m.add_lay = (e) => this.#b(e), m.clear_lay = (e) => this.#D(e), m.finish_trans = () => !1, m.lay = (e) => this.#T(e), m.trans = (e) => this.#N(e), m.wt = (e) => CmnTween.wt(e), m.quake = (e) => this.#L(e), m.stop_quake = m.finish_trans, m.wq = m.wt, m.pause_tsy = (e) => CmnTween.pause_tsy(e), m.resume_tsy = (e) => CmnTween.resume_tsy(e), m.stop_tsy = (e) => CmnTween.stop_tsy(e), m.tsy = (e) => this.#R(e), m.wait_tsy = (e) => CmnTween.wait_tsy(e), m.add_filter = (e) => this.#z(e), m.clear_filter = (e) => this.#V(e), m.enable_filter = (e) => this.#H(e), m.ch = (e) => this.#W(e), m.clear_text = (e) => this.#Q(e), m.current = (e) => this.#q(e), m.endlink = (e) => this.#$(e), m.er = (e) => this.#ee(e), m.graph = (e) => this.#te(e), m.link = (e) => this.#ne(e), m.r = (e) => this.#re(e), m.ruby2 = (e) => this.#ie(e), m.span = (e) => this.#ae(e), m.tcy = (e) => this.#oe(e), m.add_face = (e) => SpritesMng.add_face(e), m.wv = (e) => SpritesMng.wv(e), m.dump_lay = (e) => this.#se(e), m.enable_event = (e) => this.#ce(e), m.button = (e) => this.#le(e), e.existsBreakline && (this.breakLine = (e) => {
|
|
307
|
+
delete e.visible, e.id = "break", e.pic = "breakline", this.#m("grp|" + cnvSArg(e));
|
|
308
|
+
}), e.existsBreakpage && (this.breakPage = (e) => {
|
|
309
|
+
delete e.visible, e.id = "break", e.pic = "breakpage", this.#m("grp|" + cnvSArg(e));
|
|
310
|
+
}), this.#i = parseColor(String(e.oCfg.init.bg_color));
|
|
311
|
+
let T = new Graphics();
|
|
312
|
+
T.beginFill(this.#i).lineStyle(0, this.#i).drawRect(0, 0, CmnLib.stageW, CmnLib.stageH).endFill(), this.#t.addChild(T.clone()), this.#n.addChild(T), this.#n.visible = !1, this.#t.name = "page:A", this.#n.name = "page:B", this.#e = g.stage, this.#e.addChild(this.#n), this.#e.addChild(this.#t), this.#e.addChild(this.#A), this.#e.addChild(this.#M), this.#e.name = "stage";
|
|
313
|
+
let E = (e, m) => {
|
|
314
|
+
this.#p(Number(m));
|
|
315
|
+
};
|
|
316
|
+
E("", _.getVal("sys:TextLayer.Back.Alpha", 1)), _.defValTrg("sys:TextLayer.Back.Alpha", E);
|
|
317
|
+
let D = (e, m) => {
|
|
318
|
+
Button.fontFamily = m;
|
|
319
|
+
};
|
|
320
|
+
D("", _.getVal("tmp:sn.button.fontFamily", Button.fontFamily)), _.defValTrg("tmp:sn.button.fontFamily", D), _.defTmp("const.sn.last_page_text", () => this.currentTxtlayFore?.pageText ?? ""), _.defTmp("const.sn.last_page_plain_text", () => this.currentTxtlayFore?.pagePlainText ?? ""), CmnLib.isDbg && (DesignCast.init(g, x, b, C, e, this.#x), this.cvsResizeDesign = () => DesignCast.cvsResizeDesign(), x.addHook((e, m) => {
|
|
321
|
+
this.#s[e]?.(e, m) && delete this.#s[e];
|
|
322
|
+
}));
|
|
323
|
+
}
|
|
324
|
+
cvsResizeDesign() {}
|
|
325
|
+
#s = {
|
|
326
|
+
attach: (e) => (DesignCast.leaveMode(), !1),
|
|
327
|
+
continue: (e) => (DesignCast.leaveMode(), !1),
|
|
328
|
+
disconnect: (e) => (DesignCast.leaveMode(), !1),
|
|
329
|
+
_enterDesign: (e) => {
|
|
330
|
+
DesignCast.enterMode();
|
|
331
|
+
for (let e of this.#S) {
|
|
332
|
+
let m = this.#x[e].fore;
|
|
333
|
+
m.makeDesignCastChildren((e) => e.make()), m.makeDesignCast((e) => e.make());
|
|
334
|
+
}
|
|
335
|
+
return this.#u(this.#C), !1;
|
|
336
|
+
},
|
|
337
|
+
_replaceToken: (e, m) => (DesignCast.replaceToken(m), !1),
|
|
338
|
+
_selectNode: (e, m) => (this.#u(m.node), !1)
|
|
339
|
+
};
|
|
340
|
+
#c = "";
|
|
341
|
+
#l = "";
|
|
342
|
+
#u(e) {
|
|
343
|
+
[this.#c = "", this.#l = ""] = e.split("/");
|
|
344
|
+
let m = this.#x[this.#c];
|
|
345
|
+
m && (DesignCast.allHide(), this.#l ? m.fore.showDesignCastChildren() : m.fore.showDesignCast());
|
|
346
|
+
}
|
|
347
|
+
getFrmDisabled = (e) => this.#r.getFrmDisabled(e);
|
|
348
|
+
#d = void 0;
|
|
349
|
+
cover(e, m = 0) {
|
|
350
|
+
this.#d &&= (this.#e.removeChild(this.#d), this.#d.destroy(), void 0), e && this.#e.addChild((this.#d = new Graphics()).beginFill(m).lineStyle(0, m).drawRect(0, 0, CmnLib.stageW, CmnLib.stageH).endFill());
|
|
351
|
+
}
|
|
352
|
+
#f;
|
|
353
|
+
setEvtMng(e) {
|
|
354
|
+
this.#f = e, this.#r.setEvtMng(e), SpritesMng.setEvtMng(e), CmnTween.init(e);
|
|
355
|
+
}
|
|
356
|
+
destroy() {
|
|
357
|
+
for (let e of Object.values(this.#x)) e.destroy();
|
|
358
|
+
this.#o.clear(), GrpLayer.destroy(), RubySpliter.destroy(), TxtStage.destroy(), TxtLayer.destroy(), this.#r.destroy(), CmnTween.destroy(), TxtLayer.msecChWait = 10;
|
|
359
|
+
}
|
|
360
|
+
#p(e) {
|
|
361
|
+
for (let m of this.#S) {
|
|
362
|
+
let { fore: h, back: g } = this.#x[m];
|
|
363
|
+
h instanceof TxtLayer && (h.chgBackAlpha(e), g.chgBackAlpha(e));
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
#m = (e, m = this.currentTxtlayForeNeedErr, h = !0) => m.tagCh("| 《" + e + "》");
|
|
367
|
+
goTxt = () => {};
|
|
368
|
+
get needGoTxt() {
|
|
369
|
+
return this.currentTxtlayFore?.needGoTxt ?? !1;
|
|
370
|
+
}
|
|
371
|
+
breakLine = (e) => {};
|
|
372
|
+
breakPage = (e) => {};
|
|
373
|
+
clearBreak() {
|
|
374
|
+
this.currentTxtlayFore && (this.clearBreak = () => this.#m("del|break"), this.clearBreak());
|
|
375
|
+
}
|
|
376
|
+
clickTxtLay() {
|
|
377
|
+
return this.currentTxtlayFore ? this.#S.map((e) => this.#x[e].fore).some((e) => e instanceof TxtLayer && e.click()) : !1;
|
|
378
|
+
}
|
|
379
|
+
#h(e) {
|
|
380
|
+
let m = getDateStr("-", "_", "", "_"), h = e.fn ? e.fn.startsWith("userdata:/") ? e.fn : `${PROTOCOL_DL + e.fn + m}.png` : `${PROTOCOL_DL}snapshot${m}.png`, _ = this.cfg.searchPath(h), v = argChk_Num(e, "width", CmnLib.stageW), x = argChk_Num(e, "height", CmnLib.stageH);
|
|
381
|
+
return this.#g(e, _, v, x, `snapshot dt:${m}`);
|
|
382
|
+
}
|
|
383
|
+
#g = () => !1;
|
|
384
|
+
#_({ layer: e }, m, h, g, _) {
|
|
385
|
+
if (this.#r.hideAllFrame(), Reading.beginProc(_), !e) return this.sys.capturePage(m, h, g, () => {
|
|
386
|
+
this.#r.restoreAllFrame(), Reading.endProc(_);
|
|
387
|
+
}), !0;
|
|
388
|
+
let v = this.#S.map((e) => {
|
|
389
|
+
let { ctn: m } = this.#x[e].fore, h = [m, m.visible];
|
|
390
|
+
return m.visible = !1, h;
|
|
391
|
+
});
|
|
392
|
+
for (let m of this.#P(e)) this.#x[m].fore.ctn.visible = !0;
|
|
393
|
+
return this.sys.capturePage(m, h, g, () => {
|
|
394
|
+
for (let [e, m] of v) e.visible = m;
|
|
395
|
+
this.#r.restoreAllFrame(), Reading.endProc(_);
|
|
396
|
+
}), !0;
|
|
397
|
+
}
|
|
398
|
+
#v(m, h, g, _, y) {
|
|
399
|
+
Reading.beginProc(y);
|
|
400
|
+
let b = argChk_Color(m, "b_color", this.#i), x = autoDetectRenderer({
|
|
401
|
+
width: g,
|
|
402
|
+
height: _,
|
|
403
|
+
backgroundAlpha: b > 16777216 && h.endsWith(".png") ? 0 : 1,
|
|
404
|
+
antialias: argChk_Boolean(m, "smoothing", !1),
|
|
405
|
+
preserveDrawingBuffer: !0,
|
|
406
|
+
backgroundColor: b & 16777215,
|
|
407
|
+
autoDensity: !0
|
|
408
|
+
}), C = m.page === "back" ? "back" : "fore", { layer: w } = m;
|
|
409
|
+
return Promise.allSettled(this.#P(w).map((e) => new Promise((m) => this.#x[e][C].snapshot(x, m)))).then(async () => {
|
|
410
|
+
let e = RenderTexture.create({
|
|
411
|
+
width: x.width,
|
|
412
|
+
height: x.height
|
|
413
|
+
});
|
|
414
|
+
x.render(this.#e, { renderTexture: e }), await this.sys.savePic(h, x.plugins.extract.base64(e)), e.destroy();
|
|
415
|
+
for (let e of this.#P(w)) this.#x[e][C].snapshot_end();
|
|
416
|
+
x.destroy(!0), Reading.endProc(y);
|
|
417
|
+
}), !0;
|
|
418
|
+
}
|
|
419
|
+
#y(e) {
|
|
420
|
+
let { fn: m } = e;
|
|
421
|
+
if (!m) throw "fnは必須です";
|
|
422
|
+
if (!m.endsWith(".css")) throw "サポートされない拡張子です";
|
|
423
|
+
let h = argChk_Boolean(e, "join", !0), g = Reading.procID + `loadplugin fn:${m}`;
|
|
424
|
+
return h && Reading.beginProc(g), (async () => {
|
|
425
|
+
let e = await fetch(m);
|
|
426
|
+
if (!e.ok) throw Error("Network response was not ok.");
|
|
427
|
+
addStyle(await e.text()), h && Reading.endProc(g);
|
|
428
|
+
})(), h;
|
|
429
|
+
}
|
|
430
|
+
#b(e) {
|
|
431
|
+
let { layer: m, class: h } = e;
|
|
432
|
+
if (!m) throw "layerは必須です";
|
|
433
|
+
if (m.includes(",")) throw "layer名に「,」は使えません";
|
|
434
|
+
if (m in this.#x) throw `layer【${m}】はすでにあります`;
|
|
435
|
+
if (!h) throw "clsは必須です";
|
|
436
|
+
let g = { isWait: !1 };
|
|
437
|
+
switch (this.#x[m] = new Pages(m, h, this.#t, this.#n, e, this.sys, this.val, g), this.#S.push(m), h) {
|
|
438
|
+
case "txt":
|
|
439
|
+
this.#C || (this.#X = () => {}, this.#G = (e) => this.#K(e), this.#q = (e) => this.#J(e), this.hTag.current({ layer: m }), this.goTxt = () => {
|
|
440
|
+
this.#f.isSkipping ? TxtLayer.msecChWait = 0 : this.setNormalChWait();
|
|
441
|
+
for (let e of this.#S) {
|
|
442
|
+
let m = this.#x[e].fore;
|
|
443
|
+
m instanceof TxtLayer && this.#m("gotxt|", m, !1);
|
|
444
|
+
}
|
|
445
|
+
}), this.val.setVal_Nochk("save", "const.sn.layer." + m + ".enabled", !0);
|
|
446
|
+
break;
|
|
447
|
+
case "grp":
|
|
448
|
+
if (this.#w) break;
|
|
449
|
+
this.#w = m;
|
|
450
|
+
break;
|
|
451
|
+
}
|
|
452
|
+
return this.scrItr.recodeDesign(e), g.isWait;
|
|
453
|
+
}
|
|
454
|
+
#x = {};
|
|
455
|
+
#S = [];
|
|
456
|
+
#C = "";
|
|
457
|
+
#w = "";
|
|
458
|
+
#T(e) {
|
|
459
|
+
let m = this.#Z(e), h = this.#x[m], _ = h.back.ctn, y = h.fore.ctn;
|
|
460
|
+
if (argChk_Boolean(e, "float", !1)) this.#n.setChildIndex(_, this.#n.children.length - 1), this.#t.setChildIndex(y, this.#t.children.length - 1), this.#E();
|
|
461
|
+
else if (e.index) argChk_Num(e, "index", 0) && (this.#n.setChildIndex(_, e.index), this.#t.setChildIndex(y, e.index), this.#E());
|
|
462
|
+
else if (e.dive) {
|
|
463
|
+
let { dive: h } = e, g = 0;
|
|
464
|
+
if (m === h) throw "[lay] 属性 layerとdiveが同じ【" + h + "】です";
|
|
465
|
+
let v = this.#x[h];
|
|
466
|
+
if (!v) throw "[lay] 属性 dive【" + h + "】が不正です。レイヤーがありません";
|
|
467
|
+
let b = v.back, x = v.fore, S = this.#n.getChildIndex(b.ctn), C = this.#t.getChildIndex(x.ctn);
|
|
468
|
+
g = S < C ? S : C, g > this.#n.getChildIndex(_) && --g, this.#t.setChildIndex(y, g), this.#n.setChildIndex(_, g), this.#E();
|
|
469
|
+
}
|
|
470
|
+
return e[":id_tag"] = h.fore.name.slice(0, -7), this.scrItr.recodeDesign(e), h.lay(e);
|
|
471
|
+
}
|
|
472
|
+
#E() {
|
|
473
|
+
this.#S = this.#I();
|
|
474
|
+
}
|
|
475
|
+
#D(e) {
|
|
476
|
+
return this.#F(e, (m) => {
|
|
477
|
+
let h = this.#x[this.#Z({ layer: m })];
|
|
478
|
+
if (e.page === "both") {
|
|
479
|
+
h.fore.clearLay(e), h.back.clearLay(e);
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
h.getPage(e).clearLay(e);
|
|
483
|
+
}), !1;
|
|
484
|
+
}
|
|
485
|
+
static #O = "\nprecision mediump float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform sampler2D rule;\nuniform float vague;\nuniform float tick;\n\nuniform vec4 inputPixel;\nuniform highp vec4 outputFrame;\nvec2 getUV(vec2 coord) {\n return coord * inputPixel.xy / outputFrame.zw;\n}\n\nvoid main() {\n vec4 fg = texture2D(uSampler, vTextureCoord);\n vec4 ru = texture2D(rule, getUV(vTextureCoord));\n\n float v = ru.r - tick;\n gl_FragColor = abs(v) < vague\n ? vec4(fg.rgb, 1) *fg.a *(0.5 +v /vague *0.5)\n : 0.0 <= v ? fg : vec4(0);\n}";
|
|
486
|
+
#k = RenderTexture.create({
|
|
487
|
+
width: CmnLib.stageW,
|
|
488
|
+
height: CmnLib.stageH
|
|
489
|
+
});
|
|
490
|
+
#A = new Sprite(this.#k);
|
|
491
|
+
#j = RenderTexture.create({
|
|
492
|
+
width: CmnLib.stageW,
|
|
493
|
+
height: CmnLib.stageH
|
|
494
|
+
});
|
|
495
|
+
#M = new Sprite(this.#j);
|
|
496
|
+
#N(e) {
|
|
497
|
+
let { layer: m } = e, h = /* @__PURE__ */ new Set(), _ = this.#P(m).map((e) => (h.add(e), this.#x[e].fore)), v = () => {
|
|
498
|
+
[this.#t, this.#n] = [this.#n, this.#t];
|
|
499
|
+
let e = [];
|
|
500
|
+
for (let [m, g] of Object.entries(this.#x)) {
|
|
501
|
+
if (h.has(m)) {
|
|
502
|
+
g.transPage(e);
|
|
503
|
+
continue;
|
|
504
|
+
}
|
|
505
|
+
let { fore: { ctn: _ }, back: { ctn: v } } = g, y = this.#t.getChildIndex(v);
|
|
506
|
+
this.#t.removeChild(v), this.#n.removeChild(_), this.#t.addChildAt(_, y), this.#n.addChildAt(v, y);
|
|
507
|
+
}
|
|
508
|
+
Promise.allSettled(e).then(() => {
|
|
509
|
+
this.#t.visible = !0, this.#n.visible = !1, this.#A.visible = !1, this.#M.visible = !1, Reading.notifyEndProc(TW_NM_TRANS);
|
|
510
|
+
});
|
|
511
|
+
};
|
|
512
|
+
if (this.#M.filters = [], this.#M.alpha = 1, argChk_Num(e, "time", 0) === 0 || this.#f.isSkipping) return v(), !1;
|
|
513
|
+
let y = [], b = this.#S.map((e) => {
|
|
514
|
+
let { fore: m, back: g } = this.#x[e], _ = h.has(e) ? g : m;
|
|
515
|
+
return _.ctn.visible && y.push(_.ctn), _;
|
|
516
|
+
}), { ticker: S, renderer: w } = this.appPixi;
|
|
517
|
+
w.render(this.#n, { renderTexture: this.#k });
|
|
518
|
+
let T = () => {
|
|
519
|
+
for (let e of y) w.render(e, {
|
|
520
|
+
renderTexture: this.#k,
|
|
521
|
+
clear: !1
|
|
522
|
+
});
|
|
523
|
+
};
|
|
524
|
+
if (!b.some((e) => e.containMovement)) {
|
|
525
|
+
let e = T;
|
|
526
|
+
T = () => {
|
|
527
|
+
T = () => {}, e();
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
let E = () => w.render(this.#t, { renderTexture: this.#j });
|
|
531
|
+
E();
|
|
532
|
+
let D = () => {
|
|
533
|
+
this.#t.visible = !0, E(), this.#t.visible = !1;
|
|
534
|
+
};
|
|
535
|
+
if (!_.some((e) => e.containMovement)) {
|
|
536
|
+
let e = D;
|
|
537
|
+
D = () => {
|
|
538
|
+
D = () => {}, e();
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
let O = () => {
|
|
542
|
+
T(), this.#A.visible = !0, D(), this.#M.visible = !0;
|
|
543
|
+
}, { glsl: A, rule: j } = e, M = () => {
|
|
544
|
+
S.remove(O), v();
|
|
545
|
+
};
|
|
546
|
+
if (!A && !j) return CmnTween.tween(TW_NM_TRANS, e, this.#M, { alpha: 0 }, () => {}, M, () => {}), S.add(O), !1;
|
|
547
|
+
let F = {
|
|
548
|
+
rule: Texture.EMPTY,
|
|
549
|
+
vague: argChk_Num(e, "vague", .04),
|
|
550
|
+
tick: 0
|
|
551
|
+
};
|
|
552
|
+
this.#M.filters = [new Filter(void 0, A ?? x.#O, F)];
|
|
553
|
+
let I = CmnTween.tween(TW_NM_TRANS, e, F, { tick: 1 }, () => {}, M, () => {}, !j);
|
|
554
|
+
return j ? new SpritesMng(j, void 0, (e) => {
|
|
555
|
+
F.rule = e.texture, e.destroy(), I.start(), S.add(O);
|
|
556
|
+
}, (e) => {
|
|
557
|
+
e && this.main.resume();
|
|
558
|
+
}).ret : (S.add(O), !1);
|
|
559
|
+
}
|
|
560
|
+
#P(e = "") {
|
|
561
|
+
return e ? e.split(",") : this.#S;
|
|
562
|
+
}
|
|
563
|
+
#F(e, m) {
|
|
564
|
+
let h = this.#P(e.layer);
|
|
565
|
+
for (let e of h) {
|
|
566
|
+
let h = this.#x[e];
|
|
567
|
+
if (!h) throw `存在しないlayer【${e}】です`;
|
|
568
|
+
m(e, h);
|
|
569
|
+
}
|
|
570
|
+
return h;
|
|
571
|
+
}
|
|
572
|
+
#I(e = "") {
|
|
573
|
+
return this.#P(e).sort((e, m) => {
|
|
574
|
+
let h = this.#t.getChildIndex(this.#x[e].fore.ctn), g = this.#t.getChildIndex(this.#x[m].fore.ctn);
|
|
575
|
+
return h < g ? -1 : h > g ? 1 : 0;
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
setAllStyle2TxtLay(e) {
|
|
579
|
+
for (let m of this.#S) {
|
|
580
|
+
let h = this.#x[m].fore;
|
|
581
|
+
h instanceof TxtLayer && h.lay({ style: e });
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
#L(e) {
|
|
585
|
+
if (argChk_Num(e, "time", NaN) === 0) return !1;
|
|
586
|
+
let h = this.#P(e.layer).map((e) => this.#x[e].fore.ctn), { renderer: _, ticker: v } = this.appPixi;
|
|
587
|
+
this.#j.resize(CmnLib.stageW, CmnLib.stageH);
|
|
588
|
+
let b = () => {
|
|
589
|
+
this.#t.visible = !0;
|
|
590
|
+
for (let e of h) _.render(e, {
|
|
591
|
+
renderTexture: this.#j,
|
|
592
|
+
clear: !1
|
|
593
|
+
});
|
|
594
|
+
this.#t.visible = !1;
|
|
595
|
+
};
|
|
596
|
+
this.#M.visible = !0, this.#M.alpha = 1;
|
|
597
|
+
let x = uint(argChk_Num(e, "hmax", 10)), S = uint(argChk_Num(e, "vmax", 10)), C = x === 0 ? () => {} : () => {
|
|
598
|
+
this.#M.x = Math.round(Math.random() * x * 2) - x;
|
|
599
|
+
}, w = S === 0 ? () => {} : () => {
|
|
600
|
+
this.#M.y = Math.round(Math.random() * S * 2) - S;
|
|
601
|
+
};
|
|
602
|
+
return this.#M.filters = [], CmnTween.tween(TW_NM_TRANS, e, this.#M, {
|
|
603
|
+
x: 0,
|
|
604
|
+
y: 0
|
|
605
|
+
}, () => {
|
|
606
|
+
C(), w();
|
|
607
|
+
}, () => {
|
|
608
|
+
v.remove(b), this.#t.visible = !0, this.#M.visible = !1, this.#M.x = 0, this.#M.y = 0, Reading.notifyEndProc(TW_NM_TRANS);
|
|
609
|
+
}, () => {}), v.add(b), !1;
|
|
610
|
+
}
|
|
611
|
+
#R(e) {
|
|
612
|
+
let { layer: m, render: h, name: g } = e;
|
|
613
|
+
if (!m) throw "layerは必須です";
|
|
614
|
+
let _ = this.#x[this.#Z(e)], y = _.fore, b = () => {};
|
|
615
|
+
h && (this.#f.isSkipping ? y.renderStart(!0) : (y.renderStart(!1), b = () => y.renderEnd()));
|
|
616
|
+
let x = CmnTween.cnvTweenArg(e, y), S = argChk_Boolean(e, "arrive", !1), C = argChk_Boolean(e, "backlay", !1), w = _.back.ctn;
|
|
617
|
+
return CmnTween.tween(g ?? m, e, y, CmnTween.cnvTweenArg(e, y), () => {}, b, () => {
|
|
618
|
+
if (S && Object.assign(y, x), C) for (let e of CmnTween.aLayerPrpNm) w[e] = y[e];
|
|
619
|
+
}), "filter" in e && (y.ctn.filters = [Layer.bldFilters(e)], y.aFltHArg = [e]), !1;
|
|
620
|
+
}
|
|
621
|
+
#z(e) {
|
|
622
|
+
return this.#F(e, (m) => {
|
|
623
|
+
let h = this.#x[this.#Z({ layer: m })];
|
|
624
|
+
if (e.page === "both") {
|
|
625
|
+
this.#B(h.fore, e), this.#B(h.back, e);
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
628
|
+
let g = h.getPage(e);
|
|
629
|
+
this.#B(g, e);
|
|
630
|
+
}), !1;
|
|
631
|
+
}
|
|
632
|
+
#B(e, m) {
|
|
633
|
+
let h = e.ctn;
|
|
634
|
+
h.filters ??= [], h.filters = [...h.filters, Layer.bldFilters(m)], e.aFltHArg.push(m);
|
|
635
|
+
}
|
|
636
|
+
#V(e) {
|
|
637
|
+
return this.#F(e, (m) => {
|
|
638
|
+
let h = this.#x[this.#Z({ layer: m })];
|
|
639
|
+
if (e.page === "both") {
|
|
640
|
+
let e = h.fore, m = h.back;
|
|
641
|
+
e.ctn.filters = null, m.ctn.filters = null, e.aFltHArg = [], m.aFltHArg = [];
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
let g = h.getPage(e);
|
|
645
|
+
g.ctn.filters = null, g.aFltHArg = [];
|
|
646
|
+
}), !1;
|
|
647
|
+
}
|
|
648
|
+
#H(e) {
|
|
649
|
+
return this.#F(e, (m) => {
|
|
650
|
+
let h = this.#x[this.#Z({ layer: m })];
|
|
651
|
+
if (e.page === "both") {
|
|
652
|
+
this.#U(h.fore, e), this.#U(h.back, e);
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
let g = h.getPage(e);
|
|
656
|
+
this.#U(g, e);
|
|
657
|
+
}), !1;
|
|
658
|
+
}
|
|
659
|
+
#U(e, h) {
|
|
660
|
+
let _ = e.ctn;
|
|
661
|
+
if (!_.filters) throw "フィルターがありません";
|
|
662
|
+
let y = uint(argChk_Num(h, "index", 0)), b = _.filters.length;
|
|
663
|
+
if (b <= y) throw `フィルターの個数(${String(b)})を越えています`;
|
|
664
|
+
e.aFltHArg[y].enabled = _.filters[y].enabled = argChk_Boolean(h, "enabled", !0);
|
|
665
|
+
}
|
|
666
|
+
#W(e) {
|
|
667
|
+
let { text: m } = e;
|
|
668
|
+
if (!m) throw "textは必須です";
|
|
669
|
+
let h = this.#G(e);
|
|
670
|
+
delete e.text, this.setNormalChWait(), this.#f.isSkipping ? e.wait = 0 : "wait" in e && argChk_Num(e, "wait", NaN), this.#m("add|" + cnvSArg(e), h);
|
|
671
|
+
let _ = argChk_Boolean(e, "record", !0), y = this.val.doRecLog();
|
|
672
|
+
return _ || this.val.setVal_Nochk("save", "sn.doRecLog", _), h.tagCh(m.replaceAll("[r]", "\n")), this.val.setVal_Nochk("save", "sn.doRecLog", y), this.#m("add_close|", h), !1;
|
|
673
|
+
}
|
|
674
|
+
#G = (e) => {
|
|
675
|
+
throw this.#X(), 0;
|
|
676
|
+
};
|
|
677
|
+
#K(e) {
|
|
678
|
+
let m = this.#Z(e, this.#C), h = this.#x[m].getPage(e);
|
|
679
|
+
if (!(h instanceof TxtLayer)) throw m + "はTxtLayerではありません";
|
|
680
|
+
return h;
|
|
681
|
+
}
|
|
682
|
+
setNormalChWait() {
|
|
683
|
+
TxtLayer.msecChWait = this.scrItr.normalWait;
|
|
684
|
+
}
|
|
685
|
+
#q = (e) => {
|
|
686
|
+
throw this.#X(), 0;
|
|
687
|
+
};
|
|
688
|
+
#J(e) {
|
|
689
|
+
let { layer: m } = e;
|
|
690
|
+
if (!m) throw "[current] layerは必須です";
|
|
691
|
+
let h = this.#x[m];
|
|
692
|
+
if (!h || !(h.getPage(e) instanceof TxtLayer)) throw `${m}はTxtLayerではありません`;
|
|
693
|
+
this.#Y = h, this.#a.pagebreak(), this.#C = m, this.val.setVal_Nochk("save", "const.sn.mesLayer", m);
|
|
694
|
+
for (let e of this.#S) {
|
|
695
|
+
let { fore: h, back: g } = this.#x[e];
|
|
696
|
+
h instanceof TxtLayer && (h.isCur = g.isCur = e === m);
|
|
697
|
+
}
|
|
698
|
+
return !1;
|
|
699
|
+
}
|
|
700
|
+
get currentTxtlayForeNeedErr() {
|
|
701
|
+
return this.#X(), this.currentTxtlayFore;
|
|
702
|
+
}
|
|
703
|
+
get currentTxtlayFore() {
|
|
704
|
+
return this.#Y ? this.#Y.fore : null;
|
|
705
|
+
}
|
|
706
|
+
#Y = void 0;
|
|
707
|
+
#X = () => {
|
|
708
|
+
throw "文字レイヤーがありません。文字表示や操作する前に、[add_lay layer=(レイヤ名) class=txt]で文字レイヤを追加して下さい";
|
|
709
|
+
};
|
|
710
|
+
#Z(e, m = "") {
|
|
711
|
+
let h = e.layer ?? m;
|
|
712
|
+
if (h.includes(",")) throw "layer名に「,」は使えません";
|
|
713
|
+
if (!(h in this.#x)) throw "属性 layer【" + h + "】が不正です。レイヤーがありません";
|
|
714
|
+
return e.layer = h, h;
|
|
715
|
+
}
|
|
716
|
+
recPagebreak() {
|
|
717
|
+
this.#a.pagebreak();
|
|
718
|
+
}
|
|
719
|
+
#Q(e) {
|
|
720
|
+
let m = this.#G(e);
|
|
721
|
+
return e.layer === this.#C && e.page === "fore" && this.#a.pagebreak(), m.clearText(), !1;
|
|
722
|
+
}
|
|
723
|
+
#$(e) {
|
|
724
|
+
return this.#m("endlink|", this.#G(e)), !1;
|
|
725
|
+
}
|
|
726
|
+
#ee(e) {
|
|
727
|
+
return argChk_Boolean(e, "rec_page_break", !0) && this.#a.pagebreak(), this.#Y && (this.#Y.fore.clearLay(e), this.#Y.back.clearLay(e)), !1;
|
|
728
|
+
}
|
|
729
|
+
#te(e) {
|
|
730
|
+
if (!e.pic) throw "[graph] picは必須です";
|
|
731
|
+
return this.#m("grp|" + cnvSArg(e), this.#G(e)), !1;
|
|
732
|
+
}
|
|
733
|
+
#ne(e) {
|
|
734
|
+
if (!e.fn && !e.label && !e.url) throw "fn,label,url いずれかは必須です";
|
|
735
|
+
return e.fn ??= this.scrItr.scriptFn, e.style ??= "background-color: rgba(255,0,0,0.5);", e.style_hover ??= "background-color: rgba(255,0,0,0.9);", e.style_clicked ??= e.style, this.#m("link|" + cnvSArg(e), this.#G(e)), !1;
|
|
736
|
+
}
|
|
737
|
+
#re(e) {
|
|
738
|
+
return this.#W({
|
|
739
|
+
...e,
|
|
740
|
+
text: "\n"
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
#ie(e) {
|
|
744
|
+
let { t: m, r: h } = e;
|
|
745
|
+
if (!m) throw "[ruby2] tは必須です";
|
|
746
|
+
if (!h) throw "[ruby2] rは必須です";
|
|
747
|
+
return e.text = "|" + encodeURIComponent(m) + "《" + encodeURIComponent(h) + "》", delete e.t, delete e.r, this.#W(e);
|
|
748
|
+
}
|
|
749
|
+
#ae(e) {
|
|
750
|
+
return this.#m("span|" + cnvSArg(e), this.#G(e)), !1;
|
|
751
|
+
}
|
|
752
|
+
#oe(e) {
|
|
753
|
+
if (!e.t) throw "[tcy] tは必須です";
|
|
754
|
+
return this.#m("tcy|" + cnvSArg(e), this.#G(e)), !1;
|
|
755
|
+
}
|
|
756
|
+
#se({ layer: e }) {
|
|
757
|
+
console.group("🥟 [dump_lay]");
|
|
758
|
+
for (let m of this.#P(e)) {
|
|
759
|
+
let { fore: e, back: h } = this.#x[m];
|
|
760
|
+
try {
|
|
761
|
+
console.info(`%c${e.name.slice(0, -7)} %o`, `color:#${CmnLib.isDarkMode ? "49F" : "05A"};`, JSON.parse(`{"back":{${h.dump()}}, "fore":{${e.dump()}}}`));
|
|
762
|
+
} catch (m) {
|
|
763
|
+
console.error("dump_lay err:%o", m), console.error(` back:${h.dump()}`), console.error(` fore:${e.dump()}`);
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
return console.groupEnd(), !1;
|
|
767
|
+
}
|
|
768
|
+
#ce(e) {
|
|
769
|
+
let m = this.#Z(e, this.#C), h = argChk_Boolean(e, "enabled", !0);
|
|
770
|
+
return this.#G(e).enabled = h, this.val.setVal_Nochk("save", "const.sn.layer." + m + ".enabled", h), !1;
|
|
771
|
+
}
|
|
772
|
+
#le(e) {
|
|
773
|
+
return Pages.argChk_page(e, "back"), e.fn ??= this.scrItr.scriptFn, this.#G(e).addButton(e), this.scrItr.recodeDesign(e), !1;
|
|
774
|
+
}
|
|
775
|
+
record() {
|
|
776
|
+
let e = {};
|
|
777
|
+
for (let m of this.#S) {
|
|
778
|
+
let h = this.#x[m];
|
|
779
|
+
e[m] = {
|
|
780
|
+
cls: h.cls,
|
|
781
|
+
fore: h.fore.record(),
|
|
782
|
+
back: h.back.record()
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
return e;
|
|
786
|
+
}
|
|
787
|
+
playback(e) {
|
|
788
|
+
this.#a.playback();
|
|
789
|
+
let m = [], h = [];
|
|
790
|
+
for (let [g, { fore: _, fore: { idx: v }, back: y, cls: b }] of Object.entries(e)) {
|
|
791
|
+
h.push({
|
|
792
|
+
ln: g,
|
|
793
|
+
idx: v
|
|
794
|
+
});
|
|
795
|
+
let e = this.#x[g] ??= new Pages(g, b, this.#t, this.#n, {}, this.sys, this.val, { isWait: !1 });
|
|
796
|
+
e.fore.playback(_, m), e.back.playback(y, m);
|
|
797
|
+
}
|
|
798
|
+
let g = this.#t.children.length;
|
|
799
|
+
return m.push(new Promise((e) => {
|
|
800
|
+
for (let { ln: e, idx: m } of h.sort(({ idx: e }, { idx: m }) => e === m ? 0 : e < m ? -1 : 1)) {
|
|
801
|
+
let h = this.#x[e];
|
|
802
|
+
if (!h) continue;
|
|
803
|
+
let _ = g > m ? m : g - 1, { fore: v, back: y } = h;
|
|
804
|
+
this.#t.setChildIndex(v.ctn, _), this.#n.setChildIndex(y.ctn, _);
|
|
805
|
+
}
|
|
806
|
+
e();
|
|
807
|
+
})), m;
|
|
808
|
+
}
|
|
992
809
|
};
|
|
993
|
-
|
|
810
|
+
export { LayerMng };
|
|
811
|
+
|
|
812
|
+
//# sourceMappingURL=LayerMng.js.map
|