@famibee/skynovel 1.64.8 → 1.64.10
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 +1 -1
- package/dist/Button.js +162 -0
- package/dist/Button.js.map +1 -0
- package/dist/CallStack.js.map +1 -1
- package/dist/CmnTween.js +201 -0
- package/dist/CmnTween.js.map +1 -0
- package/dist/DebugMng.js +105 -0
- package/dist/DebugMng.js.map +1 -0
- package/dist/EventMng.js +40 -39
- package/dist/EventMng.js.map +1 -1
- package/dist/GrpLayer.js +192 -0
- package/dist/GrpLayer.js.map +1 -0
- package/dist/LayerMng.js +483 -2422
- package/dist/LayerMng.js.map +1 -1
- package/dist/Main.js +394 -0
- package/dist/Main.js.map +1 -0
- package/dist/PropParser.js +1 -1
- package/dist/PropParser.js.map +1 -1
- package/dist/Reading.js +11 -11
- package/dist/Reading.js.map +1 -1
- package/dist/RubySpliter.js +90 -0
- package/dist/RubySpliter.js.map +1 -0
- package/dist/ScriptIterator.js +263 -353
- package/dist/ScriptIterator.js.map +1 -1
- package/dist/SndBuf.js +746 -949
- package/dist/SndBuf.js.map +1 -1
- package/dist/SoundMng.js +1 -1
- package/dist/SoundMng.js.map +1 -1
- package/dist/SpritesMng.js +229 -0
- package/dist/SpritesMng.js.map +1 -0
- package/dist/TxtLayer.js +1402 -0
- package/dist/TxtLayer.js.map +1 -0
- package/dist/Variable.js +157 -164
- package/dist/Variable.js.map +1 -1
- package/dist/app.d.ts +4 -4
- package/dist/app.d.ts.map +1 -1
- package/dist/appMain.d.ts.map +1 -1
- package/dist/appMain_cmn.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/platform.js +369 -0
- package/dist/platform.js.map +1 -0
- package/dist/sn/Button.d.ts +2 -2
- package/dist/sn/CallStack.d.ts +2 -2
- package/dist/sn/CmnInterface.d.ts +39 -41
- package/dist/sn/CmnInterface.d.ts.map +1 -1
- package/dist/sn/CmnLib.d.ts +11 -7
- package/dist/sn/CmnLib.d.ts.map +1 -1
- package/dist/sn/CmnTween.d.ts +9 -9
- package/dist/sn/Config.d.ts.map +1 -1
- package/dist/sn/ConfigBase.d.ts +16 -17
- package/dist/sn/ConfigBase.d.ts.map +1 -1
- package/dist/sn/DebugMng.d.ts +2 -2
- package/dist/sn/DebugMng.d.ts.map +1 -1
- package/dist/sn/DesignCast.d.ts +9 -9
- package/dist/sn/DesignCast.d.ts.map +1 -1
- package/dist/sn/EventMng.d.ts +4 -4
- package/dist/sn/EventMng.d.ts.map +1 -1
- package/dist/sn/FrameMng.d.ts +5 -5
- package/dist/sn/FrameMng.d.ts.map +1 -1
- package/dist/sn/Grammar.d.ts +124 -124
- package/dist/sn/Grammar.d.ts.map +1 -1
- package/dist/sn/GrpLayer.d.ts +7 -7
- package/dist/sn/GrpLayer.d.ts.map +1 -1
- package/dist/sn/Hyphenation.d.ts +2 -2
- package/dist/sn/Layer.d.ts +10 -10
- package/dist/sn/LayerMng.d.ts +7 -8
- package/dist/sn/LayerMng.d.ts.map +1 -1
- package/dist/sn/Log.d.ts +3 -3
- package/dist/sn/Log.d.ts.map +1 -1
- package/dist/sn/Main.d.ts +6 -5
- package/dist/sn/Main.d.ts.map +1 -1
- package/dist/sn/Pages.d.ts +8 -8
- package/dist/sn/Pages.d.ts.map +1 -1
- package/dist/sn/PropParser.d.ts +3 -3
- package/dist/sn/PropParser.d.ts.map +1 -1
- package/dist/sn/Reading.d.ts +12 -12
- package/dist/sn/Reading.d.ts.map +1 -1
- package/dist/sn/RubySpliter.d.ts +4 -4
- package/dist/sn/RubySpliter.d.ts.map +1 -1
- package/dist/sn/ScriptIterator.d.ts +5 -6
- package/dist/sn/ScriptIterator.d.ts.map +1 -1
- package/dist/sn/SndBuf.d.ts +12 -12
- package/dist/sn/SndBuf.d.ts.map +1 -1
- package/dist/sn/SoundMng.d.ts +4 -4
- package/dist/sn/SoundMng.d.ts.map +1 -1
- package/dist/sn/SpritesMng.d.ts +5 -5
- package/dist/sn/SpritesMng.d.ts.map +1 -1
- package/dist/sn/SysApp.d.ts +13 -10
- package/dist/sn/SysApp.d.ts.map +1 -1
- package/dist/sn/SysBase.d.ts +33 -32
- package/dist/sn/SysBase.d.ts.map +1 -1
- package/dist/sn/SysWeb.d.ts +7 -11
- package/dist/sn/SysWeb.d.ts.map +1 -1
- package/dist/sn/TxtLayer.d.ts +10 -8
- package/dist/sn/TxtLayer.d.ts.map +1 -1
- package/dist/sn/TxtStage.d.ts +5 -5
- package/dist/sn/TxtStage.d.ts.map +1 -1
- package/dist/sn/Variable.d.ts +9 -8
- package/dist/sn/Variable.d.ts.map +1 -1
- package/dist/test/SysTest.d.ts +2 -2
- package/dist/test/ValTest.d.ts +4 -4
- package/dist/test/ValTest.d.ts.map +1 -1
- package/dist/web.d.ts +4 -4
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +3 -3
- package/dist/web2.js +6959 -8339
- package/dist/web2.js.map +1 -1
- package/dist_app/Button.js +162 -0
- package/dist_app/Button.js.map +1 -0
- package/dist_app/CallStack.js.map +1 -1
- package/dist_app/CmnTween.js +201 -0
- package/dist_app/CmnTween.js.map +1 -0
- package/dist_app/EventMng.js +40 -39
- package/dist_app/EventMng.js.map +1 -1
- package/dist_app/GrpLayer.js +192 -0
- package/dist_app/GrpLayer.js.map +1 -0
- package/dist_app/LayerMng.js +483 -2422
- package/dist_app/LayerMng.js.map +1 -1
- package/dist_app/Main.js +393 -0
- package/dist_app/Main.js.map +1 -0
- package/dist_app/PropParser.js.map +1 -1
- package/dist_app/Reading.js +19 -19
- package/dist_app/Reading.js.map +1 -1
- package/dist_app/RubySpliter.js +90 -0
- package/dist_app/RubySpliter.js.map +1 -0
- package/dist_app/ScriptIterator.js +216 -307
- package/dist_app/ScriptIterator.js.map +1 -1
- package/dist_app/SndBuf.js +746 -949
- package/dist_app/SndBuf.js.map +1 -1
- package/dist_app/SoundMng.js +1 -1
- package/dist_app/SoundMng.js.map +1 -1
- package/dist_app/SpritesMng.js +228 -0
- package/dist_app/SpritesMng.js.map +1 -0
- package/dist_app/TxtLayer.js +1401 -0
- package/dist_app/TxtLayer.js.map +1 -0
- package/dist_app/Variable.js +157 -164
- package/dist_app/Variable.js.map +1 -1
- package/dist_app/app.d.ts +4 -4
- package/dist_app/app.d.ts.map +1 -1
- package/dist_app/app.js +2 -2
- package/dist_app/app2.js +3075 -4351
- package/dist_app/app2.js.map +1 -1
- package/dist_app/appMain.d.ts.map +1 -1
- package/dist_app/appMain.js +18 -18
- package/dist_app/appMain.js.map +1 -1
- package/dist_app/appMain_cmn.d.ts.map +1 -1
- package/dist_app/index.d.ts +0 -1
- package/dist_app/index.d.ts.map +1 -1
- package/dist_app/platform.js +369 -0
- package/dist_app/platform.js.map +1 -0
- package/dist_app/sn/Button.d.ts +2 -2
- package/dist_app/sn/CallStack.d.ts +2 -2
- package/dist_app/sn/CmnInterface.d.ts +39 -41
- package/dist_app/sn/CmnInterface.d.ts.map +1 -1
- package/dist_app/sn/CmnLib.d.ts +11 -7
- package/dist_app/sn/CmnLib.d.ts.map +1 -1
- package/dist_app/sn/CmnTween.d.ts +9 -9
- package/dist_app/sn/Config.d.ts.map +1 -1
- package/dist_app/sn/ConfigBase.d.ts +16 -17
- package/dist_app/sn/ConfigBase.d.ts.map +1 -1
- package/dist_app/sn/DebugMng.d.ts +2 -2
- package/dist_app/sn/DebugMng.d.ts.map +1 -1
- package/dist_app/sn/DesignCast.d.ts +9 -9
- package/dist_app/sn/DesignCast.d.ts.map +1 -1
- package/dist_app/sn/EventMng.d.ts +4 -4
- package/dist_app/sn/EventMng.d.ts.map +1 -1
- package/dist_app/sn/FrameMng.d.ts +5 -5
- package/dist_app/sn/FrameMng.d.ts.map +1 -1
- package/dist_app/sn/Grammar.d.ts +124 -124
- package/dist_app/sn/Grammar.d.ts.map +1 -1
- package/dist_app/sn/GrpLayer.d.ts +7 -7
- package/dist_app/sn/GrpLayer.d.ts.map +1 -1
- package/dist_app/sn/Hyphenation.d.ts +2 -2
- package/dist_app/sn/Layer.d.ts +10 -10
- package/dist_app/sn/LayerMng.d.ts +7 -8
- package/dist_app/sn/LayerMng.d.ts.map +1 -1
- package/dist_app/sn/Log.d.ts +3 -3
- package/dist_app/sn/Log.d.ts.map +1 -1
- package/dist_app/sn/Main.d.ts +6 -5
- package/dist_app/sn/Main.d.ts.map +1 -1
- package/dist_app/sn/Pages.d.ts +8 -8
- package/dist_app/sn/Pages.d.ts.map +1 -1
- package/dist_app/sn/PropParser.d.ts +3 -3
- package/dist_app/sn/PropParser.d.ts.map +1 -1
- package/dist_app/sn/Reading.d.ts +12 -12
- package/dist_app/sn/Reading.d.ts.map +1 -1
- package/dist_app/sn/RubySpliter.d.ts +4 -4
- package/dist_app/sn/RubySpliter.d.ts.map +1 -1
- package/dist_app/sn/ScriptIterator.d.ts +5 -6
- package/dist_app/sn/ScriptIterator.d.ts.map +1 -1
- package/dist_app/sn/SndBuf.d.ts +12 -12
- package/dist_app/sn/SndBuf.d.ts.map +1 -1
- package/dist_app/sn/SoundMng.d.ts +4 -4
- package/dist_app/sn/SoundMng.d.ts.map +1 -1
- package/dist_app/sn/SpritesMng.d.ts +5 -5
- package/dist_app/sn/SpritesMng.d.ts.map +1 -1
- package/dist_app/sn/SysApp.d.ts +13 -10
- package/dist_app/sn/SysApp.d.ts.map +1 -1
- package/dist_app/sn/SysBase.d.ts +33 -32
- package/dist_app/sn/SysBase.d.ts.map +1 -1
- package/dist_app/sn/SysWeb.d.ts +7 -11
- package/dist_app/sn/SysWeb.d.ts.map +1 -1
- package/dist_app/sn/TxtLayer.d.ts +10 -8
- package/dist_app/sn/TxtLayer.d.ts.map +1 -1
- package/dist_app/sn/TxtStage.d.ts +5 -5
- package/dist_app/sn/TxtStage.d.ts.map +1 -1
- package/dist_app/sn/Variable.d.ts +9 -8
- package/dist_app/sn/Variable.d.ts.map +1 -1
- package/dist_app/test/SysTest.d.ts +2 -2
- package/dist_app/test/ValTest.d.ts +4 -4
- package/dist_app/test/ValTest.d.ts.map +1 -1
- package/dist_app/web.d.ts +4 -4
- package/dist_app/web.d.ts.map +1 -1
- package/package.json +7 -7
- package/dist/sn/SysNode.d.ts +0 -15
- package/dist/sn/SysNode.d.ts.map +0 -1
- package/dist_app/sn/SysNode.d.ts +0 -15
- package/dist_app/sn/SysNode.d.ts.map +0 -1
package/dist/LayerMng.js
CHANGED
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
import { e as
|
|
2
|
-
import { C as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { e as w, S as H, L as F, n as D, l as v, a as x, p as A, G, q as U, E as tt, f as et, r as st, t as it, v as B, w as at, x as q, y as nt, F as rt, u as W, z as Y } from "./web2.js";
|
|
2
|
+
import { C as _, T as J, a as P } from "./CmnTween.js";
|
|
3
|
+
import { G as X, D as K } from "./GrpLayer.js";
|
|
4
|
+
import { S as I } from "./SpritesMng.js";
|
|
5
|
+
import { T as $, a as ot } from "./TxtLayer.js";
|
|
6
|
+
import { R as ct } from "./RubySpliter.js";
|
|
7
|
+
import { P as lt, b as Q } from "./Main.js";
|
|
8
|
+
import { a as C } from "./Reading.js";
|
|
9
|
+
import { Button as Z } from "./Button.js";
|
|
10
|
+
class R {
|
|
11
|
+
constructor(t, e, s, i, n, o, r, l) {
|
|
12
|
+
this.cls = e, this.hArg = n, this.sys = o, this.val = r, this.ret = l;
|
|
13
|
+
const f = o.hFactoryCls[e];
|
|
14
|
+
if (!f) throw `属性 class【${e}】が不正です`;
|
|
15
|
+
const d = f(), h = f();
|
|
16
|
+
d.layname = h.layname = t;
|
|
12
17
|
const p = n[":id_tag"] = `layer:${t} cls:${e} page:`;
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
18
|
+
d.ctn.name = d.name = p + "A", h.ctn.name = h.name = p + "B", s.addChild(d.ctn), i.addChild(h.ctn), w(n, "visible", !0), w(n, "visible", !0), l.isWait = d.lay(n) || h.lay(n), this.#e = { fore: d, back: h }, i.visible = !1;
|
|
19
|
+
const c = `const.sn.lay.${t}`;
|
|
20
|
+
r.setVal_Nochk("tmp", c, !0), r.defTmp(c + ".fore.alpha", () => this.#e.fore.alpha), r.defTmp(c + ".back.alpha", () => this.#e.back.alpha), r.defTmp(c + ".fore.height", () => this.#e.fore.height), r.defTmp(c + ".back.height", () => this.#e.back.height), r.defTmp(c + ".fore.visible", () => this.#e.fore.ctn.visible), r.defTmp(c + ".back.visible", () => this.#e.back.ctn.visible), r.defTmp(c + ".fore.width", () => this.#e.fore.width), r.defTmp(c + ".back.width", () => this.#e.back.width), r.defTmp(c + ".fore.x", () => this.#e.fore.x), r.defTmp(c + ".back.x", () => this.#e.back.x), r.defTmp(c + ".fore.y", () => this.#e.fore.y), r.defTmp(c + ".back.y", () => this.#e.back.y);
|
|
16
21
|
}
|
|
17
|
-
#
|
|
22
|
+
#e;
|
|
18
23
|
destroy() {
|
|
19
|
-
this.#
|
|
24
|
+
this.#e.fore.destroy(), this.#e.back.destroy();
|
|
20
25
|
}
|
|
21
26
|
lay = (t) => this.getPage(t).lay(t);
|
|
22
|
-
getPage = (t) =>
|
|
27
|
+
getPage = (t) => R.argChk_page(t, "fore") !== "back" ? this.#e.fore : this.#e.back;
|
|
23
28
|
static argChk_page(t, e) {
|
|
24
29
|
const s = t.page ?? e;
|
|
25
30
|
if (s === "fore" || s === "back")
|
|
@@ -27,2077 +32,143 @@ class et {
|
|
|
27
32
|
throw Error("属性 page【" + s + "】が不正です");
|
|
28
33
|
}
|
|
29
34
|
get fore() {
|
|
30
|
-
return this.#
|
|
35
|
+
return this.#e.fore;
|
|
31
36
|
}
|
|
32
37
|
get back() {
|
|
33
|
-
return this.#
|
|
38
|
+
return this.#e.back;
|
|
34
39
|
}
|
|
35
40
|
transPage(t) {
|
|
36
|
-
[this.#
|
|
41
|
+
[this.#e.back, this.#e.fore] = [this.#e.fore, this.#e.back], this.#e.back.copy(this.#e.fore, t);
|
|
37
42
|
}
|
|
38
43
|
}
|
|
39
|
-
class
|
|
40
|
-
// static readonly #alzTagArg = new AnalyzeTagArg;
|
|
41
|
-
constructor(t, e = !1) {
|
|
42
|
-
this.bg_col = t, this.isLay = e;
|
|
43
|
-
}
|
|
44
|
-
static init(t, e, s, i, n, a) {
|
|
45
|
-
}
|
|
46
|
-
static cvsResizeDesign() {
|
|
47
|
-
}
|
|
48
|
-
destroy() {
|
|
49
|
-
}
|
|
50
|
-
gethArg() {
|
|
51
|
-
return this.hArg;
|
|
52
|
-
}
|
|
53
|
-
hArg = {};
|
|
54
|
-
sethArg(t) {
|
|
55
|
-
this.hArg = t;
|
|
56
|
-
}
|
|
57
|
-
setOther(t) {
|
|
58
|
-
}
|
|
59
|
-
adopt(t) {
|
|
60
|
-
}
|
|
61
|
-
static enterMode() {
|
|
62
|
-
}
|
|
63
|
-
static allHide() {
|
|
64
|
-
}
|
|
65
|
-
set visible(t) {
|
|
66
|
-
}
|
|
67
|
-
static leaveMode() {
|
|
68
|
-
}
|
|
69
|
-
cvsResize() {
|
|
70
|
-
}
|
|
71
|
-
make() {
|
|
72
|
-
}
|
|
73
|
-
static replaceToken(t) {
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
class Ht extends ut {
|
|
77
|
-
constructor(t, e) {
|
|
78
|
-
super("#29e", !0);
|
|
79
|
-
}
|
|
80
|
-
setSp(t) {
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
class m {
|
|
84
|
-
constructor(t = "", e, s = () => {
|
|
85
|
-
}, i = () => {
|
|
86
|
-
}) {
|
|
87
|
-
this.csvFn = t, this.ctn = e, this.fncFirstComp = s, this.fncAllComp = i, t && (this.#u = e ? (n) => {
|
|
88
|
-
e.addChild(n), this.#c.push(n);
|
|
89
|
-
} : () => {
|
|
90
|
-
}, this.ret = m.#x(
|
|
91
|
-
t,
|
|
92
|
-
(n) => this.fncFirstComp(n),
|
|
93
|
-
// 差し替え考慮
|
|
94
|
-
(n) => this.fncAllComp(n),
|
|
95
|
-
// 差し替え考慮
|
|
96
|
-
(n) => this.#u(n)
|
|
97
|
-
// 差し替え考慮
|
|
98
|
-
));
|
|
99
|
-
}
|
|
100
|
-
static #s;
|
|
101
|
-
static #e;
|
|
102
|
-
static #n;
|
|
103
|
-
static #r;
|
|
104
|
-
static init(t, e, s, i, n) {
|
|
105
|
-
m.#s = t, m.#e = e, m.#n = s, m.#r = i, s.arg.crypto && (m.#f = (o, r, c) => m.#a(o, r, c), m.#o = (o, r, c) => m.#I(o, r, c));
|
|
106
|
-
const a = () => {
|
|
107
|
-
const o = m.#l * m.#t;
|
|
108
|
-
for (const r of Object.values(m.#w)) r.volume = o;
|
|
109
|
-
};
|
|
110
|
-
n.setNoticeChgVolume(
|
|
111
|
-
(o) => {
|
|
112
|
-
m.#l = o, a();
|
|
113
|
-
},
|
|
114
|
-
(o) => {
|
|
115
|
-
m.#t = o, a();
|
|
116
|
-
}
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
static #t = 1;
|
|
120
|
-
static #l = 1;
|
|
121
|
-
static #p;
|
|
122
|
-
static setEvtMng(t) {
|
|
123
|
-
m.#p = t;
|
|
124
|
-
}
|
|
125
|
-
ret = !1;
|
|
126
|
-
#u;
|
|
127
|
-
#c = [];
|
|
128
|
-
destroy() {
|
|
129
|
-
this.fncFirstComp = () => {
|
|
130
|
-
}, this.fncAllComp = () => {
|
|
131
|
-
}, this.#u = (t) => t.destroy();
|
|
132
|
-
for (const t of this.#c)
|
|
133
|
-
m.stopVideo(t.name), t.parent?.removeChild(t), t.destroy();
|
|
134
|
-
this.#c = [];
|
|
135
|
-
}
|
|
136
|
-
static destroy() {
|
|
137
|
-
m.#i = {}, m.#d = {}, m.#w = {};
|
|
138
|
-
}
|
|
139
|
-
//static #ldrHFn: {[fn: string]: 1} = {};
|
|
140
|
-
static #x(t, e, s, i) {
|
|
141
|
-
if (!t) return !1;
|
|
142
|
-
let n = !1;
|
|
143
|
-
if (t.startsWith("data:")) {
|
|
144
|
-
const l = () => {
|
|
145
|
-
const p = j.from(t);
|
|
146
|
-
i(p), e(p), s(n);
|
|
147
|
-
};
|
|
148
|
-
return t in ct ? l() : (n = !0, new Q().add(t, t).load(l)), n;
|
|
149
|
-
}
|
|
150
|
-
const a = [], o = new Q(), r = t.split(","), c = r.length;
|
|
151
|
-
for (let l = 0; l < c; ++l) {
|
|
152
|
-
const p = r[l];
|
|
153
|
-
if (!p) throw "face属性に空要素が含まれます";
|
|
154
|
-
const { dx: d, dy: h, blendmode: u, fn: x } = m.#i[p] ?? {
|
|
155
|
-
fn: p,
|
|
156
|
-
dx: 0,
|
|
157
|
-
dy: 0,
|
|
158
|
-
blendmode: St.NORMAL
|
|
159
|
-
}, v = l === 0 ? e : (E) => {
|
|
160
|
-
E.transform && (E.x = d, E.y = h, E.blendMode = u);
|
|
161
|
-
};
|
|
162
|
-
if (a.push({ fn: x, fnc: v }), x in m.#d || x in ct || x in Q.shared.resources) continue;
|
|
163
|
-
n = !0;
|
|
164
|
-
const y = m.#s.searchPath(x, Z.SP_GSM), b = this.#n.arg.crypto ? { xhrType: y.endsWith(".json") ? D.XHR_RESPONSE_TYPE.TEXT : D.XHR_RESPONSE_TYPE.BUFFER } : {};
|
|
165
|
-
o.add({ ...b, name: x, url: y });
|
|
166
|
-
}
|
|
167
|
-
const f = (l, p) => {
|
|
168
|
-
for (const { fn: d, fnc: h } of a) {
|
|
169
|
-
const u = m.#k(d, p);
|
|
170
|
-
u.name = d, i(u), h(u);
|
|
171
|
-
}
|
|
172
|
-
s(n);
|
|
173
|
-
};
|
|
174
|
-
return n ? o.use((l, p) => {
|
|
175
|
-
try {
|
|
176
|
-
if (l.extension === "json") {
|
|
177
|
-
this.#n.dec("json", l.data).then((d) => m.#o(d, l, p));
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
this.#n.decAB(l.data).then((d) => m.#f(d, l, p));
|
|
181
|
-
} catch (d) {
|
|
182
|
-
const h = `画像/動画ロード失敗です fn:${l.name} ${String(d)}`;
|
|
183
|
-
m.#p.isSkipping ? console.warn(h) : console.error("%c" + h, "color:#FF3300;");
|
|
184
|
-
}
|
|
185
|
-
}).load(f) : queueMicrotask(() => f(0, {})), n;
|
|
186
|
-
}
|
|
187
|
-
static #i = {};
|
|
188
|
-
static #d = {};
|
|
189
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
190
|
-
static #f = (t, { type: e, name: s, data: i }, n) => {
|
|
191
|
-
switch (e) {
|
|
192
|
-
case D.TYPE.VIDEO: {
|
|
193
|
-
const a = i;
|
|
194
|
-
a.volume = m.#l, m.#w[s] = m.#g(a);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
n();
|
|
198
|
-
};
|
|
199
|
-
static #y(t) {
|
|
200
|
-
const e = /([^\d]+)\d+\.(\w+)/.exec(t[0] ?? "");
|
|
201
|
-
if (!e) return [];
|
|
202
|
-
const [, s = "", i = ""] = e, n = s.length, a = -i.length - 1;
|
|
203
|
-
return t.sort((o, r) => bt(o.slice(n, a)) > bt(r.slice(n, a)) ? 1 : -1);
|
|
204
|
-
}
|
|
205
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
206
|
-
static #a(t, e, s) {
|
|
207
|
-
if (e.data = t, e.extension !== "bin" && s(), t instanceof HTMLImageElement) {
|
|
208
|
-
J.fromLoader(t, e.url, e.name).then((i) => {
|
|
209
|
-
e.texture = i, e.type = D.TYPE.IMAGE;
|
|
210
|
-
});
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
t instanceof HTMLVideoElement && (t.volume = m.#l, m.#w[e.name] = m.#g(t), e.type = D.TYPE.VIDEO), s();
|
|
214
|
-
}
|
|
215
|
-
static #g(t) {
|
|
216
|
-
return m.#e.getVal("const.sn.needClick2Play") && (it.trace_beforeNew(`[lay系] ${it.strPos()}未クリック状態で動画を自動再生します。音声はミュートされます`, "W"), t.muted = !0), t.setAttribute("playsinline", ""), t;
|
|
217
|
-
}
|
|
218
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
219
|
-
static #o = (t, { type: e, spritesheet: s, name: i, data: n }, a) => {
|
|
220
|
-
switch (e) {
|
|
221
|
-
case D.TYPE.JSON: {
|
|
222
|
-
const o = s._frameKeys;
|
|
223
|
-
m.#y(o), m.#d[i] = {
|
|
224
|
-
aTex: o.map((r) => J.from(r)),
|
|
225
|
-
meta: n.meta
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
a();
|
|
230
|
-
};
|
|
231
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
232
|
-
static #I(t, e, s) {
|
|
233
|
-
const { meta: i, frames: n } = e.data = JSON.parse(t);
|
|
234
|
-
if (e.type = D.TYPE.JSON, !i?.image) {
|
|
235
|
-
s();
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
const a = Rt(i.image), o = m.#s.searchPath(a, Z.SP_GSM);
|
|
239
|
-
new Q().use((r, c) => {
|
|
240
|
-
this.#n.decAB(r.data).then((f) => {
|
|
241
|
-
r.data = f, f instanceof HTMLImageElement && (r.type = D.TYPE.IMAGE, URL.revokeObjectURL(f.src)), c();
|
|
242
|
-
}).catch((f) => this.#r.errScript(`画像/動画ロード失敗です dec2res4Cripto fn:${r.name} ${String(f)}`, !1));
|
|
243
|
-
}).add({ name: a, url: o, xhrType: D.XHR_RESPONSE_TYPE.BUFFER }).load((r, c) => {
|
|
244
|
-
for (const { data: f } of Object.values(r.resources)) {
|
|
245
|
-
const { baseTexture: l } = J.from(f), p = Object.values(n);
|
|
246
|
-
m.#d[e.name] = {
|
|
247
|
-
aTex: p.map(({ frame: { x: d, y: h, w: u, h: x } }) => new J(
|
|
248
|
-
l,
|
|
249
|
-
new Y(d, h, u, x)
|
|
250
|
-
)),
|
|
251
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
252
|
-
meta: i
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
s();
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
static #k(t, e) {
|
|
259
|
-
const s = m.#d[t];
|
|
260
|
-
if (s) {
|
|
261
|
-
const a = new gt(s.aTex);
|
|
262
|
-
return a.animationSpeed = s.meta.animationSpeed ?? 1, a.play(), a;
|
|
263
|
-
}
|
|
264
|
-
if (t in ct) return j.from(t);
|
|
265
|
-
const i = m.#w[t];
|
|
266
|
-
if (i) return j.from(i);
|
|
267
|
-
const n = e[t];
|
|
268
|
-
return n ? new j(n.texture) : new j();
|
|
269
|
-
}
|
|
270
|
-
static #w = {};
|
|
271
|
-
static getHFn2VElm(t) {
|
|
272
|
-
return m.#w[t];
|
|
273
|
-
}
|
|
274
|
-
static wv(t) {
|
|
275
|
-
const { fn: e } = t;
|
|
276
|
-
if (!e) throw "fnは必須です";
|
|
277
|
-
const s = m.#w[e];
|
|
278
|
-
if (!s || s.loop) return !1;
|
|
279
|
-
if (m.#p.isSkipping || s.ended)
|
|
280
|
-
return m.stopVideo(e), !1;
|
|
281
|
-
const i = "wv fn:" + e, n = R(t, "stop", !0), a = () => {
|
|
282
|
-
n && m.stopVideo(e);
|
|
283
|
-
};
|
|
284
|
-
return F.beginProc(i, a, !0, a), s.addEventListener("ended", () => F.notifyEndProc(i), { once: !0, passive: !0 }), !0;
|
|
285
|
-
}
|
|
286
|
-
static stopVideo(t) {
|
|
287
|
-
const e = m.#w[t];
|
|
288
|
-
e && (delete m.#w[t], e.pause(), e.currentTime = e.duration);
|
|
289
|
-
}
|
|
290
|
-
static add_face(t) {
|
|
291
|
-
const { name: e } = t;
|
|
292
|
-
if (!e) throw "nameは必須です";
|
|
293
|
-
if (e in m.#i) throw "一つのname(" + e + ")に対して同じ画像を複数割り当てられません";
|
|
294
|
-
const { fn: s = e } = t;
|
|
295
|
-
return m.#i[e] = {
|
|
296
|
-
fn: s,
|
|
297
|
-
dx: w(t, "dx", 0),
|
|
298
|
-
dy: w(t, "dy", 0),
|
|
299
|
-
blendmode: H.getBlendmodeNum(t.blendmode ?? "")
|
|
300
|
-
}, !1;
|
|
301
|
-
}
|
|
302
|
-
// static clearFace2Name(): void {SpritesMng.hFace = {}}
|
|
303
|
-
}
|
|
304
|
-
class L extends H {
|
|
305
|
-
static #s = new kt();
|
|
306
|
-
static #e;
|
|
307
|
-
static init(t, e, s, i, n, a) {
|
|
308
|
-
L.#e = s, m.init(e, a, i, t, n);
|
|
309
|
-
}
|
|
310
|
-
static destroy() {
|
|
311
|
-
L.#s.clear(), m.destroy();
|
|
312
|
-
}
|
|
313
|
-
#n = new Ht(this.ctn, this);
|
|
314
|
-
constructor() {
|
|
315
|
-
super(), S.isDbg && (this.#r = (t) => this.#n.setSp(t), this.cvsResize = () => {
|
|
316
|
-
super.cvsResize(), this.#n.cvsResize();
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
#r = () => {
|
|
320
|
-
};
|
|
321
|
-
#t = "";
|
|
322
|
-
#l = "";
|
|
323
|
-
#p = "";
|
|
324
|
-
lay = (t) => {
|
|
325
|
-
const e = F.procID + `GrpLayer lay name:${this.name_}`, s = this.#u(t, (i) => {
|
|
326
|
-
i && F.endProc(e);
|
|
327
|
-
});
|
|
328
|
-
return s && F.beginProc(e), s;
|
|
329
|
-
};
|
|
330
|
-
#u(t, e) {
|
|
331
|
-
const { fn: s, face: i = "" } = t;
|
|
332
|
-
if (this.#n.sethArg(t), !s)
|
|
333
|
-
return super.lay(t), this.ctn.children.length > 0 && this.setPos(t), this.#l = "", this.#t = this.#p = i, e(!1), !1;
|
|
334
|
-
const n = "fn" in t, a = "face" in t;
|
|
335
|
-
return this.clearLay({ clear_filter: R(t, "clear_filter", !0) }), n && (this.#l = s), a && (this.#p = i), super.lay(t), t.dx = 0, t.dy = 0, this.#c.destroy(), this.#c = new m(
|
|
336
|
-
this.#t = s + (i ? "," + i : ""),
|
|
337
|
-
this.ctn,
|
|
338
|
-
(o) => {
|
|
339
|
-
("width" in t || "height" in t) && (o.width = w(t, "width", 0), o.height = w(t, "height", 0)), this.#x = o.width, this.#i = o.height, H.setXY(o, t, this.ctn, !0), H.setBlendmode(this.ctn, t), this.#r(o);
|
|
340
|
-
},
|
|
341
|
-
(o) => e(o)
|
|
342
|
-
), this.#c.ret;
|
|
343
|
-
}
|
|
344
|
-
#c = new m();
|
|
345
|
-
#x = 0;
|
|
346
|
-
#i = 0;
|
|
347
|
-
get width() {
|
|
348
|
-
return this.#x;
|
|
349
|
-
}
|
|
350
|
-
get height() {
|
|
351
|
-
return this.#i;
|
|
352
|
-
}
|
|
353
|
-
renderStart() {
|
|
354
|
-
this.#f = new j(this.#d), this.#f.visible = !1, this.ctn.addChildAt(this.#f, 0), this.#f.position.set(-this.ctn.x, -this.ctn.y);
|
|
355
|
-
let t = () => {
|
|
356
|
-
const e = this.ctn.alpha;
|
|
357
|
-
this.ctn.alpha = 1;
|
|
358
|
-
for (const s of this.ctn.children) s.visible = !0;
|
|
359
|
-
this.#f.visible = !1, L.#e.renderer.render(this.ctn, { renderTexture: this.#d }), this.ctn.alpha = e;
|
|
360
|
-
for (const s of this.ctn.children) s.visible = !1;
|
|
361
|
-
};
|
|
362
|
-
if (!this.containMovement) {
|
|
363
|
-
const e = t;
|
|
364
|
-
t = () => {
|
|
365
|
-
t = () => {
|
|
366
|
-
}, e();
|
|
367
|
-
};
|
|
368
|
-
}
|
|
369
|
-
this.#y = () => {
|
|
370
|
-
t(), this.#f.visible = !0;
|
|
371
|
-
}, L.#e.ticker.add(this.#y);
|
|
372
|
-
}
|
|
373
|
-
#d = tt.create({
|
|
374
|
-
width: S.stageW,
|
|
375
|
-
height: S.stageH
|
|
376
|
-
});
|
|
377
|
-
#f = new j();
|
|
378
|
-
#y = () => {
|
|
379
|
-
};
|
|
380
|
-
renderEnd() {
|
|
381
|
-
L.#e.ticker.remove(this.#y), this.ctn.removeChild(this.#f);
|
|
382
|
-
for (const t of this.ctn.children) t.visible = !0;
|
|
383
|
-
this.#f.destroy(!0), this.#d = tt.create({
|
|
384
|
-
width: S.stageW,
|
|
385
|
-
height: S.stageH
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
setPos(t) {
|
|
389
|
-
H.setXY(
|
|
390
|
-
this.ctn.children[0] ?? this.ctn,
|
|
391
|
-
t,
|
|
392
|
-
this.ctn,
|
|
393
|
-
!0
|
|
394
|
-
);
|
|
395
|
-
}
|
|
396
|
-
// アニメ・動画を含むか
|
|
397
|
-
get containMovement() {
|
|
398
|
-
if (this.#t === "") return !1;
|
|
399
|
-
const t = this.ctn.children;
|
|
400
|
-
return this.#t.split(",").some(
|
|
401
|
-
(e, s) => t[s] instanceof gt || m.getHFn2VElm(e)
|
|
402
|
-
);
|
|
403
|
-
}
|
|
404
|
-
clearLay(t) {
|
|
405
|
-
super.clearLay(t), this.#c.destroy(), this.#l = "", this.#p = "", this.#t = "";
|
|
406
|
-
}
|
|
407
|
-
record = () => ({
|
|
408
|
-
...super.record(),
|
|
409
|
-
sBkFn: this.#l,
|
|
410
|
-
sBkFace: this.#p
|
|
411
|
-
// idc_hArg : this.#idc.gethArg(),
|
|
412
|
-
});
|
|
413
|
-
playback(t, e) {
|
|
414
|
-
if (super.playback(t, e), t.sBkFn === "" && t.sBkFace === "") {
|
|
415
|
-
this.#l = "", this.#p = "";
|
|
416
|
-
return;
|
|
417
|
-
}
|
|
418
|
-
e.push(new Promise((s) => this.#u(
|
|
419
|
-
{ fn: t.sBkFn, face: t.sBkFace, left: t.x, top: t.y, alpha: t.alpha, blendmode: H.getNum2Blendmode(t.blendMode), rotation: t.rotation, scale_x: t.scale_x, scale_y: t.scale_y },
|
|
420
|
-
(i) => {
|
|
421
|
-
this.ctn.position.set(t.x, t.y), s();
|
|
422
|
-
}
|
|
423
|
-
// Layer.setXY()の後に再度移動
|
|
424
|
-
)));
|
|
425
|
-
}
|
|
426
|
-
makeDesignCast(t) {
|
|
427
|
-
this.ctn.visible && t(this.#n);
|
|
428
|
-
}
|
|
429
|
-
//makeDesignCastChildren(_gdc: IMakeDesignCast) {}
|
|
430
|
-
cvsResize() {
|
|
431
|
-
super.cvsResize();
|
|
432
|
-
}
|
|
433
|
-
showDesignCast() {
|
|
434
|
-
this.#n.visible = !0;
|
|
435
|
-
}
|
|
436
|
-
//showDesignCastChildren() {}
|
|
437
|
-
dump = () => super.dump() + `, "pic":"${this.#t}"`;
|
|
438
|
-
}
|
|
439
|
-
const st = "、。,.)]}〉」』】〕”〟ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶ!?!?‼⁉・ーゝゞヽヾ々", rt = "[({〈「『【〔“〝", ht = "─‥…", ft = st, $t = new RegExp(`[${st}]`), Wt = new RegExp(`[${rt}]`), zt = new RegExp(`[${ht}]`), Lt = $t;
|
|
440
|
-
class Jt {
|
|
441
|
-
#s = st;
|
|
442
|
-
#e = rt;
|
|
443
|
-
#n = ht;
|
|
444
|
-
#r = ft;
|
|
445
|
-
get 行頭禁則() {
|
|
446
|
-
return this.#s;
|
|
447
|
-
}
|
|
448
|
-
get 行末禁則() {
|
|
449
|
-
return this.#e;
|
|
450
|
-
}
|
|
451
|
-
get 分割禁止() {
|
|
452
|
-
return this.#n;
|
|
453
|
-
}
|
|
454
|
-
get ぶら下げ() {
|
|
455
|
-
return this.#r;
|
|
456
|
-
}
|
|
457
|
-
#t = $t;
|
|
458
|
-
#l = Wt;
|
|
459
|
-
#p = zt;
|
|
460
|
-
#u = Lt;
|
|
461
|
-
break_fixed = !1;
|
|
462
|
-
break_fixed_left = 0;
|
|
463
|
-
break_fixed_top = 0;
|
|
464
|
-
bura = !1;
|
|
465
|
-
lay(t) {
|
|
466
|
-
t.kinsoku_sol && (this.#s = t.kinsoku_sol, this.#t = new RegExp(`[${this.#s}]`)), t.kinsoku_eol && (this.#e = t.kinsoku_eol, this.#c(), this.#l = new RegExp(`[${this.#e}]`)), t.kinsoku_dns && (this.#n = t.kinsoku_dns, this.#x(), this.#p = new RegExp(`[${this.#n}]`)), t.kinsoku_bura && (this.#r = t.kinsoku_bura, this.#c(), this.#x(), this.#u = new RegExp(`[${this.#r}]`)), "bura" in t && (this.bura = R(t, "bura", !1)), this.break_fixed = R(t, "break_fixed", this.break_fixed), this.break_fixed_left = w(t, "break_fixed_left", this.break_fixed_left), this.break_fixed_top = w(t, "break_fixed_top", this.break_fixed_top);
|
|
467
|
-
}
|
|
468
|
-
// 禁則の競合(ぶら下げ と 行末禁則 の両方に含まれる文字があってはならない)
|
|
469
|
-
#c() {
|
|
470
|
-
const t = this.#e.length, e = this.#r.length;
|
|
471
|
-
if (t < e)
|
|
472
|
-
for (let s = 0; s < t; ++s) {
|
|
473
|
-
const i = this.#e[s];
|
|
474
|
-
if (this.#r.includes(i)) throw `禁則の競合があります。文字 ${i} がぶら下げ と 行末禁則 の両方に含まれます`;
|
|
475
|
-
}
|
|
476
|
-
else
|
|
477
|
-
for (let s = 0; s < e; ++s) {
|
|
478
|
-
const i = this.#r[s];
|
|
479
|
-
if (this.#e.includes(i)) throw `禁則の競合があります。文字 ${i} がぶら下げ と 行末禁則 の両方に含まれます`;
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
// 禁則の競合(ぶら下げ と 分割禁止 の両方に含まれる文字があってはならない)
|
|
483
|
-
#x() {
|
|
484
|
-
const t = this.#n.length, e = this.#r.length;
|
|
485
|
-
if (t < e)
|
|
486
|
-
for (let s = 0; s < t; ++s) {
|
|
487
|
-
const i = this.#n[s];
|
|
488
|
-
if (this.#r.includes(i)) throw `禁則の競合があります。文字 ${i} がぶら下げ と 分割禁止 の両方に含まれます`;
|
|
489
|
-
}
|
|
490
|
-
else
|
|
491
|
-
for (let s = 0; s < e; ++s) {
|
|
492
|
-
const i = this.#r[s];
|
|
493
|
-
if (this.#n.includes(i)) throw `禁則の競合があります。文字 ${i} がぶら下げ と 分割禁止 の両方に含まれます`;
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
reNew(t) {
|
|
497
|
-
t.#i(this.#s, this.#e, this.#n, this.#r), t.break_fixed = this.break_fixed, t.break_fixed_left = this.break_fixed_left, t.break_fixed_top = this.break_fixed_top, t.bura = this.bura;
|
|
498
|
-
}
|
|
499
|
-
#i(t, e, s, i) {
|
|
500
|
-
this.#s !== t && (this.#s = t, this.#t = new RegExp(`[${t}]`)), this.#e !== e && (this.#e = e, this.#l = new RegExp(`[${e}]`)), this.#n !== s && (this.#n = s, this.#p = new RegExp(`[${s}]`)), this.#r !== i && (this.#r = i, this.#u = new RegExp(`[${i}]`));
|
|
501
|
-
}
|
|
502
|
-
record() {
|
|
503
|
-
const t = {
|
|
504
|
-
break_fixed: this.break_fixed,
|
|
505
|
-
break_fixed_left: this.break_fixed_left,
|
|
506
|
-
break_fixed_top: this.break_fixed_top,
|
|
507
|
-
bura: this.bura
|
|
508
|
-
};
|
|
509
|
-
return this.#s === st && (t.行頭禁則 = this.#s), this.#e === rt && (t.行末禁則 = this.#e), this.#n === ht && (t.分割禁止 = this.#n), this.#r === ft && (t.ぶら下げ = this.#r), t;
|
|
510
|
-
}
|
|
511
|
-
playback(t) {
|
|
512
|
-
t && (this.#i(
|
|
513
|
-
t.行頭禁則 ?? st,
|
|
514
|
-
t.行末禁則 ?? rt,
|
|
515
|
-
t.分割禁止 ?? ht,
|
|
516
|
-
t.ぶら下げ ?? ft
|
|
517
|
-
), this.break_fixed = t.break_fixed, this.break_fixed_left = t.break_fixed_left, this.break_fixed_top = t.break_fixed_top, this.bura = t.bura);
|
|
518
|
-
}
|
|
519
|
-
hyph(t, e, s, i, n) {
|
|
520
|
-
let a, o = 0, r = 2, c = (f) => (c = () => !1, i === f ? (i > 0 && (t.innerHTML = n.replaceAll('class="sn_ch"', 'class="sn_ch sn_ch_in_default"')), !0) : f < 2);
|
|
521
|
-
do {
|
|
522
|
-
if (a = this.#f(t, e), o = a.length, c(o)) break;
|
|
523
|
-
let f = -1 / 0;
|
|
524
|
-
for (; r < o; ++r) {
|
|
525
|
-
const { elm: l, rect: p, ch: d } = a[r];
|
|
526
|
-
if (l.tagName === "RT") continue;
|
|
527
|
-
const h = s ? p.y : p.x;
|
|
528
|
-
if (f <= h || l.previousElementSibling?.tagName === "SPAN" && l.previousElementSibling?.innerHTML.includes("<br>") || l.parentElement?.previousElementSibling?.tagName === "SPAN" && l.parentElement?.previousElementSibling?.innerHTML.includes("<br>")) {
|
|
529
|
-
f = h, this.break_fixed || (this.break_fixed_left = p.x, this.break_fixed_top = p.y);
|
|
530
|
-
continue;
|
|
531
|
-
}
|
|
532
|
-
const u = this.#d(a, r), { elm: x, rect: v, ch: y } = a[u];
|
|
533
|
-
if (!this.break_fixed) {
|
|
534
|
-
this.break_fixed_left = v.x, this.break_fixed_top = v.y;
|
|
535
|
-
const N = globalThis.getComputedStyle(x), O = parseFloat(N.fontSize);
|
|
536
|
-
s ? this.break_fixed_top += O : this.break_fixed_left += O;
|
|
537
|
-
}
|
|
538
|
-
f = -1 / 0;
|
|
539
|
-
const b = r, { cont: E, ins: _ } = this.bura ? this.hyph_alg_bura(a, u, y, r) : this.hyph_alg(a, u, y, r, d);
|
|
540
|
-
if (r = _, E) continue;
|
|
541
|
-
const T = a[r].elm, $ = T.parentElement, k = document.createElement("br");
|
|
542
|
-
if ($.classList.contains("sn_tx")) $.insertBefore(k, T);
|
|
543
|
-
else {
|
|
544
|
-
const N = $.parentElement;
|
|
545
|
-
N.classList.contains("sn_ch") ? N.parentElement.insertBefore(k, N) : N.insertBefore(k, $);
|
|
546
|
-
}
|
|
547
|
-
r += 2, r < b && (r = b), o = -1;
|
|
548
|
-
break;
|
|
549
|
-
}
|
|
550
|
-
} while (o < 0);
|
|
551
|
-
return [a, o];
|
|
552
|
-
}
|
|
553
|
-
// 一つ前の要素を探す(ルビ対応)
|
|
554
|
-
#d(t, e) {
|
|
555
|
-
const s = e - 1, { elm: i } = t[s];
|
|
556
|
-
return i.tagName !== "RT" ? s - (i.style.textCombineUpright === "all" ? Array.from(i.textContent).length - 1 : 0) : s - Array.from(i.textContent).length;
|
|
557
|
-
}
|
|
558
|
-
#f(t, e) {
|
|
559
|
-
const s = [];
|
|
560
|
-
if (t.nodeType !== t.TEXT_NODE) return Array.from(t.childNodes).map((o) => this.#f(o, e)).flat();
|
|
561
|
-
const i = t.ownerDocument.createRange();
|
|
562
|
-
i.selectNodeContents(t);
|
|
563
|
-
let n = 0;
|
|
564
|
-
const a = i.endOffset;
|
|
565
|
-
for (; n < a; ) {
|
|
566
|
-
i.setStart(t, n), i.setEnd(t, ++n);
|
|
567
|
-
const o = i.toString();
|
|
568
|
-
s.push({
|
|
569
|
-
ch: o,
|
|
570
|
-
rect: e(i, o),
|
|
571
|
-
elm: i.startContainer.parentElement
|
|
572
|
-
});
|
|
573
|
-
}
|
|
574
|
-
return i.detach(), s;
|
|
575
|
-
}
|
|
576
|
-
/**
|
|
577
|
-
* 抽象化した禁則処理アルゴリズム
|
|
578
|
-
* @method hyph_alg
|
|
579
|
-
* @param {IChRect[]} a - 文章の抽象化配列
|
|
580
|
-
* @param {number} p_i - 処理要素の一つ前の添字
|
|
581
|
-
* @param {string} p_ch - 処理要素の一つ前の文字
|
|
582
|
-
* @param {number} i - 処理要素の添字
|
|
583
|
-
* @param {string} ch - 処理要素の文字
|
|
584
|
-
* @return {Object} result 戻り値
|
|
585
|
-
* @return {boolean} result.cont - true: 呼び元で改行挿入せず continue
|
|
586
|
-
* @return {number} result.ins - 手前に改行を挿入すべき要素の添字
|
|
587
|
-
*/
|
|
588
|
-
hyph_alg(t, e, s, i, n) {
|
|
589
|
-
let a = i;
|
|
590
|
-
if (!this.#l.test(s)) {
|
|
591
|
-
if (this.#t.test(n))
|
|
592
|
-
for (; (a = this.#d(t, a)) >= 0 && this.#t.test(t[a].ch); )
|
|
593
|
-
;
|
|
594
|
-
else if (!(s === n && this.#p.test(s))) return { cont: !0, ins: a + 1 };
|
|
595
|
-
}
|
|
596
|
-
for (a = e; (a = this.#d(t, a)) >= 0 && this.#l.test(t[a].ch); )
|
|
597
|
-
;
|
|
598
|
-
return { cont: !1, ins: a + 1 };
|
|
599
|
-
}
|
|
600
|
-
/**
|
|
601
|
-
* 抽象化した禁則処理アルゴリズム
|
|
602
|
-
* @method hyph_alg
|
|
603
|
-
* @param {IChRect[]} a - 文章の抽象化配列
|
|
604
|
-
* @param {number} p_i - 処理要素の一つ前の添字
|
|
605
|
-
* @param {string} p_ch - 処理要素の一つ前の文字
|
|
606
|
-
* @param {number} i - 処理要素の添字
|
|
607
|
-
* @return {Object} result 戻り値
|
|
608
|
-
* @return {boolean} result.cont - true: 呼び元で改行挿入せず continue
|
|
609
|
-
* @return {number} result.ins - 手前に改行を挿入すべき要素の添字
|
|
610
|
-
*/
|
|
611
|
-
hyph_alg_bura(t, e, s, i) {
|
|
612
|
-
const n = this.#d(t, e), { ch: a } = t[n];
|
|
613
|
-
if (this.#u.test(a) || this.#t.test(a)) {
|
|
614
|
-
let r = e;
|
|
615
|
-
(this.#u.test(s) || this.#t.test(s)) && ++r;
|
|
616
|
-
const c = this.#d(t, r), { ch: f } = t[c], { ch: l } = t[r];
|
|
617
|
-
if (f === l && this.#p.test(l)) return { cont: !1, ins: c };
|
|
618
|
-
if (!this.#l.test(f)) return { cont: !1, ins: r };
|
|
619
|
-
r = c;
|
|
620
|
-
do
|
|
621
|
-
if (!this.#l.test(t[r].ch)) break;
|
|
622
|
-
while ((r = this.#d(t, r)) >= 0);
|
|
623
|
-
return { cont: !1, ins: r + 1 };
|
|
624
|
-
}
|
|
625
|
-
const o = this.#d(t, n);
|
|
626
|
-
if (i >= 3) {
|
|
627
|
-
const { ch: r } = t[o];
|
|
628
|
-
if (this.#p.test(a) && r === a)
|
|
629
|
-
return { cont: !1, ins: o };
|
|
630
|
-
if (this.#l.test(r)) {
|
|
631
|
-
let c = o;
|
|
632
|
-
for (; (c = this.#d(t, c)) >= 0 && this.#l.test(t[c].ch); )
|
|
633
|
-
;
|
|
634
|
-
return { cont: !1, ins: c + 1 };
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
return { cont: !1, ins: n };
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
function Ut(q, t, e, s, i, n = !0) {
|
|
641
|
-
const a = {
|
|
642
|
-
escape: (y) => y.replaceAll(/([.*+?^${}()|[\]/\\])/g, "\\$1"),
|
|
643
|
-
mimeType: (y) => {
|
|
644
|
-
const b = l(y).toLowerCase();
|
|
645
|
-
return o()[b] || "";
|
|
646
|
-
},
|
|
647
|
-
dataAsUrl: u,
|
|
648
|
-
isDataUrl: p,
|
|
649
|
-
resolveUrl: d,
|
|
650
|
-
getAndEncode: h,
|
|
651
|
-
asArray: (y) => {
|
|
652
|
-
const b = [], E = y.length;
|
|
653
|
-
for (let _ = 0; _ < E; ++_) b.push(y[_]);
|
|
654
|
-
return b;
|
|
655
|
-
}
|
|
656
|
-
};
|
|
657
|
-
function o() {
|
|
658
|
-
const y = "application/font-woff", b = "image/jpeg";
|
|
659
|
-
return {
|
|
660
|
-
woff: y,
|
|
661
|
-
woff2: y,
|
|
662
|
-
ttf: "application/font-truetype",
|
|
663
|
-
eot: "application/vnd.ms-fontobject",
|
|
664
|
-
png: "image/png",
|
|
665
|
-
jpg: b,
|
|
666
|
-
jpeg: b,
|
|
667
|
-
gif: "image/gif",
|
|
668
|
-
tiff: "image/tiff",
|
|
669
|
-
svg: "image/svg+xml"
|
|
670
|
-
};
|
|
671
|
-
}
|
|
672
|
-
const r = x(), c = v();
|
|
673
|
-
function f(y) {
|
|
674
|
-
return c.resolveAll().then((b) => {
|
|
675
|
-
const E = document.createElement("style");
|
|
676
|
-
return y.appendChild(E), E.appendChild(document.createTextNode(b)), y;
|
|
677
|
-
});
|
|
678
|
-
}
|
|
679
|
-
function l(y) {
|
|
680
|
-
return /\.([^./]*?)$/g.exec(y)?.[1] ?? "";
|
|
681
|
-
}
|
|
682
|
-
function p(y) {
|
|
683
|
-
return y.search(/^(data:)/) !== -1;
|
|
684
|
-
}
|
|
685
|
-
function d(y, b) {
|
|
686
|
-
const E = document.implementation.createHTMLDocument(), _ = E.createElement("base");
|
|
687
|
-
E.head.appendChild(_);
|
|
688
|
-
const T = E.createElement("a");
|
|
689
|
-
return E.body.appendChild(T), _.href = b, T.href = y, T.href;
|
|
690
|
-
}
|
|
691
|
-
function h(y) {
|
|
692
|
-
return new Promise(function(E) {
|
|
693
|
-
const _ = new XMLHttpRequest();
|
|
694
|
-
_.onreadystatechange = T, _.ontimeout = $, _.responseType = "blob", _.timeout = 3e4, _.open("GET", y, !0), _.send();
|
|
695
|
-
function T() {
|
|
696
|
-
if (_.readyState !== 4) return;
|
|
697
|
-
if (_.status !== 200) {
|
|
698
|
-
k("cannot fetch resource: " + y + ", status: " + _.status);
|
|
699
|
-
return;
|
|
700
|
-
}
|
|
701
|
-
const N = new FileReader();
|
|
702
|
-
N.onloadend = function() {
|
|
703
|
-
const O = N.result.toString().split(/,/)[1];
|
|
704
|
-
E(O);
|
|
705
|
-
}, N.readAsDataURL(_.response);
|
|
706
|
-
}
|
|
707
|
-
function $() {
|
|
708
|
-
k("timeout of 30000ms occured while fetching resource: " + y);
|
|
709
|
-
}
|
|
710
|
-
function k(N) {
|
|
711
|
-
console.error(N), E("");
|
|
712
|
-
}
|
|
713
|
-
});
|
|
714
|
-
}
|
|
715
|
-
function u(y, b) {
|
|
716
|
-
return "data:" + b + ";base64," + y;
|
|
717
|
-
}
|
|
718
|
-
function x() {
|
|
719
|
-
const y = /url\(['"]?([^'"]+?)['"]?\)/g;
|
|
720
|
-
return {
|
|
721
|
-
inlineAll: T,
|
|
722
|
-
shouldProcess: b
|
|
723
|
-
};
|
|
724
|
-
function b($) {
|
|
725
|
-
return $.search(y) !== -1;
|
|
726
|
-
}
|
|
727
|
-
function E($) {
|
|
728
|
-
const k = [];
|
|
729
|
-
let N;
|
|
730
|
-
for (; N = y.exec($); )
|
|
731
|
-
k.push(N[1]);
|
|
732
|
-
return k.filter(function(O) {
|
|
733
|
-
return !a.isDataUrl(O);
|
|
734
|
-
});
|
|
735
|
-
}
|
|
736
|
-
function _($, k, N, O) {
|
|
737
|
-
return Promise.resolve(k).then((I) => N ? a.resolveUrl(I, N) : I).then(O || a.getAndEncode).then((I) => a.dataAsUrl(I, a.mimeType(k))).then((I) => $.replace(M(k), "$1" + I + "$3"));
|
|
738
|
-
function M(I) {
|
|
739
|
-
return new RegExp(`(url\\(['"]?)(` + a.escape(I) + `)(['"]?\\))`, "g");
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
function T($, k, N) {
|
|
743
|
-
if (O()) return Promise.resolve($);
|
|
744
|
-
return Promise.resolve($).then(E).then((M) => {
|
|
745
|
-
let I = Promise.resolve($);
|
|
746
|
-
for (const K of M) I = I.then((lt) => _(lt, K, k, N));
|
|
747
|
-
return I;
|
|
748
|
-
});
|
|
749
|
-
function O() {
|
|
750
|
-
return !b($);
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
function v() {
|
|
755
|
-
return {
|
|
756
|
-
resolveAll: y,
|
|
757
|
-
impl: { readAll: b }
|
|
758
|
-
};
|
|
759
|
-
function y() {
|
|
760
|
-
return b().then((E) => Promise.allSettled(
|
|
761
|
-
E.map((_) => _.resolve())
|
|
762
|
-
)).then((E) => E.join(`
|
|
763
|
-
`));
|
|
764
|
-
}
|
|
765
|
-
function b() {
|
|
766
|
-
return Promise.resolve(a.asArray(document.styleSheets)).then(_).then(E).then(($) => $.map(T));
|
|
767
|
-
function E($) {
|
|
768
|
-
return $.filter((k) => k.type === CSSRule.FONT_FACE_RULE).filter((k) => r.shouldProcess(k.style.getPropertyValue("src")));
|
|
769
|
-
}
|
|
770
|
-
function _($) {
|
|
771
|
-
const k = [];
|
|
772
|
-
for (const N of $)
|
|
773
|
-
try {
|
|
774
|
-
if (N.href) continue;
|
|
775
|
-
a.asArray(N.cssRules || []).forEach(k.push.bind(k));
|
|
776
|
-
} catch (O) {
|
|
777
|
-
console.error("Error while reading CSS rules from " + N.href, String(O));
|
|
778
|
-
}
|
|
779
|
-
return k;
|
|
780
|
-
}
|
|
781
|
-
function T($) {
|
|
782
|
-
return {
|
|
783
|
-
resolve: function() {
|
|
784
|
-
const N = ($.parentStyleSheet || {}).href;
|
|
785
|
-
return r.inlineAll($.cssText, N);
|
|
786
|
-
},
|
|
787
|
-
src() {
|
|
788
|
-
return $.style.getPropertyValue("src");
|
|
789
|
-
}
|
|
790
|
-
};
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
Promise.resolve(t).then((y) => {
|
|
795
|
-
const b = y.cloneNode(!0);
|
|
796
|
-
return b.style.padding = "0px", b.style.paddingRight = s + "px", b.style.paddingTop = i + "px", b.style.left = "0px", b.style.top = "0px", b.style.width = e.$width - e.pad_left - e.pad_right + "px", b.style.height = e.$height - e.pad_top - e.pad_bottom + "px", t.hidden = n, b;
|
|
797
|
-
}).then(f).then((y) => {
|
|
798
|
-
y.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
|
|
799
|
-
const b = new Image();
|
|
800
|
-
return b.src = `data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="${e.$width}px" height="${e.$height}px"><foreignObject x="0" y="0" width="100%" height="100%">${new XMLSerializer().serializeToString(y).replaceAll("#", "%23").replaceAll(`
|
|
801
|
-
`, "%0A")}</foreignObject></svg>`, new Promise((E) => {
|
|
802
|
-
b.onload = () => E(b);
|
|
803
|
-
});
|
|
804
|
-
}).then((y) => new Promise((b) => setTimeout(() => b(y), 100))).then((y) => {
|
|
805
|
-
const b = document.createElement("canvas");
|
|
806
|
-
b.width = e.$width, b.height = e.$height, b.getContext("2d").drawImage(y, 0, 0), q(J.from(b));
|
|
807
|
-
}).catch((y) => it.myTrace(`goTxt() = ${y}`));
|
|
808
|
-
}
|
|
809
|
-
class g extends W {
|
|
810
|
-
constructor(t, e, s) {
|
|
811
|
-
super(), this.ctn = t, this.canFocus = e, this.sys = s, this.#t.classList.add("sn_tx"), this.#t.style.position = "absolute", g.#e.view.parentElement.appendChild(this.#t), this.addChild(this.#l), this.addChild(this.#p), this.#p.name = "grpDbgMasume";
|
|
812
|
-
const i = S.debugLog ? ({ ch: n, rect: { x: a, y: o, width: r, height: c } }) => console.log(`🍌 masume ch:${n} x:${a} y:${o} w:${r} h:${c}`) : () => {
|
|
813
|
-
};
|
|
814
|
-
this.#x = g.#s.oCfg.debug.masume ? (n) => {
|
|
815
|
-
i(n);
|
|
816
|
-
const { x: a, y: o, width: r, height: c } = n.rect;
|
|
817
|
-
this.#p.beginFill(6737151, 0.5).lineStyle(2, 16724736, 1).drawRect(a, o, r, c).endFill();
|
|
818
|
-
} : () => {
|
|
819
|
-
}, this.noticeCompTxt = s.isApp && g.#s.oCfg.debug.dumpHtm ? () => {
|
|
820
|
-
F.notifyEndProc(wt);
|
|
821
|
-
const n = this.#t.innerHTML;
|
|
822
|
-
if (n === "") return;
|
|
823
|
-
const { fn: a, ln: o } = g.#r.nowScrFnLn(), r = `dumpHtm ${t.name.slice(0, -7).replaceAll(":", "=")}(fn=${a} line=${String(o)})`;
|
|
824
|
-
s.outputFile(
|
|
825
|
-
s.path_downloads + r + ".htm",
|
|
826
|
-
`<!doctype html><html><head><meta charset=utf-8><title>${r}</title>
|
|
827
|
-
<h1>${r}</h1>${n.replaceAll(/ class="sn_ch"|animation-delay: \d+ms; ?| data-add="{"ch_in_style":"default", "ch_out_style":"default"}"/g, "").replaceAll(' style=""', "").replaceAll(/(<\/?ruby>)/g, `
|
|
828
|
-
$1
|
|
829
|
-
`).replaceAll(/<(br|\/span)>/g, `<$1>
|
|
830
|
-
`)}`
|
|
831
|
-
);
|
|
832
|
-
} : () => F.notifyEndProc(wt);
|
|
833
|
-
}
|
|
834
|
-
static #s;
|
|
835
|
-
static #e;
|
|
836
|
-
static init(t, e) {
|
|
837
|
-
g.#s = t, g.#e = e;
|
|
838
|
-
}
|
|
839
|
-
static #n;
|
|
840
|
-
static #r;
|
|
841
|
-
static setEvtMng(t, e) {
|
|
842
|
-
g.#n = t, g.#r = e;
|
|
843
|
-
}
|
|
844
|
-
static destroy() {
|
|
845
|
-
g.#F = /* @__PURE__ */ Object.create(null), g.#j = /* @__PURE__ */ Object.create(null), g.delBreak();
|
|
846
|
-
}
|
|
847
|
-
#t = document.createElement("span");
|
|
848
|
-
// サンプリング元
|
|
849
|
-
#l = new W();
|
|
850
|
-
// サンプリング先
|
|
851
|
-
#p = new U();
|
|
852
|
-
static #u = {
|
|
853
|
-
"background-color": 0,
|
|
854
|
-
"border-bottom-width": 0,
|
|
855
|
-
"border-left-width": 0,
|
|
856
|
-
"border-right-width": 0,
|
|
857
|
-
"border-top-width": 0,
|
|
858
|
-
"margin-bottom": 0,
|
|
859
|
-
"margin-left": 0,
|
|
860
|
-
"margin-right": 0,
|
|
861
|
-
"margin-top": 0
|
|
862
|
-
};
|
|
863
|
-
#c = new Jt();
|
|
864
|
-
noticeCompTxt = () => {
|
|
865
|
-
};
|
|
866
|
-
#x;
|
|
867
|
-
// readonly #idc :TxtLayDesignCast;
|
|
868
|
-
// readonly #idcCh = new TxtLayPadDesignCast(this);
|
|
869
|
-
#i = {
|
|
870
|
-
fontsize: 24,
|
|
871
|
-
$width: 0,
|
|
872
|
-
// レイヤサイズであり、背景色(画像)サイズ
|
|
873
|
-
$height: 0,
|
|
874
|
-
pad_left: 0,
|
|
875
|
-
// paddingLeft(レイヤサイズの内側のスペーサー)
|
|
876
|
-
pad_right: 0,
|
|
877
|
-
// paddingRight
|
|
878
|
-
pad_top: 0,
|
|
879
|
-
// paddingTop
|
|
880
|
-
pad_bottom: 0
|
|
881
|
-
// paddingBottom
|
|
882
|
-
};
|
|
883
|
-
lay(t) {
|
|
884
|
-
const e = this.#t.style;
|
|
885
|
-
if ("style" in t)
|
|
886
|
-
if (t.style) {
|
|
887
|
-
const s = document.createElement("span");
|
|
888
|
-
s.style.cssText = t.style;
|
|
889
|
-
const i = s.style.length;
|
|
890
|
-
for (let n = 0; n < i; ++n) {
|
|
891
|
-
const a = s.style[n];
|
|
892
|
-
if (a in g.#u) {
|
|
893
|
-
it.myTrace(`${String(a)}は指定できません`, "W");
|
|
894
|
-
continue;
|
|
895
|
-
}
|
|
896
|
-
e[a] = s.style[a];
|
|
897
|
-
}
|
|
898
|
-
!s.style.opacity && "alpha" in t && (e.opacity = String(this.ctn.alpha));
|
|
899
|
-
} else this.#t.style.cssText = "";
|
|
900
|
-
else "alpha" in t && (e.opacity = String(this.ctn.alpha));
|
|
901
|
-
if ("width" in t && (e.width = String(t.width ?? "0") + "px"), "height" in t && (e.height = String(t.height ?? "0") + "px"), "pl" in t && (e.paddingLeft = String(t.pl ?? "0") + "px"), "pr" in t && (e.paddingRight = String(t.pr ?? "0") + "px"), "pt" in t && (e.paddingTop = String(t.pt ?? "0") + "px"), "pb" in t && (e.paddingBottom = String(t.pb ?? "0") + "px"), this.#c.lay(t), this.#f(), this.#y = this.ctn.position.x, e.transformOrigin = `${this.ctn.pivot.x}px ${this.ctn.pivot.y}px`, this.cvsResize(), e.display = this.ctn.visible ? "inline" : "none", ":redraw" in t && this.#w > 0) {
|
|
902
|
-
const s = [
|
|
903
|
-
this.#t.innerHTML.replaceAll(/(animation-delay: )\d+ms/g, "$10ms"),
|
|
904
|
-
`<span class='sn_ch' data-add='{"ch_in_style":"default"}'> </span>`
|
|
905
|
-
];
|
|
906
|
-
this.#_(), this.goTxt(s, !0);
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
// oxlint-disable-next-line no-unused-private-class-members
|
|
910
|
-
#d = 0;
|
|
911
|
-
// 「g」などで下が欠ける問題対策
|
|
912
|
-
#f() {
|
|
913
|
-
const t = this.#t.style, e = parseFloat(t.fontSize || "0");
|
|
914
|
-
this.#i.fontsize = e, this.#i.pad_left = parseFloat(t.paddingLeft || "0"), this.#i.pad_right = parseFloat(t.paddingRight || "0"), this.#i.pad_top = parseFloat(t.paddingTop || "0"), this.#i.pad_bottom = parseFloat(t.paddingBottom || "0"), this.#i.$width = parseFloat(t.width || "0"), this.#i.$height = parseFloat(t.height || "0"), this.position.set(this.#i.pad_left, this.#i.pad_top), this.#a = t.writingMode === "vertical-rl", this.#g = 0, this.#o = 0;
|
|
915
|
-
const s = t.lineHeight ?? "0";
|
|
916
|
-
this.#d = this.#a ? 0 : (s.endsWith("px") ? parseFloat(s) : e * parseFloat(s) - e) / 2;
|
|
917
|
-
}
|
|
918
|
-
cvsResize() {
|
|
919
|
-
const t = this.#t.style, e = this.sys.cvsScale;
|
|
920
|
-
t.left = `${this.sys.ofsLeft4elm + this.#y * e}px`, t.top = `${this.sys.ofsTop4elm + this.ctn.position.y * e}px`, t.transform = `rotate(${this.ctn.angle}deg) scale(${this.ctn.scale.x * e}, ${this.ctn.scale.y * e})`;
|
|
921
|
-
}
|
|
922
|
-
#y = 0;
|
|
923
|
-
#a = !1;
|
|
924
|
-
get tategaki() {
|
|
925
|
-
return this.#a;
|
|
926
|
-
}
|
|
927
|
-
#g = 0;
|
|
928
|
-
#o = 0;
|
|
929
|
-
get infTL() {
|
|
930
|
-
return this.#i;
|
|
931
|
-
}
|
|
932
|
-
get getWidth() {
|
|
933
|
-
return this.#i.$width;
|
|
934
|
-
}
|
|
935
|
-
get getHeight() {
|
|
936
|
-
return this.#i.$height;
|
|
937
|
-
}
|
|
938
|
-
setMySize(t, e) {
|
|
939
|
-
this.#i.$width = t, this.#i.$height = e, this.#t.style.width = String(this.#i.$width) + "px", this.#t.style.height = String(this.#i.$height) + "px";
|
|
940
|
-
}
|
|
941
|
-
#I = [];
|
|
942
|
-
// FIFO実行バッファ
|
|
943
|
-
goTxt(t, e) {
|
|
944
|
-
const s = () => this.#h(t, e);
|
|
945
|
-
this.#I.push(s) === 1 && s();
|
|
946
|
-
}
|
|
947
|
-
#k = [];
|
|
948
|
-
#w = 0;
|
|
949
|
-
static #v = "<span class='sn_ch sn_ch_last'> </span>";
|
|
950
|
-
#h(t, e) {
|
|
951
|
-
g.#H.visible = !1;
|
|
952
|
-
let s = this.#k.length, i = "";
|
|
953
|
-
if (s === 0) {
|
|
954
|
-
if (g.#s.oCfg.debug.masume && (S.debugLog && console.log(`🍌 masume ${// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
955
|
-
this.name} v:${this.visible} l:${this.x} t:${this.y} a:${this.alpha} pl:${this.#i.pad_left} pr:${this.#i.pad_right} pt:${this.#i.pad_top} pb:${this.#i.pad_bottom} w:${this.#i.$width} h:${this.#i.$height}`), this.#p.clear().beginFill(3407616, 0.2).lineStyle(1, 3407616, 1).drawRect(-this.#i.pad_left, -this.#i.pad_top, this.#i.$width, this.#i.$height).endFill().beginFill(13311, 0.2).lineStyle(2, 13311, 1).drawRect(
|
|
956
|
-
0,
|
|
957
|
-
0,
|
|
958
|
-
this.#i.$width - this.#i.pad_left - this.#i.pad_right,
|
|
959
|
-
this.#i.$height - this.#i.pad_top - this.#i.pad_bottom
|
|
960
|
-
).endFill()), this.#t.innerHTML = [...t].join("").replaceAll(/[\n\t]/g, "") + g.#v, !this.#c.break_fixed) {
|
|
961
|
-
const u = globalThis.getComputedStyle(this.#t), x = parseFloat(u.fontSize);
|
|
962
|
-
this.#a ? (this.#c.break_fixed_left = (this.#i.$width - this.#i.pad_left - this.#i.pad_right - x * 1.5) * this.sys.cvsScale, this.#c.break_fixed_top = 0) : (this.#c.break_fixed_left = 0, this.#c.break_fixed_top = x / 2 * this.sys.cvsScale);
|
|
963
|
-
}
|
|
964
|
-
} else
|
|
965
|
-
i = this.#t.innerHTML, --s, this.#t.getElementsByClassName("sn_ch_last").item(0)?.remove(), this.#t.querySelectorAll(":scope > br").forEach((u) => u.remove()), this.#t.insertAdjacentHTML(
|
|
966
|
-
"beforeend",
|
|
967
|
-
t.slice(this.#w).join("").replaceAll(/[\n\t]/g, "") + g.#v
|
|
968
|
-
// 末尾改行削除挙動対策
|
|
969
|
-
);
|
|
970
|
-
this.#t.querySelectorAll(".sn_ch:has(> ruby)").forEach((u) => {
|
|
971
|
-
u.style.background = "";
|
|
972
|
-
}), this.#w = t.length;
|
|
973
|
-
const n = this.sys.cvsScale, a = this.#t.getBoundingClientRect(), o = a.left + this.#i.pad_left, r = a.top + this.#i.pad_top;
|
|
974
|
-
let c;
|
|
975
|
-
if (n === 1) c = (u, x) => {
|
|
976
|
-
const v = u.getBoundingClientRect();
|
|
977
|
-
return new Y(
|
|
978
|
-
v.left - o,
|
|
979
|
-
v.top - r,
|
|
980
|
-
v.width,
|
|
981
|
-
v.height + ("gjqy".includes(x) ? this.#d : 0)
|
|
982
|
-
);
|
|
983
|
-
};
|
|
984
|
-
else {
|
|
985
|
-
const u = this.sys.ofsPadLeft_Dom2PIXI + a.left * (1 - n), x = this.sys.ofsPadTop_Dom2PIXI + a.top * (1 - n);
|
|
986
|
-
c = (v, y) => {
|
|
987
|
-
const b = v.getBoundingClientRect();
|
|
988
|
-
return new Y(
|
|
989
|
-
(b.left - u) / n - o,
|
|
990
|
-
(b.top - x) / n - r,
|
|
991
|
-
b.width / n,
|
|
992
|
-
(b.height + ("gjqy".includes(y) ? this.#d : 0)) / n
|
|
993
|
-
);
|
|
994
|
-
};
|
|
995
|
-
}
|
|
996
|
-
const [f, l] = this.#c.hyph(this.#t, c, this.#a, s, i);
|
|
997
|
-
this.#k = f;
|
|
998
|
-
const p = B.ease(this.#$);
|
|
999
|
-
for (let u = s; u < l; ++u) {
|
|
1000
|
-
const x = this.#k[u], { elm: { dataset: v, parentElement: y }, rect: b } = x, E = JSON.parse(v.arg ?? '{"delay": 0}'), _ = JSON.parse(v.add ?? "{}"), T = g.#F[_.ch_in_style];
|
|
1001
|
-
if (this.#x(x), v.cmd === "grp") {
|
|
1002
|
-
const $ = new W();
|
|
1003
|
-
this.#l.addChild($), new m(E.pic, $, (k) => {
|
|
1004
|
-
this.#E($, E, _, b, p, T ?? {}), $.parent || $.removeChild(k);
|
|
1005
|
-
});
|
|
1006
|
-
}
|
|
1007
|
-
if (v.lnk) {
|
|
1008
|
-
const $ = y.closest("[data-arg]"), k = JSON.parse($.dataset.arg ?? "{}");
|
|
1009
|
-
k.key = `lnk=[${String(u)}] ` + this.name;
|
|
1010
|
-
const N = new j();
|
|
1011
|
-
this.#E(N, k, _, b, p, T ?? {});
|
|
1012
|
-
const O = k.style ?? "", M = O + (k.style_hover ?? ""), I = O + (k.style_clicked ?? ""), K = k.r_style ?? "", lt = K + (k.r_style_hover ?? ""), Ct = K + (k.r_style_clicked ?? ""), yt = Array.from($.getElementsByTagName("rt"));
|
|
1013
|
-
for (const at of yt) at.dataset.st_r_bk = at.style.cssText;
|
|
1014
|
-
const Et = $.style.cssText, nt = (at, Nt) => {
|
|
1015
|
-
$.style.cssText = Et + at;
|
|
1016
|
-
for (const mt of yt) mt.style.cssText = mt.dataset.st_r_bk + Nt;
|
|
1017
|
-
};
|
|
1018
|
-
R(k, "enabled", !0) ? g.#n.button(
|
|
1019
|
-
k,
|
|
1020
|
-
N,
|
|
1021
|
-
() => nt(O, K),
|
|
1022
|
-
() => this.canFocus() ? (nt(M, lt), !0) : !1,
|
|
1023
|
-
() => nt(I, Ct)
|
|
1024
|
-
) : nt(
|
|
1025
|
-
O + (k.style_disable ?? "color: gray;"),
|
|
1026
|
-
K + (k.r_style_disable ?? "color: gray;")
|
|
1027
|
-
), this.#l.addChild(N);
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
const d = Array.from(this.#t.getElementsByClassName("sn_ch_yet"));
|
|
1031
|
-
this.#b = () => {
|
|
1032
|
-
this.#b = () => !1;
|
|
1033
|
-
for (const x of d) x.className = "sn_ch";
|
|
1034
|
-
g.#H.position.set(
|
|
1035
|
-
this.#c.break_fixed_left,
|
|
1036
|
-
this.#c.break_fixed_top
|
|
1037
|
-
), g.#H.visible = !0, this.noticeCompTxt();
|
|
1038
|
-
const u = this.#I.shift();
|
|
1039
|
-
return this.#I.length > 0 && u(), !0;
|
|
1040
|
-
};
|
|
1041
|
-
for (const u of d) u.className = u.className.replace("sn_ch_yet sn", "go");
|
|
1042
|
-
s > 0 && ++s;
|
|
1043
|
-
let h;
|
|
1044
|
-
for (let u = l - 2; u >= 0; --u) {
|
|
1045
|
-
const { elm: x } = this.#k[u];
|
|
1046
|
-
if (x.tagName === "SPAN") {
|
|
1047
|
-
h = x.parentElement?.tagName === "RUBY" ? x.parentElement.parentElement ?? x : x;
|
|
1048
|
-
break;
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
if (!h || e || s === l) {
|
|
1052
|
-
this.#b();
|
|
1053
|
-
return;
|
|
1054
|
-
}
|
|
1055
|
-
h.addEventListener("animationend", () => this.#b(), { once: !0 });
|
|
1056
|
-
}
|
|
1057
|
-
#b = () => !1;
|
|
1058
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1059
|
-
#E(t, e, s, i, n, a) {
|
|
1060
|
-
t.alpha = 0, e.x && (i.x = e.x.startsWith("=") ? i.x + parseInt(e.x.slice(1)) : parseInt(e.x)), e.y && (i.y = e.y.startsWith("=") ? i.y + parseInt(e.y.slice(1)) : parseInt(e.y)), e.width && (i.width = parseInt(e.width)), e.height && (i.height = parseInt(e.height)), e.wait && (a.wait = e.wait), t.width = i.width, t.height = i.height, a.x ? t.position.set(
|
|
1061
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
1062
|
-
a.x.startsWith("=") ? i.x + t.width * a.nx : a.nx,
|
|
1063
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
1064
|
-
a.y.startsWith("=") ? i.y + t.height * a.ny : a.ny
|
|
1065
|
-
) : t.position.set(i.x, i.y);
|
|
1066
|
-
const o = {
|
|
1067
|
-
sp: t,
|
|
1068
|
-
tw: new Dt(t).to({ alpha: 1, x: i.x, y: i.y, width: i.width, height: i.height, angle: 0 }, a.wait ?? 0).easing(n).delay((s.wait ?? 0) + (e.delay ?? 0)).onComplete(() => {
|
|
1069
|
-
o.tw = void 0;
|
|
1070
|
-
}).start()
|
|
1071
|
-
};
|
|
1072
|
-
this.#V.push(o);
|
|
1073
|
-
}
|
|
1074
|
-
#V = [];
|
|
1075
|
-
skipChIn() {
|
|
1076
|
-
let t = this.#b();
|
|
1077
|
-
for (const e of this.#V)
|
|
1078
|
-
e.tw && (e.tw.stop().end(), t = !0);
|
|
1079
|
-
return this.#V = [], t;
|
|
1080
|
-
}
|
|
1081
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
1082
|
-
static #F = /* @__PURE__ */ Object.create(null);
|
|
1083
|
-
static #z = /[{\s.,*{]/;
|
|
1084
|
-
// https://regex101.com/r/APC91I/1
|
|
1085
|
-
static initChStyle() {
|
|
1086
|
-
g.#F = /* @__PURE__ */ Object.create(null), g.#j = /* @__PURE__ */ Object.create(null);
|
|
1087
|
-
}
|
|
1088
|
-
static getChInStyle(t) {
|
|
1089
|
-
return g.#F[t];
|
|
1090
|
-
}
|
|
1091
|
-
static ch_in_style(t) {
|
|
1092
|
-
const { name: e } = t;
|
|
1093
|
-
if (!e) throw "nameは必須です";
|
|
1094
|
-
if (g.#z.test(e)) throw `name【${e}】に使えない文字が含まれます`;
|
|
1095
|
-
if (e in g.#F) throw `name【${e}】はすでにあります`;
|
|
1096
|
-
const s = String(t.x ?? "=0"), i = String(t.y ?? "=0");
|
|
1097
|
-
return g.#F[e] = {
|
|
1098
|
-
wait: w(t, "wait", 500),
|
|
1099
|
-
// アニメ・FI時間
|
|
1100
|
-
alpha: w(t, "alpha", 0),
|
|
1101
|
-
x: s,
|
|
1102
|
-
// 初期x値
|
|
1103
|
-
y: i,
|
|
1104
|
-
// [tsy]と同様に絶対・相対指定可能
|
|
1105
|
-
// {x:500} X位置を500に
|
|
1106
|
-
// {x:'=500'} 現在のX位置に+500加算した位置
|
|
1107
|
-
// {x:'=-500'} 現在のX位置に-500加算した位置
|
|
1108
|
-
// {x:'250,500'} +250から+500までの間でランダムな値をX位置に
|
|
1109
|
-
// {x:'=250,500'} +250から+500までの間でランダムな値を現在のX位置に加算
|
|
1110
|
-
nx: parseFloat(s.at(0) === "=" ? s.slice(1) : s),
|
|
1111
|
-
ny: parseFloat(i.at(0) === "=" ? i.slice(1) : i),
|
|
1112
|
-
scale_x: w(t, "scale_x", 1),
|
|
1113
|
-
scale_y: w(t, "scale_y", 1),
|
|
1114
|
-
rotate: w(t, "rotate", 0),
|
|
1115
|
-
join: R(t, "join", !0),
|
|
1116
|
-
// 文字を順番に出すか(true)同時か(false)
|
|
1117
|
-
ease: t.ease ?? "ease-out"
|
|
1118
|
-
};
|
|
1119
|
-
}
|
|
1120
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
1121
|
-
static #j = /* @__PURE__ */ Object.create(null);
|
|
1122
|
-
static getChOutStyle(t) {
|
|
1123
|
-
return g.#j[t];
|
|
1124
|
-
}
|
|
1125
|
-
static ch_out_style(t) {
|
|
1126
|
-
const { name: e } = t;
|
|
1127
|
-
if (!e) throw "nameは必須です";
|
|
1128
|
-
if (g.#z.test(e)) throw `name【${e}】に使えない文字が含まれます`;
|
|
1129
|
-
if (e in g.#j) throw `name【${e}】はすでにあります`;
|
|
1130
|
-
const s = String(t.x ?? "=0"), i = String(t.y ?? "=0");
|
|
1131
|
-
return g.#j[e] = {
|
|
1132
|
-
wait: w(t, "wait", 500),
|
|
1133
|
-
// アニメ・FI時間
|
|
1134
|
-
alpha: w(t, "alpha", 0),
|
|
1135
|
-
x: s,
|
|
1136
|
-
// 初期x値
|
|
1137
|
-
y: i,
|
|
1138
|
-
// [tsy]と同様に絶対・相対指定可能
|
|
1139
|
-
// {x:500} X位置を500に
|
|
1140
|
-
// {x:'=500'} 現在のX位置に+500加算した位置
|
|
1141
|
-
// {x:'=-500'} 現在のX位置に-500加算した位置
|
|
1142
|
-
// {x:'250,500'} +250から+500までの間でランダムな値をX位置に
|
|
1143
|
-
// {x:'=250,500'} +250から+500までの間でランダムな値を現在のX位置に加算
|
|
1144
|
-
nx: parseFloat(s.at(0) === "=" ? s.slice(1) : s),
|
|
1145
|
-
ny: parseFloat(i.at(0) === "=" ? i.slice(1) : i),
|
|
1146
|
-
scale_x: w(t, "scale_x", 1),
|
|
1147
|
-
scale_y: w(t, "scale_y", 1),
|
|
1148
|
-
rotate: w(t, "rotate", 0),
|
|
1149
|
-
join: R(t, "join", !1),
|
|
1150
|
-
// 文字を順番に出すか(true)同時か(false)
|
|
1151
|
-
ease: t.ease ?? "ease-out"
|
|
1152
|
-
};
|
|
1153
|
-
}
|
|
1154
|
-
static #H = new W();
|
|
1155
|
-
static #O = new m();
|
|
1156
|
-
dispBreak(t) {
|
|
1157
|
-
g.delBreak();
|
|
1158
|
-
const e = g.#H;
|
|
1159
|
-
e.visible = !1, this.addChild(e), g.#O.destroy(), g.#O = new m(t.pic, e, (s) => {
|
|
1160
|
-
e.parent ? (s.x = w(t, "x", 0), s.y = w(t, "y", 0), s.width = w(t, "width", this.#i.fontsize), s.height = w(t, "height", this.#i.fontsize)) : e.removeChild(s);
|
|
1161
|
-
});
|
|
1162
|
-
}
|
|
1163
|
-
static delBreak() {
|
|
1164
|
-
const t = g.#H;
|
|
1165
|
-
t.parent?.removeChild(t), g.#O.destroy();
|
|
1166
|
-
}
|
|
1167
|
-
#$ = "Quadratic.Out";
|
|
1168
|
-
#N = "Quadratic.Out";
|
|
1169
|
-
#_() {
|
|
1170
|
-
this.#p.clear(), this.#k = [], this.#w = 0, this.#I = [], this.skipChIn();
|
|
1171
|
-
const t = this.#t.cloneNode(!0);
|
|
1172
|
-
t.textContent = "";
|
|
1173
|
-
const e = this.#t, s = Array.from(e.getElementsByClassName("sn_ch"));
|
|
1174
|
-
e.parentElement.insertBefore(t, e);
|
|
1175
|
-
let i = 0;
|
|
1176
|
-
s.forEach((a) => {
|
|
1177
|
-
const o = JSON.parse(
|
|
1178
|
-
a.dataset.add ?? // 通常文字
|
|
1179
|
-
a.children[0]?.getAttribute("data-add") ?? // ルビ
|
|
1180
|
-
a.children[0]?.children[0]?.getAttribute("data-add") ?? "{}"
|
|
1181
|
-
// 縦中横
|
|
1182
|
-
);
|
|
1183
|
-
if (!o.ch_out_style) return;
|
|
1184
|
-
const r = g.#j[o.ch_out_style];
|
|
1185
|
-
if (r) {
|
|
1186
|
-
if (r.wait === 0) {
|
|
1187
|
-
a.style.display = "none";
|
|
1188
|
-
return;
|
|
1189
|
-
}
|
|
1190
|
-
i += r.wait, r.join || (a.style.animationDelay = "0ms"), a.classList.add(`go_ch_out_${String(o.ch_out_style)}`);
|
|
1191
|
-
}
|
|
1192
|
-
});
|
|
1193
|
-
const n = () => {
|
|
1194
|
-
e.parentElement.removeChild(e);
|
|
1195
|
-
for (const a of this.#l.removeChildren())
|
|
1196
|
-
a instanceof W && g.#n.unButton(a), a.destroy();
|
|
1197
|
-
};
|
|
1198
|
-
i === 0 ? (this.#t.textContent = "", n()) : e.lastElementChild?.addEventListener("animationend", n, { once: !0 }), this.#t = t;
|
|
1199
|
-
}
|
|
1200
|
-
reNew() {
|
|
1201
|
-
this.#_();
|
|
1202
|
-
const t = new g(this.ctn, () => this.canFocus(), this.sys);
|
|
1203
|
-
return t.#i = this.#i, t.#t.style.cssText = this.#t.style.cssText, t.#y = this.#y, t.name = this.name, t.#f(), t.#W = this.#W, t.#$ = this.#$, t.#N = this.#N, this.#c.reNew(t.#c), this.destroy(), t;
|
|
1204
|
-
}
|
|
1205
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1206
|
-
#W = void 0;
|
|
1207
|
-
// 文字にかけるフィルター
|
|
1208
|
-
record() {
|
|
1209
|
-
return {
|
|
1210
|
-
infTL: this.#i,
|
|
1211
|
-
cssText: this.#t.style.cssText,
|
|
1212
|
-
left: this.#y,
|
|
1213
|
-
// idc_hArg : this.#idc.gethArg(),
|
|
1214
|
-
ch_filter: this.#W,
|
|
1215
|
-
fi_easing: this.#$,
|
|
1216
|
-
fo_easing: this.#N,
|
|
1217
|
-
hyph: this.#c.record()
|
|
1218
|
-
};
|
|
1219
|
-
}
|
|
1220
|
-
playback(t) {
|
|
1221
|
-
this.#i = t.infTL, this.position.set(this.#i.pad_left, this.#i.pad_top), this.#t.style.cssText = t.cssText, this.#y = t.left, this.#f(), this.#W = t.ch_filter, this.#$ = t.fi_easing, this.#N = t.fo_easing, this.#c.playback(t.hyph);
|
|
1222
|
-
}
|
|
1223
|
-
get cssText() {
|
|
1224
|
-
return this.#t.style.cssText;
|
|
1225
|
-
}
|
|
1226
|
-
set cssText(t) {
|
|
1227
|
-
this.#t.style.cssText = t;
|
|
1228
|
-
}
|
|
1229
|
-
#m = void 0;
|
|
1230
|
-
snapshot(t, e) {
|
|
1231
|
-
Ut((s) => {
|
|
1232
|
-
this.#m = j.from(s), this.#a && (this.#m.x += S.stageW - (this.#y + this.#i.$width)), this.#m.y -= this.#o, this.#m.texture.frame = new Y(
|
|
1233
|
-
0,
|
|
1234
|
-
0,
|
|
1235
|
-
Math.min(this.#m.width, this.#i.$width - this.#y),
|
|
1236
|
-
Math.min(this.#m.height, this.#i.$height)
|
|
1237
|
-
), this.#l.addChild(this.#m), t.render(this.#m, { clear: !1 }), e();
|
|
1238
|
-
}, this.#t, this.#i, this.#g, this.#o, !1);
|
|
1239
|
-
}
|
|
1240
|
-
snapshot_end() {
|
|
1241
|
-
this.#m && (this.#l.removeChild(this.#m), this.#m = void 0);
|
|
1242
|
-
}
|
|
1243
|
-
makeDesignCast(t) {
|
|
1244
|
-
}
|
|
1245
|
-
showDesignCast() {
|
|
1246
|
-
}
|
|
1247
|
-
// showDesignCast() {this.#idc.visible = true; this.#idcCh.visible = true}
|
|
1248
|
-
dump() {
|
|
1249
|
-
const t = [], e = this.#t.style, s = e.length;
|
|
1250
|
-
for (let i = 0; i < s; ++i) {
|
|
1251
|
-
const n = e[i];
|
|
1252
|
-
t.push(`"${String(n)}":"${e[n].replaceAll(/(["\\])/g, "\\$1")}"`);
|
|
1253
|
-
}
|
|
1254
|
-
return `"txt":"${this.#t.textContent.replaceAll(/(["\\])/g, "\\$1")}", "style":{${t.join(",")}}`;
|
|
1255
|
-
}
|
|
1256
|
-
destroy() {
|
|
1257
|
-
g.delBreak(), this.#t.parentElement.removeChild(this.#t), this.removeChild(this.#l), this.removeChild(this.#p), super.destroy();
|
|
1258
|
-
}
|
|
1259
|
-
}
|
|
1260
|
-
class z extends W {
|
|
1261
|
-
constructor(t, e, s, i) {
|
|
1262
|
-
if (super(), this.hArg = t, this.evtMng = e, this.resolve = s, this.canFocus = i, this.#t = {
|
|
1263
|
-
type: "pic",
|
|
1264
|
-
enabled: R(t, "enabled", !0),
|
|
1265
|
-
x: this.x = V(t.left ?? 0),
|
|
1266
|
-
y: this.y = V(t.top ?? 0),
|
|
1267
|
-
rotation: this.angle = w(t, "rotation", this.angle),
|
|
1268
|
-
// flash : rotation is in degrees.
|
|
1269
|
-
// pixijs: rotation is in radians, angle is in degrees.
|
|
1270
|
-
pivot_x: this.pivot.x = w(t, "pivot_x", this.pivot.x),
|
|
1271
|
-
pivot_y: this.pivot.y = w(t, "pivot_y", this.pivot.y),
|
|
1272
|
-
scale_x: this.scale.x = w(t, "scale_x", this.scale.x),
|
|
1273
|
-
scale_y: this.scale.y = w(t, "scale_y", this.scale.y),
|
|
1274
|
-
alpha: 1,
|
|
1275
|
-
text: "",
|
|
1276
|
-
b_pic: "",
|
|
1277
|
-
width: 0,
|
|
1278
|
-
height: 0
|
|
1279
|
-
}, this.getBtnBounds = () => (this.#n.x = this.#t.x, this.#n.y = this.#t.y, this.#n), this.#t.enabled && e.button(t, this, () => this.normal(), () => this.#p(), () => this.#u()), t.pic) {
|
|
1280
|
-
this.#t.type = "pic", this.#r = new m(
|
|
1281
|
-
t.pic,
|
|
1282
|
-
this,
|
|
1283
|
-
(l) => {
|
|
1284
|
-
this.#c(l), this.#n.width = l.width * this.#t.scale_x, this.#n.height = l.height * this.#t.scale_y;
|
|
1285
|
-
},
|
|
1286
|
-
(l) => s()
|
|
1287
|
-
);
|
|
1288
|
-
return;
|
|
1289
|
-
}
|
|
1290
|
-
if (!t.text) throw "textまたはpic属性は必須です";
|
|
1291
|
-
const n = w(t, "height", 30), a = new Tt({
|
|
1292
|
-
align: "center",
|
|
1293
|
-
dropShadow: !0,
|
|
1294
|
-
dropShadowAlpha: 0.7,
|
|
1295
|
-
dropShadowColor: "white",
|
|
1296
|
-
dropShadowBlur: 7,
|
|
1297
|
-
dropShadowDistance: 0,
|
|
1298
|
-
fill: this.#t.enabled ? "black" : "gray",
|
|
1299
|
-
fontFamily: z.fontFamily,
|
|
1300
|
-
fontSize: n,
|
|
1301
|
-
padding: 5
|
|
1302
|
-
});
|
|
1303
|
-
if (t.style) try {
|
|
1304
|
-
const l = JSON.parse(t.style);
|
|
1305
|
-
for (const [p, d] of Object.entries(l)) a[p] = d;
|
|
1306
|
-
this.#t = { ...this.#t, ...l };
|
|
1307
|
-
} catch (l) {
|
|
1308
|
-
throw l instanceof SyntaxError ? new Error(dt(t, "style", l.message)) : "fn:Button.ts style";
|
|
1309
|
-
}
|
|
1310
|
-
const o = new Pt(t.text ?? "", a);
|
|
1311
|
-
o.alpha = w(t, "alpha", o.alpha), o.width = w(t, "width", 100), o.height = t.height = n, this.setText = (l) => {
|
|
1312
|
-
o.text = l;
|
|
1313
|
-
}, this.#t = {
|
|
1314
|
-
...this.#t,
|
|
1315
|
-
type: "text",
|
|
1316
|
-
// dump用
|
|
1317
|
-
alpha: o.alpha,
|
|
1318
|
-
text: o.text,
|
|
1319
|
-
width: o.width,
|
|
1320
|
-
height: o.height
|
|
1321
|
-
};
|
|
1322
|
-
let r = !1;
|
|
1323
|
-
if (this.#t.width = this.width, this.#t.height = this.height, t.b_pic && (this.#t.b_pic = t.b_pic, this.#r = new m(
|
|
1324
|
-
t.b_pic,
|
|
1325
|
-
this,
|
|
1326
|
-
(l) => {
|
|
1327
|
-
this.#l(l, o), this.#t.width = this.width, this.#t.height = this.height, o.name = JSON.stringify(this.#t);
|
|
1328
|
-
},
|
|
1329
|
-
(l) => {
|
|
1330
|
-
H.setBlendmode(this, t), l && s();
|
|
1331
|
-
}
|
|
1332
|
-
), r = this.#r.ret), o.name = JSON.stringify(this.#t), this.addChild(o), this.#n.width = o.width, this.#n.height = o.height, t.b_pic || H.setBlendmode(this, t), z.#s(this, o), !this.#t.enabled) {
|
|
1333
|
-
r || s();
|
|
1334
|
-
return;
|
|
1335
|
-
}
|
|
1336
|
-
const c = a.clone();
|
|
1337
|
-
if (t.style_hover) try {
|
|
1338
|
-
const l = JSON.parse(t.style_hover);
|
|
1339
|
-
for (const [p, d] of Object.entries(l)) c[p] = d;
|
|
1340
|
-
} catch (l) {
|
|
1341
|
-
throw l instanceof SyntaxError ? new Error(dt(t, "style_hover", l.message)) : "fn:Button.ts style_hover";
|
|
1342
|
-
}
|
|
1343
|
-
else c.fill = "white";
|
|
1344
|
-
const f = c.clone();
|
|
1345
|
-
if (t.style_clicked) try {
|
|
1346
|
-
const l = JSON.parse(t.style_clicked);
|
|
1347
|
-
for (const [p, d] of Object.entries(l)) f[p] = d;
|
|
1348
|
-
} catch (l) {
|
|
1349
|
-
throw l instanceof SyntaxError ? new Error(dt(t, "style_clicked", l.message)) : "fn:Button.ts style_clicked";
|
|
1350
|
-
}
|
|
1351
|
-
else f.dropShadow = !1;
|
|
1352
|
-
this.normal = () => {
|
|
1353
|
-
o.style = a;
|
|
1354
|
-
}, this.#p = () => i() ? (o.style = c, !0) : !1, this.#u = () => {
|
|
1355
|
-
o.style = f;
|
|
1356
|
-
}, r || s();
|
|
1357
|
-
}
|
|
1358
|
-
static fontFamily = "'Hiragino Sans', 'Hiragino Kaku Gothic ProN', '游ゴシック Medium', meiryo, sans-serif";
|
|
1359
|
-
static #s = (t, e) => {
|
|
1360
|
-
};
|
|
1361
|
-
static #e = (t, e, s, i) => {
|
|
1362
|
-
};
|
|
1363
|
-
static init(t) {
|
|
1364
|
-
t.oCfg.debug.masume && (z.#s = (e, s) => e.addChild(
|
|
1365
|
-
new U().beginFill(8926088, 0.2).lineStyle(1, 8926088, 1).drawRect(s.x, s.y, s.width, s.height).endFill()
|
|
1366
|
-
), z.#e = (e, s, i, n) => e.addChild(
|
|
1367
|
-
new U().beginFill(8926088, 0.2).lineStyle(1, 8926088, 1).drawRect(s.x, s.y, i, n).endFill()
|
|
1368
|
-
));
|
|
1369
|
-
}
|
|
1370
|
-
setText(t) {
|
|
1371
|
-
}
|
|
1372
|
-
getBtnBounds = () => this.#n;
|
|
1373
|
-
// 文字ボタンは背景画像を含まない位置指定なので、その当たり判定用
|
|
1374
|
-
#n = new Y();
|
|
1375
|
-
#r = new m();
|
|
1376
|
-
// #idc : DesignCast;
|
|
1377
|
-
#t;
|
|
1378
|
-
destroy() {
|
|
1379
|
-
this.evtMng.unButton(this), this.#r.destroy(), super.destroy();
|
|
1380
|
-
}
|
|
1381
|
-
makeDesignCast(t) {
|
|
1382
|
-
}
|
|
1383
|
-
showDesignCast() {
|
|
1384
|
-
}
|
|
1385
|
-
// showDesignCast() {this.#idc.visible = true}
|
|
1386
|
-
cvsResize() {
|
|
1387
|
-
}
|
|
1388
|
-
#l(t, e) {
|
|
1389
|
-
this.setChildIndex(t, 0), t.alpha = e.alpha, t.setTransform(
|
|
1390
|
-
e.x,
|
|
1391
|
-
e.y,
|
|
1392
|
-
1,
|
|
1393
|
-
1,
|
|
1394
|
-
e.rotation,
|
|
1395
|
-
0,
|
|
1396
|
-
0,
|
|
1397
|
-
(t.width - e.width) / 2,
|
|
1398
|
-
(t.height - e.height) / 2
|
|
1399
|
-
), t.name = e.name;
|
|
1400
|
-
}
|
|
1401
|
-
normal = () => {
|
|
1402
|
-
};
|
|
1403
|
-
#p = () => !1;
|
|
1404
|
-
#u = () => {
|
|
1405
|
-
};
|
|
1406
|
-
#c(t) {
|
|
1407
|
-
this.#t.alpha = t.alpha = w(this.hArg, "alpha", t.alpha);
|
|
1408
|
-
const e = t.width / 3, s = this.#t.enabled ? e : t.width, i = t.height, n = t.texture.baseTexture, a = new J(n, new Y(0, 0, e, i)), o = new J(n, new Y(e, 0, e, i)), r = new J(n, new Y(e * 2, 0, e, i)), c = () => {
|
|
1409
|
-
t.texture = a;
|
|
1410
|
-
};
|
|
1411
|
-
this.#t.enabled && c(), this.normal = c, this.#p = () => this.canFocus() ? (t.texture = r, !0) : !1, this.#u = () => {
|
|
1412
|
-
t.texture = o;
|
|
1413
|
-
}, "width" in this.hArg ? (this.#t.width = V(this.hArg.width), this.scale.x *= this.#t.width / s) : this.#t.width = s, "height" in this.hArg ? (this.#t.height = V(this.hArg.height), this.scale.y *= this.#t.height / i) : this.#t.height = i, t.name = JSON.stringify(this.#t), z.#e(this, t, s, i);
|
|
1414
|
-
}
|
|
1415
|
-
}
|
|
1416
|
-
class P extends H {
|
|
1417
|
-
static #s;
|
|
1418
|
-
static #e;
|
|
1419
|
-
static #n;
|
|
1420
|
-
static #r;
|
|
1421
|
-
static init(t, e, s, i, n, a) {
|
|
1422
|
-
this.#s = t, g.init(t, a), this.#e = s, this.#r = i, this.#n = n, s.setDoRecProc((o) => this.chgDoRec(o)), e.autowc = (o) => this.#i(o), e.autowc({ enabled: !1, text: "", time: 0 }), e.ch_in_style = (o) => this.#t(o), e.ch_out_style = (o) => this.#l(o), g.initChStyle(), Ft(), ot(
|
|
1423
|
-
t.matchPath(".+", Z.FONT).flatMap((o) => Object.values(o).map((r) => `
|
|
1424
|
-
@font-face {
|
|
1425
|
-
font-family: '${r}';
|
|
1426
|
-
src: url('${this.#s.searchPath(String(r), Z.FONT)}');
|
|
1427
|
-
}
|
|
1428
|
-
`)).join("") + `
|
|
1429
|
-
.sn_tx {
|
|
1430
|
-
pointer-events: none;
|
|
1431
|
-
user-select: none;
|
|
1432
|
-
-webkit-touch-callout: none;
|
|
1433
|
-
box-sizing: border-box;
|
|
1434
|
-
}
|
|
1435
|
-
.sn_ch {
|
|
1436
|
-
position: relative;
|
|
1437
|
-
display: inline-block;
|
|
1438
|
-
}
|
|
1439
|
-
`
|
|
1440
|
-
// 「sn_ch」と「sn_ch_in_〜」の中身が重複しているが、これは必須
|
|
1441
|
-
), this.#t({
|
|
1442
|
-
name: "default",
|
|
1443
|
-
wait: 500,
|
|
1444
|
-
alpha: 0,
|
|
1445
|
-
x: "=0.3",
|
|
1446
|
-
y: "=0",
|
|
1447
|
-
scale_x: 1,
|
|
1448
|
-
scale_y: 1,
|
|
1449
|
-
rotate: 0,
|
|
1450
|
-
join: !0,
|
|
1451
|
-
ease: "ease-out"
|
|
1452
|
-
}), this.#l({
|
|
1453
|
-
name: "default",
|
|
1454
|
-
wait: 0,
|
|
1455
|
-
alpha: 0,
|
|
1456
|
-
x: "=0",
|
|
1457
|
-
y: "=0",
|
|
1458
|
-
scale_x: 1,
|
|
1459
|
-
scale_y: 1,
|
|
1460
|
-
rotate: 0,
|
|
1461
|
-
join: !1,
|
|
1462
|
-
ease: "ease-out"
|
|
1463
|
-
});
|
|
1464
|
-
}
|
|
1465
|
-
// 文字出現演出
|
|
1466
|
-
static #t(t) {
|
|
1467
|
-
const e = g.ch_in_style(t), s = e.x.startsWith("=") ? `${e.nx * 100}%` : `${e.nx}px`, i = e.y.startsWith("=") ? `${e.ny * 100}%` : `${e.ny}px`, { name: n } = t;
|
|
1468
|
-
return ot(`
|
|
1469
|
-
.sn_ch_in_${n} {
|
|
1470
|
-
position: relative;
|
|
1471
|
-
display: inline-block;
|
|
1472
|
-
}
|
|
1473
|
-
.go_ch_in_${n} {
|
|
1474
|
-
opacity: ${e.alpha};
|
|
1475
|
-
position: relative;
|
|
1476
|
-
display: inline-block;
|
|
1477
|
-
animation: sn_ch_in_${n} ${e.wait}ms ${e.ease} 0s both;
|
|
1478
|
-
}
|
|
1479
|
-
@keyframes sn_ch_in_${n} {
|
|
1480
|
-
from {transform: rotate(${e.rotate}deg) scale(${e.scale_x}, ${e.scale_y}) translate(${s}, ${i})}
|
|
1481
|
-
to {opacity: 1; transform: none;}
|
|
1482
|
-
}
|
|
1483
|
-
`), !1;
|
|
1484
|
-
}
|
|
1485
|
-
// 文字消去演出
|
|
1486
|
-
static #l(t) {
|
|
1487
|
-
const e = g.ch_out_style(t), s = e.x.startsWith("=") ? `${e.nx * 100}%` : `${e.nx}px`, i = e.y.startsWith("=") ? `${e.ny * 100}%` : `${e.ny}px`, { name: n } = t;
|
|
1488
|
-
return ot(`
|
|
1489
|
-
.go_ch_out_${n} {
|
|
1490
|
-
position: relative;
|
|
1491
|
-
display: inline-block;
|
|
1492
|
-
animation: go_ch_out_${n} ${e.wait}ms ${e.ease} 0s both;
|
|
1493
|
-
}
|
|
1494
|
-
@keyframes go_ch_out_${n} {
|
|
1495
|
-
to {
|
|
1496
|
-
opacity: ${e.alpha};
|
|
1497
|
-
transform: rotate(${e.rotate}deg) scale(${e.scale_x}, ${e.scale_y}) translate(${s}, ${i});
|
|
1498
|
-
}
|
|
1499
|
-
`), !1;
|
|
1500
|
-
}
|
|
1501
|
-
static #p;
|
|
1502
|
-
static #u;
|
|
1503
|
-
static setEvtMng(t, e, s) {
|
|
1504
|
-
this.#p = t, this.#u = e, g.setEvtMng(t, s);
|
|
1505
|
-
}
|
|
1506
|
-
// 文字ごとのウェイト
|
|
1507
|
-
static #c = !1;
|
|
1508
|
-
static #x = {};
|
|
1509
|
-
static #i(t) {
|
|
1510
|
-
this.#c = R(t, "enabled", this.#c), this.#e.setVal_Nochk("save", "const.sn.autowc.enabled", this.#c);
|
|
1511
|
-
const { text: e } = t;
|
|
1512
|
-
if ("text" in t != "time" in t) throw "[autowc] textとtimeは同時指定必須です";
|
|
1513
|
-
if (this.#e.setVal_Nochk("save", "const.sn.autowc.text", e), !e)
|
|
1514
|
-
return this.#e.setVal_Nochk("save", "const.sn.autowc.time", ""), !1;
|
|
1515
|
-
const s = e.length;
|
|
1516
|
-
if (this.#c && s === 0) throw '[autowc] enabled === false かつ text === "" は許されません';
|
|
1517
|
-
const i = String(t.time).split(",");
|
|
1518
|
-
if (i.length !== s) throw "[autowc] text文字数とtimeに記述された待ち時間(コンマ区切り)は同数にして下さい";
|
|
1519
|
-
this.#x = {};
|
|
1520
|
-
for (let n = 0; n < s; ++n) this.#x[e[n]] = V(i[n]);
|
|
1521
|
-
return this.#e.setVal_Nochk("save", "const.sn.autowc.time", t.time), !1;
|
|
1522
|
-
}
|
|
1523
|
-
// バック
|
|
1524
|
-
#d = 0;
|
|
1525
|
-
#f = 0;
|
|
1526
|
-
#y = !1;
|
|
1527
|
-
#a = void 0;
|
|
1528
|
-
#g = "";
|
|
1529
|
-
// 背景画像無し(=単色塗り)
|
|
1530
|
-
// 文字表示
|
|
1531
|
-
#o = new g(this.ctn, () => this.canFocus(), P.#u);
|
|
1532
|
-
#I = new pt();
|
|
1533
|
-
#k = document.createElement("span");
|
|
1534
|
-
// cssチェック・保存用
|
|
1535
|
-
static #w = {
|
|
1536
|
-
"text-align": 0,
|
|
1537
|
-
"text-align-last": 0,
|
|
1538
|
-
height: 0,
|
|
1539
|
-
width: 0,
|
|
1540
|
-
"padding-left": 0,
|
|
1541
|
-
"padding-right": 0,
|
|
1542
|
-
"padding-top": 0,
|
|
1543
|
-
"padding-bottom": 0
|
|
1544
|
-
};
|
|
1545
|
-
#v = new W();
|
|
1546
|
-
constructor() {
|
|
1547
|
-
super(), this.ctn.addChild(this.#o), this.#I.init(this.#Q), this.ctn.addChild(this.#v), this.#v.name = "cntBtn", this.lay({ style: `width: ${S.stageW}px; height: ${S.stageH}px; font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', '游ゴシック Medium', meiryo, sans-serif; color: white; font-size: 24px; line-height: 1.5; padding: 16px;`, in_style: "default", out_style: "default", back_clear: "true" });
|
|
1548
|
-
}
|
|
1549
|
-
destroy() {
|
|
1550
|
-
this.#a && (this.ctn.removeChild(this.#a).destroy(), this.#a = void 0), P.#r.pagebreak(), this.#o.destroy();
|
|
1551
|
-
}
|
|
1552
|
-
static destroy() {
|
|
1553
|
-
this.#c = !1, this.#x = {}, this.#W = (t) => t;
|
|
1554
|
-
}
|
|
1555
|
-
set name(t) {
|
|
1556
|
-
this.name_ = t, this.#o.name = t;
|
|
1557
|
-
}
|
|
1558
|
-
get name() {
|
|
1559
|
-
return this.name_;
|
|
1560
|
-
}
|
|
1561
|
-
// getは継承しないらしい
|
|
1562
|
-
cvsResize() {
|
|
1563
|
-
this.#o.cvsResize();
|
|
1564
|
-
}
|
|
1565
|
-
cvsResizeChildren() {
|
|
1566
|
-
for (const t of this.#v.children) t.cvsResize();
|
|
1567
|
-
}
|
|
1568
|
-
procSetX(t) {
|
|
1569
|
-
this.#o.lay({ x: t });
|
|
1570
|
-
}
|
|
1571
|
-
procSetY(t) {
|
|
1572
|
-
this.#o.lay({ y: t });
|
|
1573
|
-
}
|
|
1574
|
-
lay(t) {
|
|
1575
|
-
if (super.lay(t), H.setXY(this.ctn, t, this.ctn), t[":id_tag"] = this.name_.slice(0, -7), pt.setting(t), this.#H(t), this.#o.lay(t), "r_align" in t && (this.#S = t.r_align ?? ""), this.#m = S.isSafari ? this.#o.tategaki ? (i, n) => `text-align: start; height: ${n}em; padding-top: ${i}; padding-bottom: ${i};` : (i, n) => `text-align: start; width: ${n}em; padding-left: ${i}; padding-right: ${i};` : this.#o.tategaki ? (i) => `text-align: justify; text-align-last: justify; padding-top: ${i}; padding-bottom: ${i};` : (i) => `text-align: justify; text-align-last: justify; padding-left: ${i}; padding-right: ${i};`, S.isFirefox && (this.#L = this.#M), "r_style" in t)
|
|
1576
|
-
if (t.r_style) {
|
|
1577
|
-
const i = document.createElement("span");
|
|
1578
|
-
i.style.cssText = t.r_style;
|
|
1579
|
-
const n = i.style.length, a = this.#k.style;
|
|
1580
|
-
for (let o = 0; o < n; ++o) {
|
|
1581
|
-
const r = i.style[o];
|
|
1582
|
-
if (r in P.#w) {
|
|
1583
|
-
it.myTrace(`${r}は指定できません`, "W");
|
|
1584
|
-
continue;
|
|
1585
|
-
}
|
|
1586
|
-
const c = i.style[r];
|
|
1587
|
-
c && (a[r] = c);
|
|
1588
|
-
}
|
|
1589
|
-
} else this.#k.style.cssText = "";
|
|
1590
|
-
if ("alpha" in t) for (const i of this.#v.children) i.alpha = this.ctn.alpha;
|
|
1591
|
-
this.#h(t), this.#V(t);
|
|
1592
|
-
const e = F.procID + `TxtLayer lay name:${this.name_}`, s = this.#j(t, (i) => {
|
|
1593
|
-
i && F.endProc(e);
|
|
1594
|
-
});
|
|
1595
|
-
return s && F.beginProc(e), s;
|
|
1596
|
-
}
|
|
1597
|
-
#h(t) {
|
|
1598
|
-
const { in_style: e } = t;
|
|
1599
|
-
if (!e) return;
|
|
1600
|
-
const s = g.getChInStyle(e);
|
|
1601
|
-
if (!s) throw `存在しないin_style【${e}】です`;
|
|
1602
|
-
this.#b = e, this.#E = s.join;
|
|
1603
|
-
}
|
|
1604
|
-
#b = "";
|
|
1605
|
-
#E = !0;
|
|
1606
|
-
get width() {
|
|
1607
|
-
return this.#o.getWidth;
|
|
1608
|
-
}
|
|
1609
|
-
get height() {
|
|
1610
|
-
return this.#o.getHeight;
|
|
1611
|
-
}
|
|
1612
|
-
#V(t) {
|
|
1613
|
-
const { out_style: e } = t;
|
|
1614
|
-
if (!e) return;
|
|
1615
|
-
if (!g.getChOutStyle(e)) throw `存在しないout_style【${e}】です`;
|
|
1616
|
-
this.#F = e;
|
|
1617
|
-
}
|
|
1618
|
-
#F = "";
|
|
1619
|
-
#z = new m();
|
|
1620
|
-
#j(t, e) {
|
|
1621
|
-
if ("back_clear" in t)
|
|
1622
|
-
return R(t, "back_clear", !1) && (this.#d = 0, this.#f = 0, this.#y = !1, this.#g = ""), e(!1), !1;
|
|
1623
|
-
this.#f = w(t, "b_alpha", this.#f), this.#y = R(t, "b_alpha_isfixed", this.#y);
|
|
1624
|
-
const s = (this.#y ? 1 : Number(P.#e.getVal("sys:TextLayer.Back.Alpha"))) * this.#f;
|
|
1625
|
-
if (t.b_pic) {
|
|
1626
|
-
if (this.#g !== t.b_pic)
|
|
1627
|
-
return this.#g = t.b_pic, this.#a && (this.ctn.removeChild(this.#a), this.#a.destroy()), this.#z = new m(this.#g, this.ctn, (i) => {
|
|
1628
|
-
this.#a = i, i.name = "back(pic)", i.visible = s > 0, i.alpha = s, this.#o.setMySize(i.width, i.height), this.ctn.setChildIndex(i, 0), e(!0);
|
|
1629
|
-
}), this.#z.ret;
|
|
1630
|
-
} else "b_color" in t && (this.#d = vt(t, "b_color", 0), this.#a && (this.ctn.removeChild(this.#a), this.#a.destroy()), this.#g = "", this.ctn.addChildAt(
|
|
1631
|
-
(this.#a = new U()).beginFill(this.#d, s).lineStyle(void 0).drawRect(0, 0, this.#o.getWidth, this.#o.getHeight).endFill(),
|
|
1632
|
-
0
|
|
1633
|
-
), this.#a.name = "back(color)");
|
|
1634
|
-
return this.#a && (this.#a.visible = s > 0, this.#a.alpha = s), e(!1), !1;
|
|
1635
|
-
}
|
|
1636
|
-
chgBackAlpha(t) {
|
|
1637
|
-
const e = this.#y ? this.#f : t * this.#f;
|
|
1638
|
-
this.#a instanceof U && (this.#a && (this.ctn.removeChild(this.#a), this.#a.destroy()), this.ctn.addChildAt(
|
|
1639
|
-
(this.#a = new U()).beginFill(this.#d, e).lineStyle(void 0).drawRect(0, 0, this.#o.getWidth, this.#o.getHeight).endFill(),
|
|
1640
|
-
0
|
|
1641
|
-
), this.#a.name = "back(color)"), this.#a && (this.#a.visible = e > 0, this.#a.alpha = e);
|
|
1642
|
-
}
|
|
1643
|
-
#H(t) {
|
|
1644
|
-
"noffs" in t && (this.#N = t.noffs ?? "", this.#_ = new RegExp(`[ ${this.#N}]`)), "ffs" in t && (this.#O ??= "", this.#$ = this.#O === "" ? () => "" : (e) => this.#_.test(e) ? "" : ` font-feature-settings: ${this.#O};`);
|
|
1645
|
-
}
|
|
1646
|
-
#O = "";
|
|
1647
|
-
#$ = (t) => "";
|
|
1648
|
-
#N = "";
|
|
1649
|
-
// eslint-disable-next-line no-irregular-whitespace
|
|
1650
|
-
#_ = /[ ]/;
|
|
1651
|
-
// Safariが全体に「font-feature-settings」した後、特定文字の「font-feature-settings: initial;」を受け付けてくれないのでわざわざ一つずつ指定
|
|
1652
|
-
static chgDoRec(t) {
|
|
1653
|
-
this.#W = t ? (e) => e : (e) => `<span class='offrec'>${e}</span>`;
|
|
1654
|
-
}
|
|
1655
|
-
static #W = (t) => t;
|
|
1656
|
-
isCur = !1;
|
|
1657
|
-
#m = () => "";
|
|
1658
|
-
#L = (t, e, s, i = "") => {
|
|
1659
|
-
if (!s) return ` style='${i}'`;
|
|
1660
|
-
const n = t.length * 2;
|
|
1661
|
-
if (n - e.length < 0) return ` style='text-align: ${s}; ${i}'`;
|
|
1662
|
-
let a = "";
|
|
1663
|
-
switch (s) {
|
|
1664
|
-
case "justify":
|
|
1665
|
-
a = this.#m("0", n);
|
|
1666
|
-
break;
|
|
1667
|
-
case "121":
|
|
1668
|
-
a = this.#m(`calc(${(n - e.length) / (e.length * 2)}em)`, n);
|
|
1669
|
-
break;
|
|
1670
|
-
case "even":
|
|
1671
|
-
a = this.#m(`calc(${(n - e.length) / (e.length + 1)}em)`, n);
|
|
1672
|
-
break;
|
|
1673
|
-
case "1ruby":
|
|
1674
|
-
a = this.#m("1em", n);
|
|
1675
|
-
break;
|
|
1676
|
-
default:
|
|
1677
|
-
a = `text-align: ${s};`;
|
|
1678
|
-
}
|
|
1679
|
-
return ` style='${a} ${i}'`;
|
|
1680
|
-
};
|
|
1681
|
-
#S = "";
|
|
1682
|
-
#M(t, e, s, i = "") {
|
|
1683
|
-
if (!s) return ` style='${i}'`;
|
|
1684
|
-
const n = t.length * 2;
|
|
1685
|
-
if (n - e.length < 0) return ` style='text-align: ${s}; ${i}'`;
|
|
1686
|
-
let a = "";
|
|
1687
|
-
switch (s) {
|
|
1688
|
-
case "left":
|
|
1689
|
-
a = "ruby-align: start;";
|
|
1690
|
-
break;
|
|
1691
|
-
case "center":
|
|
1692
|
-
a = "ruby-align: center;";
|
|
1693
|
-
break;
|
|
1694
|
-
case "right":
|
|
1695
|
-
a = "ruby-align: start;";
|
|
1696
|
-
break;
|
|
1697
|
-
case "justify":
|
|
1698
|
-
a = "ruby-align: space-between;";
|
|
1699
|
-
break;
|
|
1700
|
-
case "121":
|
|
1701
|
-
a = "ruby-align: space-around;";
|
|
1702
|
-
break;
|
|
1703
|
-
case "even":
|
|
1704
|
-
{
|
|
1705
|
-
const o = (n - e.length) / (e.length + 1);
|
|
1706
|
-
a = "ruby-align: space-between; " + (this.#o.tategaki ? `padding-top: ${o}em; padding-bottom: ${o}em;` : `padding-left: ${o}em; padding-right: ${o}em;`);
|
|
1707
|
-
}
|
|
1708
|
-
break;
|
|
1709
|
-
case "1ruby":
|
|
1710
|
-
a = "ruby-align: space-between; " + (this.#o.tategaki ? "padding-top: 1em; padding-bottom: 1em;" : "padding-left: 1em; padding-right: 1em;");
|
|
1711
|
-
break;
|
|
1712
|
-
default:
|
|
1713
|
-
a = `text-align: ${s};`;
|
|
1714
|
-
}
|
|
1715
|
-
return ` style='${a} ${i}'`;
|
|
1716
|
-
}
|
|
1717
|
-
tagCh(t) {
|
|
1718
|
-
this.#I.putTxt(t);
|
|
1719
|
-
}
|
|
1720
|
-
#R = !1;
|
|
1721
|
-
get needGoTxt() {
|
|
1722
|
-
return this.#R;
|
|
1723
|
-
}
|
|
1724
|
-
#Q = (t, e) => {
|
|
1725
|
-
let s = e;
|
|
1726
|
-
P.#s.oCfg.debug.putCh && console.log(`🖊 文字表示 text:\`${t}\`(${t.charCodeAt(0).toString(16)}) ruby:\`${s}\` name:\`${this.name_}\``);
|
|
1727
|
-
const i = s.split("|");
|
|
1728
|
-
let n = "";
|
|
1729
|
-
const [a, ...o] = i, r = o.join("|");
|
|
1730
|
-
switch (i.length) {
|
|
1731
|
-
case 1:
|
|
1732
|
-
if (this.#R = !0, t === `
|
|
1733
|
-
`) {
|
|
1734
|
-
this.#B ? (this.#B = !1, n = "<ruby> <rt> </rt></ruby><br/>") : n = "<br/>";
|
|
1735
|
-
break;
|
|
1736
|
-
}
|
|
1737
|
-
this.#B && (this.#B = !1, s === "" && (s = " ")), n = this.#Y(t, s, this.#S);
|
|
1738
|
-
break;
|
|
1739
|
-
default:
|
|
1740
|
-
switch (a) {
|
|
1741
|
-
// ルビ揃え指定と同時シリーズ
|
|
1742
|
-
case "start":
|
|
1743
|
-
// 初期値
|
|
1744
|
-
case "left":
|
|
1745
|
-
//(肩付き)先頭親文字から、ルビ間は密着
|
|
1746
|
-
case "center":
|
|
1747
|
-
//(中付き)センター合わせ、〃
|
|
1748
|
-
case "right":
|
|
1749
|
-
//(右/下揃え)末尾親文字から、〃
|
|
1750
|
-
case "justify":
|
|
1751
|
-
//(両端揃え)先頭から末尾親文字間に、ルビ間は均等にあける
|
|
1752
|
-
case "121":
|
|
1753
|
-
//(1-2-1(JIS))ルビの前後を比率1、ルビ間を比率2であける
|
|
1754
|
-
case "even":
|
|
1755
|
-
//(均等アキ)ルビの前後、ルビ間も均等にあける
|
|
1756
|
-
case "1ruby":
|
|
1757
|
-
this.#B = !1, this.#R = !0, n = this.#Y(t, r, a);
|
|
1758
|
-
break;
|
|
1759
|
-
case "gotxt":
|
|
1760
|
-
this.#X(), this.#R ? (this.isCur && P.#r.recText(
|
|
1761
|
-
this.#C.join("").replace(/^<ruby> <rt> <\/rt><\/ruby>(<br\/>)+/, "").replaceAll(/style='(anim\S+ [^;]+;\s*)+/g, "style='").replaceAll(/( style=''| data-(add|arg|cmd)='[^']+'|\n+|\t+)/g, "").replaceAll(/class='sn_ch[^']+/g, "class='sn_ch").replaceAll("display: none;", "").replaceAll("class='offrec'", "style='display: none;'")
|
|
1762
|
-
), this.#o.goTxt(this.#C, this.#J === 0), this.#R = !1, this.#J = 0) : this.isCur && this.#o.noticeCompTxt();
|
|
1763
|
-
return;
|
|
1764
|
-
// breakではない
|
|
1765
|
-
case "add":
|
|
1766
|
-
{
|
|
1767
|
-
const c = JSON.parse(r), { style: f = "", wait: l = null } = c, { cl: p, sty: d } = this.#U(!0, l ? V(l) : null);
|
|
1768
|
-
this.#C.push(`<span${p} style='${d} display: inline; ${f}'>`), delete c.style, this.#P(c);
|
|
1769
|
-
}
|
|
1770
|
-
return;
|
|
1771
|
-
// breakではない
|
|
1772
|
-
case "add_close":
|
|
1773
|
-
this.#C.push("</span>"), this.#X();
|
|
1774
|
-
return;
|
|
1775
|
-
// breakではない
|
|
1776
|
-
case "grp":
|
|
1777
|
-
this.#R = !0;
|
|
1778
|
-
{
|
|
1779
|
-
const c = JSON.parse(r);
|
|
1780
|
-
if (c.id ??= String(this.#C.length), c.id === "break") {
|
|
1781
|
-
this.#o.dispBreak(c);
|
|
1782
|
-
return;
|
|
1783
|
-
}
|
|
1784
|
-
this.#B = !1, c.delay = this.#J, c.r ??= "", c.style ??= "", c.r_style ??= "";
|
|
1785
|
-
const { r: f, wait: l = null, r_style: p } = c, { cl: d, sty: h, lnk: u } = this.#U(!0, l ? V(l) : null);
|
|
1786
|
-
n = `<span${d} style='${h} ${c.style}'><ruby><span data-cmd='grp' data-arg='${JSON.stringify(c)}'${u} style='${h} display: inline;'> </span><rt${u}${this.#L(
|
|
1787
|
-
" ",
|
|
1788
|
-
f,
|
|
1789
|
-
this.#S,
|
|
1790
|
-
this.#k.style.cssText + (this.#T.at(-1)?.o.r_style ?? "") + p
|
|
1791
|
-
)}>${c.r}</rt></ruby></span>`;
|
|
1792
|
-
}
|
|
1793
|
-
break;
|
|
1794
|
-
case "tcy":
|
|
1795
|
-
this.#B = !1, this.#R = !0;
|
|
1796
|
-
{
|
|
1797
|
-
const { t: c = "", r: f = "", wait: l = null, style: p = "", r_style: d = "" } = JSON.parse(r);
|
|
1798
|
-
P.#e.doRecLog() && (this.#q += t + (s ? `《${s}》` : ""), this.#D += c);
|
|
1799
|
-
const h = S.isSafari ? f.replaceAll(/[A-Za-z0-9]/g, (y) => String.fromCharCode(y.charCodeAt(0) + 65248)) : f, { cl: u, sty: x, lnk: v } = this.#U(!0, l ? V(l) : null);
|
|
1800
|
-
n = `<span${u} style='${x}${this.#$(c)} ${p}'><ruby><span${v} style='${x} display: inline; text-combine-upright: all;'>${c}</span><rt${v}${this.#L(
|
|
1801
|
-
c,
|
|
1802
|
-
h,
|
|
1803
|
-
this.#S,
|
|
1804
|
-
this.#k.style.cssText + (this.#T.at(-1)?.o.r_style ?? "") + d
|
|
1805
|
-
)}>${h}</rt></ruby></span>`;
|
|
1806
|
-
}
|
|
1807
|
-
break;
|
|
1808
|
-
case "del":
|
|
1809
|
-
g.delBreak();
|
|
1810
|
-
return;
|
|
1811
|
-
// breakではない
|
|
1812
|
-
case "span":
|
|
1813
|
-
this.#R = !0, this.#K(JSON.parse(r));
|
|
1814
|
-
return;
|
|
1815
|
-
// breakではない
|
|
1816
|
-
case "link":
|
|
1817
|
-
this.#R = !0;
|
|
1818
|
-
{
|
|
1819
|
-
const c = JSON.parse(r);
|
|
1820
|
-
c[":link"] = " data-lnk='@'";
|
|
1821
|
-
const { cl: f, sty: l, curpos: p } = this.#U(!1, c.wait ? V(c.wait) : null);
|
|
1822
|
-
this.#C.push(`<span${f} style='${l} display: inline; ${c.style ?? ""}' ${p} data-arg='${r}'>`), delete c.style, this.#K(c);
|
|
1823
|
-
}
|
|
1824
|
-
return;
|
|
1825
|
-
// breakではない
|
|
1826
|
-
case "endlink":
|
|
1827
|
-
this.#R = !0, this.#C.push("</span>"), this.#X();
|
|
1828
|
-
return;
|
|
1829
|
-
// breakではない
|
|
1830
|
-
default:
|
|
1831
|
-
this.#R = !0, n = this.#Y(t, s, this.#S);
|
|
1832
|
-
}
|
|
1833
|
-
break;
|
|
1834
|
-
}
|
|
1835
|
-
this.#C.push(P.#W(n));
|
|
1836
|
-
};
|
|
1837
|
-
#Y(t, e, s) {
|
|
1838
|
-
const i = t === " " ? " " : t === " " ? " " : t;
|
|
1839
|
-
P.#e.doRecLog() && (this.#q += i + (e ? `《${e}》` : ""), t !== " " && (this.#D += t));
|
|
1840
|
-
const { cl: n, sty: a, lnk: o } = this.#U(!0, null, t);
|
|
1841
|
-
return e ? `<span${n} style='${a} ${this.#$(t)}'><ruby>${// 文字個別に出現させるため以下にも ${cl} が必要
|
|
1842
|
-
Array.from(t).map((r, c) => `<span${n}${o} style='${c > 0 ? this.#U(!0, null, t).sty : a} display: inline;'>${r === " " ? " " : r === " " ? " " : r}</span>`).join("")}<rt${o}${this.#L(
|
|
1843
|
-
t,
|
|
1844
|
-
e,
|
|
1845
|
-
s,
|
|
1846
|
-
this.#k.style.cssText + (this.#T.at(-1)?.o.r_style ?? "")
|
|
1847
|
-
)}>${e}</rt></ruby></span>` : `<span${n} style='${a} ${this.#$(t)}'${o}>${i}</span>`;
|
|
1848
|
-
}
|
|
1849
|
-
#U(t, e, s = `
|
|
1850
|
-
`) {
|
|
1851
|
-
const i = this.#E ? e ?? this.#T.at(0)?.o.wait ?? (P.#c ? P.#x[s.at(0) ?? ""] ?? 0 : G.msecChWait) : 0;
|
|
1852
|
-
P.#p.isSkipping ? this.#J = 0 : t && this.#E && (this.#J += V(i));
|
|
1853
|
-
const n = `data-add='{"ch_in_style":"${this.#b}", "ch_out_style":"${this.#F}"}'`;
|
|
1854
|
-
return {
|
|
1855
|
-
cl: ` class='sn_ch sn_ch_yet sn_ch_in_${this.#b}'`,
|
|
1856
|
-
// TxtStage.goTxt()はこれ単位で文字出現させる
|
|
1857
|
-
sty: `animation-delay: ${this.#J}ms;${this.#T.at(-1)?.o.style ?? ""}`,
|
|
1858
|
-
// TxtStage.goTxt()はこれ単位で文字出現させる
|
|
1859
|
-
lnk: (this.#T.at(0)?.o[":link"] ?? "") + " " + n,
|
|
1860
|
-
curpos: n
|
|
1861
|
-
};
|
|
1862
|
-
}
|
|
1863
|
-
#J = 0;
|
|
1864
|
-
#B = !0;
|
|
1865
|
-
#C = [];
|
|
1866
|
-
#T = [];
|
|
1867
|
-
#P(t) {
|
|
1868
|
-
this.#T.push({
|
|
1869
|
-
o: t,
|
|
1870
|
-
r_align: this.#S,
|
|
1871
|
-
ch_in_style: this.#b,
|
|
1872
|
-
ch_out_style: this.#F
|
|
1873
|
-
}), t.r_align && (this.#S = t.r_align), this.#h(t), this.#V(t);
|
|
1874
|
-
}
|
|
1875
|
-
#X() {
|
|
1876
|
-
const t = this.#T.pop();
|
|
1877
|
-
t && (this.#S = t.r_align, this.#h({ in_style: t.ch_in_style }), this.#V({ out_style: t.ch_out_style }));
|
|
1878
|
-
}
|
|
1879
|
-
#K(t) {
|
|
1880
|
-
const e = this.#T.at(-1);
|
|
1881
|
-
if (!e) {
|
|
1882
|
-
this.#P(t);
|
|
1883
|
-
return;
|
|
1884
|
-
}
|
|
1885
|
-
e.o = { ...e.o, ...t }, !t.style && !t.r_style && (e.o.style = "", e.o.r_style = ""), t.r_align && (this.#S = t.r_align), this.#h(t), this.#V(t);
|
|
1886
|
-
}
|
|
1887
|
-
click = () => !this.ctn.interactiveChildren || !this.ctn.visible ? !1 : this.#o.skipChIn();
|
|
1888
|
-
clearText() {
|
|
1889
|
-
this.ctn.addChild(this.#o = this.#o.reNew()), this.#J = 0, this.#B = !0, this.#C = [], this.#q = "", this.#D = "", P.#r.pagebreak();
|
|
1890
|
-
}
|
|
1891
|
-
#q = "";
|
|
1892
|
-
#D = "";
|
|
1893
|
-
get pageText() {
|
|
1894
|
-
return this.#q.replace("《 》", "");
|
|
1895
|
-
}
|
|
1896
|
-
get pagePlainText() {
|
|
1897
|
-
return this.#D;
|
|
1898
|
-
}
|
|
1899
|
-
get enabled() {
|
|
1900
|
-
return this.ctn.interactiveChildren;
|
|
1901
|
-
}
|
|
1902
|
-
set enabled(t) {
|
|
1903
|
-
this.ctn.interactiveChildren = t;
|
|
1904
|
-
}
|
|
1905
|
-
addButton = (t) => new Promise((e) => {
|
|
1906
|
-
t.key = `btn=[${this.#v.children.length}] ` + this.name_, t[":id_tag"] = t.key.slice(0, -7), R(t, "hint_tate", this.#o.tategaki);
|
|
1907
|
-
const s = new z(t, P.#p, () => e(), () => this.canFocus());
|
|
1908
|
-
s.name = JSON.stringify(t).replaceAll('"', "'"), this.#v.addChild(s);
|
|
1909
|
-
});
|
|
1910
|
-
canFocus() {
|
|
1911
|
-
return (this.ctn.interactiveChildren ?? !1) && this.ctn.visible && P.#n(this);
|
|
1912
|
-
}
|
|
1913
|
-
clearLay(t) {
|
|
1914
|
-
super.clearLay(t), this.clearText();
|
|
1915
|
-
for (const e of this.#v.removeChildren()) e.destroy();
|
|
1916
|
-
}
|
|
1917
|
-
record = () => ({
|
|
1918
|
-
...super.record(),
|
|
1919
|
-
enabled: this.enabled,
|
|
1920
|
-
r_cssText: this.#k.style.cssText,
|
|
1921
|
-
r_align: this.#S,
|
|
1922
|
-
// バック
|
|
1923
|
-
b_do: this.#a === void 0 ? void 0 : this.#a instanceof j ? "Sprite" : "Graphics",
|
|
1924
|
-
b_pic: this.#g,
|
|
1925
|
-
b_color: this.#d,
|
|
1926
|
-
b_alpha: this.#f,
|
|
1927
|
-
b_alpha_isfixed: this.#y,
|
|
1928
|
-
ffs: this.#O,
|
|
1929
|
-
txs: this.#o.record(),
|
|
1930
|
-
strNoFFS: this.#N,
|
|
1931
|
-
btns: this.#v.children.map((t) => t.name)
|
|
1932
|
-
});
|
|
1933
|
-
playback(t, e) {
|
|
1934
|
-
super.playback(t, e), this.enabled = t.enabled, this.#k.style.cssText = t.r_cssText, this.#S = t.r_align, this.cvsResize(), this.#H(t), this.#o.playback(t.txs), this.#f = t.b_alpha, this.#y = t.b_alpha_isfixed, e.push(
|
|
1935
|
-
new Promise((s) => {
|
|
1936
|
-
const i = t.b_do ? t.b_do === "Sprite" ? { b_pic: t.b_pic } : { b_color: t.b_color } : { b_pic: "" };
|
|
1937
|
-
i.b_alpha = t.b_alpha, i.b_alpha_isfixed = t.b_alpha_isfixed, this.#j(i, (n) => {
|
|
1938
|
-
n && s();
|
|
1939
|
-
}) || s();
|
|
1940
|
-
}),
|
|
1941
|
-
...t.btns.map((s) => this.addButton(JSON.parse(s.replaceAll("'", '"')))).flat()
|
|
1942
|
-
);
|
|
1943
|
-
}
|
|
1944
|
-
get cssText() {
|
|
1945
|
-
return this.#o.cssText;
|
|
1946
|
-
}
|
|
1947
|
-
set cssText(t) {
|
|
1948
|
-
this.#o.cssText = t;
|
|
1949
|
-
}
|
|
1950
|
-
snapshot(t, e) {
|
|
1951
|
-
t.render(this.ctn, { clear: !1 }), this.#o.snapshot(t, e);
|
|
1952
|
-
}
|
|
1953
|
-
snapshot_end() {
|
|
1954
|
-
this.#o.snapshot_end();
|
|
1955
|
-
}
|
|
1956
|
-
makeDesignCast(t) {
|
|
1957
|
-
this.ctn.visible && this.#o.makeDesignCast(t);
|
|
1958
|
-
}
|
|
1959
|
-
makeDesignCastChildren(t) {
|
|
1960
|
-
if (this.ctn.visible)
|
|
1961
|
-
for (const e of this.#v.children) e.makeDesignCast(t);
|
|
1962
|
-
}
|
|
1963
|
-
showDesignCast() {
|
|
1964
|
-
this.#o.showDesignCast();
|
|
1965
|
-
}
|
|
1966
|
-
showDesignCastChildren() {
|
|
1967
|
-
for (const t of this.#v.children) t.showDesignCast();
|
|
1968
|
-
}
|
|
1969
|
-
dump() {
|
|
1970
|
-
return this.#Q("", "gotxt|"), super.dump() + `, "enabled":"${this.enabled}", ${this.#o.dump()}, "b_pic":"${this.#g}", "b_color":"${this.#d}", "b_alpha":${this.#f}, "b_alpha_isfixed":"${this.#y}", "width":${this.#o.getWidth}, "height":${this.#o.getHeight}, "pixi_obj":[${this.ctn.children.map((t) => `{"class":"${t instanceof j ? "Sprite" : t instanceof U ? "Graphics" : t instanceof W ? "Container" : "?"}", "name":"${t.name}", "alpha":${t.alpha}, "x":${t.x}, "y":${t.y}, "visible":"${t.visible}"}`).join(",")}], "button":[${this.#v.children.map((t) => t.children[0]?.name ?? "{}").join(",")}]`;
|
|
1971
|
-
}
|
|
1972
|
-
}
|
|
1973
|
-
class C {
|
|
44
|
+
class u {
|
|
1974
45
|
constructor(t, e, s) {
|
|
1975
|
-
this.appPixi = e, this.val = s, t.add_frame = (i) => this.#
|
|
46
|
+
this.appPixi = e, this.val = s, t.add_frame = (i) => this.#x(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);
|
|
1976
47
|
}
|
|
1977
|
-
static #s;
|
|
1978
48
|
static #e;
|
|
1979
|
-
static #
|
|
49
|
+
static #t;
|
|
50
|
+
static #i;
|
|
1980
51
|
static init(t, e, s) {
|
|
1981
|
-
|
|
52
|
+
u.#e = t, u.#t = e, u.#i = s;
|
|
1982
53
|
}
|
|
1983
|
-
#
|
|
54
|
+
#o;
|
|
1984
55
|
setEvtMng(t) {
|
|
1985
|
-
this.#
|
|
56
|
+
this.#o = t;
|
|
1986
57
|
}
|
|
1987
58
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
1988
|
-
#
|
|
59
|
+
#c = /* @__PURE__ */ Object.create(null);
|
|
1989
60
|
destroy() {
|
|
1990
|
-
for (const t of Object.values(this.#
|
|
1991
|
-
this.#
|
|
61
|
+
for (const t of Object.values(this.#c)) t.parentElement.removeChild(t);
|
|
62
|
+
this.#c = /* @__PURE__ */ Object.create(null);
|
|
1992
63
|
}
|
|
1993
64
|
hideAllFrame() {
|
|
1994
|
-
for (const [t, { style: e }] of Object.entries(this.#
|
|
65
|
+
for (const [t, { style: e }] of Object.entries(this.#c))
|
|
1995
66
|
this.#l[t] = e.display !== "none", e.display = "none";
|
|
1996
67
|
}
|
|
1997
68
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
1998
69
|
#l = /* @__PURE__ */ Object.create(null);
|
|
1999
70
|
restoreAllFrame() {
|
|
2000
71
|
for (const [t, e] of Object.entries(this.#l)) {
|
|
2001
|
-
const s = this.#
|
|
72
|
+
const s = this.#c[t];
|
|
2002
73
|
s && (s.style.display = e ? "inline" : "none");
|
|
2003
74
|
}
|
|
2004
75
|
this.#l = /* @__PURE__ */ Object.create(null);
|
|
2005
76
|
}
|
|
2006
77
|
// HTMLフレーム
|
|
2007
78
|
// フレーム追加
|
|
2008
|
-
#
|
|
2009
|
-
const { id: e, src: s, alpha: i = 1, scale_x: n = 1, scale_y:
|
|
79
|
+
#x(t) {
|
|
80
|
+
const { id: e, src: s, alpha: i = 1, scale_x: n = 1, scale_y: o = 1, rotate: r = 0 } = t;
|
|
2010
81
|
if (!e) throw "idは必須です";
|
|
2011
82
|
if (!s) throw "srcは必須です";
|
|
2012
|
-
const
|
|
2013
|
-
if (this.val.getVal(`tmp:${
|
|
2014
|
-
const
|
|
2015
|
-
|
|
2016
|
-
const p =
|
|
2017
|
-
|
|
2018
|
-
const
|
|
2019
|
-
return
|
|
83
|
+
const l = "const.sn.frm." + e;
|
|
84
|
+
if (this.val.getVal(`tmp:${l}`)) throw `frame【${e}】はすでにあります`;
|
|
85
|
+
const f = w(t, "visible", !0), d = t.b_color ? ` background-color: ${t.b_color};` : "", h = this.#b(t);
|
|
86
|
+
u.#i.cvs.insertAdjacentHTML("beforebegin", `<iframe id="${e}" style="opacity: ${i}; ${d} position: absolute; left:${u.#t.ofsLeft4elm + h.x * u.#t.cvsScale}px; top: ${u.#t.ofsTop4elm + h.y * u.#t.cvsScale}px; z-index: 1; border: 0px; overflow: hidden; display: ${f ? "inline" : "none"}; transform: scale(${n}, ${o}) rotate(${r}deg);" width="${h.width * u.#t.cvsScale}" height="${h.height * u.#t.cvsScale}"></iframe>`);
|
|
87
|
+
const p = C.procID + `add_frame id:${e}`;
|
|
88
|
+
C.beginProc(p);
|
|
89
|
+
const c = u.#e.searchPath(s, H.HTML), a = new F().add({ name: s, url: c, xhrType: D.XHR_RESPONSE_TYPE.TEXT });
|
|
90
|
+
return u.#t.arg.crypto && a.use(
|
|
2020
91
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
2021
|
-
(
|
|
2022
|
-
|
|
2023
|
-
}).catch((
|
|
2024
|
-
|
|
92
|
+
(y, k) => void u.#t.dec(y.extension, y.data).then((b) => {
|
|
93
|
+
y.data = b, k();
|
|
94
|
+
}).catch((b) => {
|
|
95
|
+
u.#i.errScript(`[add_frame]Html ロード失敗です src:${y.name} ${b}`, !1), k();
|
|
2025
96
|
})
|
|
2026
|
-
),
|
|
2027
|
-
const
|
|
2028
|
-
this.#
|
|
2029
|
-
const
|
|
2030
|
-
|
|
97
|
+
), a.load((y, k) => {
|
|
98
|
+
const b = document.getElementById(e);
|
|
99
|
+
this.#c[e] = b, this.#y[e] = !1;
|
|
100
|
+
const g = c.lastIndexOf("/") + 1, S = c.slice(0, g), j = S.slice(0, g);
|
|
101
|
+
b.srcdoc = String(k[s]?.data).replace("sn_repRes();", "").replaceAll(
|
|
2031
102
|
/\s(?:src|href)=(["'])(\S+?)\1/g,
|
|
2032
103
|
// 【\s】が大事、data-src弾く
|
|
2033
|
-
(
|
|
2034
|
-
),
|
|
104
|
+
(m, N, L) => L.startsWith("../") ? j + m.slice(3) : m.replace("./", "").replace(N, N + S)
|
|
105
|
+
), b.srcdoc.includes("true/*WEBP*/;") && (b.srcdoc = b.srcdoc.replaceAll(
|
|
2035
106
|
/data-src="(.+?\.)(?:jpe?g|png)/g,
|
|
2036
|
-
(
|
|
2037
|
-
)),
|
|
2038
|
-
|
|
2039
|
-
const
|
|
2040
|
-
this.#
|
|
107
|
+
(m, N) => `data-src="${N}webp`
|
|
108
|
+
)), b.onload = () => {
|
|
109
|
+
C.endProc(p), this.val.setVal_Nochk("tmp", l, !0), this.val.setVal_Nochk("tmp", l + ".alpha", i), this.val.setVal_Nochk("tmp", l + ".x", h.x), this.val.setVal_Nochk("tmp", l + ".y", h.y), this.val.setVal_Nochk("tmp", l + ".scale_x", n), this.val.setVal_Nochk("tmp", l + ".scale_y", o), this.val.setVal_Nochk("tmp", l + ".rotate", r), this.val.setVal_Nochk("tmp", l + ".width", h.width), this.val.setVal_Nochk("tmp", l + ".height", h.height), this.val.setVal_Nochk("tmp", l + ".visible", f);
|
|
110
|
+
const m = b.contentWindow;
|
|
111
|
+
this.#o.resvFlameEvent(m.document.body), m.sn_repRes?.((N) => u.#_(N.dataset.src ?? "", N));
|
|
2041
112
|
};
|
|
2042
113
|
}), !0;
|
|
2043
114
|
}
|
|
2044
|
-
#
|
|
115
|
+
#y = {};
|
|
2045
116
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2046
117
|
getFrmDisabled(t) {
|
|
2047
|
-
return this.#
|
|
118
|
+
return this.#y[t];
|
|
2048
119
|
}
|
|
2049
|
-
#
|
|
2050
|
-
const e = { ...t }
|
|
120
|
+
#b(t) {
|
|
121
|
+
const e = { ...t };
|
|
2051
122
|
return new DOMRect(
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
123
|
+
v(e, "x", 0),
|
|
124
|
+
v(e, "y", 0),
|
|
125
|
+
v(e, "width", x.stageW),
|
|
126
|
+
v(e, "height", x.stageH)
|
|
2056
127
|
);
|
|
2057
128
|
}
|
|
2058
|
-
static #
|
|
2059
|
-
const i = this.#
|
|
129
|
+
static #_(t, e, s) {
|
|
130
|
+
const i = this.#f[t];
|
|
2060
131
|
if (i) {
|
|
2061
132
|
e.src = i, s && (e.onload = () => s(e));
|
|
2062
133
|
return;
|
|
2063
134
|
}
|
|
2064
|
-
const n = this.#
|
|
135
|
+
const n = this.#m[t];
|
|
2065
136
|
if (n) {
|
|
2066
137
|
n.push(e);
|
|
2067
138
|
return;
|
|
2068
139
|
}
|
|
2069
|
-
this.#
|
|
2070
|
-
const [
|
|
2071
|
-
|
|
2072
|
-
if (
|
|
2073
|
-
|
|
140
|
+
this.#m[t] = [e];
|
|
141
|
+
const [o = "", r = ""] = t.split("?"), l = u.#e.searchPath(o, H.SP_GSM), f = new F().add({ name: t, url: l, xhrType: D.XHR_RESPONSE_TYPE.BUFFER });
|
|
142
|
+
u.#t.use4ViteElectron(t, l, f, u.#i) || u.#t.arg.crypto && l.endsWith(".bin") && f.use((d, h) => {
|
|
143
|
+
if (d.extension !== "bin") {
|
|
144
|
+
h();
|
|
2074
145
|
return;
|
|
2075
146
|
}
|
|
2076
|
-
|
|
2077
|
-
|
|
147
|
+
u.#t.decAB(d.data).then((p) => {
|
|
148
|
+
d.data = p, p instanceof HTMLImageElement && (d.type = D.TYPE.IMAGE), h();
|
|
2078
149
|
}).catch((p) => {
|
|
2079
|
-
|
|
150
|
+
u.#i.errScript(`FrameMng loadPic ロード失敗です fn:${d.name} ${p}`, !1), h();
|
|
2080
151
|
});
|
|
2081
|
-
}),
|
|
2082
|
-
for (const [p, { data: { src:
|
|
2083
|
-
const
|
|
2084
|
-
(
|
|
2085
|
-
if (
|
|
2086
|
-
|
|
2087
|
-
delete this.#
|
|
152
|
+
}), f.load((d, h) => {
|
|
153
|
+
for (const [p, { data: { src: c } }] of Object.entries(h)) {
|
|
154
|
+
const a = this.#f[p] = c + // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
155
|
+
(c.startsWith("blob:") || c.startsWith("data:") ? "" : r ? "?" + r : ""), y = this.#m[p];
|
|
156
|
+
if (y) for (const k of y)
|
|
157
|
+
k.src = a, s && (k.onload = () => s(k));
|
|
158
|
+
delete this.#m[p];
|
|
2088
159
|
}
|
|
2089
160
|
});
|
|
2090
161
|
}
|
|
2091
|
-
static #
|
|
2092
|
-
static #
|
|
162
|
+
static #m = {};
|
|
163
|
+
static #f = {};
|
|
2093
164
|
cvsResize() {
|
|
2094
|
-
for (const [t, e] of Object.entries(this.#
|
|
2095
|
-
const s = "const.sn.frm." + t, i = Number(this.val.getVal(s + ".x")), n = Number(this.val.getVal(s + ".y")),
|
|
2096
|
-
e.style.left = `${
|
|
165
|
+
for (const [t, e] of Object.entries(this.#c)) {
|
|
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 = `${u.#t.ofsLeft4elm + i * u.#t.cvsScale}px`, e.style.top = `${u.#t.ofsTop4elm + n * u.#t.cvsScale}px`, e.width = String(o * u.#t.cvsScale), e.height = String(r * u.#t.cvsScale);
|
|
2097
168
|
}
|
|
2098
169
|
}
|
|
2099
170
|
// フレーム変数を取得
|
|
2100
|
-
#
|
|
171
|
+
#d(t) {
|
|
2101
172
|
const { id: e, var_name: s } = t;
|
|
2102
173
|
if (!e) throw "idは必須です";
|
|
2103
174
|
const i = document.getElementById(e);
|
|
@@ -2105,33 +176,33 @@ class C {
|
|
|
2105
176
|
const n = "const.sn.frm." + e;
|
|
2106
177
|
if (!this.val.getVal(`tmp:${n}`)) throw `frame【${e}】が読み込まれていません`;
|
|
2107
178
|
if (!s) throw "var_nameは必須です";
|
|
2108
|
-
const
|
|
2109
|
-
if (!Object.hasOwn(
|
|
2110
|
-
const
|
|
179
|
+
const o = i.contentWindow;
|
|
180
|
+
if (!Object.hasOwn(o, s)) throw `frame【${e}】に変数/関数【${s}】がありません。変数は var付きにして下さい`;
|
|
181
|
+
const r = o[s];
|
|
2111
182
|
return this.val.setVal_Nochk(
|
|
2112
183
|
"tmp",
|
|
2113
184
|
n + "." + s,
|
|
2114
185
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call
|
|
2115
|
-
|
|
186
|
+
w(t, "function", !1) ? r() : r
|
|
2116
187
|
), !1;
|
|
2117
188
|
}
|
|
2118
189
|
// フレーム変数に設定
|
|
2119
|
-
#
|
|
190
|
+
#N(t) {
|
|
2120
191
|
const { id: e, var_name: s, text: i } = t;
|
|
2121
192
|
if (!e) throw "idは必須です";
|
|
2122
193
|
const n = document.getElementById(e);
|
|
2123
194
|
if (!n) throw `id【${e}】はフレームではありません`;
|
|
2124
|
-
const
|
|
2125
|
-
if (!this.val.getVal(`tmp:${
|
|
195
|
+
const o = "const.sn.frm." + e;
|
|
196
|
+
if (!this.val.getVal(`tmp:${o}`)) throw `frame【${e}】が読み込まれていません`;
|
|
2126
197
|
if (!s) throw "var_nameは必須です";
|
|
2127
198
|
if (!i) throw "textは必須です";
|
|
2128
|
-
this.val.setVal_Nochk("tmp",
|
|
2129
|
-
const
|
|
2130
|
-
return
|
|
199
|
+
this.val.setVal_Nochk("tmp", o + "." + s, i);
|
|
200
|
+
const r = n.contentWindow;
|
|
201
|
+
return r[s] = i, !1;
|
|
2131
202
|
}
|
|
2132
203
|
// フレームに設定
|
|
2133
|
-
#
|
|
2134
|
-
#
|
|
204
|
+
#n = 1;
|
|
205
|
+
#S(t) {
|
|
2135
206
|
const { id: e } = t;
|
|
2136
207
|
if (!e) throw "idは必須です";
|
|
2137
208
|
const s = document.getElementById(e);
|
|
@@ -2139,90 +210,90 @@ class C {
|
|
|
2139
210
|
const i = "const.sn.frm." + e;
|
|
2140
211
|
if (!this.val.getVal("tmp:" + i)) throw `frame【${e}】が読み込まれていません`;
|
|
2141
212
|
const n = s.style;
|
|
2142
|
-
if (
|
|
2143
|
-
const
|
|
2144
|
-
this.val.setVal_Nochk("tmp", i + ".alpha",
|
|
213
|
+
if (w(t, "float", !1) ? n.zIndex = `${++this.#n}` : "index" in t ? n.zIndex = `${v(t, "index", 0)}` : t.dive && (n.zIndex = `-${++this.#n}`), "alpha" in t) {
|
|
214
|
+
const r = n.opacity = String(t.alpha);
|
|
215
|
+
this.val.setVal_Nochk("tmp", i + ".alpha", r);
|
|
2145
216
|
}
|
|
2146
|
-
const
|
|
2147
|
-
if (("x" in t || "y" in t) && (n.left = `${
|
|
2148
|
-
const
|
|
2149
|
-
n.transform = `scale(${
|
|
217
|
+
const o = this.#b(t);
|
|
218
|
+
if (("x" in t || "y" in t) && (n.left = `${u.#t.ofsLeft4elm + o.x * u.#t.cvsScale}px`, n.top = `${u.#t.ofsTop4elm + o.y * u.#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 = v(t, "scale_x", 1), l = v(t, "scale_y", 1), f = v(t, "rotate", 0);
|
|
220
|
+
n.transform = `scale(${r}, ${l}) rotate(${f}deg)`, this.val.setVal_Nochk("tmp", i + ".scale_x", r), this.val.setVal_Nochk("tmp", i + ".scale_y", l), this.val.setVal_Nochk("tmp", i + ".rotate", f);
|
|
2150
221
|
}
|
|
2151
|
-
if ("width" in t && (s.width = String(
|
|
2152
|
-
const
|
|
2153
|
-
n.display =
|
|
222
|
+
if ("width" in t && (s.width = String(o.width * u.#t.cvsScale), this.val.setVal_Nochk("tmp", i + ".width", o.width)), "height" in t && (s.height = String(o.height * u.#t.cvsScale), this.val.setVal_Nochk("tmp", i + ".height", o.height)), "visible" in t) {
|
|
223
|
+
const r = w(t, "visible", !0);
|
|
224
|
+
n.display = r ? "inline" : "none", this.val.setVal_Nochk("tmp", i + ".visible", r);
|
|
2154
225
|
}
|
|
2155
226
|
if ("b_color" in t && (n.backgroundColor = t.b_color), "disabled" in t) {
|
|
2156
|
-
const
|
|
2157
|
-
for (const
|
|
2158
|
-
...Array.from(
|
|
2159
|
-
...Array.from(
|
|
2160
|
-
])
|
|
227
|
+
const r = this.#y[e] = w(t, "disabled", !0), l = s.contentDocument.body;
|
|
228
|
+
for (const f of [
|
|
229
|
+
...Array.from(l.getElementsByTagName("input")),
|
|
230
|
+
...Array.from(l.getElementsByTagName("select"))
|
|
231
|
+
]) f.disabled = r;
|
|
2161
232
|
}
|
|
2162
233
|
return !1;
|
|
2163
234
|
}
|
|
2164
235
|
// フレームをトゥイーン開始
|
|
2165
|
-
#
|
|
2166
|
-
const { id: e, alpha: s, x: i, y: n, scale_x:
|
|
236
|
+
#w(t) {
|
|
237
|
+
const { id: e, alpha: s, x: i, y: n, scale_x: o, scale_y: r, rotate: l, width: f, height: d } = t;
|
|
2167
238
|
if (!e) throw "idは必須です";
|
|
2168
|
-
const
|
|
2169
|
-
if (!
|
|
239
|
+
const h = document.getElementById(e);
|
|
240
|
+
if (!h) throw `id【${e}】はフレームではありません`;
|
|
2170
241
|
const p = "const.sn.frm." + e;
|
|
2171
242
|
if (!this.val.getVal(`tmp:${p}`, 0)) throw `frame【${e}】が読み込まれていません`;
|
|
2172
|
-
const
|
|
2173
|
-
s && (
|
|
2174
|
-
const
|
|
2175
|
-
let
|
|
243
|
+
const c = {};
|
|
244
|
+
s && (c.a = Number(h.style.opacity)), (i || n || o || r || l) && (c.x = Number(this.val.getVal(`tmp:${p}.x`)), c.y = Number(this.val.getVal(`tmp:${p}.y`)), c.sx = Number(this.val.getVal(`tmp:${p}.scale_x`)), c.sy = Number(this.val.getVal(`tmp:${p}.scale_y`)), c.r = Number(this.val.getVal(`tmp:${p}.rotate`))), f && (c.w = Number(this.val.getVal(`tmp:${p}.width`))), d && (c.h = Number(this.val.getVal(`tmp:${p}.height`)));
|
|
245
|
+
const a = _.cnvTweenArg(t, c);
|
|
246
|
+
let y = () => {
|
|
2176
247
|
};
|
|
2177
|
-
s && (
|
|
2178
|
-
|
|
248
|
+
s && (v(a, "alpha", 0), y = () => {
|
|
249
|
+
h.style.opacity = String(c.a), this.val.setVal_Nochk("tmp", "alpha", c.a);
|
|
2179
250
|
});
|
|
2180
|
-
let
|
|
251
|
+
let k = () => {
|
|
2181
252
|
};
|
|
2182
|
-
const
|
|
2183
|
-
(i || n ||
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
253
|
+
const b = this.#b(a);
|
|
254
|
+
(i || n || o || r || l) && (b.x, b.y, v(a, "scale_x", 1), v(a, "scale_y", 1), v(a, "rotate", 0), k = () => {
|
|
255
|
+
h.style.left = `${// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
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);
|
|
2187
258
|
});
|
|
2188
|
-
let
|
|
259
|
+
let g = () => {
|
|
2189
260
|
};
|
|
2190
|
-
|
|
2191
|
-
|
|
261
|
+
f && (b.width, g = () => {
|
|
262
|
+
h.width = `${c.w * u.#t.cvsScale} px`, this.val.setVal_Nochk("tmp", p + ".width", c.w);
|
|
2192
263
|
});
|
|
2193
|
-
let
|
|
264
|
+
let S = () => {
|
|
2194
265
|
};
|
|
2195
|
-
return
|
|
2196
|
-
|
|
2197
|
-
}), this.appPixi.stage.interactive = !1,
|
|
2198
|
-
${e}`, t,
|
|
2199
|
-
|
|
266
|
+
return d && (b.height, S = () => {
|
|
267
|
+
h.height = `${c.h * u.#t.cvsScale} px`, this.val.setVal_Nochk("tmp", p + ".height", c.h);
|
|
268
|
+
}), this.appPixi.stage.interactive = !1, _.tween(`frm
|
|
269
|
+
${e}`, t, c, _.cnvTweenArg(t, c), () => {
|
|
270
|
+
y(), k(), g(), S();
|
|
2200
271
|
}, () => {
|
|
2201
272
|
this.appPixi.stage.interactive = !0;
|
|
2202
273
|
}, () => {
|
|
2203
274
|
}), !1;
|
|
2204
275
|
}
|
|
2205
276
|
}
|
|
2206
|
-
class
|
|
277
|
+
class ht {
|
|
2207
278
|
// 🍚
|
|
2208
279
|
constructor(t, e, s) {
|
|
2209
|
-
this.oCfg = t, this.hTag = e, this.val = s, e.rec_ch = (i) => this.#
|
|
2210
|
-
this.#
|
|
2211
|
-
this.#
|
|
2212
|
-
const i = [...this.#
|
|
280
|
+
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", () => {
|
|
281
|
+
this.#e.text = // 🌾
|
|
282
|
+
this.#e.text.replaceAll("</span><span class='sn_ch'>", "");
|
|
283
|
+
const i = [...this.#t, this.#e];
|
|
2213
284
|
return JSON.stringify(i);
|
|
2214
285
|
}), this.recText("");
|
|
2215
286
|
}
|
|
2216
|
-
#
|
|
287
|
+
#e = { text: "" };
|
|
2217
288
|
// 🌾
|
|
2218
|
-
#
|
|
289
|
+
#t = [];
|
|
2219
290
|
// [ch] からコールされる
|
|
2220
291
|
// [ch] // 文字を追加する
|
|
2221
292
|
// recText(text: string) コール
|
|
2222
293
|
// 🌾this.#LastLog = {text}; // 置換でよい
|
|
2223
294
|
// 🍊save:const.sn.sLog = 🦀const.sn.log.json // これを起動したい
|
|
2224
295
|
recText(t) {
|
|
2225
|
-
this.#
|
|
296
|
+
this.#e.text = t, this.val.setVal_Nochk(
|
|
2226
297
|
"save",
|
|
2227
298
|
"const.sn.sLog",
|
|
2228
299
|
// 🍊 リプレイ時の回復用
|
|
@@ -2232,8 +303,8 @@ class Gt {
|
|
|
2232
303
|
}
|
|
2233
304
|
//MARK: 履歴書き込み
|
|
2234
305
|
// 🌾this.#LastLog = {...hArg, text: 🌾this.#LastLog.text};
|
|
2235
|
-
#
|
|
2236
|
-
return this.#
|
|
306
|
+
#i(t) {
|
|
307
|
+
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(
|
|
2237
308
|
"save",
|
|
2238
309
|
"const.sn.sLog",
|
|
2239
310
|
// 🍊 リプレイ時の回復用
|
|
@@ -2242,124 +313,124 @@ class Gt {
|
|
|
2242
313
|
), !1);
|
|
2243
314
|
}
|
|
2244
315
|
//MARK: 履歴改行
|
|
2245
|
-
#
|
|
2246
|
-
return this.#
|
|
316
|
+
#o(t) {
|
|
317
|
+
return this.#i({ ...t, text: "[r]" });
|
|
2247
318
|
}
|
|
2248
319
|
//MARK: 履歴リセット
|
|
2249
320
|
// 以下をクリア。text で置き換え値を設定できる
|
|
2250
321
|
// 🌾this.#LastLog = {text: hArg.text ?? ''};
|
|
2251
322
|
// 🍚this.#aLog = []
|
|
2252
323
|
// 🍊save:const.sn.sLog= hArg.text ?[{text:"${hArg.text}"}] : []
|
|
2253
|
-
#
|
|
2254
|
-
return this.#
|
|
324
|
+
#c(t) {
|
|
325
|
+
return this.#t = [], t.text ??= "", this.#e = { text: t.text }, this.val.setVal_Nochk("save", "const.sn.sLog", JSON.stringify([this.#e])), !1;
|
|
2255
326
|
}
|
|
2256
327
|
//MARK: 履歴改ページ
|
|
2257
328
|
pagebreak() {
|
|
2258
|
-
this.#
|
|
2259
|
-
this.#
|
|
329
|
+
this.#e.text = // 🌾
|
|
330
|
+
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: "" });
|
|
2260
331
|
}
|
|
2261
332
|
//MARK: 履歴回復
|
|
2262
333
|
// save:const.sn.sLog からの復帰
|
|
2263
334
|
playback() {
|
|
2264
|
-
this.#
|
|
335
|
+
this.#t = JSON.parse(String(this.val.getVal("save:const.sn.sLog"))), this.#e = { text: "" };
|
|
2265
336
|
}
|
|
2266
337
|
}
|
|
2267
|
-
function
|
|
2268
|
-
return encodeURIComponent(JSON.stringify(
|
|
338
|
+
function V(O) {
|
|
339
|
+
return encodeURIComponent(JSON.stringify(O));
|
|
2269
340
|
}
|
|
2270
|
-
class
|
|
341
|
+
class M {
|
|
2271
342
|
//MARK: コンストラクタ
|
|
2272
|
-
constructor(t, e, s, i, n,
|
|
2273
|
-
this.cfg = t, this.hTag = e, this.appPixi = s, this.val = i, this.main = n, this.scrItr =
|
|
2274
|
-
const
|
|
2275
|
-
if (
|
|
2276
|
-
this.#
|
|
2277
|
-
else for (const
|
|
2278
|
-
this.#
|
|
2279
|
-
this.#
|
|
2280
|
-
};
|
|
2281
|
-
if (
|
|
2282
|
-
this.#
|
|
343
|
+
constructor(t, e, s, i, n, o, r, l, f) {
|
|
344
|
+
this.cfg = t, this.hTag = e, this.appPixi = s, this.val = i, this.main = n, this.scrItr = o, this.sys = r;
|
|
345
|
+
const d = () => {
|
|
346
|
+
if (r.cvsResize(), this.cvsResizeDesign(), this.#_) for (const a of this.#r)
|
|
347
|
+
this.#s[a].fore.cvsResizeChildren();
|
|
348
|
+
else for (const a of this.#r)
|
|
349
|
+
this.#s[a].fore.cvsResize();
|
|
350
|
+
this.#o.cvsResize(), this.#d.cvsResize();
|
|
351
|
+
};
|
|
352
|
+
if (x.isMobile)
|
|
353
|
+
this.#x.add(globalThis, "orientationchange", d, { passive: !0 });
|
|
2283
354
|
else {
|
|
2284
|
-
let
|
|
2285
|
-
this.#
|
|
2286
|
-
|
|
2287
|
-
|
|
355
|
+
let a;
|
|
356
|
+
this.#x.add(globalThis, "resize", () => {
|
|
357
|
+
a || (a = setTimeout(() => {
|
|
358
|
+
a = void 0, d();
|
|
2288
359
|
}, 1e3 / 60 * 10));
|
|
2289
360
|
}, { passive: !0 });
|
|
2290
361
|
}
|
|
2291
|
-
|
|
2292
|
-
delete
|
|
2293
|
-
}), t.existsBreakpage && (this.breakPage = (
|
|
2294
|
-
delete
|
|
2295
|
-
}), this.#
|
|
2296
|
-
const
|
|
2297
|
-
|
|
2298
|
-
const p = (
|
|
2299
|
-
this.#
|
|
362
|
+
r.cvsResize(), this.#l = new ht(this.cfg.oCfg, e, i), $.init(t, e, i, this.#l, (a) => this.#s[a.layname].fore === a, s), X.init(n, t, s, r, l, i), u.init(t, r, n), this.#o = new u(e, s, i), e.loadplugin = (a) => this.#O(a), e.snapshot = (a) => this.#S(a), this.#w = this.sys.isApp ? (a, y, k, b, g) => this.#B(a, y, k, b, g) : (a, y, k, b, g) => this.#W(a, y, k, b, g), 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) => _.wt(a), e.quake = (a) => this.#q(a), e.stop_quake = e.finish_trans, e.wq = e.wt, e.pause_tsy = (a) => _.pause_tsy(a), e.resume_tsy = (a) => _.resume_tsy(a), e.stop_tsy = (a) => _.stop_tsy(a), e.tsy = (a) => this.#Y(a), e.wait_tsy = (a) => _.wait_tsy(a), e.add_filter = (a) => this.#J(a), e.clear_filter = (a) => this.#X(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) => I.add_face(a), e.wv = (a) => I.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) => {
|
|
363
|
+
delete a.visible, a.id = "break", a.pic = "breakline", this.#n("grp|" + V(a));
|
|
364
|
+
}), t.existsBreakpage && (this.breakPage = (a) => {
|
|
365
|
+
delete a.visible, a.id = "break", a.pic = "breakpage", this.#n("grp|" + V(a));
|
|
366
|
+
}), this.#c = A(String(t.oCfg.init.bg_color));
|
|
367
|
+
const h = new G();
|
|
368
|
+
h.beginFill(this.#c).lineStyle(0, this.#c).drawRect(0, 0, x.stageW, x.stageH).endFill(), this.#t.addChild(h.clone()), this.#i.addChild(h), 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";
|
|
369
|
+
const p = (a, y) => {
|
|
370
|
+
this.#N(Number(y));
|
|
2300
371
|
};
|
|
2301
372
|
p("", i.getVal("sys:TextLayer.Back.Alpha", 1)), i.defValTrg("sys:TextLayer.Back.Alpha", p);
|
|
2302
|
-
const
|
|
2303
|
-
|
|
373
|
+
const c = (a, y) => {
|
|
374
|
+
Z.fontFamily = y;
|
|
2304
375
|
};
|
|
2305
|
-
|
|
2306
|
-
this.#
|
|
376
|
+
c("", i.getVal("tmp:sn.button.fontFamily", Z.fontFamily)), i.defValTrg("tmp:sn.button.fontFamily", c), i.defTmp("const.sn.last_page_text", () => this.currentTxtlayFore?.pageText ?? ""), i.defTmp("const.sn.last_page_plain_text", () => this.currentTxtlayFore?.pagePlainText ?? ""), x.isDbg && (K.init(s, r, o, f, t, this.#s), this.cvsResizeDesign = () => K.cvsResizeDesign(), r.addHook((a, y) => {
|
|
377
|
+
this.#y[a]?.(a, y) && delete this.#y[a];
|
|
2307
378
|
}));
|
|
2308
379
|
}
|
|
2309
|
-
#
|
|
2310
|
-
#
|
|
2311
|
-
#
|
|
2312
|
-
#
|
|
2313
|
-
#
|
|
380
|
+
#e;
|
|
381
|
+
#t = new U();
|
|
382
|
+
#i = new U();
|
|
383
|
+
#o;
|
|
384
|
+
#c;
|
|
2314
385
|
#l;
|
|
2315
|
-
#
|
|
386
|
+
#x = new tt();
|
|
2316
387
|
cvsResizeDesign() {
|
|
2317
388
|
}
|
|
2318
|
-
#
|
|
389
|
+
#y = {
|
|
2319
390
|
attach: (t) => !1,
|
|
2320
391
|
continue: (t) => !1,
|
|
2321
392
|
disconnect: (t) => !1,
|
|
2322
393
|
_enterDesign: (t) => {
|
|
2323
|
-
for (const e of this.#
|
|
2324
|
-
const s = this.#
|
|
394
|
+
for (const e of this.#r) {
|
|
395
|
+
const s = this.#s[e].fore;
|
|
2325
396
|
s.makeDesignCastChildren((i) => i.make()), s.makeDesignCast((i) => i.make());
|
|
2326
397
|
}
|
|
2327
|
-
return this.#
|
|
398
|
+
return this.#m(this.#v), !1;
|
|
2328
399
|
},
|
|
2329
400
|
_replaceToken: (t, e) => !1,
|
|
2330
401
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
|
|
2331
|
-
_selectNode: (t, e) => (this.#
|
|
402
|
+
_selectNode: (t, e) => (this.#m(e.node), !1)
|
|
2332
403
|
};
|
|
2333
|
-
#
|
|
2334
|
-
#
|
|
2335
|
-
#
|
|
2336
|
-
[this.#
|
|
2337
|
-
const e = this.#
|
|
2338
|
-
e && (this.#
|
|
2339
|
-
}
|
|
2340
|
-
getFrmDisabled = (t) => this.#
|
|
2341
|
-
#
|
|
404
|
+
#b = "";
|
|
405
|
+
#_ = "";
|
|
406
|
+
#m(t) {
|
|
407
|
+
[this.#b = "", this.#_ = ""] = t.split("/");
|
|
408
|
+
const e = this.#s[this.#b];
|
|
409
|
+
e && (this.#_ ? e.fore.showDesignCastChildren() : e.fore.showDesignCast());
|
|
410
|
+
}
|
|
411
|
+
getFrmDisabled = (t) => this.#o.getFrmDisabled(t);
|
|
412
|
+
#f = void 0;
|
|
2342
413
|
cover(t, e = 0) {
|
|
2343
|
-
this.#
|
|
2344
|
-
(this.#
|
|
414
|
+
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, x.stageW, x.stageH).endFill()
|
|
2345
416
|
);
|
|
2346
417
|
}
|
|
2347
|
-
#
|
|
418
|
+
#d;
|
|
2348
419
|
setEvtMng(t) {
|
|
2349
|
-
this.#
|
|
420
|
+
this.#d = t, this.#o.setEvtMng(t), I.setEvtMng(t), _.init(t, this.appPixi);
|
|
2350
421
|
}
|
|
2351
422
|
destroy() {
|
|
2352
|
-
for (const t of Object.values(this.#
|
|
2353
|
-
this.#
|
|
423
|
+
for (const t of Object.values(this.#s)) t.destroy();
|
|
424
|
+
this.#x.clear(), X.destroy(), ct.destroy(), ot.destroy(), $.destroy(), this.#o.destroy(), _.destroy(), $.msecChWait = 10;
|
|
2354
425
|
}
|
|
2355
426
|
// 既存の全文字レイヤの実際のバック不透明度、を再計算
|
|
2356
|
-
#
|
|
2357
|
-
for (const e of this.#
|
|
2358
|
-
const { fore: s, back: i } = this.#
|
|
2359
|
-
s instanceof
|
|
427
|
+
#N(t) {
|
|
428
|
+
for (const e of this.#r) {
|
|
429
|
+
const { fore: s, back: i } = this.#s[e];
|
|
430
|
+
s instanceof $ && (s.chgBackAlpha(t), i.chgBackAlpha(t));
|
|
2360
431
|
}
|
|
2361
432
|
}
|
|
2362
|
-
#
|
|
433
|
+
#n = (t, e = this.currentTxtlayForeNeedErr, s = !0) => e.tagCh("| 《" + t + "》");
|
|
2363
434
|
goTxt = () => {
|
|
2364
435
|
};
|
|
2365
436
|
get needGoTxt() {
|
|
@@ -2370,130 +441,130 @@ class G {
|
|
|
2370
441
|
breakPage = (t) => {
|
|
2371
442
|
};
|
|
2372
443
|
clearBreak() {
|
|
2373
|
-
this.currentTxtlayFore && (this.clearBreak = () => this.#
|
|
444
|
+
this.currentTxtlayFore && (this.clearBreak = () => this.#n("del|break"), this.clearBreak());
|
|
2374
445
|
}
|
|
2375
446
|
clickTxtLay() {
|
|
2376
|
-
return this.currentTxtlayFore ? this.#
|
|
447
|
+
return this.currentTxtlayFore ? this.#r.map((t) => this.#s[t].fore).some((t) => t instanceof $ && t.click()) : !1;
|
|
2377
448
|
}
|
|
2378
449
|
// // システム
|
|
2379
450
|
//MARK: スナップショット
|
|
2380
|
-
#
|
|
2381
|
-
const e =
|
|
2382
|
-
return this.#
|
|
451
|
+
#S(t) {
|
|
452
|
+
const e = et("-", "_", "", "_"), s = t.fn ? t.fn.startsWith(lt) ? t.fn : `${Q + t.fn + e}.png` : `${Q}snapshot${e}.png`, i = this.cfg.searchPath(s), n = v(t, "width", x.stageW), o = v(t, "height", x.stageH);
|
|
453
|
+
return this.#w(t, i, n, o, `snapshot dt:${e}`);
|
|
2383
454
|
}
|
|
2384
|
-
#
|
|
2385
|
-
#
|
|
2386
|
-
if (this.#
|
|
455
|
+
#w = () => !1;
|
|
456
|
+
#B({ layer: t }, e, s, i, n) {
|
|
457
|
+
if (this.#o.hideAllFrame(), C.beginProc(n), !t)
|
|
2387
458
|
return this.sys.capturePage(e, s, i, () => {
|
|
2388
|
-
this.#
|
|
459
|
+
this.#o.restoreAllFrame(), C.endProc(n);
|
|
2389
460
|
}), !0;
|
|
2390
|
-
const
|
|
2391
|
-
const { ctn:
|
|
2392
|
-
return
|
|
461
|
+
const o = this.#r.map((r) => {
|
|
462
|
+
const { ctn: l } = this.#s[r].fore, f = [l, l.visible];
|
|
463
|
+
return l.visible = !1, f;
|
|
2393
464
|
});
|
|
2394
|
-
for (const
|
|
465
|
+
for (const r of this.#p(t)) this.#s[r].fore.ctn.visible = !0;
|
|
2395
466
|
return this.sys.capturePage(e, s, i, () => {
|
|
2396
|
-
for (const [
|
|
2397
|
-
this.#
|
|
467
|
+
for (const [r, l] of o) r.visible = l;
|
|
468
|
+
this.#o.restoreAllFrame(), C.endProc(n);
|
|
2398
469
|
}), !0;
|
|
2399
470
|
}
|
|
2400
|
-
#
|
|
2401
|
-
|
|
2402
|
-
const
|
|
471
|
+
#W(t, e, s, i, n) {
|
|
472
|
+
C.beginProc(n);
|
|
473
|
+
const o = st(t, "b_color", this.#c), r = it({
|
|
2403
474
|
width: s,
|
|
2404
475
|
height: i,
|
|
2405
|
-
backgroundAlpha:
|
|
2406
|
-
antialias:
|
|
476
|
+
backgroundAlpha: o > 16777216 && e.endsWith(".png") ? 0 : 1,
|
|
477
|
+
antialias: w(t, "smoothing", !1),
|
|
2407
478
|
preserveDrawingBuffer: !0,
|
|
2408
|
-
backgroundColor:
|
|
479
|
+
backgroundColor: o & 16777215,
|
|
2409
480
|
autoDensity: !0
|
|
2410
|
-
}),
|
|
481
|
+
}), l = t.page !== "back" ? "fore" : "back", { layer: f } = t;
|
|
2411
482
|
return Promise.allSettled(
|
|
2412
|
-
this.#
|
|
2413
|
-
(
|
|
483
|
+
this.#p(f).map((d) => new Promise(
|
|
484
|
+
(h) => this.#s[d][l].snapshot(r, h)
|
|
2414
485
|
))
|
|
2415
486
|
).then(async () => {
|
|
2416
|
-
const
|
|
2417
|
-
|
|
487
|
+
const d = B.create({ width: r.width, height: r.height });
|
|
488
|
+
r.render(this.#e, { renderTexture: d }), await this.sys.savePic(
|
|
2418
489
|
e,
|
|
2419
490
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
2420
|
-
|
|
2421
|
-
),
|
|
2422
|
-
for (const
|
|
2423
|
-
|
|
491
|
+
r.plugins.extract.base64(d)
|
|
492
|
+
), d.destroy();
|
|
493
|
+
for (const h of this.#p(f)) this.#s[h][l].snapshot_end();
|
|
494
|
+
r.destroy(!0), C.endProc(n);
|
|
2424
495
|
}), !0;
|
|
2425
496
|
}
|
|
2426
497
|
//MARK: プラグインの読み込み
|
|
2427
|
-
#
|
|
498
|
+
#O(t) {
|
|
2428
499
|
const { fn: e } = t;
|
|
2429
500
|
if (!e) throw "fnは必須です";
|
|
2430
501
|
if (!e.endsWith(".css")) throw "サポートされない拡張子です";
|
|
2431
|
-
const s =
|
|
2432
|
-
return s &&
|
|
502
|
+
const s = w(t, "join", !0), i = C.procID + `loadplugin fn:${e}`;
|
|
503
|
+
return s && C.beginProc(i), (async () => {
|
|
2433
504
|
const n = await fetch(e);
|
|
2434
505
|
if (!n.ok) throw new Error("Network response was not ok.");
|
|
2435
|
-
|
|
506
|
+
at(await n.text()), s && C.endProc(i);
|
|
2436
507
|
})(), s;
|
|
2437
508
|
}
|
|
2438
509
|
// // レイヤ共通
|
|
2439
510
|
//MARK: レイヤを追加する
|
|
2440
|
-
#
|
|
511
|
+
#j(t) {
|
|
2441
512
|
const { layer: e, class: s } = t;
|
|
2442
513
|
if (!e) throw "layerは必須です";
|
|
2443
514
|
if (e.includes(",")) throw "layer名に「,」は使えません";
|
|
2444
|
-
if (e in this.#
|
|
515
|
+
if (e in this.#s) throw `layer【${e}】はすでにあります`;
|
|
2445
516
|
if (!s) throw "clsは必須です";
|
|
2446
517
|
const i = { isWait: !1 };
|
|
2447
|
-
switch (this.#
|
|
518
|
+
switch (this.#s[e] = new R(e, s, this.#t, this.#i, t, this.sys, this.val, i), this.#r.push(e), s) {
|
|
2448
519
|
case "txt":
|
|
2449
|
-
this.#
|
|
2450
|
-
}, this.#
|
|
2451
|
-
this.#
|
|
2452
|
-
for (const n of this.#
|
|
2453
|
-
const
|
|
2454
|
-
|
|
520
|
+
this.#v || (this.#$ = () => {
|
|
521
|
+
}, this.#h = (n) => this.#Q(n), this.#D = (n) => this.#Z(n), this.hTag.current({ layer: e }), this.goTxt = () => {
|
|
522
|
+
this.#d.isSkipping ? $.msecChWait = 0 : this.setNormalChWait();
|
|
523
|
+
for (const n of this.#r) {
|
|
524
|
+
const o = this.#s[n].fore;
|
|
525
|
+
o instanceof $ && this.#n("gotxt|", o, !1);
|
|
2455
526
|
}
|
|
2456
527
|
}), this.val.setVal_Nochk("save", "const.sn.layer." + e + ".enabled", !0);
|
|
2457
528
|
break;
|
|
2458
529
|
case "grp":
|
|
2459
|
-
if (this.#
|
|
2460
|
-
this.#
|
|
530
|
+
if (this.#E) break;
|
|
531
|
+
this.#E = e;
|
|
2461
532
|
break;
|
|
2462
533
|
}
|
|
2463
534
|
return this.scrItr.recodeDesign(t), i.isWait;
|
|
2464
535
|
}
|
|
2465
|
-
#
|
|
536
|
+
#s = {
|
|
2466
537
|
/* empty */
|
|
2467
538
|
};
|
|
2468
539
|
// しおりLoad時再読込
|
|
2469
|
-
#
|
|
540
|
+
#r = [];
|
|
2470
541
|
// 最適化用・重なり順つき全レイヤ名
|
|
542
|
+
#v = "";
|
|
2471
543
|
#E = "";
|
|
2472
|
-
#
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
this.#n.setChildIndex(i, this.#n.children.length - 1), this.#e.setChildIndex(n, this.#e.children.length - 1), this.#z();
|
|
544
|
+
#z(t) {
|
|
545
|
+
const e = this.#u(t), s = this.#s[e], i = s.back.ctn, n = s.fore.ctn;
|
|
546
|
+
if (w(t, "float", !1))
|
|
547
|
+
this.#i.setChildIndex(i, this.#i.children.length - 1), this.#t.setChildIndex(n, this.#t.children.length - 1), this.#V();
|
|
2477
548
|
else if (t.index)
|
|
2478
|
-
|
|
549
|
+
v(t, "index", 0) && (this.#i.setChildIndex(i, t.index), this.#t.setChildIndex(n, t.index), this.#V());
|
|
2479
550
|
else if (t.dive) {
|
|
2480
|
-
const { dive:
|
|
2481
|
-
let
|
|
2482
|
-
if (e ===
|
|
2483
|
-
const
|
|
2484
|
-
if (!
|
|
2485
|
-
const
|
|
2486
|
-
|
|
551
|
+
const { dive: o } = t;
|
|
552
|
+
let r = 0;
|
|
553
|
+
if (e === o) throw "[lay] 属性 layerとdiveが同じ【" + o + "】です";
|
|
554
|
+
const l = this.#s[o];
|
|
555
|
+
if (!l) throw "[lay] 属性 dive【" + o + "】が不正です。レイヤーがありません";
|
|
556
|
+
const f = l.back, d = l.fore, h = this.#i.getChildIndex(f.ctn), p = this.#t.getChildIndex(d.ctn);
|
|
557
|
+
r = h < p ? h : p, r > this.#i.getChildIndex(i) && --r, this.#t.setChildIndex(n, r), this.#i.setChildIndex(i, r), this.#V();
|
|
2487
558
|
}
|
|
2488
559
|
return t[":id_tag"] = s.fore.name.slice(0, -7), this.scrItr.recodeDesign(t), s.lay(t);
|
|
2489
560
|
}
|
|
2490
|
-
#
|
|
2491
|
-
this.#
|
|
561
|
+
#V() {
|
|
562
|
+
this.#r = this.#U();
|
|
2492
563
|
}
|
|
2493
564
|
//MARK: レイヤ設定の消去
|
|
2494
|
-
#
|
|
2495
|
-
return this.#
|
|
2496
|
-
const s = this.#
|
|
565
|
+
#H(t) {
|
|
566
|
+
return this.#C(t, (e) => {
|
|
567
|
+
const s = this.#s[this.#u({ layer: e })];
|
|
2497
568
|
if (t.page === "both") {
|
|
2498
569
|
s.fore.clearLay(t), s.back.clearLay(t);
|
|
2499
570
|
return;
|
|
@@ -2503,7 +574,7 @@ class G {
|
|
|
2503
574
|
}
|
|
2504
575
|
//===================================================
|
|
2505
576
|
//MARK: WebGL フラグメントシェーダー GLSL
|
|
2506
|
-
static #
|
|
577
|
+
static #F = (
|
|
2507
578
|
/* glsl */
|
|
2508
579
|
`
|
|
2509
580
|
precision mediump float;
|
|
@@ -2545,183 +616,183 @@ void main() {
|
|
|
2545
616
|
★GLSL : don't use "if"|Nobu note.com/nobuhirosaijo/n/n606a3f5d8e89
|
|
2546
617
|
> if文はあまり使わない方がいいらしい (処理負荷が高い)
|
|
2547
618
|
*/
|
|
2548
|
-
#
|
|
2549
|
-
width:
|
|
2550
|
-
height:
|
|
619
|
+
#L = B.create({
|
|
620
|
+
width: x.stageW,
|
|
621
|
+
height: x.stageH
|
|
2551
622
|
});
|
|
2552
|
-
|
|
2553
|
-
#
|
|
2554
|
-
width:
|
|
2555
|
-
height:
|
|
623
|
+
#T = new q(this.#L);
|
|
624
|
+
#g = B.create({
|
|
625
|
+
width: x.stageW,
|
|
626
|
+
height: x.stageH
|
|
2556
627
|
});
|
|
2557
|
-
#
|
|
628
|
+
#a = new q(this.#g);
|
|
2558
629
|
//MARK: ページ裏表を交換
|
|
2559
|
-
#
|
|
2560
|
-
const { layer: e } = t, s = /* @__PURE__ */ new Set(), i = this.#
|
|
2561
|
-
[this.#
|
|
2562
|
-
const
|
|
2563
|
-
for (const [
|
|
2564
|
-
if (s.has(
|
|
2565
|
-
|
|
630
|
+
#G(t) {
|
|
631
|
+
const { layer: e } = t, s = /* @__PURE__ */ new Set(), i = this.#p(e).map((m) => (s.add(m), this.#s[m].fore)), n = () => {
|
|
632
|
+
[this.#t, this.#i] = [this.#i, this.#t];
|
|
633
|
+
const m = [];
|
|
634
|
+
for (const [N, L] of Object.entries(this.#s)) {
|
|
635
|
+
if (s.has(N)) {
|
|
636
|
+
L.transPage(m);
|
|
2566
637
|
continue;
|
|
2567
638
|
}
|
|
2568
|
-
const { fore: { ctn:
|
|
2569
|
-
this.#
|
|
639
|
+
const { fore: { ctn: T }, back: { ctn: E } } = L, z = this.#t.getChildIndex(E);
|
|
640
|
+
this.#t.removeChild(E), this.#i.removeChild(T), this.#t.addChildAt(T, z), this.#i.addChildAt(E, z);
|
|
2570
641
|
}
|
|
2571
|
-
Promise.allSettled(
|
|
2572
|
-
this.#
|
|
642
|
+
Promise.allSettled(m).then(() => {
|
|
643
|
+
this.#t.visible = !0, this.#i.visible = !1, this.#T.visible = !1, this.#a.visible = !1, C.notifyEndProc(J + P);
|
|
2573
644
|
});
|
|
2574
645
|
};
|
|
2575
|
-
if (this.#
|
|
2576
|
-
return
|
|
646
|
+
if (this.#a.filters = [], this.#a.alpha = 1, v(t, "time", 0) === 0 || this.#d.isSkipping)
|
|
647
|
+
return C.beginProc(J + P, () => {
|
|
2577
648
|
}), queueMicrotask(() => n()), !0;
|
|
2578
|
-
const
|
|
2579
|
-
const { fore:
|
|
2580
|
-
return
|
|
2581
|
-
}), { ticker:
|
|
2582
|
-
|
|
2583
|
-
let
|
|
2584
|
-
for (const
|
|
2585
|
-
|
|
2586
|
-
{ renderTexture: this.#
|
|
649
|
+
const r = [], l = this.#r.map((m) => {
|
|
650
|
+
const { fore: N, back: L } = this.#s[m], T = s.has(m) ? L : N;
|
|
651
|
+
return T.ctn.visible && r.push(T.ctn), T;
|
|
652
|
+
}), { ticker: f, renderer: d } = this.appPixi;
|
|
653
|
+
d.render(this.#i, { renderTexture: this.#L });
|
|
654
|
+
let h = () => {
|
|
655
|
+
for (const m of r) d.render(
|
|
656
|
+
m,
|
|
657
|
+
{ renderTexture: this.#L, clear: !1 }
|
|
2587
658
|
);
|
|
2588
659
|
};
|
|
2589
|
-
if (!
|
|
2590
|
-
const
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
},
|
|
660
|
+
if (!l.some((m) => m.containMovement)) {
|
|
661
|
+
const m = h;
|
|
662
|
+
h = () => {
|
|
663
|
+
h = () => {
|
|
664
|
+
}, m();
|
|
2594
665
|
};
|
|
2595
666
|
}
|
|
2596
|
-
const p = () =>
|
|
667
|
+
const p = () => d.render(this.#t, { renderTexture: this.#g });
|
|
2597
668
|
p();
|
|
2598
|
-
let
|
|
2599
|
-
this.#
|
|
2600
|
-
};
|
|
2601
|
-
if (!i.some((
|
|
2602
|
-
const
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
},
|
|
669
|
+
let c = () => {
|
|
670
|
+
this.#t.visible = !0, p(), this.#t.visible = !1;
|
|
671
|
+
};
|
|
672
|
+
if (!i.some((m) => m.containMovement)) {
|
|
673
|
+
const m = c;
|
|
674
|
+
c = () => {
|
|
675
|
+
c = () => {
|
|
676
|
+
}, m();
|
|
2606
677
|
};
|
|
2607
678
|
}
|
|
2608
|
-
const
|
|
2609
|
-
|
|
2610
|
-
}, { glsl:
|
|
2611
|
-
|
|
2612
|
-
};
|
|
2613
|
-
if (!
|
|
2614
|
-
return
|
|
2615
|
-
},
|
|
2616
|
-
}),
|
|
2617
|
-
const
|
|
2618
|
-
rule:
|
|
2619
|
-
vague:
|
|
679
|
+
const a = () => {
|
|
680
|
+
h(), this.#T.visible = !0, c(), this.#a.visible = !0;
|
|
681
|
+
}, { glsl: y, rule: k } = t, b = () => {
|
|
682
|
+
f.remove(a), n();
|
|
683
|
+
};
|
|
684
|
+
if (!y && !k)
|
|
685
|
+
return _.tween(P, t, this.#a, { alpha: 0 }, () => {
|
|
686
|
+
}, b, () => {
|
|
687
|
+
}), f.add(a), !1;
|
|
688
|
+
const g = {
|
|
689
|
+
rule: nt.EMPTY,
|
|
690
|
+
vague: v(t, "vague", 0.04),
|
|
2620
691
|
tick: 0
|
|
2621
692
|
};
|
|
2622
|
-
this.#
|
|
693
|
+
this.#a.filters = [new rt(
|
|
2623
694
|
void 0,
|
|
2624
|
-
|
|
2625
|
-
|
|
695
|
+
y ?? M.#F,
|
|
696
|
+
g
|
|
2626
697
|
)];
|
|
2627
|
-
const
|
|
2628
|
-
},
|
|
2629
|
-
}, !
|
|
2630
|
-
return
|
|
2631
|
-
|
|
2632
|
-
}, (
|
|
2633
|
-
|
|
2634
|
-
}).ret : (
|
|
2635
|
-
}
|
|
2636
|
-
#
|
|
2637
|
-
return t ? t.split(",") : this.#
|
|
2638
|
-
}
|
|
2639
|
-
#
|
|
2640
|
-
const s = this.#
|
|
698
|
+
const S = _.tween(P, t, g, { tick: 1 }, () => {
|
|
699
|
+
}, b, () => {
|
|
700
|
+
}, !k);
|
|
701
|
+
return k ? new I(k, void 0, (m) => {
|
|
702
|
+
g.rule = m.texture, m.destroy(), S.start(), f.add(a);
|
|
703
|
+
}, (m) => {
|
|
704
|
+
m && this.main.resume();
|
|
705
|
+
}).ret : (f.add(a), !1);
|
|
706
|
+
}
|
|
707
|
+
#p(t = "") {
|
|
708
|
+
return t ? t.split(",") : this.#r;
|
|
709
|
+
}
|
|
710
|
+
#C(t, e) {
|
|
711
|
+
const s = this.#p(t.layer);
|
|
2641
712
|
for (const i of s) {
|
|
2642
|
-
const n = this.#
|
|
713
|
+
const n = this.#s[i];
|
|
2643
714
|
if (!n) throw `存在しないlayer【${i}】です`;
|
|
2644
715
|
e(i, n);
|
|
2645
716
|
}
|
|
2646
717
|
return s;
|
|
2647
718
|
}
|
|
2648
|
-
#
|
|
2649
|
-
return this.#
|
|
2650
|
-
const i = this.#
|
|
719
|
+
#U(t = "") {
|
|
720
|
+
return this.#p(t).sort((e, s) => {
|
|
721
|
+
const i = this.#t.getChildIndex(this.#s[e].fore.ctn), n = this.#t.getChildIndex(this.#s[s].fore.ctn);
|
|
2651
722
|
return i < n ? -1 : i > n ? 1 : 0;
|
|
2652
723
|
});
|
|
2653
724
|
}
|
|
2654
725
|
setAllStyle2TxtLay(t) {
|
|
2655
|
-
for (const e of this.#
|
|
2656
|
-
const s = this.#
|
|
2657
|
-
s instanceof
|
|
726
|
+
for (const e of this.#r) {
|
|
727
|
+
const s = this.#s[e].fore;
|
|
728
|
+
s instanceof $ && s.lay({ style: t });
|
|
2658
729
|
}
|
|
2659
730
|
}
|
|
2660
731
|
//MARK: 画面を揺らす
|
|
2661
|
-
#
|
|
2662
|
-
if (
|
|
2663
|
-
const e = this.#
|
|
2664
|
-
this.#
|
|
732
|
+
#q(t) {
|
|
733
|
+
if (v(t, "time", NaN) === 0) return !1;
|
|
734
|
+
const e = this.#p(t.layer).map((d) => this.#s[d].fore.ctn), { renderer: s, ticker: i } = this.appPixi;
|
|
735
|
+
this.#g.resize(x.stageW, x.stageH);
|
|
2665
736
|
const n = () => {
|
|
2666
|
-
this.#
|
|
2667
|
-
for (const
|
|
2668
|
-
|
|
2669
|
-
{ renderTexture: this.#
|
|
737
|
+
this.#t.visible = !0;
|
|
738
|
+
for (const d of e) s.render(
|
|
739
|
+
d,
|
|
740
|
+
{ renderTexture: this.#g, clear: !1 }
|
|
2670
741
|
);
|
|
2671
|
-
this.#
|
|
742
|
+
this.#t.visible = !1;
|
|
2672
743
|
};
|
|
2673
|
-
this.#
|
|
2674
|
-
const
|
|
744
|
+
this.#a.visible = !0, this.#a.alpha = 1;
|
|
745
|
+
const o = W(v(t, "hmax", 10)), r = W(v(t, "vmax", 10)), l = o === 0 ? () => {
|
|
2675
746
|
} : () => {
|
|
2676
|
-
this.#
|
|
2677
|
-
},
|
|
747
|
+
this.#a.x = Math.round(Math.random() * o * 2) - o;
|
|
748
|
+
}, f = r === 0 ? () => {
|
|
2678
749
|
} : () => {
|
|
2679
|
-
this.#
|
|
750
|
+
this.#a.y = Math.round(Math.random() * r * 2) - r;
|
|
2680
751
|
};
|
|
2681
|
-
return this.#
|
|
2682
|
-
|
|
752
|
+
return this.#a.filters = [], _.tween(P, t, this.#a, { x: 0, y: 0 }, () => {
|
|
753
|
+
l(), f();
|
|
2683
754
|
}, () => {
|
|
2684
|
-
i.remove(n), this.#
|
|
755
|
+
i.remove(n), this.#t.visible = !0, this.#a.visible = !1, this.#a.x = 0, this.#a.y = 0;
|
|
2685
756
|
}, () => {
|
|
2686
757
|
}), i.add(n), !1;
|
|
2687
758
|
}
|
|
2688
759
|
//MARK: トゥイーン開始
|
|
2689
|
-
#
|
|
760
|
+
#Y(t) {
|
|
2690
761
|
const { layer: e, render: s, name: i } = t;
|
|
2691
762
|
if (!e) throw "layerは必須です";
|
|
2692
|
-
const n = this.#
|
|
2693
|
-
let
|
|
763
|
+
const n = this.#s[this.#u(t)], o = n.fore;
|
|
764
|
+
let r = () => {
|
|
2694
765
|
};
|
|
2695
|
-
s && !this.#
|
|
2696
|
-
const
|
|
2697
|
-
return
|
|
2698
|
-
},
|
|
2699
|
-
if (
|
|
2700
|
-
}), "filter" in t && (
|
|
766
|
+
s && !this.#d.isSkipping && (o.renderStart(), r = () => o.renderEnd());
|
|
767
|
+
const l = _.cnvTweenArg(t, o), f = w(t, "arrive", !1), d = w(t, "backlay", !1), h = n.back.ctn;
|
|
768
|
+
return _.tween(i ?? e, t, o, _.cnvTweenArg(t, o), () => {
|
|
769
|
+
}, r, () => {
|
|
770
|
+
if (f && Object.assign(o, l), d) for (const p of Object.keys(_.hMemberCnt)) h[p] = o[p];
|
|
771
|
+
}), "filter" in t && (o.ctn.filters = [Y.bldFilters(t)], o.aFltHArg = [t]), !1;
|
|
2701
772
|
}
|
|
2702
773
|
//MARK: フィルター追加
|
|
2703
|
-
#
|
|
2704
|
-
return this.#
|
|
2705
|
-
const s = this.#
|
|
774
|
+
#J(t) {
|
|
775
|
+
return this.#C(t, (e) => {
|
|
776
|
+
const s = this.#s[this.#u({ layer: e })];
|
|
2706
777
|
if (t.page === "both") {
|
|
2707
|
-
this.#
|
|
778
|
+
this.#P(s.fore, t), this.#P(s.back, t);
|
|
2708
779
|
return;
|
|
2709
780
|
}
|
|
2710
781
|
const i = s.getPage(t);
|
|
2711
|
-
this.#
|
|
782
|
+
this.#P(i, t);
|
|
2712
783
|
}), !1;
|
|
2713
784
|
}
|
|
2714
|
-
#
|
|
785
|
+
#P(t, e) {
|
|
2715
786
|
const s = t.ctn;
|
|
2716
|
-
s.filters ??= [], s.filters = [...s.filters,
|
|
787
|
+
s.filters ??= [], s.filters = [...s.filters, Y.bldFilters(e)], t.aFltHArg.push(e);
|
|
2717
788
|
}
|
|
2718
789
|
//MARK: フィルター全削除
|
|
2719
|
-
#
|
|
2720
|
-
return this.#
|
|
2721
|
-
const s = this.#
|
|
790
|
+
#X(t) {
|
|
791
|
+
return this.#C(t, (e) => {
|
|
792
|
+
const s = this.#s[this.#u({ layer: e })];
|
|
2722
793
|
if (t.page === "both") {
|
|
2723
|
-
const n = s.fore,
|
|
2724
|
-
n.ctn.filters = null,
|
|
794
|
+
const n = s.fore, o = s.back;
|
|
795
|
+
n.ctn.filters = null, o.ctn.filters = null, n.aFltHArg = [], o.aFltHArg = [];
|
|
2725
796
|
return;
|
|
2726
797
|
}
|
|
2727
798
|
const i = s.getPage(t);
|
|
@@ -2729,112 +800,108 @@ void main() {
|
|
|
2729
800
|
}), !1;
|
|
2730
801
|
}
|
|
2731
802
|
//MARK: フィルター個別切替
|
|
2732
|
-
#
|
|
2733
|
-
return this.#
|
|
2734
|
-
const s = this.#
|
|
803
|
+
#K(t) {
|
|
804
|
+
return this.#C(t, (e) => {
|
|
805
|
+
const s = this.#s[this.#u({ layer: e })];
|
|
2735
806
|
if (t.page === "both") {
|
|
2736
|
-
this.#
|
|
807
|
+
this.#R(s.fore, t), this.#R(s.back, t);
|
|
2737
808
|
return;
|
|
2738
809
|
}
|
|
2739
810
|
const i = s.getPage(t);
|
|
2740
|
-
this.#
|
|
811
|
+
this.#R(i, t);
|
|
2741
812
|
}), !1;
|
|
2742
813
|
}
|
|
2743
|
-
#
|
|
814
|
+
#R(t, e) {
|
|
2744
815
|
const s = t.ctn;
|
|
2745
816
|
if (!s.filters) throw "フィルターがありません";
|
|
2746
|
-
const i =
|
|
817
|
+
const i = W(v(e, "index", 0)), n = s.filters.length;
|
|
2747
818
|
if (n <= i) throw `フィルターの個数(${String(n)})を越えています`;
|
|
2748
|
-
t.aFltHArg[i].enabled = s.filters[i].enabled =
|
|
819
|
+
t.aFltHArg[i].enabled = s.filters[i].enabled = w(e, "enabled", !0);
|
|
2749
820
|
}
|
|
2750
821
|
// // 文字・文字レイヤ
|
|
2751
|
-
static #C = 10;
|
|
2752
|
-
static get msecChWait() {
|
|
2753
|
-
return G.#C;
|
|
2754
|
-
}
|
|
2755
822
|
//MARK: 文字を追加する
|
|
2756
|
-
#
|
|
823
|
+
#I(t) {
|
|
2757
824
|
const { text: e } = t;
|
|
2758
825
|
if (!e) throw "textは必須です";
|
|
2759
|
-
const s = this.#
|
|
2760
|
-
delete t.text, this.setNormalChWait(), this.#
|
|
2761
|
-
const i =
|
|
826
|
+
const s = this.#h(t);
|
|
827
|
+
delete t.text, this.setNormalChWait(), this.#d.isSkipping ? t.wait = 0 : "wait" in t && v(t, "wait", NaN), this.#n("add|" + V(t), s);
|
|
828
|
+
const i = w(t, "record", !0), n = this.val.doRecLog();
|
|
2762
829
|
return i || this.val.setVal_Nochk("save", "sn.doRecLog", i), s.tagCh(e.replaceAll("[r]", `
|
|
2763
|
-
`)), this.val.setVal_Nochk("save", "sn.doRecLog", n), this.#
|
|
830
|
+
`)), this.val.setVal_Nochk("save", "sn.doRecLog", n), this.#n("add_close|", s), !1;
|
|
2764
831
|
}
|
|
2765
|
-
#
|
|
2766
|
-
throw this
|
|
832
|
+
#h = (t) => {
|
|
833
|
+
throw this.#$(), 0;
|
|
2767
834
|
};
|
|
2768
|
-
#
|
|
2769
|
-
const e = this.#
|
|
2770
|
-
if (!(i instanceof
|
|
835
|
+
#Q(t) {
|
|
836
|
+
const e = this.#u(t, this.#v), i = this.#s[e].getPage(t);
|
|
837
|
+
if (!(i instanceof $)) throw e + "はTxtLayerではありません";
|
|
2771
838
|
return i;
|
|
2772
839
|
}
|
|
2773
840
|
setNormalChWait() {
|
|
2774
|
-
|
|
841
|
+
$.msecChWait = this.scrItr.normalWait;
|
|
2775
842
|
}
|
|
2776
843
|
//MARK: 操作対象のメッセージレイヤの指定
|
|
2777
|
-
#
|
|
2778
|
-
throw this
|
|
844
|
+
#D = (t) => {
|
|
845
|
+
throw this.#$(), 0;
|
|
2779
846
|
};
|
|
2780
|
-
#
|
|
847
|
+
#Z(t) {
|
|
2781
848
|
const { layer: e } = t;
|
|
2782
849
|
if (!e) throw "[current] layerは必須です";
|
|
2783
|
-
const s = this.#
|
|
2784
|
-
if (!s || !(s.getPage(t) instanceof
|
|
2785
|
-
this.#
|
|
2786
|
-
for (const i of this.#
|
|
2787
|
-
const { fore: n, back:
|
|
2788
|
-
n instanceof
|
|
850
|
+
const s = this.#s[e];
|
|
851
|
+
if (!s || !(s.getPage(t) instanceof $)) throw `${e}はTxtLayerではありません`;
|
|
852
|
+
this.#k = s, this.#l.pagebreak(), this.#v = e, this.val.setVal_Nochk("save", "const.sn.mesLayer", e);
|
|
853
|
+
for (const i of this.#r) {
|
|
854
|
+
const { fore: n, back: o } = this.#s[i];
|
|
855
|
+
n instanceof $ && (n.isCur = o.isCur = i === e);
|
|
2789
856
|
}
|
|
2790
857
|
return !1;
|
|
2791
858
|
}
|
|
2792
859
|
get currentTxtlayForeNeedErr() {
|
|
2793
|
-
return this
|
|
860
|
+
return this.#$(), this.currentTxtlayFore;
|
|
2794
861
|
}
|
|
2795
862
|
get currentTxtlayFore() {
|
|
2796
|
-
return this.#
|
|
863
|
+
return this.#k ? this.#k.fore : null;
|
|
2797
864
|
}
|
|
2798
|
-
#
|
|
865
|
+
#k = void 0;
|
|
2799
866
|
// カレントテキストレイヤ
|
|
2800
|
-
|
|
867
|
+
#$ = () => {
|
|
2801
868
|
throw "文字レイヤーがありません。文字表示や操作する前に、[add_lay layer=(レイヤ名) class=txt]で文字レイヤを追加して下さい";
|
|
2802
869
|
};
|
|
2803
|
-
#
|
|
870
|
+
#u(t, e = "") {
|
|
2804
871
|
const s = t.layer ?? e;
|
|
2805
872
|
if (s.includes(",")) throw "layer名に「,」は使えません";
|
|
2806
|
-
if (!(s in this.#
|
|
873
|
+
if (!(s in this.#s)) throw "属性 layer【" + s + "】が不正です。レイヤーがありません";
|
|
2807
874
|
return t.layer = s, s;
|
|
2808
875
|
}
|
|
2809
876
|
recPagebreak() {
|
|
2810
877
|
this.#l.pagebreak();
|
|
2811
878
|
}
|
|
2812
879
|
//MARK: 文字消去
|
|
2813
|
-
#
|
|
2814
|
-
const e = this.#
|
|
2815
|
-
return t.layer === this.#
|
|
880
|
+
#M(t) {
|
|
881
|
+
const e = this.#h(t);
|
|
882
|
+
return t.layer === this.#v && t.page === "fore" && this.#l.pagebreak(), e.clearText(), !1;
|
|
2816
883
|
}
|
|
2817
884
|
//MARK: ハイパーリンクの終了
|
|
2818
|
-
#
|
|
2819
|
-
return this.#
|
|
885
|
+
#A(t) {
|
|
886
|
+
return this.#n("endlink|", this.#h(t)), !1;
|
|
2820
887
|
}
|
|
2821
888
|
//MARK: ページ両面の文字消去
|
|
2822
|
-
#
|
|
2823
|
-
return
|
|
889
|
+
#tt(t) {
|
|
890
|
+
return w(t, "rec_page_break", !0) && this.#l.pagebreak(), this.#k && (this.#k.fore.clearLay(t), this.#k.back.clearLay(t)), !1;
|
|
2824
891
|
}
|
|
2825
892
|
//MARK: インライン画像表示
|
|
2826
|
-
#
|
|
893
|
+
#et(t) {
|
|
2827
894
|
if (!t.pic) throw "[graph] picは必須です";
|
|
2828
|
-
return this.#
|
|
895
|
+
return this.#n("grp|" + V(t), this.#h(t)), !1;
|
|
2829
896
|
}
|
|
2830
897
|
//MARK: ハイパーリンク
|
|
2831
|
-
#
|
|
898
|
+
#st(t) {
|
|
2832
899
|
if (!t.fn && !t.label && !t.url) throw "fn,label,url いずれかは必須です";
|
|
2833
|
-
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.#
|
|
900
|
+
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|" + V(t), this.#h(t)), !1;
|
|
2834
901
|
}
|
|
2835
902
|
//MARK: 改行
|
|
2836
|
-
#
|
|
2837
|
-
return this.#
|
|
903
|
+
#it(t) {
|
|
904
|
+
return this.#I({ ...t, text: `
|
|
2838
905
|
` });
|
|
2839
906
|
}
|
|
2840
907
|
//MARK: 文字列と複数ルビの追加
|
|
@@ -2842,26 +909,26 @@ void main() {
|
|
|
2842
909
|
const { t: e, r: s } = t;
|
|
2843
910
|
if (!e) throw "[ruby2] tは必須です";
|
|
2844
911
|
if (!s) throw "[ruby2] rは必須です";
|
|
2845
|
-
return t.text = "|" + encodeURIComponent(e) + "《" + encodeURIComponent(s) + "》", delete t.t, delete t.r, this.#
|
|
912
|
+
return t.text = "|" + encodeURIComponent(e) + "《" + encodeURIComponent(s) + "》", delete t.t, delete t.r, this.#I(t);
|
|
2846
913
|
}
|
|
2847
914
|
//MARK: インラインスタイル設定
|
|
2848
|
-
#
|
|
2849
|
-
return this.#
|
|
915
|
+
#nt(t) {
|
|
916
|
+
return this.#n("span|" + V(t), this.#h(t)), !1;
|
|
2850
917
|
}
|
|
2851
918
|
//MARK: tcy縦中横を表示する
|
|
2852
919
|
#rt(t) {
|
|
2853
920
|
if (!t.t) throw "[tcy] tは必須です";
|
|
2854
|
-
return this.#
|
|
921
|
+
return this.#n("tcy|" + V(t), this.#h(t)), !1;
|
|
2855
922
|
}
|
|
2856
923
|
//MARK: レイヤのダンプ
|
|
2857
|
-
#
|
|
924
|
+
#ot({ layer: t }) {
|
|
2858
925
|
console.group("🥟 [dump_lay]");
|
|
2859
|
-
for (const e of this.#
|
|
2860
|
-
const { fore: s, back: i } = this.#
|
|
926
|
+
for (const e of this.#p(t)) {
|
|
927
|
+
const { fore: s, back: i } = this.#s[e];
|
|
2861
928
|
try {
|
|
2862
929
|
console.info(
|
|
2863
930
|
`%c${s.name.slice(0, -7)} %o`,
|
|
2864
|
-
`color:#${
|
|
931
|
+
`color:#${x.isDarkMode ? "49F" : "05A"};`,
|
|
2865
932
|
JSON.parse(`{"back":{${i.dump()}}, "fore":{${s.dump()}}}`)
|
|
2866
933
|
);
|
|
2867
934
|
} catch (n) {
|
|
@@ -2871,19 +938,19 @@ void main() {
|
|
|
2871
938
|
return console.groupEnd(), !1;
|
|
2872
939
|
}
|
|
2873
940
|
//MARK: イベント有無の切替
|
|
2874
|
-
#
|
|
2875
|
-
const e = this.#
|
|
2876
|
-
return this.#
|
|
941
|
+
#ct(t) {
|
|
942
|
+
const e = this.#u(t, this.#v), s = w(t, "enabled", !0);
|
|
943
|
+
return this.#h(t).enabled = s, this.val.setVal_Nochk("save", "const.sn.layer." + e + ".enabled", s), !1;
|
|
2877
944
|
}
|
|
2878
945
|
//MARK: ボタンを表示
|
|
2879
|
-
#
|
|
2880
|
-
return
|
|
946
|
+
#lt(t) {
|
|
947
|
+
return R.argChk_page(t, "back"), t.fn ??= this.scrItr.scriptFn, this.#h(t).addButton(t), this.scrItr.recodeDesign(t), !1;
|
|
2881
948
|
}
|
|
2882
949
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2883
950
|
record() {
|
|
2884
951
|
const t = {};
|
|
2885
|
-
for (const e of this.#
|
|
2886
|
-
const s = this.#
|
|
952
|
+
for (const e of this.#r) {
|
|
953
|
+
const s = this.#s[e];
|
|
2887
954
|
t[e] = {
|
|
2888
955
|
cls: s.cls,
|
|
2889
956
|
fore: s.fore.record(),
|
|
@@ -2895,30 +962,24 @@ void main() {
|
|
|
2895
962
|
playback(t) {
|
|
2896
963
|
this.#l.playback();
|
|
2897
964
|
const e = [], s = [];
|
|
2898
|
-
for (const [n, { fore:
|
|
2899
|
-
s.push({ ln: n, idx:
|
|
2900
|
-
const
|
|
2901
|
-
|
|
965
|
+
for (const [n, { fore: o, fore: { idx: r }, back: l, cls: f }] of Object.entries(t)) {
|
|
966
|
+
s.push({ ln: n, idx: r });
|
|
967
|
+
const d = this.#s[n] ??= new R(n, f, this.#t, this.#i, {}, this.sys, this.val, { isWait: !1 });
|
|
968
|
+
d.fore.playback(o, e), d.back.playback(l, e);
|
|
2902
969
|
}
|
|
2903
|
-
const i = this.#
|
|
970
|
+
const i = this.#t.children.length;
|
|
2904
971
|
return e.push(new Promise((n) => {
|
|
2905
|
-
for (const { ln:
|
|
2906
|
-
const
|
|
2907
|
-
if (!
|
|
2908
|
-
const
|
|
2909
|
-
this.#
|
|
972
|
+
for (const { ln: o, idx: r } of s.sort(({ idx: l }, { idx: f }) => l === f ? 0 : l < f ? -1 : 1)) {
|
|
973
|
+
const l = this.#s[o];
|
|
974
|
+
if (!l) continue;
|
|
975
|
+
const f = i > r ? r : i - 1, { fore: d, back: h } = l;
|
|
976
|
+
this.#t.setChildIndex(d.ctn, f), this.#i.setChildIndex(h.ctn, f);
|
|
2910
977
|
}
|
|
2911
978
|
n();
|
|
2912
979
|
})), e;
|
|
2913
980
|
}
|
|
2914
981
|
}
|
|
2915
|
-
const Zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2916
|
-
__proto__: null,
|
|
2917
|
-
LayerMng: G
|
|
2918
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
2919
982
|
export {
|
|
2920
|
-
|
|
2921
|
-
Zt as L,
|
|
2922
|
-
P as T
|
|
983
|
+
M as LayerMng
|
|
2923
984
|
};
|
|
2924
985
|
//# sourceMappingURL=LayerMng.js.map
|