Load of Hint VoiceOver Improvements
This commit is contained in:
1 parent
e36bec6b36
commit
6cf631f995
23 files changed
+27
-11
No files matched your search
@@ -10,22 +10,27 @@ import OldButton from "./OldButton";
|
||||
import { addBoughtHint, getBoughtHints } from "@/utils/boughtHints";
|
||||
import OldPopUp from "./OldPopUp";
|
||||
import { getPoints, takePoints } from "@/utils/points";
|
||||
import VoiceOver from "./VoiceOver";
|
||||
import { VoiceOverMode } from "@/types/voiceOverMode";
|
||||
|
||||
interface RiddleHintProps {
|
||||
riddle: Riddle;
|
||||
onSkip?: (() => void) | null;
|
||||
dismissHintPage: () => void;
|
||||
voiceOverMode: VoiceOverMode;
|
||||
};
|
||||
|
||||
export default function RiddleHintPage({
|
||||
riddle,
|
||||
onSkip,
|
||||
dismissHintPage
|
||||
dismissHintPage,
|
||||
voiceOverMode
|
||||
}: RiddleHintProps) {
|
||||
//const [ pointsStr, ] = useLocalStorage(PREF.points, "");
|
||||
const [ boughtHintsStr, ] = useLocalStorage(PREF.boughtHints, "");
|
||||
const [ showBuyHint, setShowBuyHint ] = useState(false);
|
||||
const [ showSkipRiddle, setShowSkipRiddle ] = useState(false);
|
||||
const [ currentVoiceOver, setCurrentVoiceOver ] = useState(-1);
|
||||
|
||||
const boughtHints = useMemo(() => {
|
||||
return getBoughtHints();
|
||||
@@ -47,10 +52,20 @@ export default function RiddleHintPage({
|
||||
return sortedHints.find(h => !boughtHints.includes(h.id));
|
||||
}, [sortedHints, boughtHints]);
|
||||
|
||||
console.log(boughtHints);
|
||||
console.log(sortedHints, nextHintToBuy);
|
||||
|
||||
return (
|
||||
<div className={clsx(styles["container"])}>
|
||||
{ currentVoiceOver > -1 ?
|
||||
<VoiceOver voiceOverMode={voiceOverMode}
|
||||
sources={[
|
||||
{
|
||||
src: "/res/tour/riddle_" + (riddle.step + 1) + "/voiceovers/Hinweis " + currentVoiceOver + ".mp3",
|
||||
type: "audio/mpeg"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
: null}
|
||||
<div className={styles["header"]}>
|
||||
<img src={"/icons/hinweis-dunkel.svg"} className={styles["hint-icon"]}/>
|
||||
<p className={clsx(styles["hint-p"], "eisenkraft-regular")}>Hinweise</p>
|
||||
@@ -79,6 +94,7 @@ export default function RiddleHintPage({
|
||||
<p>Möchtet ihr diesen Hinweis für {nextHintToBuy.penaltyPoints} Rufpunkte kaufen?</p>
|
||||
<OldButton red={true} /*disabled={points >= nextHintToBuy.penaltyPoints}*/ onAction={() => {
|
||||
addBoughtHint(nextHintToBuy.id);
|
||||
setCurrentVoiceOver(nextHintToBuy.hintOrder + 1)
|
||||
takePoints(nextHintToBuy.penaltyPoints);
|
||||
setShowBuyHint(false);
|
||||
}}>JA, KAUFEN!</OldButton>
|
||||
|
||||
Reference in new issue
Block a user