fix friendly targeting

This commit is contained in:
ntr 2019-05-18 23:08:54 +10:00
parent 7bc3e60fab
commit d72118b157
4 changed files with 10 additions and 5 deletions

View File

@ -69,7 +69,7 @@ function GamePanel(props) {
const now = Date.now(); const now = Date.now();
const end = Date.parse(game.phase_end); const end = Date.parse(game.phase_end);
const timerPct = ((now - zero) / (end - zero) * 100); const timerPct = ((now - zero) / (end - zero) * 100);
const displayPct = resolution const displayPct = resolution || game.phase === 'Finish'
? 0 ? 0
: Math.min(timerPct, 100); : Math.min(timerPct, 100);
@ -162,8 +162,13 @@ function GamePanel(props) {
const gameClasses = `game ${resolution ? 'resolving': ''}`; const gameClasses = `game ${resolution ? 'resolving': ''}`;
function gameClick(e) {
e.stopPropagation();
setActiveCryp(null);
}
return ( return (
<main className={gameClasses} onClick={() => setActiveCryp(null)} > <main className={gameClasses} onClick={gameClick} >
{header} {header}
{timer} {timer}
{otherTeams.map(OpponentTeam)} {otherTeams.map(OpponentTeam)}

View File

@ -47,7 +47,7 @@ function GameCryp(props) {
resolution, resolution,
activeSkill, activeSkill,
setActiveCryp, setActiveCryp,
// selectSkillTarget, selectSkillTarget,
} = props; } = props;
const ko = cryp.green_life.value === 0 ? 'ko' : ''; const ko = cryp.green_life.value === 0 ? 'ko' : '';

View File

@ -78,7 +78,7 @@ function Nav(args) {
<h2>Team</h2> <h2>Team</h2>
{teamElements} {teamElements}
<h2>Instances</h2> <h2>Instances</h2>
<button onClick={() => navTo('list')}>list</button> <button onClick={() => navTo('list')}>Join</button>
<hr /> <hr />
{joined} {joined}
<h2>Hax</h2> <h2>Hax</h2>

View File

@ -88,7 +88,7 @@ function registerEvents(store) {
} }
return store.dispatch(actions.setGame(game)); return store.dispatch(actions.setGame(game));
// return console.log('EVENT ->', 'game', game); return console.log('EVENT ->', 'game', game);
} }
function setAccount(account) { function setAccount(account) {