mirror of
https://github.com/ad044/lainTSX.git
synced 2024-10-22 23:19:06 +00:00
testing around idle nodes trying to find an optimal way to make this shit work
This commit is contained in:
parent
2bf0a047e0
commit
908479f21a
8 changed files with 20 additions and 38 deletions
|
@ -1,11 +1,11 @@
|
|||
import React, { useEffect, useState, Suspense, useMemo } from "react";
|
||||
import React, { Suspense, useEffect, useMemo } from "react";
|
||||
import MainScene from "./scenes/MainScene";
|
||||
import "./static/css/page.css";
|
||||
import { Canvas } from "react-three-fiber";
|
||||
import MediaPlayer from "./components/MediaScene/MediaPlayer";
|
||||
import MediaScene from "./scenes/MediaScene";
|
||||
import EventManager from "./core/StateManagers/EventManager";
|
||||
import { useMediaStore, useSceneStore } from "./store";
|
||||
import { useSceneStore } from "./store";
|
||||
import GateScene from "./scenes/GateScene";
|
||||
import BootScene from "./scenes/BootScene";
|
||||
import SSknScene from "./scenes/SSknScene";
|
||||
|
|
|
@ -204,10 +204,6 @@ const MiddleRing = () => {
|
|||
}
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
console.log(mainRingVisible);
|
||||
}, [mainRingVisible]);
|
||||
|
||||
return (
|
||||
<a.group rotation-z={rotState.rotZ}>
|
||||
<a.mesh
|
||||
|
|
|
@ -69,9 +69,7 @@ const MediaPlayer = () => {
|
|||
setPercentageElapsed(percentageElapsed);
|
||||
if (percentageElapsed === 100) {
|
||||
videoRef.current.currentTime = 0;
|
||||
if (currentScene === "idle_media") {
|
||||
setScene("main");
|
||||
} else if (currentScene === "end") {
|
||||
if (currentScene === "end") {
|
||||
incrementEndMediaPlayedCount();
|
||||
} else {
|
||||
if (
|
||||
|
@ -179,9 +177,6 @@ const MediaPlayer = () => {
|
|||
}
|
||||
);
|
||||
}
|
||||
if (videoRef.current) {
|
||||
videoRef.current.play();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,6 +146,7 @@ const EventManager = () => {
|
|||
if (
|
||||
timePassedSinceLastKeyPress.current > -1 &&
|
||||
mainSubscene !== "pause" &&
|
||||
mainSubscene !== "level_selection" &&
|
||||
currentScene === "main"
|
||||
) {
|
||||
if (now > timePassedSinceLastKeyPress.current + 10000) {
|
||||
|
@ -191,10 +192,10 @@ const EventManager = () => {
|
|||
const keyPress = getKeyCodeAssociation(keyCode);
|
||||
|
||||
if (keyPress && !inputCooldown) {
|
||||
timePassedSinceLastKeyPress.current = Date.now() + 2500;
|
||||
let event;
|
||||
switch (currentScene) {
|
||||
case "main":
|
||||
timePassedSinceLastKeyPress.current = Date.now() + 2500;
|
||||
event = handleMainSceneEvent({
|
||||
mainSubscene: mainSubscene,
|
||||
keyPress: keyPress,
|
||||
|
@ -210,6 +211,7 @@ const EventManager = () => {
|
|||
});
|
||||
break;
|
||||
case "media":
|
||||
case "idle_media":
|
||||
event = handleMediaSceneEvent({
|
||||
keyPress: keyPress,
|
||||
activeMediaComponent: activeMediaComponent,
|
||||
|
|
|
@ -83,8 +83,6 @@ const IdleManager = (props: StateManagerProps) => {
|
|||
idleNodes.video[Math.floor(Math.random() * idleNodes.video.length)]
|
||||
);
|
||||
}
|
||||
|
||||
console.log('s')
|
||||
},
|
||||
[setImages, setMedia]
|
||||
);
|
||||
|
|
|
@ -62,13 +62,7 @@ const MediaScene = () => {
|
|||
return (
|
||||
<perspectiveCamera position-z={3}>
|
||||
<group position={[0.4, -0.3, 0]}>
|
||||
{currentScene !== "idle_media" ? (
|
||||
<>
|
||||
<pointLight
|
||||
intensity={1.2}
|
||||
color={0xffffff}
|
||||
position={[-2, 0, 0]}
|
||||
/>
|
||||
<pointLight intensity={1.2} color={0xffffff} position={[-2, 0, 0]} />
|
||||
<LeftSide activeMediaComponent={activeMediaComponent} />
|
||||
<group position={[0, 0.5, -3]}>
|
||||
<MediaLoadingBar />
|
||||
|
@ -80,10 +74,6 @@ const MediaScene = () => {
|
|||
))}
|
||||
</group>
|
||||
<MediaYellowTextAnimator />
|
||||
</>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
{activeNodeMedia.includes("XA") || idleMedia.includes("XA") ? (
|
||||
<>
|
||||
{currentScene !== "idle_media" ? (
|
||||
|
|
|
@ -35,6 +35,7 @@ const TaKScene = () => {
|
|||
setAudioAnalyser(new THREE.AudioAnalyser(audio, 2048));
|
||||
|
||||
if (mediaElement) {
|
||||
mediaElement.currentTime = 0;
|
||||
mediaElement.play();
|
||||
setIsIntro(false);
|
||||
}
|
||||
|
|
|
@ -338,7 +338,7 @@ export const useNodeStore = create(
|
|||
);
|
||||
|
||||
export const useIdleStore = create<IdleState>((set) => ({
|
||||
media: undefined,
|
||||
media: "INS01.STR",
|
||||
// this may be undefined depending on whether or not the media is audio or not
|
||||
images: undefined,
|
||||
setMedia: (to) => set(() => ({ media: to })),
|
||||
|
|
Loading…
Reference in a new issue