@luna-editor/engine 0.5.11 → 0.5.12
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/hooks/useBacklog.js +11 -4
- package/package.json +1 -1
package/dist/hooks/useBacklog.js
CHANGED
|
@@ -4,14 +4,21 @@ import { useCallback, useEffect, useRef, useState } from "react";
|
|
|
4
4
|
* 優先順位: speakerState > baseBodyState > characters[].entityState
|
|
5
5
|
*/
|
|
6
6
|
function resolveSpeakerImage(block, allBlocks) {
|
|
7
|
-
var _a, _b, _c, _d;
|
|
8
|
-
// 1. speakerState(単一画像キャラ)
|
|
7
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
8
|
+
// 1. speakerState.imageUrl(単一画像キャラ)
|
|
9
9
|
if ((_a = block.speakerState) === null || _a === void 0 ? void 0 : _a.imageUrl) {
|
|
10
10
|
return {
|
|
11
11
|
imageUrl: block.speakerState.imageUrl,
|
|
12
12
|
cropArea: (_b = block.speakerState.cropArea) !== null && _b !== void 0 ? _b : undefined,
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
+
// 2. speakerState.layers[0].imageUrl(レイヤー機能キャラの表情レイヤー)
|
|
16
|
+
if ((_e = (_d = (_c = block.speakerState) === null || _c === void 0 ? void 0 : _c.layers) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.imageUrl) {
|
|
17
|
+
return {
|
|
18
|
+
imageUrl: block.speakerState.layers[0].imageUrl,
|
|
19
|
+
cropArea: (_f = block.speakerState.cropArea) !== null && _f !== void 0 ? _f : undefined,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
15
22
|
if (!block.speakerId)
|
|
16
23
|
return {};
|
|
17
24
|
// 2. character_entranceブロックからbaseBodyState or entityStateを探す
|
|
@@ -19,13 +26,13 @@ function resolveSpeakerImage(block, allBlocks) {
|
|
|
19
26
|
if (b.characters) {
|
|
20
27
|
const char = b.characters.find((c) => c.object.id === block.speakerId);
|
|
21
28
|
if (char) {
|
|
22
|
-
if ((
|
|
29
|
+
if ((_g = char.baseBodyState) === null || _g === void 0 ? void 0 : _g.imageUrl) {
|
|
23
30
|
return { imageUrl: char.baseBodyState.imageUrl };
|
|
24
31
|
}
|
|
25
32
|
if (char.entityState.imageUrl) {
|
|
26
33
|
return {
|
|
27
34
|
imageUrl: char.entityState.imageUrl,
|
|
28
|
-
cropArea: (
|
|
35
|
+
cropArea: (_h = char.entityState.cropArea) !== null && _h !== void 0 ? _h : undefined,
|
|
29
36
|
};
|
|
30
37
|
}
|
|
31
38
|
}
|