Compare commits
2
Commits
70fb9e4850
...
51e5a98a92
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51e5a98a92 | ||
|
|
dbfa9788a7 |
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"]}/>
|
<img src={"/icons/hinweis-dunkel.svg"} className={styles["hint-icon"]}/>
|
||||||
<p className={clsx(styles["hint-p"], "eisenkraft-regular")}>Hinweise</p>
|
<p className={clsx(styles["hint-p"], "eisenkraft-regular")}>Hinweise</p>
|
||||||
</div>
|
</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 {nextHintToBuy.penaltyPoints} Rufpunkte.</p> : null }
|
||||||
{ 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 zum Glück keine Rufpunkte.</p> : null }
|
||||||
{ riddle.hints.length === 0 && <p>Für das Rätsel gibt es keine Hinweise!</p> }
|
{ 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 keine Rufpunkte.</p> }
|
||||||
{ riddle.skipPenaltyPoints > 0 && <p>Überspringt ihr das Rätsel, bekommt ihr {riddle.skipPenaltyPoints} Rufpunkte abgezogen.</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 { addCompletedRiddle } from "@/utils/completedRiddles";
|
||||||
import ChargedButton from "../ChargedButton";
|
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";
|
export type ConnectionStatus = "disconnected" | "connected" | "connecting";
|
||||||
|
|
||||||
interface MQTTMessage {
|
interface MQTTMessage {
|
||||||
@@ -122,10 +124,8 @@ export default function Riddle_2({
|
|||||||
ws.onmessage = (event) => {
|
ws.onmessage = (event) => {
|
||||||
const data: MQTTMessage = JSON.parse(event.data);
|
const data: MQTTMessage = JSON.parse(event.data);
|
||||||
|
|
||||||
if (data.topic === 'outdoor/king-arthur/sword/stat') {
|
if (data.topic === `${TOPIC_PREFIX}/stat`) {
|
||||||
setSwordStatus(data.payload);
|
setSwordStatus(data.payload);
|
||||||
} else if (data.topic === 'outdoor/king-arthur/throne/stat') {
|
|
||||||
//setThroneStatus(data.payload);
|
|
||||||
} else if (data.topic.includes('/event')) {
|
} else if (data.topic.includes('/event')) {
|
||||||
console.log(`Event received on ${data.topic}:`, data.payload);
|
console.log(`Event received on ${data.topic}:`, data.payload);
|
||||||
if (data.payload === "pull-denied") {
|
if (data.payload === "pull-denied") {
|
||||||
@@ -171,8 +171,8 @@ export default function Riddle_2({
|
|||||||
const handleIntercept = async () => {
|
const handleIntercept = async () => {
|
||||||
if (page === 1) {
|
if (page === 1) {
|
||||||
awaitTryAbort = false;
|
awaitTryAbort = false;
|
||||||
sendCommand('outdoor/king-arthur/sword/set', 'abortTry');
|
sendCommand(`${TOPIC_PREFIX}/set`, 'abortTry');
|
||||||
waitUntilTrue(() => {
|
await waitUntilTrue(() => {
|
||||||
return awaitTryAbort
|
return awaitTryAbort
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -198,7 +198,7 @@ export default function Riddle_2({
|
|||||||
</div>
|
</div>
|
||||||
<div className={styles["buttons"]}>
|
<div className={styles["buttons"]}>
|
||||||
<OldButton red={false} onAction={() => {
|
<OldButton red={false} onAction={() => {
|
||||||
if (!sendCommand('outdoor/king-arthur/sword/set', 'stayLocked')) {
|
if (!sendCommand(`${TOPIC_PREFIX}/set`, 'stayLocked')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setCanGoNext(false);
|
setCanGoNext(false);
|
||||||
@@ -224,28 +224,28 @@ export default function Riddle_2({
|
|||||||
<p style={{ fontSize: '0.6rem' }}><strong>Stat:<br></br></strong> {swordStatus}</p>
|
<p style={{ fontSize: '0.6rem' }}><strong>Stat:<br></br></strong> {swordStatus}</p>
|
||||||
<button
|
<button
|
||||||
style={{ fontSize: '0.6rem', padding: '4px 8px' }}
|
style={{ fontSize: '0.6rem', padding: '4px 8px' }}
|
||||||
onClick={() => sendCommand('outdoor/king-arthur/sword/set', 'releaseLock')}
|
onClick={() => sendCommand(`${TOPIC_PREFIX}/set`, 'releaseLock')}
|
||||||
>
|
>
|
||||||
Release Lock
|
Release Lock
|
||||||
</button>
|
</button>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<button
|
<button
|
||||||
style={{ fontSize: '0.6rem', padding: '4px 8px' }}
|
style={{ fontSize: '0.6rem', padding: '4px 8px' }}
|
||||||
onClick={() => sendCommand('outdoor/king-arthur/sword/set', 'stayLocked')}
|
onClick={() => sendCommand(`${TOPIC_PREFIX}/set`, 'stayLocked')}
|
||||||
>
|
>
|
||||||
Stay Locked
|
Stay Locked
|
||||||
</button>
|
</button>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<button
|
<button
|
||||||
style={{ fontSize: '0.6rem', padding: '4px 8px' }}
|
style={{ fontSize: '0.6rem', padding: '4px 8px' }}
|
||||||
onClick={() => sendCommand('outdoor/king-arthur/sword/set', 'gameStarted')}
|
onClick={() => sendCommand(`${TOPIC_PREFIX}/set`, 'gameStarted')}
|
||||||
>
|
>
|
||||||
Game Started
|
Game Started
|
||||||
</button>
|
</button>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<button
|
<button
|
||||||
style={{ fontSize: '0.6rem', padding: '4px 8px' }}
|
style={{ fontSize: '0.6rem', padding: '4px 8px' }}
|
||||||
onClick={() => sendCommand('outdoor/king-arthur/sword/set', 'gameFinished')}
|
onClick={() => sendCommand(`${TOPIC_PREFIX}/set`, 'gameFinished')}
|
||||||
>
|
>
|
||||||
Game Stopped
|
Game Stopped
|
||||||
</button>
|
</button>
|
||||||
@@ -254,7 +254,7 @@ export default function Riddle_2({
|
|||||||
<br/><br/>
|
<br/><br/>
|
||||||
<button
|
<button
|
||||||
style={{ fontSize: '0.6rem', padding: '4px 8px' }}
|
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
|
Play Sound
|
||||||
</button>
|
</button>
|
||||||
@@ -270,11 +270,11 @@ export default function Riddle_2({
|
|||||||
addCompletedRiddle(riddle.step);
|
addCompletedRiddle(riddle.step);
|
||||||
} else {
|
} else {
|
||||||
if (isNextIndexLastPlayer) {
|
if (isNextIndexLastPlayer) {
|
||||||
if (!sendCommand('outdoor/king-arthur/sword/set', 'releaseLock')) {
|
if (!sendCommand(`${TOPIC_PREFIX}/set`, 'releaseLock')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!sendCommand('outdoor/king-arthur/sword/set', 'stayLocked')) {
|
if (!sendCommand(`${TOPIC_PREFIX}/set`, 'stayLocked')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -282,7 +282,14 @@ export default function Riddle_2({
|
|||||||
setPlayerIndex(playerIndex+1);
|
setPlayerIndex(playerIndex+1);
|
||||||
}
|
}
|
||||||
}} disabled={!canGoNext}>{(playerIndex >= players.length-1) ? "PRÜFUNG BEENDEN" : "NÄCHSTER PRÜFLING"}</ChargedButton>
|
}} 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>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ export default function Intro() {
|
|||||||
}}
|
}}
|
||||||
playsInline={true}
|
playsInline={true}
|
||||||
>
|
>
|
||||||
<source src="/res/intro/testvid.webm" type="video/webm"/>
|
<source src="/res/intro/intro.mp4" type="video/mp4"/>
|
||||||
</video>
|
</video>
|
||||||
{ !videoEnded && videoPaused ?
|
{ !videoEnded && videoPaused ?
|
||||||
<div className={styles["pause-screen"]}>
|
<div className={styles["pause-screen"]}>
|
||||||
@@ -152,7 +152,7 @@ export default function Intro() {
|
|||||||
introVideoRef.current.play();
|
introVideoRef.current.play();
|
||||||
setVideoEnded(false);
|
setVideoEnded(false);
|
||||||
}
|
}
|
||||||
}}>Video wiederholen?</ChargedButton>
|
}} whiteText={true}>Video wiederholen?</ChargedButton>
|
||||||
<ChargedButton holdDuration={500} onAction={() => {
|
<ChargedButton holdDuration={500} onAction={() => {
|
||||||
setPoints("0");
|
setPoints("0");
|
||||||
setCompletedRiddles("");
|
setCompletedRiddles("");
|
||||||
@@ -161,7 +161,7 @@ export default function Intro() {
|
|||||||
setWorthyWords("");
|
setWorthyWords("");
|
||||||
setVoiceOverState("on");
|
setVoiceOverState("on");
|
||||||
setStep("2");
|
setStep("2");
|
||||||
}}>Wir sind bereit!</ChargedButton>
|
}} whiteText={true}>Wir sind bereit!</ChargedButton>
|
||||||
</div> : null }
|
</div> : null }
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,5 +15,9 @@ export function getBoughtHints(): number[] {
|
|||||||
if (hintsList === null) {
|
if (hintsList === null) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
return JSON.parse(hintsList);
|
try {
|
||||||
|
return JSON.parse(hintsList);
|
||||||
|
} catch {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user