no time control for practice
This commit is contained in:
@@ -108,7 +108,7 @@ function GameFooter(props) {
|
||||
const now = Date.now();
|
||||
const end = Date.parse(game.phase_end);
|
||||
const timerPct = ((now - zero) / (end - zero) * 100);
|
||||
const displayPct = resolution || game.phase === 'Finish'
|
||||
const displayPct = resolution || game.phase === 'Finish' || !game.phase_end
|
||||
? 0
|
||||
: Math.min(timerPct, 100);
|
||||
|
||||
@@ -123,11 +123,13 @@ function GameFooter(props) {
|
||||
background: displayColour,
|
||||
};
|
||||
|
||||
const timer = (
|
||||
<div class="timer-container">
|
||||
<div class="timer" style={timerStyles} > </div>
|
||||
</div>
|
||||
);
|
||||
const timer = game.phase_end
|
||||
? (
|
||||
<div class="timer-container">
|
||||
<div class="timer" style={timerStyles} > </div>
|
||||
</div>
|
||||
)
|
||||
: null;
|
||||
|
||||
return (
|
||||
<footer>
|
||||
|
||||
@@ -67,7 +67,7 @@ class InstanceCreateForm extends Component {
|
||||
placeholder="game name"
|
||||
onInput={this.nameInput}
|
||||
/>
|
||||
<label htmlFor="pveSelect">Practice Mode - Bo10, vs CPU, 2x turn time</label>
|
||||
<label htmlFor="pveSelect">Practice Mode - Bo10, vs CPU, no time control</label>
|
||||
<input id="pveSelect"
|
||||
type="checkbox"
|
||||
disabled={disabled}
|
||||
|
||||
@@ -94,7 +94,9 @@ function Instance(args) {
|
||||
const zero = Date.parse(instance.phase_start);
|
||||
const now = Date.now();
|
||||
const end = Date.parse(instance.phase_end);
|
||||
const timerPct = ((now - zero) / (end - zero) * 100);
|
||||
const timerPct = instance.phase_end
|
||||
? ((now - zero) / (end - zero) * 100)
|
||||
: 0;
|
||||
|
||||
const displayColour = player.ready
|
||||
? 'forestgreen'
|
||||
|
||||
Reference in New Issue
Block a user