mirror of
https://github.com/ad044/lainTSX.git
synced 2024-10-22 23:19:06 +00:00
minor fixes
This commit is contained in:
parent
20934e2f19
commit
483d549bb1
7 changed files with 42 additions and 37 deletions
|
@ -42,7 +42,11 @@ const App = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="game">
|
<div className="game">
|
||||||
<Canvas concurrent>
|
<Canvas
|
||||||
|
concurrent
|
||||||
|
gl={{ antialias: false }}
|
||||||
|
pixelRatio={1}
|
||||||
|
>
|
||||||
<Suspense fallback={null}>
|
<Suspense fallback={null}>
|
||||||
{/*<Preloader />*/}
|
{/*<Preloader />*/}
|
||||||
{dispatchScene[currentScene as keyof typeof dispatchScene]}
|
{dispatchScene[currentScene as keyof typeof dispatchScene]}
|
||||||
|
|
|
@ -71,7 +71,7 @@ const BlueDigit = (props: BlueDigitProps) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<a.mesh
|
<a.mesh
|
||||||
scale={[0.04, 0.1, 0]}
|
scale={[props.type === 1 ? 0.04 : 0.08, 0.1, 0]}
|
||||||
position-x={props.posX}
|
position-x={props.posX}
|
||||||
position-y={props.posY}
|
position-y={props.posY}
|
||||||
renderOrder={5}
|
renderOrder={5}
|
||||||
|
|
|
@ -43,31 +43,31 @@ const IdleManager = (props: IdleManagerProps) => {
|
||||||
|
|
||||||
if (event) handleEvent(event);
|
if (event) handleEvent(event);
|
||||||
}
|
}
|
||||||
if (now > props.idleSceneTimerRef.current + 500000) {
|
// if (now > props.idleSceneTimerRef.current + 5000) {
|
||||||
// put it on lock until the next action, since while the idle media plays, the
|
// // put it on lock until the next action, since while the idle media plays, the
|
||||||
// Date.now() value keeps increasing, which can result in another idle media playing right after one finishes
|
// // Date.now() value keeps increasing, which can result in another idle media playing right after one finishes
|
||||||
// one way to work around this would be to modify the value depending on the last played idle media's duration
|
// // one way to work around this would be to modify the value depending on the last played idle media's duration
|
||||||
// but i'm way too lazy for that
|
// // but i'm way too lazy for that
|
||||||
props.idleSceneTimerRef.current = -1;
|
// props.idleSceneTimerRef.current = -1;
|
||||||
|
//
|
||||||
playAudio(audio.sound32);
|
// playAudio(audio.sound32);
|
||||||
|
//
|
||||||
const data = getRandomIdleMedia();
|
// const data = getRandomIdleMedia();
|
||||||
|
//
|
||||||
const { type, nodeName, images, media } = data;
|
// const { type, nodeName, images, media } = data;
|
||||||
let event;
|
// let event;
|
||||||
if (type === "audio" && images && nodeName) {
|
// if (type === "audio" && images && nodeName) {
|
||||||
event = playIdleAudio({
|
// event = playIdleAudio({
|
||||||
idleNodeName: nodeName,
|
// idleNodeName: nodeName,
|
||||||
idleImages: images,
|
// idleImages: images,
|
||||||
idleMedia: media,
|
// idleMedia: media,
|
||||||
});
|
// });
|
||||||
} else if (type === "video") {
|
// } else if (type === "video") {
|
||||||
event = playIdleVideo({ idleMedia: media });
|
// event = playIdleVideo({ idleMedia: media });
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (event) handleEvent(event);
|
// if (event) handleEvent(event);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,6 @@ const About = () => {
|
||||||
const aboutBgTex = useLoader(THREE.TextureLoader, aboutBg);
|
const aboutBgTex = useLoader(THREE.TextureLoader, aboutBg);
|
||||||
|
|
||||||
const bgRef = useRef<THREE.Sprite>();
|
const bgRef = useRef<THREE.Sprite>();
|
||||||
// todo im not sure where the other bg file is located,
|
|
||||||
// the one here is just the text, in the original game there's another one
|
|
||||||
|
|
||||||
useFrame(() => {
|
useFrame(() => {
|
||||||
if (bgRef.current) {
|
if (bgRef.current) {
|
||||||
|
|
|
@ -59,7 +59,7 @@ const MediaPlayer = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<video width="800" height="600" id="media" ref={videoRef} controls>
|
<video width="800" height="600" id="media" ref={videoRef}>
|
||||||
<track id={"track"} ref={trackRef} kind="captions" default />
|
<track id={"track"} ref={trackRef} kind="captions" default />
|
||||||
</video>
|
</video>
|
||||||
<div id={"subtitle-container"}>
|
<div id={"subtitle-container"}>
|
||||||
|
|
|
@ -709,6 +709,8 @@ export const playIdleVideo = (calculatedState: { idleMedia: string }) => ({
|
||||||
mutation: {
|
mutation: {
|
||||||
idleStarting: true,
|
idleStarting: true,
|
||||||
idleMedia: calculatedState.idleMedia,
|
idleMedia: calculatedState.idleMedia,
|
||||||
|
idleImages: undefined,
|
||||||
|
idleNodeName: undefined,
|
||||||
inputCooldown: -1,
|
inputCooldown: -1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -739,7 +741,6 @@ export const playLainIdleAnim = (calculatedState: {
|
||||||
lainMoveState: string;
|
lainMoveState: string;
|
||||||
duration: number;
|
duration: number;
|
||||||
}) => ({
|
}) => ({
|
||||||
// todo appropriate disable-move here also
|
|
||||||
state: [
|
state: [
|
||||||
{
|
{
|
||||||
mutation: {
|
mutation: {
|
||||||
|
|
|
@ -25,12 +25,14 @@ const IdleMediaScene = () => {
|
||||||
|
|
||||||
if (mediaElement) {
|
if (mediaElement) {
|
||||||
mediaElement.currentTime = 0;
|
mediaElement.currentTime = 0;
|
||||||
import("../static/webvtt/" + idleNodeName + ".vtt")
|
if (idleNodeName) {
|
||||||
.then((vtt) => {
|
import("../static/webvtt/" + idleNodeName + ".vtt")
|
||||||
if (vtt) trackElement.src = vtt.default;
|
.then((vtt) => {
|
||||||
})
|
if (vtt) trackElement.src = vtt.default;
|
||||||
// some entries have no spoken words, so the file doesnt exist. we catch that here.
|
})
|
||||||
.catch((e) => console.log(e));
|
// some entries have no spoken words, so the file doesnt exist. we catch that here.
|
||||||
|
.catch(() => console.log("no subtitles for this media"));
|
||||||
|
}
|
||||||
|
|
||||||
if (idleMedia.includes("XA")) {
|
if (idleMedia.includes("XA")) {
|
||||||
import("../static/audio/" + idleMedia + ".ogg").then((media) => {
|
import("../static/audio/" + idleMedia + ".ogg").then((media) => {
|
||||||
|
|
Loading…
Reference in a new issue