Bug fixes, Intro
This commit is contained in:
1 parent
dbfa9788a7
commit
51e5a98a92
5 files changed
+26
-19
No files matched your search
Binary file not shown.
Binary file not shown.
@@ -68,8 +68,8 @@ export default function RiddleHintPage({
|
||||
<img src={"/icons/hinweis-dunkel.svg"} className={styles["hint-icon"]}/>
|
||||
<p className={clsx(styles["hint-p"], "eisenkraft-regular")}>Hinweise</p>
|
||||
</div>
|
||||
{ nextHintToBuy && nextHintToBuy.penaltyPoints > 0 && <p>Ein {boughtHintObjects.length > 0 ? "weiterer" : ""} Hinweis kostet euch {nextHintToBuy.penaltyPoints} Rufpunkte.</p> }
|
||||
{ nextHintToBuy && nextHintToBuy.penaltyPoints === 0 && <p>Ein {boughtHintObjects.length > 0 ? "weiterer" : ""} Hinweis kostet euch zum Glück keine Rufpunkte.</p> }
|
||||
{ (nextHintToBuy && nextHintToBuy.penaltyPoints > 0) ? <p>Ein {boughtHintObjects.length > 0 ? "weiterer" : ""} Hinweis kostet euch {nextHintToBuy.penaltyPoints} Rufpunkte.</p> : null }
|
||||
{ (nextHintToBuy && nextHintToBuy.penaltyPoints === 0) ? <p>Ein {boughtHintObjects.length > 0 ? "weiterer" : ""} Hinweis kostet euch zum Glück keine Rufpunkte.</p> : null }
|
||||
{ riddle.hints.length === 0 && <p>Für das Rätsel gibt es keine Hinweise!</p> }
|
||||
{ riddle.skipPenaltyPoints === 0 && <p>Überspringt ihr das Rätsel, bekommt ihr keine Rufpunkte.</p> }
|
||||
{ riddle.skipPenaltyPoints > 0 && <p>Überspringt ihr das Rätsel, bekommt ihr {riddle.skipPenaltyPoints} Rufpunkte abgezogen.</p> }
|
||||
|
||||
@@ -15,6 +15,8 @@ import { Player } from "@/types/player";
|
||||
import { addCompletedRiddle } from "@/utils/completedRiddles";
|
||||
import ChargedButton from "../ChargedButton";
|
||||
|
||||
export const TOPIC_PREFIX = (process.env.NODE_ENV === "development") ? "staging/outdoor/king-arthur/sword" : "outdoor/king-arthur/sword";
|
||||
|
||||
export type ConnectionStatus = "disconnected" | "connected" | "connecting";
|
||||
|
||||
interface MQTTMessage {
|
||||
@@ -122,10 +124,8 @@ export default function Riddle_2({
|
||||
ws.onmessage = (event) => {
|
||||
const data: MQTTMessage = JSON.parse(event.data);
|
||||
|
||||
if (data.topic === 'outdoor/king-arthur/sword/stat') {
|
||||
if (data.topic === `${TOPIC_PREFIX}/stat`) {
|
||||
setSwordStatus(data.payload);
|
||||
} else if (data.topic === 'outdoor/king-arthur/throne/stat') {
|
||||
//setThroneStatus(data.payload);
|
||||
} else if (data.topic.includes('/event')) {
|
||||
console.log(`Event received on ${data.topic}:`, data.payload);
|
||||
if (data.payload === "pull-denied") {
|
||||
@@ -171,8 +171,8 @@ export default function Riddle_2({
|
||||
const handleIntercept = async () => {
|
||||
if (page === 1) {
|
||||
awaitTryAbort = false;
|
||||
sendCommand('outdoor/king-arthur/sword/set', 'abortTry');
|
||||
waitUntilTrue(() => {
|
||||
sendCommand(`${TOPIC_PREFIX}/set`, 'abortTry');
|
||||
await waitUntilTrue(() => {
|
||||
return awaitTryAbort
|
||||
});
|
||||
}
|
||||
@@ -198,7 +198,7 @@ export default function Riddle_2({
|
||||
</div>
|
||||
<div className={styles["buttons"]}>
|
||||
<OldButton red={false} onAction={() => {
|
||||
if (!sendCommand('outdoor/king-arthur/sword/set', 'stayLocked')) {
|
||||
if (!sendCommand(`${TOPIC_PREFIX}/set`, 'stayLocked')) {
|
||||
return;
|
||||
}
|
||||
setCanGoNext(false);
|
||||
@@ -224,28 +224,28 @@ export default function Riddle_2({
|
||||
<p style={{ fontSize: '0.6rem' }}><strong>Stat:<br></br></strong> {swordStatus}</p>
|
||||
<button
|
||||
style={{ fontSize: '0.6rem', padding: '4px 8px' }}
|
||||
onClick={() => sendCommand('outdoor/king-arthur/sword/set', 'releaseLock')}
|
||||
onClick={() => sendCommand(`${TOPIC_PREFIX}/set`, 'releaseLock')}
|
||||
>
|
||||
Release Lock
|
||||
</button>
|
||||
<br/><br/>
|
||||
<button
|
||||
style={{ fontSize: '0.6rem', padding: '4px 8px' }}
|
||||
onClick={() => sendCommand('outdoor/king-arthur/sword/set', 'stayLocked')}
|
||||
onClick={() => sendCommand(`${TOPIC_PREFIX}/set`, 'stayLocked')}
|
||||
>
|
||||
Stay Locked
|
||||
</button>
|
||||
<br/><br/>
|
||||
<button
|
||||
style={{ fontSize: '0.6rem', padding: '4px 8px' }}
|
||||
onClick={() => sendCommand('outdoor/king-arthur/sword/set', 'gameStarted')}
|
||||
onClick={() => sendCommand(`${TOPIC_PREFIX}/set`, 'gameStarted')}
|
||||
>
|
||||
Game Started
|
||||
</button>
|
||||
<br/><br/>
|
||||
<button
|
||||
style={{ fontSize: '0.6rem', padding: '4px 8px' }}
|
||||
onClick={() => sendCommand('outdoor/king-arthur/sword/set', 'gameFinished')}
|
||||
onClick={() => sendCommand(`${TOPIC_PREFIX}/set`, 'gameFinished')}
|
||||
>
|
||||
Game Stopped
|
||||
</button>
|
||||
@@ -254,7 +254,7 @@ export default function Riddle_2({
|
||||
<br/><br/>
|
||||
<button
|
||||
style={{ fontSize: '0.6rem', padding: '4px 8px' }}
|
||||
onClick={() => sendCommand('outdoor/king-arthur/sword/cfg', 'playSound:' + soundInput)}
|
||||
onClick={() => sendCommand(`${TOPIC_PREFIX}/cfg`, 'playSound:' + soundInput)}
|
||||
>
|
||||
Play Sound
|
||||
</button>
|
||||
@@ -270,11 +270,11 @@ export default function Riddle_2({
|
||||
addCompletedRiddle(riddle.step);
|
||||
} else {
|
||||
if (isNextIndexLastPlayer) {
|
||||
if (!sendCommand('outdoor/king-arthur/sword/set', 'releaseLock')) {
|
||||
if (!sendCommand(`${TOPIC_PREFIX}/set`, 'releaseLock')) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!sendCommand('outdoor/king-arthur/sword/set', 'stayLocked')) {
|
||||
if (!sendCommand(`${TOPIC_PREFIX}/set`, 'stayLocked')) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -282,7 +282,14 @@ export default function Riddle_2({
|
||||
setPlayerIndex(playerIndex+1);
|
||||
}
|
||||
}} disabled={!canGoNext}>{(playerIndex >= players.length-1) ? "PRÜFUNG BEENDEN" : "NÄCHSTER PRÜFLING"}</ChargedButton>
|
||||
{playerIndex < 1 ? <OldButton red={true} onAction={() => setPage(0)} className={styles["backButton"]}>ZURÜCK</OldButton> : null}
|
||||
{playerIndex < 1 ? <OldButton red={true} onAction={async () => {
|
||||
awaitTryAbort = false;
|
||||
sendCommand(`${TOPIC_PREFIX}/set`, 'abortTry');
|
||||
await waitUntilTrue(() => {
|
||||
return awaitTryAbort;
|
||||
});
|
||||
setPage(0);
|
||||
}} className={styles["backButton"]}>ZURÜCK</OldButton> : null}
|
||||
</div>
|
||||
</div>
|
||||
),
|
||||
|
||||
@@ -135,7 +135,7 @@ export default function Intro() {
|
||||
}}
|
||||
playsInline={true}
|
||||
>
|
||||
<source src="/res/intro/testvid.webm" type="video/webm"/>
|
||||
<source src="/res/intro/intro.mp4" type="video/mp4"/>
|
||||
</video>
|
||||
{ !videoEnded && videoPaused ?
|
||||
<div className={styles["pause-screen"]}>
|
||||
@@ -152,7 +152,7 @@ export default function Intro() {
|
||||
introVideoRef.current.play();
|
||||
setVideoEnded(false);
|
||||
}
|
||||
}}>Video wiederholen?</ChargedButton>
|
||||
}} whiteText={true}>Video wiederholen?</ChargedButton>
|
||||
<ChargedButton holdDuration={500} onAction={() => {
|
||||
setPoints("0");
|
||||
setCompletedRiddles("");
|
||||
@@ -161,7 +161,7 @@ export default function Intro() {
|
||||
setWorthyWords("");
|
||||
setVoiceOverState("on");
|
||||
setStep("2");
|
||||
}}>Wir sind bereit!</ChargedButton>
|
||||
}} whiteText={true}>Wir sind bereit!</ChargedButton>
|
||||
</div> : null }
|
||||
</div>
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user