@luna-editor/engine 0.5.5 → 0.5.6
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 +28 -0
- package/package.json +1 -1
package/dist/Player.js
CHANGED
|
@@ -800,6 +800,34 @@ export const Player = ({ scenario: scenarioProp, settings, plugins = EMPTY_PLUGI
|
|
|
800
800
|
handlePreviousInternal();
|
|
801
801
|
}
|
|
802
802
|
}, [state.currentBlockIndex, handlePreviousInternal]);
|
|
803
|
+
// AUTO再生: テキスト表示完了後にautoPlaySpeed秒待って自動で次へ進む
|
|
804
|
+
useEffect(() => {
|
|
805
|
+
if (!state.isPlaying ||
|
|
806
|
+
state.isEnded ||
|
|
807
|
+
isTyping ||
|
|
808
|
+
!isFirstRenderComplete ||
|
|
809
|
+
!pluginsLoaded ||
|
|
810
|
+
!currentBlock) {
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
813
|
+
// 会話分岐中はAUTO進行しない
|
|
814
|
+
if (currentBlock.blockType === "conversation_branch") {
|
|
815
|
+
return;
|
|
816
|
+
}
|
|
817
|
+
const timer = setTimeout(() => {
|
|
818
|
+
handleNext("auto");
|
|
819
|
+
}, mergedSettings.autoPlaySpeed * 1000);
|
|
820
|
+
return () => clearTimeout(timer);
|
|
821
|
+
}, [
|
|
822
|
+
state.isPlaying,
|
|
823
|
+
state.isEnded,
|
|
824
|
+
isTyping,
|
|
825
|
+
isFirstRenderComplete,
|
|
826
|
+
pluginsLoaded,
|
|
827
|
+
currentBlock,
|
|
828
|
+
handleNext,
|
|
829
|
+
mergedSettings.autoPlaySpeed,
|
|
830
|
+
]);
|
|
803
831
|
// 現在の背景を計算
|
|
804
832
|
const currentBackground = useMemo(() => calculateCurrentBackground(actualBlockIndex), [calculateCurrentBackground, actualBlockIndex]);
|
|
805
833
|
// displayText を JSX に変換(PlaybackTextProvider 用)
|