fix game btns
This commit is contained in:
parent
1bb741f885
commit
c4f95d57f2
@ -54,17 +54,28 @@ function GameCtrlBtns(args) {
|
|||||||
game,
|
game,
|
||||||
animating,
|
animating,
|
||||||
|
|
||||||
|
getInstanceState,
|
||||||
sendGameSkillClear,
|
sendGameSkillClear,
|
||||||
sendReady,
|
sendReady,
|
||||||
|
quit,
|
||||||
} = args;
|
} = args;
|
||||||
|
|
||||||
if (!game) return false;
|
if (!game) return false;
|
||||||
|
const finished = game.phase === 'Finish';
|
||||||
|
|
||||||
|
function quitClick() {
|
||||||
|
getInstanceState();
|
||||||
|
quit();
|
||||||
|
}
|
||||||
|
|
||||||
|
const readyBtn = <button disabled={animating} class="ready" onClick={() => sendReady()}>Ready</button>;
|
||||||
|
const quitBtn = <button disabled={animating} onClick={quitClick}>Back</button>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class="game-ctrl-btns">
|
<div class="game-ctrl-btns">
|
||||||
<button disabled={true} >Chat</button>
|
<button disabled={true} >Chat</button>
|
||||||
<button disabled={animating} onClick={sendGameSkillClear}>Clear</button>
|
<button disabled={animating} onClick={sendGameSkillClear}>Clear</button>
|
||||||
<button disabled={animating} class="ready" onClick={() => sendReady()}>Ready</button>
|
{finished ? quitBtn : readyBtn}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user