@luna-editor/engine 0.5.2 → 0.5.4
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/Player.js +2 -2
- package/dist/components/GameScreen.js +13 -3
- package/package.json +1 -1
package/dist/Player.js
CHANGED
|
@@ -517,7 +517,7 @@ export const Player = ({ scenario: scenarioProp, settings, plugins = EMPTY_PLUGI
|
|
|
517
517
|
}, [pluginManager, branchState]);
|
|
518
518
|
// ダイアログ表示とアクションノード実行のuseEffectを分離
|
|
519
519
|
useEffect(() => {
|
|
520
|
-
if (currentBlock) {
|
|
520
|
+
if (currentBlock && isFirstRenderComplete && pluginsLoaded) {
|
|
521
521
|
// fullscreen_text は独自のタイプライターを使うので、displayTextをクリアしてスキップ
|
|
522
522
|
if (currentBlock.blockType === "fullscreen_text") {
|
|
523
523
|
startTyping("");
|
|
@@ -548,7 +548,7 @@ export const Player = ({ scenario: scenarioProp, settings, plugins = EMPTY_PLUGI
|
|
|
548
548
|
startTyping(content, false);
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
|
-
}, [currentBlock, previousBlock, startTyping, resetAccumulated]);
|
|
551
|
+
}, [currentBlock, previousBlock, startTyping, resetAccumulated, isFirstRenderComplete, pluginsLoaded]);
|
|
552
552
|
// 分岐ブロック自動ロード処理
|
|
553
553
|
useEffect(() => {
|
|
554
554
|
if (currentBlock && currentBlock.blockType === "conversation_branch") {
|
|
@@ -433,6 +433,16 @@ export const GameScreen = memo(function GameScreen({ scenario, currentBlock, pre
|
|
|
433
433
|
if (pendingEntranceRef.current.includes(image.objectId)) {
|
|
434
434
|
opacity = 0;
|
|
435
435
|
}
|
|
436
|
+
// useEffectが走る前の新キャラ(entranceFadesにもpendingEntranceにもまだない)を非表示
|
|
437
|
+
// これにより登場フェード開始前の1フレームでチラつくのを防ぐ
|
|
438
|
+
// ただし初回レンダリング時(prevが空)はフェードなしで即表示する
|
|
439
|
+
if (prevDisplayedCharIdsRef.current.size > 0 &&
|
|
440
|
+
entranceFadeOpacity === undefined &&
|
|
441
|
+
!pendingEntranceRef.current.includes(image.objectId) &&
|
|
442
|
+
!prevDisplayedCharIdsRef.current.has(image.objectId) &&
|
|
443
|
+
!isExitingChar) {
|
|
444
|
+
opacity = 0;
|
|
445
|
+
}
|
|
436
446
|
// 明るさを決定
|
|
437
447
|
let brightness = 1;
|
|
438
448
|
if (displayedCharacters.length > 0 && displayedChar) {
|
|
@@ -530,12 +540,12 @@ export const GameScreen = memo(function GameScreen({ scenario, currentBlock, pre
|
|
|
530
540
|
return (_jsx("div", { style: Object.assign({ position: "absolute", visibility: shouldDisplay ? "visible" : "hidden", opacity: opacity, filter: `brightness(${brightness})`, zIndex: zIndex,
|
|
531
541
|
// CharacterEditDialogと完全に同じ: left/topを0にしてtransformで位置制御
|
|
532
542
|
// translate(%)は画像サイズに対する割合
|
|
533
|
-
left: 0, top: 0, transform: `translate(${leftPx}px, ${topPx}px) translate(${translateXPercent}%, ${translateYPercent}%)`, transition: fadeState ? "none" : undefined }, cropMaskStyle), "data-character-id": image.objectId, "data-character-sprite": true, children: hasLayerFeature && image.baseBodyUrl ? (_jsxs(_Fragment, { children: [_jsx("img", { src: image.baseBodyUrl, alt: "", style: {
|
|
543
|
+
left: 0, top: 0, transform: `translate(${leftPx}px, ${topPx}px) translate(${translateXPercent}%, ${translateYPercent}%)`, transition: fadeState ? "none" : undefined }, cropMaskStyle), "data-character-id": image.objectId, "data-character-sprite": true, children: hasLayerFeature && image.baseBodyUrl ? (_jsxs(_Fragment, { children: [_jsx("img", { src: image.baseBodyUrl, alt: "", decoding: "sync", style: {
|
|
534
544
|
height: `${baseHeight}px`,
|
|
535
545
|
width: "auto",
|
|
536
546
|
objectFit: "contain",
|
|
537
547
|
transform: `translateX(${image.baseBodyTranslateX || 0}%) translateY(${image.baseBodyTranslateY || 0}%)`,
|
|
538
|
-
} }), currentLayers === null || currentLayers === void 0 ? void 0 : currentLayers.filter((layer) => layer.imageUrl).sort((a, b) => a.sortOrder - b.sortOrder).map((layer) => (_jsx("img", { src: layer.imageUrl, alt: "", style: {
|
|
548
|
+
} }), currentLayers === null || currentLayers === void 0 ? void 0 : currentLayers.filter((layer) => layer.imageUrl).sort((a, b) => a.sortOrder - b.sortOrder).map((layer) => (_jsx("img", { src: layer.imageUrl, alt: "", decoding: "sync", style: {
|
|
539
549
|
position: "absolute",
|
|
540
550
|
left: 0,
|
|
541
551
|
top: 0,
|
|
@@ -545,7 +555,7 @@ export const GameScreen = memo(function GameScreen({ scenario, currentBlock, pre
|
|
|
545
555
|
transform: `translateX(${image.translateX || 0}%) translateY(${image.translateY || 0}%)`,
|
|
546
556
|
} }, layer.id)))] })) : (
|
|
547
557
|
/* 従来の単一画像表示 */
|
|
548
|
-
_jsx("img", { src: image.url, alt: "", style: {
|
|
558
|
+
_jsx("img", { src: image.url, alt: "", decoding: "sync", style: {
|
|
549
559
|
height: `${baseHeight}px`,
|
|
550
560
|
width: "auto",
|
|
551
561
|
objectFit: "contain",
|