mirror of
https://github.com/ad044/lainTSX.git
synced 2024-10-22 15:09:05 +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 (
|
||||
<div className="game">
|
||||
<Canvas concurrent>
|
||||
<Canvas
|
||||
concurrent
|
||||
gl={{ antialias: false }}
|
||||
pixelRatio={1}
|
||||
>
|
||||
<Suspense fallback={null}>
|
||||
{/*<Preloader />*/}
|
||||
{dispatchScene[currentScene as keyof typeof dispatchScene]}
|
||||
|
|
|
@ -71,7 +71,7 @@ const BlueDigit = (props: BlueDigitProps) => {
|
|||
|
||||
return (
|
||||
<a.mesh
|
||||
scale={[0.04, 0.1, 0]}
|
||||
scale={[props.type === 1 ? 0.04 : 0.08, 0.1, 0]}
|
||||
position-x={props.posX}
|
||||
position-y={props.posY}
|
||||
renderOrder={5}
|
||||
|
|
|
@ -43,31 +43,31 @@ const IdleManager = (props: IdleManagerProps) => {
|
|||
|
||||
if (event) handleEvent(event);
|
||||
}
|
||||
if (now > props.idleSceneTimerRef.current + 500000) {
|
||||
// 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
|
||||
// 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
|
||||
props.idleSceneTimerRef.current = -1;
|
||||
|
||||
playAudio(audio.sound32);
|
||||
|
||||
const data = getRandomIdleMedia();
|
||||
|
||||
const { type, nodeName, images, media } = data;
|
||||
let event;
|
||||
if (type === "audio" && images && nodeName) {
|
||||
event = playIdleAudio({
|
||||
idleNodeName: nodeName,
|
||||
idleImages: images,
|
||||
idleMedia: media,
|
||||
});
|
||||
} else if (type === "video") {
|
||||
event = playIdleVideo({ idleMedia: media });
|
||||
}
|
||||
|
||||
if (event) handleEvent(event);
|
||||
}
|
||||
// if (now > props.idleSceneTimerRef.current + 5000) {
|
||||
// // 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
|
||||
// // 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
|
||||
// props.idleSceneTimerRef.current = -1;
|
||||
//
|
||||
// playAudio(audio.sound32);
|
||||
//
|
||||
// const data = getRandomIdleMedia();
|
||||
//
|
||||
// const { type, nodeName, images, media } = data;
|
||||
// let event;
|
||||
// if (type === "audio" && images && nodeName) {
|
||||
// event = playIdleAudio({
|
||||
// idleNodeName: nodeName,
|
||||
// idleImages: images,
|
||||
// idleMedia: media,
|
||||
// });
|
||||
// } else if (type === "video") {
|
||||
// event = playIdleVideo({ idleMedia: media });
|
||||
// }
|
||||
//
|
||||
// if (event) handleEvent(event);
|
||||
// }
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -10,8 +10,6 @@ const About = () => {
|
|||
const aboutBgTex = useLoader(THREE.TextureLoader, aboutBg);
|
||||
|
||||
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(() => {
|
||||
if (bgRef.current) {
|
||||
|
|
|
@ -59,7 +59,7 @@ const MediaPlayer = () => {
|
|||
|
||||
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 />
|
||||
</video>
|
||||
<div id={"subtitle-container"}>
|
||||
|
|
|
@ -709,6 +709,8 @@ export const playIdleVideo = (calculatedState: { idleMedia: string }) => ({
|
|||
mutation: {
|
||||
idleStarting: true,
|
||||
idleMedia: calculatedState.idleMedia,
|
||||
idleImages: undefined,
|
||||
idleNodeName: undefined,
|
||||
inputCooldown: -1,
|
||||
},
|
||||
},
|
||||
|
@ -739,7 +741,6 @@ export const playLainIdleAnim = (calculatedState: {
|
|||
lainMoveState: string;
|
||||
duration: number;
|
||||
}) => ({
|
||||
// todo appropriate disable-move here also
|
||||
state: [
|
||||
{
|
||||
mutation: {
|
||||
|
|
|
@ -25,12 +25,14 @@ const IdleMediaScene = () => {
|
|||
|
||||
if (mediaElement) {
|
||||
mediaElement.currentTime = 0;
|
||||
import("../static/webvtt/" + idleNodeName + ".vtt")
|
||||
.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));
|
||||
if (idleNodeName) {
|
||||
import("../static/webvtt/" + idleNodeName + ".vtt")
|
||||
.then((vtt) => {
|
||||
if (vtt) trackElement.src = vtt.default;
|
||||
})
|
||||
// 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")) {
|
||||
import("../static/audio/" + idleMedia + ".ogg").then((media) => {
|
||||
|
|
Loading…
Reference in a new issue