gamebook: autoplay opponent move when comment is missing
This commit is contained in:
parent
7a0437528a
commit
ea6e480239
|
@ -55,6 +55,10 @@ export default class GamebookPlayCtrl {
|
|||
}
|
||||
}
|
||||
this.state = state as State;
|
||||
if (state.feedback === 'good' && !state.comment) setTimeout(() => {
|
||||
this.next();
|
||||
this.redraw();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
retry = () => {
|
||||
|
|
|
@ -51,7 +51,7 @@ function renderFeedback(ctrl: GamebookPlayCtrl, state: State) {
|
|||
h('i', { attrs: dataIcon('P') }),
|
||||
h('span', 'Retry')
|
||||
]);
|
||||
if (fb === 'good') return h('div.feedback.act.good', {
|
||||
if (fb === 'good' && state.comment) return h('div.feedback.act.good', {
|
||||
hook: bind('click', ctrl.next, ctrl.redraw)
|
||||
}, [
|
||||
h('i', { attrs: dataIcon('G') }),
|
||||
|
@ -61,7 +61,7 @@ function renderFeedback(ctrl: GamebookPlayCtrl, state: State) {
|
|||
h('i', { attrs: dataIcon('E') }),
|
||||
h('span', 'Gamebook complete')
|
||||
]);
|
||||
return h('div.feedback.' + fb,
|
||||
return h('div.feedback',
|
||||
h('span', fb === 'play' ? 'Your turn' : 'Opponent turn')
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue