@famibee/skynovel 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button.js +36 -34
- package/dist/Button.js.map +1 -1
- package/dist/CallStack.js +11 -6
- package/dist/CallStack.js.map +1 -1
- package/dist/CmnInterface.js +13 -11
- package/dist/CmnInterface.js.map +1 -1
- package/dist/CmnLib.js +58 -56
- package/dist/CmnLib.js.map +1 -1
- package/dist/Config.js +9 -7
- package/dist/Config.js.map +1 -1
- package/dist/ConfigBase.js +52 -49
- package/dist/ConfigBase.js.map +1 -1
- package/dist/DebugMng.js +9 -6
- package/dist/DebugMng.js.map +1 -1
- package/dist/EventListenerCtn.js +6 -4
- package/dist/EventListenerCtn.js.map +1 -1
- package/dist/EventMng.js +522 -417
- package/dist/EventMng.js.map +1 -1
- package/dist/Grammar.js +22 -20
- package/dist/Grammar.js.map +1 -1
- package/dist/GrpLayer.js +58 -57
- package/dist/GrpLayer.js.map +1 -1
- package/dist/Layer.js +66 -64
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMng.js +461 -441
- package/dist/LayerMng.js.map +1 -1
- package/dist/Main.js +69 -67
- package/dist/Main.js.map +1 -1
- package/dist/PropParser.js +23 -19
- package/dist/PropParser.js.map +1 -1
- package/dist/Reading.js +422 -418
- package/dist/Reading.js.map +1 -1
- package/dist/RubySpliter.js +6 -4
- package/dist/RubySpliter.js.map +1 -1
- package/dist/ScriptIterator.js +374 -370
- package/dist/ScriptIterator.js.map +1 -1
- package/dist/SndBuf.js +643 -622
- package/dist/SndBuf.js.map +1 -1
- package/dist/SoundMng.js +59 -60
- package/dist/SoundMng.js.map +1 -1
- package/dist/SpritesMng.js +135 -129
- package/dist/SpritesMng.js.map +1 -1
- package/dist/SysBase.js +985 -950
- package/dist/SysBase.js.map +1 -1
- package/dist/TxtLayer.js +558 -551
- package/dist/TxtLayer.js.map +1 -1
- package/dist/Variable.js +47 -45
- package/dist/Variable.js.map +1 -1
- package/dist/chunk.js +11 -9
- package/dist/gamepad.js +396 -660
- package/dist/gamepad.js.map +1 -1
- package/dist/pixi.js +2631 -2593
- package/dist/pixi.js.map +1 -1
- package/dist/platform.js +6 -4
- package/dist/platform.js.map +1 -1
- package/dist/rolldown-runtime.js +20 -0
- package/dist/sn/RubySpliter.d.ts.map +1 -1
- package/dist/web.js +418 -418
- package/dist/web.js.map +1 -1
- package/dist_app/Button.js +36 -34
- package/dist_app/Button.js.map +1 -1
- package/dist_app/CallStack.js +11 -6
- package/dist_app/CallStack.js.map +1 -1
- package/dist_app/CmnInterface.js +13 -11
- package/dist_app/CmnInterface.js.map +1 -1
- package/dist_app/CmnLib.js +58 -56
- package/dist_app/CmnLib.js.map +1 -1
- package/dist_app/Config.js +9 -7
- package/dist_app/Config.js.map +1 -1
- package/dist_app/ConfigBase.js +52 -49
- package/dist_app/ConfigBase.js.map +1 -1
- package/dist_app/DebugMng.js +9 -6
- package/dist_app/DebugMng.js.map +1 -1
- package/dist_app/EventListenerCtn.js +6 -4
- package/dist_app/EventListenerCtn.js.map +1 -1
- package/dist_app/EventMng.js +522 -417
- package/dist_app/EventMng.js.map +1 -1
- package/dist_app/Grammar.js +22 -20
- package/dist_app/Grammar.js.map +1 -1
- package/dist_app/GrpLayer.js +58 -57
- package/dist_app/GrpLayer.js.map +1 -1
- package/dist_app/Layer.js +66 -64
- package/dist_app/Layer.js.map +1 -1
- package/dist_app/LayerMng.js +461 -441
- package/dist_app/LayerMng.js.map +1 -1
- package/dist_app/Main.js +69 -67
- package/dist_app/Main.js.map +1 -1
- package/dist_app/PropParser.js +23 -19
- package/dist_app/PropParser.js.map +1 -1
- package/dist_app/Reading.js +422 -418
- package/dist_app/Reading.js.map +1 -1
- package/dist_app/RubySpliter.js +6 -4
- package/dist_app/RubySpliter.js.map +1 -1
- package/dist_app/ScriptIterator.js +374 -370
- package/dist_app/ScriptIterator.js.map +1 -1
- package/dist_app/SndBuf.js +643 -622
- package/dist_app/SndBuf.js.map +1 -1
- package/dist_app/SoundMng.js +59 -60
- package/dist_app/SoundMng.js.map +1 -1
- package/dist_app/SpritesMng.js +135 -129
- package/dist_app/SpritesMng.js.map +1 -1
- package/dist_app/SysBase.js +985 -950
- package/dist_app/SysBase.js.map +1 -1
- package/dist_app/TxtLayer.js +558 -551
- package/dist_app/TxtLayer.js.map +1 -1
- package/dist_app/Variable.js +47 -45
- package/dist_app/Variable.js.map +1 -1
- package/dist_app/app.js +62 -63
- package/dist_app/app.js.map +1 -1
- package/dist_app/appMain.js +11 -11
- package/dist_app/appMain.js.map +1 -1
- package/dist_app/chunk.js +11 -9
- package/dist_app/gamepad.js +396 -660
- package/dist_app/gamepad.js.map +1 -1
- package/dist_app/pixi.js +2028 -1990
- package/dist_app/pixi.js.map +1 -1
- package/dist_app/platform.js +6 -4
- package/dist_app/platform.js.map +1 -1
- package/dist_app/preload.js +1 -1
- package/dist_app/preload.js.map +1 -1
- package/dist_app/rolldown-runtime.js +20 -0
- package/dist_app/sn/RubySpliter.d.ts.map +1 -1
- package/package.json +20 -21
package/dist_app/LayerMng.js
CHANGED
|
@@ -1,41 +1,46 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { c
|
|
3
|
-
import { t as
|
|
4
|
-
import { n as
|
|
5
|
-
import "./
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { t as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
var
|
|
1
|
+
import { c as e, g as t, h as n, l as r, o as i, s as a, t as o, u as s } from "./CmnLib.js";
|
|
2
|
+
import { c, d as l, f as u, l as d, m as f, o as p, p as m, s as h, u as g } from "./pixi.js";
|
|
3
|
+
import { t as _ } from "./EventListenerCtn.js";
|
|
4
|
+
import { n as v } from "./ConfigBase.js";
|
|
5
|
+
import { t as y } from "./Layer.js";
|
|
6
|
+
import { i as b, r as x, t as S } from "./Reading.js";
|
|
7
|
+
import { t as C } from "./SpritesMng.js";
|
|
8
|
+
import { Button as w } from "./Button.js";
|
|
9
|
+
import { t as T } from "./RubySpliter.js";
|
|
10
|
+
import { TxtLayer as E, t as D } from "./TxtLayer.js";
|
|
11
|
+
import { GrpLayer as O, t as k } from "./GrpLayer.js";
|
|
12
|
+
import { n as A } from "./Config.js";
|
|
13
|
+
//#region src/sn/Pages.ts
|
|
14
|
+
var j = class e {
|
|
15
|
+
cls;
|
|
16
|
+
hArg;
|
|
17
|
+
sys;
|
|
18
|
+
val;
|
|
19
|
+
ret;
|
|
15
20
|
#e;
|
|
16
|
-
constructor(e,
|
|
17
|
-
this.cls =
|
|
18
|
-
let
|
|
19
|
-
if (!
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
fore:
|
|
25
|
-
back:
|
|
26
|
-
},
|
|
27
|
-
let
|
|
28
|
-
|
|
21
|
+
constructor(e, t, n, r, i, o, s, c) {
|
|
22
|
+
this.cls = t, this.hArg = i, this.sys = o, this.val = s, this.ret = c;
|
|
23
|
+
let l = o.hFactoryCls[t];
|
|
24
|
+
if (!l) throw `属性 class【${t}】が不正です`;
|
|
25
|
+
let u = l(), d = l();
|
|
26
|
+
u.layname = d.layname = e;
|
|
27
|
+
let f = i[":id_tag"] = `layer:${e} cls:${t} page:`;
|
|
28
|
+
u.ctn.name = u.name = f + "A", d.ctn.name = d.name = f + "B", n.addChild(u.ctn), r.addChild(d.ctn), a(i, "visible", !0), a(i, "visible", !0), c.isWait = u.lay(i) || d.lay(i), this.#e = {
|
|
29
|
+
fore: u,
|
|
30
|
+
back: d
|
|
31
|
+
}, r.visible = !1;
|
|
32
|
+
let p = `const.sn.lay.${e}`;
|
|
33
|
+
s.setVal_Nochk("tmp", p, !0), s.defTmp(p + ".fore.alpha", () => this.#e.fore.alpha), s.defTmp(p + ".back.alpha", () => this.#e.back.alpha), s.defTmp(p + ".fore.height", () => this.#e.fore.height), s.defTmp(p + ".back.height", () => this.#e.back.height), s.defTmp(p + ".fore.visible", () => this.#e.fore.ctn.visible), s.defTmp(p + ".back.visible", () => this.#e.back.ctn.visible), s.defTmp(p + ".fore.width", () => this.#e.fore.width), s.defTmp(p + ".back.width", () => this.#e.back.width), s.defTmp(p + ".fore.x", () => this.#e.fore.x), s.defTmp(p + ".back.x", () => this.#e.back.x), s.defTmp(p + ".fore.y", () => this.#e.fore.y), s.defTmp(p + ".back.y", () => this.#e.back.y);
|
|
29
34
|
}
|
|
30
35
|
destroy() {
|
|
31
36
|
this.#e.fore.destroy(), this.#e.back.destroy();
|
|
32
37
|
}
|
|
33
38
|
lay = (e) => this.getPage(e).lay(e);
|
|
34
|
-
getPage = (
|
|
35
|
-
static argChk_page(e,
|
|
36
|
-
let
|
|
37
|
-
if (
|
|
38
|
-
throw Error("属性 page【" +
|
|
39
|
+
getPage = (t) => e.argChk_page(t, "fore") === "back" ? this.#e.back : this.#e.fore;
|
|
40
|
+
static argChk_page(e, t) {
|
|
41
|
+
let n = e.page ?? t;
|
|
42
|
+
if (n === "fore" || n === "back") return e.page = n, n;
|
|
43
|
+
throw Error("属性 page【" + n + "】が不正です");
|
|
39
44
|
}
|
|
40
45
|
get fore() {
|
|
41
46
|
return this.#e.fore;
|
|
@@ -46,15 +51,17 @@ var Pages = class e {
|
|
|
46
51
|
transPage(e) {
|
|
47
52
|
[this.#e.back, this.#e.fore] = [this.#e.fore, this.#e.back], this.#e.back.copy(this.#e.fore, e);
|
|
48
53
|
}
|
|
49
|
-
},
|
|
54
|
+
}, M = class e {
|
|
55
|
+
appPixi;
|
|
56
|
+
val;
|
|
50
57
|
static #e;
|
|
51
58
|
static #t;
|
|
52
59
|
static #n;
|
|
53
|
-
static init(
|
|
54
|
-
e.#e =
|
|
60
|
+
static init(t, n, r) {
|
|
61
|
+
e.#e = t, e.#t = n, e.#n = r;
|
|
55
62
|
}
|
|
56
|
-
constructor(e,
|
|
57
|
-
this.appPixi =
|
|
63
|
+
constructor(e, t, n) {
|
|
64
|
+
this.appPixi = t, this.val = n, e.add_frame = (e) => this.#o(e), e.let_frame = (e) => this.#f(e), e.set_frame = (e) => this.#p(e), e.frame = (e) => this.#h(e), e.tsy_frame = (e) => this.#g(e);
|
|
58
65
|
}
|
|
59
66
|
#r;
|
|
60
67
|
setEvtMng(e) {
|
|
@@ -66,43 +73,43 @@ var Pages = class e {
|
|
|
66
73
|
this.#i = Object.create(null);
|
|
67
74
|
}
|
|
68
75
|
hideAllFrame() {
|
|
69
|
-
for (let [e, { style:
|
|
76
|
+
for (let [e, { style: t }] of Object.entries(this.#i)) this.#a[e] = t.display !== "none", t.display = "none";
|
|
70
77
|
}
|
|
71
78
|
#a = Object.create(null);
|
|
72
79
|
restoreAllFrame() {
|
|
73
|
-
for (let [e,
|
|
74
|
-
let
|
|
75
|
-
|
|
80
|
+
for (let [e, t] of Object.entries(this.#a)) {
|
|
81
|
+
let n = this.#i[e];
|
|
82
|
+
n && (n.style.display = t ? "inline" : "none");
|
|
76
83
|
}
|
|
77
84
|
this.#a = Object.create(null);
|
|
78
85
|
}
|
|
79
|
-
#o(
|
|
80
|
-
let { id:
|
|
81
|
-
if (!
|
|
82
|
-
if (!
|
|
83
|
-
let
|
|
84
|
-
if (this.val.getVal(`tmp:${
|
|
85
|
-
let
|
|
86
|
-
e.#n.cvs.insertAdjacentHTML("beforebegin", `<iframe id="${
|
|
87
|
-
let
|
|
88
|
-
|
|
89
|
-
let
|
|
90
|
-
name:
|
|
91
|
-
url:
|
|
92
|
-
xhrType:
|
|
86
|
+
#o(t) {
|
|
87
|
+
let { id: n, src: r, alpha: i = 1, scale_x: o = 1, scale_y: s = 1, rotate: l = 0 } = t;
|
|
88
|
+
if (!n) throw "idは必須です";
|
|
89
|
+
if (!r) throw "srcは必須です";
|
|
90
|
+
let u = "const.sn.frm." + n;
|
|
91
|
+
if (this.val.getVal(`tmp:${u}`)) throw `frame【${n}】はすでにあります`;
|
|
92
|
+
let f = a(t, "visible", !0), p = t.b_color ? ` background-color: ${t.b_color};` : "", m = this.#c(t);
|
|
93
|
+
e.#n.cvs.insertAdjacentHTML("beforebegin", `<iframe id="${n}" style="opacity: ${String(i)}; ${p} position: absolute; left:${String(e.#t.ofsLeft4elm + m.x * e.#t.cvsScale)}px; top: ${String(e.#t.ofsTop4elm + m.y * e.#t.cvsScale)}px; z-index: 1; border: 0px; overflow: hidden; display: ${f ? "inline" : "none"}; transform: scale(${String(o)}, ${String(s)}) rotate(${String(l)}deg);" width="${String(m.width * e.#t.cvsScale)}" height="${String(m.height * e.#t.cvsScale)}"></iframe>`);
|
|
94
|
+
let h = S.procID + `add_frame id:${n}`;
|
|
95
|
+
S.beginProc(h);
|
|
96
|
+
let g = e.#e.searchPath(r, v.HTML), _ = new c().add({
|
|
97
|
+
name: r,
|
|
98
|
+
url: g,
|
|
99
|
+
xhrType: d.XHR_RESPONSE_TYPE.TEXT
|
|
93
100
|
});
|
|
94
|
-
return e.#t.arg.crypto &&
|
|
95
|
-
|
|
96
|
-
}).catch((
|
|
97
|
-
e.#n.errScript(`[add_frame]Html ロード失敗です src:${
|
|
98
|
-
})),
|
|
99
|
-
let
|
|
100
|
-
this.#i[
|
|
101
|
-
let
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
let
|
|
105
|
-
this.#r.resvFlameEvent(
|
|
101
|
+
return e.#t.arg.crypto && _.use((t, n) => void e.#t.dec(t.extension, t.data).then((e) => {
|
|
102
|
+
t.data = e, n();
|
|
103
|
+
}).catch((r) => {
|
|
104
|
+
e.#n.errScript(`[add_frame]Html ロード失敗です src:${t.name} ${String(r)}`, !1), n();
|
|
105
|
+
})), _.load((t, a) => {
|
|
106
|
+
let c = document.getElementById(n);
|
|
107
|
+
this.#i[n] = c, this.#s[n] = !1;
|
|
108
|
+
let d = g.lastIndexOf("/") + 1, p = g.slice(0, d), _ = p.slice(0, d);
|
|
109
|
+
c.srcdoc = String(a[r]?.data).replace("sn_repRes();", "").replaceAll(/\s(?:src|href)=(["'])(\S+?)\1/g, (e, t, n) => n.startsWith("../") ? _ + e.slice(3) : e.replace("./", "").replace(t, t + p)), c.srcdoc.includes("true/*WEBP*/;") && (c.srcdoc = c.srcdoc.replaceAll(/data-src="(.+?\.)(?:jpe?g|png)/g, (e, t) => `data-src="${t}webp`)), c.onload = () => {
|
|
110
|
+
S.endProc(h), this.val.setVal_Nochk("tmp", u, !0), this.val.setVal_Nochk("tmp", u + ".alpha", i), this.val.setVal_Nochk("tmp", u + ".x", m.x), this.val.setVal_Nochk("tmp", u + ".y", m.y), this.val.setVal_Nochk("tmp", u + ".scale_x", o), this.val.setVal_Nochk("tmp", u + ".scale_y", s), this.val.setVal_Nochk("tmp", u + ".rotate", l), this.val.setVal_Nochk("tmp", u + ".width", m.width), this.val.setVal_Nochk("tmp", u + ".height", m.height), this.val.setVal_Nochk("tmp", u + ".visible", f);
|
|
111
|
+
let t = c.contentWindow;
|
|
112
|
+
this.#r.resvFlameEvent(t.document.body), t.sn_repRes?.((t) => e.#l(t.dataset.src ?? "", t));
|
|
106
113
|
};
|
|
107
114
|
}), !0;
|
|
108
115
|
}
|
|
@@ -111,40 +118,40 @@ var Pages = class e {
|
|
|
111
118
|
return this.#s[e];
|
|
112
119
|
}
|
|
113
120
|
#c(e) {
|
|
114
|
-
let
|
|
115
|
-
return new DOMRect(
|
|
121
|
+
let t = { ...e };
|
|
122
|
+
return new DOMRect(r(t, "x", 0), r(t, "y", 0), r(t, "width", o.stageW), r(t, "height", o.stageH));
|
|
116
123
|
}
|
|
117
|
-
static #l(
|
|
118
|
-
let
|
|
119
|
-
if (
|
|
120
|
-
|
|
124
|
+
static #l(t, n, r) {
|
|
125
|
+
let i = this.#d[t];
|
|
126
|
+
if (i) {
|
|
127
|
+
n.src = i, r && (n.onload = () => r(n));
|
|
121
128
|
return;
|
|
122
129
|
}
|
|
123
|
-
let
|
|
124
|
-
if (
|
|
125
|
-
|
|
130
|
+
let a = this.#u[t];
|
|
131
|
+
if (a) {
|
|
132
|
+
a.push(n);
|
|
126
133
|
return;
|
|
127
134
|
}
|
|
128
|
-
this.#u[
|
|
129
|
-
let [
|
|
130
|
-
name:
|
|
131
|
-
url:
|
|
132
|
-
xhrType:
|
|
135
|
+
this.#u[t] = [n];
|
|
136
|
+
let [o = "", s = ""] = t.split("?"), l = e.#e.searchPath(o, v.SP_GSM), u = new c().add({
|
|
137
|
+
name: t,
|
|
138
|
+
url: l,
|
|
139
|
+
xhrType: d.XHR_RESPONSE_TYPE.BUFFER
|
|
133
140
|
});
|
|
134
|
-
e.#t.use4ViteElectron(
|
|
135
|
-
if (
|
|
136
|
-
|
|
141
|
+
e.#t.use4ViteElectron(t, l, u, e.#n) || e.#t.arg.crypto && l.endsWith(".bin") && u.use((t, n) => {
|
|
142
|
+
if (t.extension !== "bin") {
|
|
143
|
+
n();
|
|
137
144
|
return;
|
|
138
145
|
}
|
|
139
|
-
e.#t.decAB(
|
|
140
|
-
|
|
141
|
-
}).catch((
|
|
142
|
-
e.#n.errScript(`FrameMng loadPic ロード失敗です fn:${
|
|
146
|
+
e.#t.decAB(t.data).then((e) => {
|
|
147
|
+
t.data = e, e instanceof HTMLImageElement && (t.type = d.TYPE.IMAGE), n();
|
|
148
|
+
}).catch((r) => {
|
|
149
|
+
e.#n.errScript(`FrameMng loadPic ロード失敗です fn:${t.name} ${String(r)}`, !1), n();
|
|
143
150
|
});
|
|
144
|
-
}),
|
|
145
|
-
for (let [e, { data: { src:
|
|
146
|
-
let
|
|
147
|
-
if (
|
|
151
|
+
}), u.load((e, t) => {
|
|
152
|
+
for (let [e, { data: { src: n } }] of Object.entries(t)) {
|
|
153
|
+
let t = this.#d[e] = n + (n.startsWith("blob:") || n.startsWith("data:") ? "" : s ? "?" + s : ""), i = this.#u[e];
|
|
154
|
+
if (i) for (let e of i) e.src = t, r && (e.onload = () => r(e));
|
|
148
155
|
delete this.#u[e];
|
|
149
156
|
}
|
|
150
157
|
});
|
|
@@ -152,100 +159,103 @@ var Pages = class e {
|
|
|
152
159
|
static #u = {};
|
|
153
160
|
static #d = {};
|
|
154
161
|
cvsResize() {
|
|
155
|
-
for (let [
|
|
156
|
-
let
|
|
157
|
-
|
|
162
|
+
for (let [t, n] of Object.entries(this.#i)) {
|
|
163
|
+
let r = "const.sn.frm." + t, i = Number(this.val.getVal(r + ".x")), a = Number(this.val.getVal(r + ".y")), o = Number(this.val.getVal(r + ".width")), s = Number(this.val.getVal(r + ".height"));
|
|
164
|
+
n.style.left = `${String(e.#t.ofsLeft4elm + i * e.#t.cvsScale)}px`, n.style.top = `${String(e.#t.ofsTop4elm + a * e.#t.cvsScale)}px`, n.width = String(o * e.#t.cvsScale), n.height = String(s * e.#t.cvsScale);
|
|
158
165
|
}
|
|
159
166
|
}
|
|
160
167
|
#f(e) {
|
|
161
|
-
let { id:
|
|
162
|
-
if (!
|
|
163
|
-
let
|
|
164
|
-
if (!
|
|
165
|
-
let
|
|
166
|
-
if (!this.val.getVal(`tmp:${
|
|
167
|
-
if (!
|
|
168
|
-
let
|
|
169
|
-
if (!Object.hasOwn(
|
|
170
|
-
let
|
|
171
|
-
return this.val.setVal_Nochk("tmp",
|
|
168
|
+
let { id: t, var_name: n } = e;
|
|
169
|
+
if (!t) throw "idは必須です";
|
|
170
|
+
let r = document.getElementById(t);
|
|
171
|
+
if (!r) throw `id【${t}】はフレームではありません`;
|
|
172
|
+
let i = "const.sn.frm." + t;
|
|
173
|
+
if (!this.val.getVal(`tmp:${i}`)) throw `frame【${t}】が読み込まれていません`;
|
|
174
|
+
if (!n) throw "var_nameは必須です";
|
|
175
|
+
let o = r.contentWindow;
|
|
176
|
+
if (!Object.hasOwn(o, n)) throw `frame【${t}】に変数/関数【${n}】がありません。変数は var付きにして下さい`;
|
|
177
|
+
let s = o[n];
|
|
178
|
+
return this.val.setVal_Nochk("tmp", i + "." + n, a(e, "function", !1) ? s() : s), !1;
|
|
172
179
|
}
|
|
173
180
|
#p(e) {
|
|
174
|
-
let { id:
|
|
175
|
-
if (!
|
|
176
|
-
let
|
|
177
|
-
if (!
|
|
178
|
-
let
|
|
179
|
-
if (!this.val.getVal(`tmp:${
|
|
180
|
-
if (!
|
|
181
|
-
if (!
|
|
182
|
-
this.val.setVal_Nochk("tmp",
|
|
183
|
-
let
|
|
184
|
-
return
|
|
181
|
+
let { id: t, var_name: n, text: r } = e;
|
|
182
|
+
if (!t) throw "idは必須です";
|
|
183
|
+
let i = document.getElementById(t);
|
|
184
|
+
if (!i) throw `id【${t}】はフレームではありません`;
|
|
185
|
+
let a = "const.sn.frm." + t;
|
|
186
|
+
if (!this.val.getVal(`tmp:${a}`)) throw `frame【${t}】が読み込まれていません`;
|
|
187
|
+
if (!n) throw "var_nameは必須です";
|
|
188
|
+
if (!r) throw "textは必須です";
|
|
189
|
+
this.val.setVal_Nochk("tmp", a + "." + n, r);
|
|
190
|
+
let o = i.contentWindow;
|
|
191
|
+
return o[n] = r, !1;
|
|
185
192
|
}
|
|
186
193
|
#m = 1;
|
|
187
|
-
#h(
|
|
188
|
-
let { id:
|
|
189
|
-
if (!
|
|
190
|
-
let
|
|
191
|
-
if (!
|
|
192
|
-
let
|
|
193
|
-
if (!this.val.getVal("tmp:" +
|
|
194
|
-
let
|
|
195
|
-
if (
|
|
196
|
-
let e =
|
|
197
|
-
this.val.setVal_Nochk("tmp",
|
|
194
|
+
#h(t) {
|
|
195
|
+
let { id: n } = t;
|
|
196
|
+
if (!n) throw "idは必須です";
|
|
197
|
+
let i = document.getElementById(n);
|
|
198
|
+
if (!i) throw `id【${n}】はフレームではありません`;
|
|
199
|
+
let o = "const.sn.frm." + n;
|
|
200
|
+
if (!this.val.getVal("tmp:" + o)) throw `frame【${n}】が読み込まれていません`;
|
|
201
|
+
let s = i.style;
|
|
202
|
+
if (a(t, "float", !1) ? s.zIndex = String(++this.#m) : "index" in t ? s.zIndex = String(r(t, "index", 0)) : t.dive && (s.zIndex = String(-++this.#m)), "alpha" in t) {
|
|
203
|
+
let e = s.opacity = String(t.alpha);
|
|
204
|
+
this.val.setVal_Nochk("tmp", o + ".alpha", e);
|
|
198
205
|
}
|
|
199
|
-
let
|
|
200
|
-
if (("x" in
|
|
201
|
-
let e =
|
|
202
|
-
|
|
206
|
+
let c = this.#c(t);
|
|
207
|
+
if (("x" in t || "y" in t) && (s.left = `${String(e.#t.ofsLeft4elm + c.x * e.#t.cvsScale)}px`, s.top = `${String(e.#t.ofsTop4elm + c.y * e.#t.cvsScale)}px`, this.val.setVal_Nochk("tmp", o + ".x", c.x), this.val.setVal_Nochk("tmp", o + ".y", c.y)), "scale_x" in t || "scale_y" in t || "rotate" in t) {
|
|
208
|
+
let e = r(t, "scale_x", 1), n = r(t, "scale_y", 1), i = r(t, "rotate", 0);
|
|
209
|
+
s.transform = `scale(${String(e)}, ${String(n)}) rotate(${String(i)}deg)`, this.val.setVal_Nochk("tmp", o + ".scale_x", e), this.val.setVal_Nochk("tmp", o + ".scale_y", n), this.val.setVal_Nochk("tmp", o + ".rotate", i);
|
|
203
210
|
}
|
|
204
|
-
if ("width" in
|
|
205
|
-
let e =
|
|
206
|
-
|
|
211
|
+
if ("width" in t && (i.width = String(c.width * e.#t.cvsScale), this.val.setVal_Nochk("tmp", o + ".width", c.width)), "height" in t && (i.height = String(c.height * e.#t.cvsScale), this.val.setVal_Nochk("tmp", o + ".height", c.height)), "visible" in t) {
|
|
212
|
+
let e = a(t, "visible", !0);
|
|
213
|
+
s.display = e ? "inline" : "none", this.val.setVal_Nochk("tmp", o + ".visible", e);
|
|
207
214
|
}
|
|
208
|
-
if ("b_color" in
|
|
209
|
-
let e = this.#s[
|
|
210
|
-
for (let
|
|
215
|
+
if ("b_color" in t && (s.backgroundColor = t.b_color), "disabled" in t) {
|
|
216
|
+
let e = this.#s[n] = a(t, "disabled", !0), r = i.contentDocument.body;
|
|
217
|
+
for (let t of [...Array.from(r.getElementsByTagName("input")), ...Array.from(r.getElementsByTagName("select"))]) t.disabled = e;
|
|
211
218
|
}
|
|
212
219
|
return !1;
|
|
213
220
|
}
|
|
214
|
-
#g(
|
|
215
|
-
let { id:
|
|
216
|
-
if (!
|
|
217
|
-
let
|
|
218
|
-
if (!
|
|
219
|
-
let
|
|
220
|
-
if (!this.val.getVal(`tmp:${
|
|
221
|
-
let
|
|
222
|
-
|
|
223
|
-
let
|
|
224
|
-
|
|
225
|
-
|
|
221
|
+
#g(t) {
|
|
222
|
+
let { id: n, alpha: i, x: a, y: o, scale_x: s, scale_y: c, rotate: l, width: u, height: d } = t;
|
|
223
|
+
if (!n) throw "idは必須です";
|
|
224
|
+
let f = document.getElementById(n);
|
|
225
|
+
if (!f) throw `id【${n}】はフレームではありません`;
|
|
226
|
+
let p = "const.sn.frm." + n;
|
|
227
|
+
if (!this.val.getVal(`tmp:${p}`, 0)) throw `frame【${n}】が読み込まれていません`;
|
|
228
|
+
let m = {};
|
|
229
|
+
i && (m.a = Number(f.style.opacity)), (a || o || s || c || l) && (m.x = Number(this.val.getVal(`tmp:${p}.x`)), m.y = Number(this.val.getVal(`tmp:${p}.y`)), m.sx = Number(this.val.getVal(`tmp:${p}.scale_x`)), m.sy = Number(this.val.getVal(`tmp:${p}.scale_y`)), m.r = Number(this.val.getVal(`tmp:${p}.rotate`))), u && (m.w = Number(this.val.getVal(`tmp:${p}.width`))), d && (m.h = Number(this.val.getVal(`tmp:${p}.height`)));
|
|
230
|
+
let h = x.cnvTweenArg(t, m), g = {}, _ = (e) => {};
|
|
231
|
+
i && (g.a = r(h, "alpha", 0), _ = (e) => {
|
|
232
|
+
f.style.opacity = String(e.a), this.val.setVal_Nochk("tmp", "alpha", e.a);
|
|
226
233
|
});
|
|
227
|
-
let
|
|
228
|
-
(
|
|
229
|
-
|
|
234
|
+
let v = (e) => {}, y = this.#c(h);
|
|
235
|
+
(a || o || s || c || l) && (g.x = y.x, g.y = y.y, g.sx = r(h, "scale_x", 1), g.sy = r(h, "scale_y", 1), g.r = r(h, "rotate", 0), v = (t) => {
|
|
236
|
+
f.style.left = `${String(e.#t.ofsLeft4elm + t.x * e.#t.cvsScale)} px`, f.style.top = `${String(e.#t.ofsTop4elm + t.y * e.#t.cvsScale)} px`, f.style.transform = `scale(${String(t.sx)}, ${String(t.sy)}) rotate(${String(t.r)}deg)`, this.val.setVal_Nochk("tmp", p + ".x", t.x), this.val.setVal_Nochk("tmp", p + ".y", t.y), this.val.setVal_Nochk("tmp", p + ".scale_x", t.sx), this.val.setVal_Nochk("tmp", p + ".scale_y", t.sy), this.val.setVal_Nochk("tmp", p + ".rotate", t.r);
|
|
230
237
|
});
|
|
231
|
-
let
|
|
232
|
-
|
|
233
|
-
|
|
238
|
+
let b = (e) => {};
|
|
239
|
+
u && (g.w = y.width, b = (t) => {
|
|
240
|
+
f.width = `${String(t.w * e.#t.cvsScale)} px`, this.val.setVal_Nochk("tmp", p + ".width", t.w);
|
|
234
241
|
});
|
|
235
|
-
let
|
|
236
|
-
return
|
|
237
|
-
|
|
238
|
-
}), this.appPixi.stage.interactive = !1,
|
|
239
|
-
|
|
242
|
+
let S = (e) => {};
|
|
243
|
+
return d && (g.h = y.height, S = (t) => {
|
|
244
|
+
f.height = `${String(t.h * e.#t.cvsScale)} px`, this.val.setVal_Nochk("tmp", p + ".height", t.h);
|
|
245
|
+
}), this.appPixi.stage.interactive = !1, x.tween(`frm\n${n}`, t, m, x.cnvTweenArg(t, m), (e) => {
|
|
246
|
+
_(e), v(e), b(e), S(e);
|
|
240
247
|
}, () => {
|
|
241
248
|
this.appPixi.stage.interactive = !0;
|
|
242
249
|
}, () => {}), !1;
|
|
243
250
|
}
|
|
244
|
-
},
|
|
251
|
+
}, N = class {
|
|
252
|
+
oCfg;
|
|
253
|
+
hTag;
|
|
254
|
+
val;
|
|
245
255
|
#e = { text: "" };
|
|
246
256
|
#t = [];
|
|
247
|
-
constructor(e,
|
|
248
|
-
this.oCfg = e, this.hTag =
|
|
257
|
+
constructor(e, t, n) {
|
|
258
|
+
this.oCfg = e, this.hTag = t, this.val = n, t.rec_ch = (e) => this.#n(e), t.rec_r = (e) => this.#r(e), t.reset_rec = (e) => this.#i(e), n.defTmp("const.sn.log.json", () => {
|
|
249
259
|
this.#e.text = this.#e.text.replaceAll("</span><span class='sn_ch'>", "");
|
|
250
260
|
let e = [...this.#t, this.#e];
|
|
251
261
|
return JSON.stringify(e);
|
|
@@ -276,94 +286,103 @@ var Pages = class e {
|
|
|
276
286
|
this.#t = JSON.parse(String(this.val.getVal("save:const.sn.sLog"))), this.#e = { text: "" };
|
|
277
287
|
}
|
|
278
288
|
};
|
|
279
|
-
|
|
289
|
+
//#endregion
|
|
290
|
+
//#region src/sn/LayerMng.ts
|
|
291
|
+
function P(e) {
|
|
280
292
|
return encodeURIComponent(JSON.stringify(e));
|
|
281
293
|
}
|
|
282
|
-
var
|
|
294
|
+
var F = class c {
|
|
295
|
+
cfg;
|
|
296
|
+
hTag;
|
|
297
|
+
appPixi;
|
|
298
|
+
val;
|
|
299
|
+
main;
|
|
300
|
+
scrItr;
|
|
301
|
+
sys;
|
|
283
302
|
#e;
|
|
284
|
-
#t = new
|
|
285
|
-
#n = new
|
|
303
|
+
#t = new f();
|
|
304
|
+
#n = new f();
|
|
286
305
|
#r;
|
|
287
306
|
#i;
|
|
288
307
|
#a;
|
|
289
|
-
#o = new
|
|
290
|
-
constructor(e,
|
|
291
|
-
this.cfg = e, this.hTag =
|
|
292
|
-
let
|
|
293
|
-
if (
|
|
308
|
+
#o = new _();
|
|
309
|
+
constructor(e, t, r, i, a, s, c, l, u) {
|
|
310
|
+
this.cfg = e, this.hTag = t, this.appPixi = r, this.val = i, this.main = a, this.scrItr = s, this.sys = c;
|
|
311
|
+
let d = () => {
|
|
312
|
+
if (c.cvsResize(), this.cvsResizeDesign(), this.#l) for (let e of this.#S) this.#x[e].fore.cvsResizeChildren();
|
|
294
313
|
else for (let e of this.#S) this.#x[e].fore.cvsResize();
|
|
295
314
|
this.#r.cvsResize(), this.#f.cvsResize();
|
|
296
315
|
};
|
|
297
|
-
if (
|
|
316
|
+
if (o.isMobile) this.#o.add(globalThis, "orientationchange", d, { passive: !0 });
|
|
298
317
|
else {
|
|
299
318
|
let e;
|
|
300
319
|
this.#o.add(globalThis, "resize", () => {
|
|
301
320
|
e ||= setTimeout(() => {
|
|
302
|
-
e = void 0,
|
|
321
|
+
e = void 0, d();
|
|
303
322
|
}, 1e3 / 60 * 10);
|
|
304
323
|
}, { passive: !0 });
|
|
305
324
|
}
|
|
306
|
-
|
|
307
|
-
delete e.visible, e.id = "break", e.pic = "breakline", this.#m("grp|" +
|
|
325
|
+
c.cvsResize(), this.#a = new N(this.cfg.oCfg, t, i), E.init(e, t, i, this.#a, (e) => this.#x[e.layname].fore === e, r), O.init(a, e, r, c, l, i), M.init(e, c, a), this.#r = new M(t, r, i), t.loadplugin = (e) => this.#y(e), t.snapshot = (e) => this.#h(e), this.#g = this.sys.isApp ? (e, t, n, r, i) => this.#_(e, t, n, r, i) : (e, t, n, r, i) => this.#v(e, t, n, r, i), t.add_lay = (e) => this.#b(e), t.clear_lay = (e) => this.#D(e), t.finish_trans = () => !1, t.lay = (e) => this.#T(e), t.trans = (e) => this.#N(e), t.wt = (e) => x.wt(e), t.quake = (e) => this.#L(e), t.stop_quake = t.finish_trans, t.wq = t.wt, t.pause_tsy = (e) => x.pause_tsy(e), t.resume_tsy = (e) => x.resume_tsy(e), t.stop_tsy = (e) => x.stop_tsy(e), t.tsy = (e) => this.#R(e), t.wait_tsy = (e) => x.wait_tsy(e), t.add_filter = (e) => this.#z(e), t.clear_filter = (e) => this.#V(e), t.enable_filter = (e) => this.#H(e), t.ch = (e) => this.#W(e), t.clear_text = (e) => this.#Q(e), t.current = (e) => this.#q(e), t.endlink = (e) => this.#$(e), t.er = (e) => this.#ee(e), t.graph = (e) => this.#te(e), t.link = (e) => this.#ne(e), t.r = (e) => this.#re(e), t.ruby2 = (e) => this.#ie(e), t.span = (e) => this.#ae(e), t.tcy = (e) => this.#oe(e), t.add_face = (e) => C.add_face(e), t.wv = (e) => C.wv(e), t.dump_lay = (e) => this.#se(e), t.enable_event = (e) => this.#ce(e), t.button = (e) => this.#le(e), e.existsBreakline && (this.breakLine = (e) => {
|
|
326
|
+
delete e.visible, e.id = "break", e.pic = "breakline", this.#m("grp|" + P(e));
|
|
308
327
|
}), e.existsBreakpage && (this.breakPage = (e) => {
|
|
309
|
-
delete e.visible, e.id = "break", e.pic = "breakpage", this.#m("grp|" +
|
|
310
|
-
}), this.#i =
|
|
311
|
-
let
|
|
312
|
-
|
|
313
|
-
let
|
|
314
|
-
this.#p(Number(
|
|
328
|
+
delete e.visible, e.id = "break", e.pic = "breakpage", this.#m("grp|" + P(e));
|
|
329
|
+
}), this.#i = n(String(e.oCfg.init.bg_color));
|
|
330
|
+
let f = new h();
|
|
331
|
+
f.beginFill(this.#i).lineStyle(0, this.#i).drawRect(0, 0, o.stageW, o.stageH).endFill(), this.#t.addChild(f.clone()), this.#n.addChild(f), this.#n.visible = !1, this.#t.name = "page:A", this.#n.name = "page:B", this.#e = r.stage, this.#e.addChild(this.#n), this.#e.addChild(this.#t), this.#e.addChild(this.#A), this.#e.addChild(this.#M), this.#e.name = "stage";
|
|
332
|
+
let p = (e, t) => {
|
|
333
|
+
this.#p(Number(t));
|
|
315
334
|
};
|
|
316
|
-
|
|
317
|
-
let
|
|
318
|
-
|
|
335
|
+
p("", i.getVal("sys:TextLayer.Back.Alpha", 1)), i.defValTrg("sys:TextLayer.Back.Alpha", p);
|
|
336
|
+
let m = (e, t) => {
|
|
337
|
+
w.fontFamily = t;
|
|
319
338
|
};
|
|
320
|
-
|
|
321
|
-
this.#s[e]?.(e,
|
|
339
|
+
m("", i.getVal("tmp:sn.button.fontFamily", w.fontFamily)), i.defValTrg("tmp:sn.button.fontFamily", m), i.defTmp("const.sn.last_page_text", () => this.currentTxtlayFore?.pageText ?? ""), i.defTmp("const.sn.last_page_plain_text", () => this.currentTxtlayFore?.pagePlainText ?? ""), o.isDbg && (k.init(r, c, s, u, e, this.#x), this.cvsResizeDesign = () => k.cvsResizeDesign(), c.addHook((e, t) => {
|
|
340
|
+
this.#s[e]?.(e, t) && delete this.#s[e];
|
|
322
341
|
}));
|
|
323
342
|
}
|
|
324
343
|
cvsResizeDesign() {}
|
|
325
344
|
#s = {
|
|
326
|
-
attach: (e) => (
|
|
327
|
-
continue: (e) => (
|
|
328
|
-
disconnect: (e) => (
|
|
345
|
+
attach: (e) => (k.leaveMode(), !1),
|
|
346
|
+
continue: (e) => (k.leaveMode(), !1),
|
|
347
|
+
disconnect: (e) => (k.leaveMode(), !1),
|
|
329
348
|
_enterDesign: (e) => {
|
|
330
|
-
|
|
349
|
+
k.enterMode();
|
|
331
350
|
for (let e of this.#S) {
|
|
332
|
-
let
|
|
333
|
-
|
|
351
|
+
let t = this.#x[e].fore;
|
|
352
|
+
t.makeDesignCastChildren((e) => e.make()), t.makeDesignCast((e) => e.make());
|
|
334
353
|
}
|
|
335
354
|
return this.#u(this.#C), !1;
|
|
336
355
|
},
|
|
337
|
-
_replaceToken: (e,
|
|
338
|
-
_selectNode: (e,
|
|
356
|
+
_replaceToken: (e, t) => (k.replaceToken(t), !1),
|
|
357
|
+
_selectNode: (e, t) => (this.#u(t.node), !1)
|
|
339
358
|
};
|
|
340
359
|
#c = "";
|
|
341
360
|
#l = "";
|
|
342
361
|
#u(e) {
|
|
343
362
|
[this.#c = "", this.#l = ""] = e.split("/");
|
|
344
|
-
let
|
|
345
|
-
|
|
363
|
+
let t = this.#x[this.#c];
|
|
364
|
+
t && (k.allHide(), this.#l ? t.fore.showDesignCastChildren() : t.fore.showDesignCast());
|
|
346
365
|
}
|
|
347
366
|
getFrmDisabled = (e) => this.#r.getFrmDisabled(e);
|
|
348
367
|
#d = void 0;
|
|
349
|
-
cover(e,
|
|
350
|
-
this.#d &&= (this.#e.removeChild(this.#d), this.#d.destroy(), void 0), e && this.#e.addChild((this.#d = new
|
|
368
|
+
cover(e, t = 0) {
|
|
369
|
+
this.#d &&= (this.#e.removeChild(this.#d), this.#d.destroy(), void 0), e && this.#e.addChild((this.#d = new h()).beginFill(t).lineStyle(0, t).drawRect(0, 0, o.stageW, o.stageH).endFill());
|
|
351
370
|
}
|
|
352
371
|
#f;
|
|
353
372
|
setEvtMng(e) {
|
|
354
|
-
this.#f = e, this.#r.setEvtMng(e),
|
|
373
|
+
this.#f = e, this.#r.setEvtMng(e), C.setEvtMng(e), x.init(e);
|
|
355
374
|
}
|
|
356
375
|
destroy() {
|
|
357
376
|
for (let e of Object.values(this.#x)) e.destroy();
|
|
358
|
-
this.#o.clear(),
|
|
377
|
+
this.#o.clear(), O.destroy(), T.destroy(), D.destroy(), E.destroy(), this.#r.destroy(), x.destroy(), E.msecChWait = 10;
|
|
359
378
|
}
|
|
360
379
|
#p(e) {
|
|
361
|
-
for (let
|
|
362
|
-
let { fore:
|
|
363
|
-
|
|
380
|
+
for (let t of this.#S) {
|
|
381
|
+
let { fore: n, back: r } = this.#x[t];
|
|
382
|
+
n instanceof E && (n.chgBackAlpha(e), r.chgBackAlpha(e));
|
|
364
383
|
}
|
|
365
384
|
}
|
|
366
|
-
#m = (e,
|
|
385
|
+
#m = (e, t = this.currentTxtlayForeNeedErr, n = !0) => t.tagCh("| 《" + e + "》");
|
|
367
386
|
goTxt = () => {};
|
|
368
387
|
get needGoTxt() {
|
|
369
388
|
return this.currentTxtlayFore?.needGoTxt ?? !1;
|
|
@@ -374,326 +393,326 @@ var LayerMng = class x {
|
|
|
374
393
|
this.currentTxtlayFore && (this.clearBreak = () => this.#m("del|break"), this.clearBreak());
|
|
375
394
|
}
|
|
376
395
|
clickTxtLay() {
|
|
377
|
-
return this.currentTxtlayFore ? this.#S.map((e) => this.#x[e].fore).some((e) => e instanceof
|
|
396
|
+
return this.currentTxtlayFore ? this.#S.map((e) => this.#x[e].fore).some((e) => e instanceof E && e.click()) : !1;
|
|
378
397
|
}
|
|
379
398
|
#h(e) {
|
|
380
|
-
let
|
|
381
|
-
return this.#g(e,
|
|
399
|
+
let t = s("-", "_", "", "_"), n = e.fn ? e.fn.startsWith("userdata:/") ? e.fn : `${A + e.fn + t}.png` : `${A}snapshot${t}.png`, i = this.cfg.searchPath(n), a = r(e, "width", o.stageW), c = r(e, "height", o.stageH);
|
|
400
|
+
return this.#g(e, i, a, c, `snapshot dt:${t}`);
|
|
382
401
|
}
|
|
383
402
|
#g = () => !1;
|
|
384
|
-
#_({ layer: e },
|
|
385
|
-
if (this.#r.hideAllFrame(),
|
|
386
|
-
this.#r.restoreAllFrame(),
|
|
403
|
+
#_({ layer: e }, t, n, r, i) {
|
|
404
|
+
if (this.#r.hideAllFrame(), S.beginProc(i), !e) return this.sys.capturePage(t, n, r, () => {
|
|
405
|
+
this.#r.restoreAllFrame(), S.endProc(i);
|
|
387
406
|
}), !0;
|
|
388
|
-
let
|
|
389
|
-
let { ctn:
|
|
390
|
-
return
|
|
407
|
+
let a = this.#S.map((e) => {
|
|
408
|
+
let { ctn: t } = this.#x[e].fore, n = [t, t.visible];
|
|
409
|
+
return t.visible = !1, n;
|
|
391
410
|
});
|
|
392
|
-
for (let
|
|
393
|
-
return this.sys.capturePage(
|
|
394
|
-
for (let [e,
|
|
395
|
-
this.#r.restoreAllFrame(),
|
|
411
|
+
for (let t of this.#P(e)) this.#x[t].fore.ctn.visible = !0;
|
|
412
|
+
return this.sys.capturePage(t, n, r, () => {
|
|
413
|
+
for (let [e, t] of a) e.visible = t;
|
|
414
|
+
this.#r.restoreAllFrame(), S.endProc(i);
|
|
396
415
|
}), !0;
|
|
397
416
|
}
|
|
398
|
-
#v(
|
|
399
|
-
|
|
400
|
-
let
|
|
401
|
-
width:
|
|
402
|
-
height:
|
|
403
|
-
backgroundAlpha:
|
|
404
|
-
antialias:
|
|
417
|
+
#v(t, n, r, i, o) {
|
|
418
|
+
S.beginProc(o);
|
|
419
|
+
let s = e(t, "b_color", this.#i), c = m({
|
|
420
|
+
width: r,
|
|
421
|
+
height: i,
|
|
422
|
+
backgroundAlpha: s > 16777216 && n.endsWith(".png") ? 0 : 1,
|
|
423
|
+
antialias: a(t, "smoothing", !1),
|
|
405
424
|
preserveDrawingBuffer: !0,
|
|
406
|
-
backgroundColor:
|
|
425
|
+
backgroundColor: s & 16777215,
|
|
407
426
|
autoDensity: !0
|
|
408
|
-
}),
|
|
409
|
-
return Promise.allSettled(this.#P(
|
|
410
|
-
let e =
|
|
411
|
-
width:
|
|
412
|
-
height:
|
|
427
|
+
}), u = t.page === "back" ? "back" : "fore", { layer: d } = t;
|
|
428
|
+
return Promise.allSettled(this.#P(d).map((e) => new Promise((t) => this.#x[e][u].snapshot(c, t)))).then(async () => {
|
|
429
|
+
let e = l.create({
|
|
430
|
+
width: c.width,
|
|
431
|
+
height: c.height
|
|
413
432
|
});
|
|
414
|
-
|
|
415
|
-
for (let e of this.#P(
|
|
416
|
-
|
|
433
|
+
c.render(this.#e, { renderTexture: e }), await this.sys.savePic(n, c.plugins.extract.base64(e)), e.destroy();
|
|
434
|
+
for (let e of this.#P(d)) this.#x[e][u].snapshot_end();
|
|
435
|
+
c.destroy(!0), S.endProc(o);
|
|
417
436
|
}), !0;
|
|
418
437
|
}
|
|
419
438
|
#y(e) {
|
|
420
|
-
let { fn:
|
|
421
|
-
if (!
|
|
422
|
-
if (!
|
|
423
|
-
let
|
|
424
|
-
return
|
|
425
|
-
let e = await fetch(
|
|
439
|
+
let { fn: t } = e;
|
|
440
|
+
if (!t) throw "fnは必須です";
|
|
441
|
+
if (!t.endsWith(".css")) throw "サポートされない拡張子です";
|
|
442
|
+
let n = a(e, "join", !0), r = S.procID + `loadplugin fn:${t}`;
|
|
443
|
+
return n && S.beginProc(r), (async () => {
|
|
444
|
+
let e = await fetch(t);
|
|
426
445
|
if (!e.ok) throw Error("Network response was not ok.");
|
|
427
|
-
|
|
428
|
-
})(),
|
|
446
|
+
i(await e.text()), n && S.endProc(r);
|
|
447
|
+
})(), n;
|
|
429
448
|
}
|
|
430
449
|
#b(e) {
|
|
431
|
-
let { layer:
|
|
432
|
-
if (!
|
|
433
|
-
if (
|
|
434
|
-
if (
|
|
435
|
-
if (!
|
|
436
|
-
let
|
|
437
|
-
switch (this.#x[
|
|
450
|
+
let { layer: t, class: n } = e;
|
|
451
|
+
if (!t) throw "layerは必須です";
|
|
452
|
+
if (t.includes(",")) throw "layer名に「,」は使えません";
|
|
453
|
+
if (t in this.#x) throw `layer【${t}】はすでにあります`;
|
|
454
|
+
if (!n) throw "clsは必須です";
|
|
455
|
+
let r = { isWait: !1 };
|
|
456
|
+
switch (this.#x[t] = new j(t, n, this.#t, this.#n, e, this.sys, this.val, r), this.#S.push(t), n) {
|
|
438
457
|
case "txt":
|
|
439
|
-
this.#C || (this.#X = () => {}, this.#G = (e) => this.#K(e), this.#q = (e) => this.#J(e), this.hTag.current({ layer:
|
|
440
|
-
this.#f.isSkipping ?
|
|
458
|
+
this.#C || (this.#X = () => {}, this.#G = (e) => this.#K(e), this.#q = (e) => this.#J(e), this.hTag.current({ layer: t }), this.goTxt = () => {
|
|
459
|
+
this.#f.isSkipping ? E.msecChWait = 0 : this.setNormalChWait();
|
|
441
460
|
for (let e of this.#S) {
|
|
442
|
-
let
|
|
443
|
-
|
|
461
|
+
let t = this.#x[e].fore;
|
|
462
|
+
t instanceof E && this.#m("gotxt|", t, !1);
|
|
444
463
|
}
|
|
445
|
-
}), this.val.setVal_Nochk("save", "const.sn.layer." +
|
|
464
|
+
}), this.val.setVal_Nochk("save", "const.sn.layer." + t + ".enabled", !0);
|
|
446
465
|
break;
|
|
447
466
|
case "grp":
|
|
448
467
|
if (this.#w) break;
|
|
449
|
-
this.#w =
|
|
468
|
+
this.#w = t;
|
|
450
469
|
break;
|
|
451
470
|
}
|
|
452
|
-
return this.scrItr.recodeDesign(e),
|
|
471
|
+
return this.scrItr.recodeDesign(e), r.isWait;
|
|
453
472
|
}
|
|
454
473
|
#x = {};
|
|
455
474
|
#S = [];
|
|
456
475
|
#C = "";
|
|
457
476
|
#w = "";
|
|
458
477
|
#T(e) {
|
|
459
|
-
let
|
|
460
|
-
if (
|
|
461
|
-
else if (e.index)
|
|
478
|
+
let t = this.#Z(e), n = this.#x[t], i = n.back.ctn, o = n.fore.ctn;
|
|
479
|
+
if (a(e, "float", !1)) this.#n.setChildIndex(i, this.#n.children.length - 1), this.#t.setChildIndex(o, this.#t.children.length - 1), this.#E();
|
|
480
|
+
else if (e.index) r(e, "index", 0) && (this.#n.setChildIndex(i, e.index), this.#t.setChildIndex(o, e.index), this.#E());
|
|
462
481
|
else if (e.dive) {
|
|
463
|
-
let { dive:
|
|
464
|
-
if (
|
|
465
|
-
let
|
|
466
|
-
if (!
|
|
467
|
-
let
|
|
468
|
-
|
|
482
|
+
let { dive: n } = e, r = 0;
|
|
483
|
+
if (t === n) throw "[lay] 属性 layerとdiveが同じ【" + n + "】です";
|
|
484
|
+
let a = this.#x[n];
|
|
485
|
+
if (!a) throw "[lay] 属性 dive【" + n + "】が不正です。レイヤーがありません";
|
|
486
|
+
let s = a.back, c = a.fore, l = this.#n.getChildIndex(s.ctn), u = this.#t.getChildIndex(c.ctn);
|
|
487
|
+
r = l < u ? l : u, r > this.#n.getChildIndex(i) && --r, this.#t.setChildIndex(o, r), this.#n.setChildIndex(i, r), this.#E();
|
|
469
488
|
}
|
|
470
|
-
return e[":id_tag"] =
|
|
489
|
+
return e[":id_tag"] = n.fore.name.slice(0, -7), this.scrItr.recodeDesign(e), n.lay(e);
|
|
471
490
|
}
|
|
472
491
|
#E() {
|
|
473
492
|
this.#S = this.#I();
|
|
474
493
|
}
|
|
475
494
|
#D(e) {
|
|
476
|
-
return this.#F(e, (
|
|
477
|
-
let
|
|
495
|
+
return this.#F(e, (t) => {
|
|
496
|
+
let n = this.#x[this.#Z({ layer: t })];
|
|
478
497
|
if (e.page === "both") {
|
|
479
|
-
|
|
498
|
+
n.fore.clearLay(e), n.back.clearLay(e);
|
|
480
499
|
return;
|
|
481
500
|
}
|
|
482
|
-
|
|
501
|
+
n.getPage(e).clearLay(e);
|
|
483
502
|
}), !1;
|
|
484
503
|
}
|
|
485
504
|
static #O = "\nprecision mediump float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform sampler2D rule;\nuniform float vague;\nuniform float tick;\n\nuniform vec4 inputPixel;\nuniform highp vec4 outputFrame;\nvec2 getUV(vec2 coord) {\n return coord * inputPixel.xy / outputFrame.zw;\n}\n\nvoid main() {\n vec4 fg = texture2D(uSampler, vTextureCoord);\n vec4 ru = texture2D(rule, getUV(vTextureCoord));\n\n float v = ru.r - tick;\n gl_FragColor = abs(v) < vague\n ? vec4(fg.rgb, 1) *fg.a *(0.5 +v /vague *0.5)\n : 0.0 <= v ? fg : vec4(0);\n}";
|
|
486
|
-
#k =
|
|
487
|
-
width:
|
|
488
|
-
height:
|
|
505
|
+
#k = l.create({
|
|
506
|
+
width: o.stageW,
|
|
507
|
+
height: o.stageH
|
|
489
508
|
});
|
|
490
|
-
#A = new
|
|
491
|
-
#j =
|
|
492
|
-
width:
|
|
493
|
-
height:
|
|
509
|
+
#A = new p(this.#k);
|
|
510
|
+
#j = l.create({
|
|
511
|
+
width: o.stageW,
|
|
512
|
+
height: o.stageH
|
|
494
513
|
});
|
|
495
|
-
#M = new
|
|
514
|
+
#M = new p(this.#j);
|
|
496
515
|
#N(e) {
|
|
497
|
-
let { layer:
|
|
516
|
+
let { layer: t } = e, n = /* @__PURE__ */ new Set(), i = this.#P(t).map((e) => (n.add(e), this.#x[e].fore)), a = () => {
|
|
498
517
|
[this.#t, this.#n] = [this.#n, this.#t];
|
|
499
518
|
let e = [];
|
|
500
|
-
for (let [
|
|
501
|
-
if (
|
|
502
|
-
|
|
519
|
+
for (let [t, r] of Object.entries(this.#x)) {
|
|
520
|
+
if (n.has(t)) {
|
|
521
|
+
r.transPage(e);
|
|
503
522
|
continue;
|
|
504
523
|
}
|
|
505
|
-
let { fore: { ctn:
|
|
506
|
-
this.#t.removeChild(
|
|
524
|
+
let { fore: { ctn: i }, back: { ctn: a } } = r, o = this.#t.getChildIndex(a);
|
|
525
|
+
this.#t.removeChild(a), this.#n.removeChild(i), this.#t.addChildAt(i, o), this.#n.addChildAt(a, o);
|
|
507
526
|
}
|
|
508
527
|
Promise.allSettled(e).then(() => {
|
|
509
|
-
this.#t.visible = !0, this.#n.visible = !1, this.#A.visible = !1, this.#M.visible = !1,
|
|
528
|
+
this.#t.visible = !0, this.#n.visible = !1, this.#A.visible = !1, this.#M.visible = !1, S.notifyEndProc(b);
|
|
510
529
|
});
|
|
511
530
|
};
|
|
512
|
-
if (this.#M.filters = [], this.#M.alpha = 1,
|
|
513
|
-
let
|
|
514
|
-
let { fore:
|
|
515
|
-
return
|
|
516
|
-
}), { ticker:
|
|
517
|
-
|
|
518
|
-
let
|
|
519
|
-
for (let e of
|
|
531
|
+
if (this.#M.filters = [], this.#M.alpha = 1, r(e, "time", 0) === 0 || this.#f.isSkipping) return a(), !1;
|
|
532
|
+
let o = [], s = this.#S.map((e) => {
|
|
533
|
+
let { fore: t, back: r } = this.#x[e], i = n.has(e) ? r : t;
|
|
534
|
+
return i.ctn.visible && o.push(i.ctn), i;
|
|
535
|
+
}), { ticker: l, renderer: d } = this.appPixi;
|
|
536
|
+
d.render(this.#n, { renderTexture: this.#k });
|
|
537
|
+
let f = () => {
|
|
538
|
+
for (let e of o) d.render(e, {
|
|
520
539
|
renderTexture: this.#k,
|
|
521
540
|
clear: !1
|
|
522
541
|
});
|
|
523
542
|
};
|
|
524
|
-
if (!
|
|
525
|
-
let e =
|
|
526
|
-
|
|
527
|
-
|
|
543
|
+
if (!s.some((e) => e.containMovement)) {
|
|
544
|
+
let e = f;
|
|
545
|
+
f = () => {
|
|
546
|
+
f = () => {}, e();
|
|
528
547
|
};
|
|
529
548
|
}
|
|
530
|
-
let
|
|
531
|
-
|
|
532
|
-
let
|
|
533
|
-
this.#t.visible = !0,
|
|
549
|
+
let p = () => d.render(this.#t, { renderTexture: this.#j });
|
|
550
|
+
p();
|
|
551
|
+
let m = () => {
|
|
552
|
+
this.#t.visible = !0, p(), this.#t.visible = !1;
|
|
534
553
|
};
|
|
535
|
-
if (!
|
|
536
|
-
let e =
|
|
537
|
-
|
|
538
|
-
|
|
554
|
+
if (!i.some((e) => e.containMovement)) {
|
|
555
|
+
let e = m;
|
|
556
|
+
m = () => {
|
|
557
|
+
m = () => {}, e();
|
|
539
558
|
};
|
|
540
559
|
}
|
|
541
|
-
let
|
|
542
|
-
|
|
543
|
-
}, { glsl:
|
|
544
|
-
|
|
560
|
+
let h = () => {
|
|
561
|
+
f(), this.#A.visible = !0, m(), this.#M.visible = !0;
|
|
562
|
+
}, { glsl: _, rule: v } = e, y = () => {
|
|
563
|
+
l.remove(h), a();
|
|
545
564
|
};
|
|
546
|
-
if (!
|
|
547
|
-
let
|
|
548
|
-
rule:
|
|
549
|
-
vague:
|
|
565
|
+
if (!_ && !v) return x.tween(b, e, this.#M, { alpha: 0 }, () => {}, y, () => {}), l.add(h), !1;
|
|
566
|
+
let w = {
|
|
567
|
+
rule: u.EMPTY,
|
|
568
|
+
vague: r(e, "vague", .04),
|
|
550
569
|
tick: 0
|
|
551
570
|
};
|
|
552
|
-
this.#M.filters = [new
|
|
553
|
-
let
|
|
554
|
-
return
|
|
555
|
-
|
|
571
|
+
this.#M.filters = [new g(void 0, _ ?? c.#O, w)];
|
|
572
|
+
let T = x.tween(b, e, w, { tick: 1 }, () => {}, y, () => {}, !v);
|
|
573
|
+
return v ? new C(v, void 0, (e) => {
|
|
574
|
+
w.rule = e.texture, e.destroy(), l.add(h), T.start();
|
|
556
575
|
}, (e) => {
|
|
557
576
|
e && this.main.resume();
|
|
558
|
-
}).ret : (
|
|
577
|
+
}).ret : (l.add(h), !1);
|
|
559
578
|
}
|
|
560
579
|
#P(e = "") {
|
|
561
580
|
return e ? e.split(",") : this.#S;
|
|
562
581
|
}
|
|
563
|
-
#F(e,
|
|
564
|
-
let
|
|
565
|
-
for (let e of
|
|
566
|
-
let
|
|
567
|
-
if (!
|
|
568
|
-
|
|
582
|
+
#F(e, t) {
|
|
583
|
+
let n = this.#P(e.layer);
|
|
584
|
+
for (let e of n) {
|
|
585
|
+
let n = this.#x[e];
|
|
586
|
+
if (!n) throw `存在しないlayer【${e}】です`;
|
|
587
|
+
t(e, n);
|
|
569
588
|
}
|
|
570
|
-
return
|
|
589
|
+
return n;
|
|
571
590
|
}
|
|
572
591
|
#I(e = "") {
|
|
573
|
-
return this.#P(e).sort((e,
|
|
574
|
-
let
|
|
575
|
-
return
|
|
592
|
+
return this.#P(e).sort((e, t) => {
|
|
593
|
+
let n = this.#t.getChildIndex(this.#x[e].fore.ctn), r = this.#t.getChildIndex(this.#x[t].fore.ctn);
|
|
594
|
+
return n < r ? -1 : +(n > r);
|
|
576
595
|
});
|
|
577
596
|
}
|
|
578
597
|
setAllStyle2TxtLay(e) {
|
|
579
|
-
for (let
|
|
580
|
-
let
|
|
581
|
-
|
|
598
|
+
for (let t of this.#S) {
|
|
599
|
+
let n = this.#x[t].fore;
|
|
600
|
+
n instanceof E && n.lay({ style: e });
|
|
582
601
|
}
|
|
583
602
|
}
|
|
584
603
|
#L(e) {
|
|
585
|
-
if (
|
|
586
|
-
let
|
|
587
|
-
this.#j.resize(
|
|
588
|
-
let
|
|
604
|
+
if (r(e, "time", NaN) === 0) return !1;
|
|
605
|
+
let n = this.#P(e.layer).map((e) => this.#x[e].fore.ctn), { renderer: i, ticker: a } = this.appPixi;
|
|
606
|
+
this.#j.resize(o.stageW, o.stageH);
|
|
607
|
+
let s = () => {
|
|
589
608
|
this.#t.visible = !0;
|
|
590
|
-
for (let e of
|
|
609
|
+
for (let e of n) i.render(e, {
|
|
591
610
|
renderTexture: this.#j,
|
|
592
611
|
clear: !1
|
|
593
612
|
});
|
|
594
613
|
this.#t.visible = !1;
|
|
595
614
|
};
|
|
596
615
|
this.#M.visible = !0, this.#M.alpha = 1;
|
|
597
|
-
let
|
|
598
|
-
this.#M.x = Math.round(Math.random() *
|
|
599
|
-
},
|
|
600
|
-
this.#M.y = Math.round(Math.random() *
|
|
616
|
+
let c = t(r(e, "hmax", 10)), l = t(r(e, "vmax", 10)), u = c === 0 ? () => {} : () => {
|
|
617
|
+
this.#M.x = Math.round(Math.random() * c * 2) - c;
|
|
618
|
+
}, d = l === 0 ? () => {} : () => {
|
|
619
|
+
this.#M.y = Math.round(Math.random() * l * 2) - l;
|
|
601
620
|
};
|
|
602
|
-
return this.#M.filters = [],
|
|
621
|
+
return this.#M.filters = [], x.tween(b, e, this.#M, {
|
|
603
622
|
x: 0,
|
|
604
623
|
y: 0
|
|
605
624
|
}, () => {
|
|
606
|
-
|
|
625
|
+
u(), d();
|
|
607
626
|
}, () => {
|
|
608
|
-
|
|
609
|
-
}, () => {}),
|
|
627
|
+
a.remove(s), this.#t.visible = !0, this.#M.visible = !1, this.#M.x = 0, this.#M.y = 0, S.notifyEndProc(b);
|
|
628
|
+
}, () => {}), a.add(s), !1;
|
|
610
629
|
}
|
|
611
630
|
#R(e) {
|
|
612
|
-
let { layer:
|
|
613
|
-
if (!
|
|
614
|
-
let
|
|
615
|
-
|
|
616
|
-
let
|
|
617
|
-
return
|
|
618
|
-
if (
|
|
619
|
-
}), "filter" in e && (
|
|
631
|
+
let { layer: t, render: n, name: r } = e;
|
|
632
|
+
if (!t) throw "layerは必須です";
|
|
633
|
+
let i = this.#x[this.#Z(e)], o = i.fore, s = () => {};
|
|
634
|
+
n && (this.#f.isSkipping ? o.renderStart(!0) : (o.renderStart(!1), s = () => o.renderEnd()));
|
|
635
|
+
let c = x.cnvTweenArg(e, o), l = a(e, "arrive", !1), u = a(e, "backlay", !1), d = i.back.ctn;
|
|
636
|
+
return x.tween(r ?? t, e, o, x.cnvTweenArg(e, o), () => {}, s, () => {
|
|
637
|
+
if (l && Object.assign(o, c), u) for (let e of x.aLayerPrpNm) d[e] = o[e];
|
|
638
|
+
}), "filter" in e && (o.ctn.filters = [y.bldFilters(e)], o.aFltHArg = [e]), !1;
|
|
620
639
|
}
|
|
621
640
|
#z(e) {
|
|
622
|
-
return this.#F(e, (
|
|
623
|
-
let
|
|
641
|
+
return this.#F(e, (t) => {
|
|
642
|
+
let n = this.#x[this.#Z({ layer: t })];
|
|
624
643
|
if (e.page === "both") {
|
|
625
|
-
this.#B(
|
|
644
|
+
this.#B(n.fore, e), this.#B(n.back, e);
|
|
626
645
|
return;
|
|
627
646
|
}
|
|
628
|
-
let
|
|
629
|
-
this.#B(
|
|
647
|
+
let r = n.getPage(e);
|
|
648
|
+
this.#B(r, e);
|
|
630
649
|
}), !1;
|
|
631
650
|
}
|
|
632
|
-
#B(e,
|
|
633
|
-
let
|
|
634
|
-
|
|
651
|
+
#B(e, t) {
|
|
652
|
+
let n = e.ctn;
|
|
653
|
+
n.filters ??= [], n.filters = [...n.filters, y.bldFilters(t)], e.aFltHArg.push(t);
|
|
635
654
|
}
|
|
636
655
|
#V(e) {
|
|
637
|
-
return this.#F(e, (
|
|
638
|
-
let
|
|
656
|
+
return this.#F(e, (t) => {
|
|
657
|
+
let n = this.#x[this.#Z({ layer: t })];
|
|
639
658
|
if (e.page === "both") {
|
|
640
|
-
let e =
|
|
641
|
-
e.ctn.filters = null,
|
|
659
|
+
let e = n.fore, t = n.back;
|
|
660
|
+
e.ctn.filters = null, t.ctn.filters = null, e.aFltHArg = [], t.aFltHArg = [];
|
|
642
661
|
return;
|
|
643
662
|
}
|
|
644
|
-
let
|
|
645
|
-
|
|
663
|
+
let r = n.getPage(e);
|
|
664
|
+
r.ctn.filters = null, r.aFltHArg = [];
|
|
646
665
|
}), !1;
|
|
647
666
|
}
|
|
648
667
|
#H(e) {
|
|
649
|
-
return this.#F(e, (
|
|
650
|
-
let
|
|
668
|
+
return this.#F(e, (t) => {
|
|
669
|
+
let n = this.#x[this.#Z({ layer: t })];
|
|
651
670
|
if (e.page === "both") {
|
|
652
|
-
this.#U(
|
|
671
|
+
this.#U(n.fore, e), this.#U(n.back, e);
|
|
653
672
|
return;
|
|
654
673
|
}
|
|
655
|
-
let
|
|
656
|
-
this.#U(
|
|
674
|
+
let r = n.getPage(e);
|
|
675
|
+
this.#U(r, e);
|
|
657
676
|
}), !1;
|
|
658
677
|
}
|
|
659
|
-
#U(e,
|
|
660
|
-
let
|
|
661
|
-
if (!
|
|
662
|
-
let
|
|
663
|
-
if (
|
|
664
|
-
e.aFltHArg[
|
|
678
|
+
#U(e, n) {
|
|
679
|
+
let i = e.ctn;
|
|
680
|
+
if (!i.filters) throw "フィルターがありません";
|
|
681
|
+
let o = t(r(n, "index", 0)), s = i.filters.length;
|
|
682
|
+
if (s <= o) throw `フィルターの個数(${String(s)})を越えています`;
|
|
683
|
+
e.aFltHArg[o].enabled = i.filters[o].enabled = a(n, "enabled", !0);
|
|
665
684
|
}
|
|
666
685
|
#W(e) {
|
|
667
|
-
let { text:
|
|
668
|
-
if (!
|
|
669
|
-
let
|
|
670
|
-
delete e.text, this.setNormalChWait(), this.#f.isSkipping ? e.wait = 0 : "wait" in e &&
|
|
671
|
-
let
|
|
672
|
-
return
|
|
686
|
+
let { text: t } = e;
|
|
687
|
+
if (!t) throw "textは必須です";
|
|
688
|
+
let n = this.#G(e);
|
|
689
|
+
delete e.text, this.setNormalChWait(), this.#f.isSkipping ? e.wait = 0 : "wait" in e && r(e, "wait", NaN), this.#m("add|" + P(e), n);
|
|
690
|
+
let i = a(e, "record", !0), o = this.val.doRecLog();
|
|
691
|
+
return i || this.val.setVal_Nochk("save", "sn.doRecLog", i), n.tagCh(t.replaceAll("[r]", "\n")), this.val.setVal_Nochk("save", "sn.doRecLog", o), this.#m("add_close|", n), !1;
|
|
673
692
|
}
|
|
674
693
|
#G = (e) => {
|
|
675
694
|
throw this.#X(), 0;
|
|
676
695
|
};
|
|
677
696
|
#K(e) {
|
|
678
|
-
let
|
|
679
|
-
if (!(
|
|
680
|
-
return
|
|
697
|
+
let t = this.#Z(e, this.#C), n = this.#x[t].getPage(e);
|
|
698
|
+
if (!(n instanceof E)) throw t + "はTxtLayerではありません";
|
|
699
|
+
return n;
|
|
681
700
|
}
|
|
682
701
|
setNormalChWait() {
|
|
683
|
-
|
|
702
|
+
E.msecChWait = this.scrItr.normalWait;
|
|
684
703
|
}
|
|
685
704
|
#q = (e) => {
|
|
686
705
|
throw this.#X(), 0;
|
|
687
706
|
};
|
|
688
707
|
#J(e) {
|
|
689
|
-
let { layer:
|
|
690
|
-
if (!
|
|
691
|
-
let
|
|
692
|
-
if (!
|
|
693
|
-
this.#Y =
|
|
708
|
+
let { layer: t } = e;
|
|
709
|
+
if (!t) throw "[current] layerは必須です";
|
|
710
|
+
let n = this.#x[t];
|
|
711
|
+
if (!n || !(n.getPage(e) instanceof E)) throw `${t}はTxtLayerではありません`;
|
|
712
|
+
this.#Y = n, this.#a.pagebreak(), this.#C = t, this.val.setVal_Nochk("save", "const.sn.mesLayer", t);
|
|
694
713
|
for (let e of this.#S) {
|
|
695
|
-
let { fore:
|
|
696
|
-
|
|
714
|
+
let { fore: n, back: r } = this.#x[e];
|
|
715
|
+
n instanceof E && (n.isCur = r.isCur = e === t);
|
|
697
716
|
}
|
|
698
717
|
return !1;
|
|
699
718
|
}
|
|
@@ -707,32 +726,32 @@ var LayerMng = class x {
|
|
|
707
726
|
#X = () => {
|
|
708
727
|
throw "文字レイヤーがありません。文字表示や操作する前に、[add_lay layer=(レイヤ名) class=txt]で文字レイヤを追加して下さい";
|
|
709
728
|
};
|
|
710
|
-
#Z(e,
|
|
711
|
-
let
|
|
712
|
-
if (
|
|
713
|
-
if (!(
|
|
714
|
-
return e.layer =
|
|
729
|
+
#Z(e, t = "") {
|
|
730
|
+
let n = e.layer ?? t;
|
|
731
|
+
if (n.includes(",")) throw "layer名に「,」は使えません";
|
|
732
|
+
if (!(n in this.#x)) throw "属性 layer【" + n + "】が不正です。レイヤーがありません";
|
|
733
|
+
return e.layer = n, n;
|
|
715
734
|
}
|
|
716
735
|
recPagebreak() {
|
|
717
736
|
this.#a.pagebreak();
|
|
718
737
|
}
|
|
719
738
|
#Q(e) {
|
|
720
|
-
let
|
|
721
|
-
return e.layer === this.#C && e.page === "fore" && this.#a.pagebreak(),
|
|
739
|
+
let t = this.#G(e);
|
|
740
|
+
return e.layer === this.#C && e.page === "fore" && this.#a.pagebreak(), t.clearText(), !1;
|
|
722
741
|
}
|
|
723
742
|
#$(e) {
|
|
724
743
|
return this.#m("endlink|", this.#G(e)), !1;
|
|
725
744
|
}
|
|
726
745
|
#ee(e) {
|
|
727
|
-
return
|
|
746
|
+
return a(e, "rec_page_break", !0) && this.#a.pagebreak(), this.#Y && (this.#Y.fore.clearLay(e), this.#Y.back.clearLay(e)), !1;
|
|
728
747
|
}
|
|
729
748
|
#te(e) {
|
|
730
749
|
if (!e.pic) throw "[graph] picは必須です";
|
|
731
|
-
return this.#m("grp|" +
|
|
750
|
+
return this.#m("grp|" + P(e), this.#G(e)), !1;
|
|
732
751
|
}
|
|
733
752
|
#ne(e) {
|
|
734
753
|
if (!e.fn && !e.label && !e.url) throw "fn,label,url いずれかは必須です";
|
|
735
|
-
return e.fn ??= this.scrItr.scriptFn, e.style ??= "background-color: rgba(255,0,0,0.5);", e.style_hover ??= "background-color: rgba(255,0,0,0.9);", e.style_clicked ??= e.style, this.#m("link|" +
|
|
754
|
+
return e.fn ??= this.scrItr.scriptFn, e.style ??= "background-color: rgba(255,0,0,0.5);", e.style_hover ??= "background-color: rgba(255,0,0,0.9);", e.style_clicked ??= e.style, this.#m("link|" + P(e), this.#G(e)), !1;
|
|
736
755
|
}
|
|
737
756
|
#re(e) {
|
|
738
757
|
return this.#W({
|
|
@@ -741,72 +760,73 @@ var LayerMng = class x {
|
|
|
741
760
|
});
|
|
742
761
|
}
|
|
743
762
|
#ie(e) {
|
|
744
|
-
let { t
|
|
745
|
-
if (!
|
|
746
|
-
if (!
|
|
747
|
-
return e.text = "|" + encodeURIComponent(
|
|
763
|
+
let { t, r: n } = e;
|
|
764
|
+
if (!t) throw "[ruby2] tは必須です";
|
|
765
|
+
if (!n) throw "[ruby2] rは必須です";
|
|
766
|
+
return e.text = "|" + encodeURIComponent(t) + "《" + encodeURIComponent(n) + "》", delete e.t, delete e.r, this.#W(e);
|
|
748
767
|
}
|
|
749
768
|
#ae(e) {
|
|
750
|
-
return this.#m("span|" +
|
|
769
|
+
return this.#m("span|" + P(e), this.#G(e)), !1;
|
|
751
770
|
}
|
|
752
771
|
#oe(e) {
|
|
753
772
|
if (!e.t) throw "[tcy] tは必須です";
|
|
754
|
-
return this.#m("tcy|" +
|
|
773
|
+
return this.#m("tcy|" + P(e), this.#G(e)), !1;
|
|
755
774
|
}
|
|
756
775
|
#se({ layer: e }) {
|
|
757
776
|
console.group("🥟 [dump_lay]");
|
|
758
|
-
for (let
|
|
759
|
-
let { fore: e, back:
|
|
777
|
+
for (let t of this.#P(e)) {
|
|
778
|
+
let { fore: e, back: n } = this.#x[t];
|
|
760
779
|
try {
|
|
761
|
-
console.info(`%c${e.name.slice(0, -7)} %o`, `color:#${
|
|
762
|
-
} catch (
|
|
763
|
-
console.error("dump_lay err:%o",
|
|
780
|
+
console.info(`%c${e.name.slice(0, -7)} %o`, `color:#${o.isDarkMode ? "49F" : "05A"};`, JSON.parse(`{"back":{${n.dump()}}, "fore":{${e.dump()}}}`));
|
|
781
|
+
} catch (t) {
|
|
782
|
+
console.error("dump_lay err:%o", t), console.error(` back:${n.dump()}`), console.error(` fore:${e.dump()}`);
|
|
764
783
|
}
|
|
765
784
|
}
|
|
766
785
|
return console.groupEnd(), !1;
|
|
767
786
|
}
|
|
768
787
|
#ce(e) {
|
|
769
|
-
let
|
|
770
|
-
return this.#G(e).enabled =
|
|
788
|
+
let t = this.#Z(e, this.#C), n = a(e, "enabled", !0);
|
|
789
|
+
return this.#G(e).enabled = n, this.val.setVal_Nochk("save", "const.sn.layer." + t + ".enabled", n), !1;
|
|
771
790
|
}
|
|
772
791
|
#le(e) {
|
|
773
|
-
return
|
|
792
|
+
return j.argChk_page(e, "back"), e.fn ??= this.scrItr.scriptFn, this.#G(e).addButton(e), this.scrItr.recodeDesign(e), !1;
|
|
774
793
|
}
|
|
775
794
|
record() {
|
|
776
795
|
let e = {};
|
|
777
|
-
for (let
|
|
778
|
-
let
|
|
779
|
-
e[
|
|
780
|
-
cls:
|
|
781
|
-
fore:
|
|
782
|
-
back:
|
|
796
|
+
for (let t of this.#S) {
|
|
797
|
+
let n = this.#x[t];
|
|
798
|
+
e[t] = {
|
|
799
|
+
cls: n.cls,
|
|
800
|
+
fore: n.fore.record(),
|
|
801
|
+
back: n.back.record()
|
|
783
802
|
};
|
|
784
803
|
}
|
|
785
804
|
return e;
|
|
786
805
|
}
|
|
787
806
|
playback(e) {
|
|
788
807
|
this.#a.playback();
|
|
789
|
-
let
|
|
790
|
-
for (let [
|
|
791
|
-
|
|
792
|
-
ln:
|
|
793
|
-
idx:
|
|
808
|
+
let t = [], n = [];
|
|
809
|
+
for (let [r, { fore: i, fore: { idx: a }, back: o, cls: s }] of Object.entries(e)) {
|
|
810
|
+
n.push({
|
|
811
|
+
ln: r,
|
|
812
|
+
idx: a
|
|
794
813
|
});
|
|
795
|
-
let e = this.#x[
|
|
796
|
-
e.fore.playback(
|
|
814
|
+
let e = this.#x[r] ??= new j(r, s, this.#t, this.#n, {}, this.sys, this.val, { isWait: !1 });
|
|
815
|
+
e.fore.playback(i, t), e.back.playback(o, t);
|
|
797
816
|
}
|
|
798
|
-
let
|
|
799
|
-
return
|
|
800
|
-
for (let { ln: e, idx:
|
|
801
|
-
let
|
|
802
|
-
if (!
|
|
803
|
-
let
|
|
804
|
-
this.#t.setChildIndex(
|
|
817
|
+
let r = this.#t.children.length;
|
|
818
|
+
return t.push(new Promise((e) => {
|
|
819
|
+
for (let { ln: e, idx: t } of n.sort(({ idx: e }, { idx: t }) => e === t ? 0 : e < t ? -1 : 1)) {
|
|
820
|
+
let n = this.#x[e];
|
|
821
|
+
if (!n) continue;
|
|
822
|
+
let i = r > t ? t : r - 1, { fore: a, back: o } = n;
|
|
823
|
+
this.#t.setChildIndex(a.ctn, i), this.#n.setChildIndex(o.ctn, i);
|
|
805
824
|
}
|
|
806
825
|
e();
|
|
807
|
-
})),
|
|
826
|
+
})), t;
|
|
808
827
|
}
|
|
809
828
|
};
|
|
810
|
-
|
|
829
|
+
//#endregion
|
|
830
|
+
export { F as LayerMng };
|
|
811
831
|
|
|
812
832
|
//# sourceMappingURL=LayerMng.js.map
|