|
|
@ -305,7 +305,7 @@ const InGame = ({locale, changeLocale}) => {
|
|
|
|
window.open(url);
|
|
|
|
window.open(url);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const [SwitchEnabled, setSwitchEnabled] = useState(false)
|
|
|
|
// const [SwitchEnabled, setSwitchEnabled] = useState(false)
|
|
|
|
const allIndices = Stub.GenerateIndice()
|
|
|
|
const allIndices = Stub.GenerateIndice()
|
|
|
|
const { indice, players, actualPlayerIndex} = useGame();
|
|
|
|
const { indice, players, actualPlayerIndex} = useGame();
|
|
|
|
|
|
|
|
|
|
|
@ -315,14 +315,23 @@ const InGame = ({locale, changeLocale}) => {
|
|
|
|
|
|
|
|
|
|
|
|
//* Sound
|
|
|
|
//* Sound
|
|
|
|
const [playTurnSound, setPlayTurnSound] = useState(false);
|
|
|
|
const [playTurnSound, setPlayTurnSound] = useState(false);
|
|
|
|
|
|
|
|
const [soundPreference, setSoundPreference] = useState(true); // utilisateur
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleSoundPreferenceChange = () => {
|
|
|
|
|
|
|
|
setSoundPreference(!soundPreference);
|
|
|
|
|
|
|
|
console.log("changement des options du son : "+ soundPreference)
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handleTurn = () => {
|
|
|
|
const handleTurn = () => {
|
|
|
|
|
|
|
|
|
|
|
|
setPlayTurnSound(true);
|
|
|
|
console.log("etat normal du sound : " + soundPreference)
|
|
|
|
|
|
|
|
if (soundPreference) {
|
|
|
|
setTimeout(() => {
|
|
|
|
setPlayTurnSound(true);
|
|
|
|
setPlayTurnSound(false);
|
|
|
|
|
|
|
|
}, 2000);
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
|
|
setPlayTurnSound(false);
|
|
|
|
|
|
|
|
}, 2000);
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -478,19 +487,6 @@ const InGame = ({locale, changeLocale}) => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{/*
|
|
|
|
|
|
|
|
<Offcanvas show={showP}
|
|
|
|
|
|
|
|
onHide={handleCloseP}>
|
|
|
|
|
|
|
|
<Offcanvas.Header closeButton>
|
|
|
|
|
|
|
|
<Offcanvas.Title>Joueurs</Offcanvas.Title>
|
|
|
|
|
|
|
|
<h3>Il y a {players.length} joueurs</h3>
|
|
|
|
|
|
|
|
</Offcanvas.Header>
|
|
|
|
|
|
|
|
<Offcanvas.Body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Offcanvas.Body>
|
|
|
|
|
|
|
|
</Offcanvas>
|
|
|
|
|
|
|
|
*/}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ !IsSolo &&
|
|
|
|
{ !IsSolo &&
|
|
|
|
<div className='playerlistDiv'>
|
|
|
|
<div className='playerlistDiv'>
|
|
|
|
<PlayerList players={players} setPlayerTouched={handleSetPlayerTouched} playerTouched={playerTouched} playerIndex={playerIndex} askedWrong={askedWrong} greyForEveryone={() => {}}/>
|
|
|
|
<PlayerList players={players} setPlayerTouched={handleSetPlayerTouched} playerTouched={playerTouched} playerIndex={playerIndex} askedWrong={askedWrong} greyForEveryone={() => {}}/>
|
|
|
@ -507,7 +503,6 @@ const InGame = ({locale, changeLocale}) => {
|
|
|
|
<Offcanvas.Title>Indice</Offcanvas.Title>
|
|
|
|
<Offcanvas.Title>Indice</Offcanvas.Title>
|
|
|
|
</Offcanvas.Header>
|
|
|
|
</Offcanvas.Header>
|
|
|
|
<Offcanvas.Body>
|
|
|
|
<Offcanvas.Body>
|
|
|
|
{/* Possède les cheveux noir <u>ou</u> joue au basket */}
|
|
|
|
|
|
|
|
{indice?.ToString(locale)}
|
|
|
|
{indice?.ToString(locale)}
|
|
|
|
</Offcanvas.Body>
|
|
|
|
</Offcanvas.Body>
|
|
|
|
</Offcanvas>
|
|
|
|
</Offcanvas>
|
|
|
@ -523,31 +518,12 @@ const InGame = ({locale, changeLocale}) => {
|
|
|
|
<Offcanvas.Title><img src={Param} alt='param'/> Paramètres</Offcanvas.Title>
|
|
|
|
<Offcanvas.Title><img src={Param} alt='param'/> Paramètres</Offcanvas.Title>
|
|
|
|
</Offcanvas.Header>
|
|
|
|
</Offcanvas.Header>
|
|
|
|
<Offcanvas.Body>
|
|
|
|
<Offcanvas.Body>
|
|
|
|
<Nav className="me-auto">
|
|
|
|
<label style={{ display:'flex'}}>
|
|
|
|
<NavDropdown
|
|
|
|
<Switch checked={soundPreference} onChange={handleSoundPreferenceChange}/>
|
|
|
|
title={<span><HiLanguage/> Language </span>}
|
|
|
|
<p style={{ marginLeft:'20px'}}>Activer les SFX</p>
|
|
|
|
className="navbar-title" id="basic-nav-dropdown">
|
|
|
|
|
|
|
|
<NavDropdown.Item onClick={() => changeLocale('fr')}>
|
|
|
|
|
|
|
|
<FormattedMessage id="languageSelector.french"/>
|
|
|
|
|
|
|
|
</NavDropdown.Item>
|
|
|
|
|
|
|
|
<NavDropdown.Item onClick={() => changeLocale('en')}>
|
|
|
|
|
|
|
|
<FormattedMessage id="languageSelector.english"/>
|
|
|
|
|
|
|
|
</NavDropdown.Item>
|
|
|
|
|
|
|
|
</NavDropdown>
|
|
|
|
|
|
|
|
</Nav>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<label>
|
|
|
|
|
|
|
|
<Switch checked={SwitchEnabled} onChange={setSwitchEnabled}/>
|
|
|
|
|
|
|
|
<p>Afficher les noeuds possibles</p>
|
|
|
|
|
|
|
|
</label>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
|
|
</Offcanvas.Body>
|
|
|
|
</Offcanvas.Body>
|
|
|
|
</Offcanvas>
|
|
|
|
</Offcanvas>
|
|
|
|
{/*
|
|
|
|
|
|
|
|
<div id="endgamebutton" > {/* tmp
|
|
|
|
|
|
|
|
<ButtonImgNav dest="/endgame" img={Leave} text='endgame'/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
*/}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
};
|
|
|
|
};
|
|
|
|