automatically rollback uncommented wrong move
parent
98b59807dd
commit
31828313c9
|
@ -79,7 +79,7 @@
|
|||
.gb_play .feedback.act:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
.gb_play .feedback.act span {
|
||||
.gb_play .feedback.act.com span {
|
||||
animation: rubberBand 8s infinite;
|
||||
}
|
||||
.gb_play .feedback.bad {
|
||||
|
|
|
@ -54,10 +54,16 @@ export default class GamebookPlayCtrl {
|
|||
}
|
||||
}
|
||||
this.state = state as State;
|
||||
if (state.feedback === 'good' && !state.comment) setTimeout(() => {
|
||||
this.next();
|
||||
this.redraw();
|
||||
}, this.root.path ? 1000 : 300);
|
||||
if (!state.comment) {
|
||||
if (state.feedback === 'good') setTimeout(() => {
|
||||
this.next();
|
||||
this.redraw();
|
||||
}, this.root.path ? 1000 : 300);
|
||||
else if (state.feedback === 'bad') setTimeout(() => {
|
||||
this.retry();
|
||||
this.redraw();
|
||||
}, 800);
|
||||
}
|
||||
}
|
||||
|
||||
isMyMove = () => this.root.turnColor() === this.root.data.orientation;
|
||||
|
|
|
@ -38,13 +38,13 @@ export function render(ctrl: GamebookPlayCtrl): VNode {
|
|||
|
||||
function renderFeedback(ctrl: GamebookPlayCtrl, state: State) {
|
||||
const fb = state.feedback;
|
||||
if (fb === 'bad') return h('div.feedback.act.bad', {
|
||||
if (fb === 'bad') return h('div.feedback.act.bad' + (state.comment ? '.com' : ''), {
|
||||
hook: bind('click', ctrl.retry, ctrl.redraw)
|
||||
}, [
|
||||
h('i', { attrs: dataIcon('P') }),
|
||||
h('span', 'Retry')
|
||||
]);
|
||||
if (fb === 'good' && state.comment) return h('div.feedback.act.good', {
|
||||
if (fb === 'good' && state.comment) return h('div.feedback.act.good.com', {
|
||||
hook: bind('click', () => ctrl.next())
|
||||
}, [
|
||||
h('i', { attrs: dataIcon('G') }),
|
||||
|
|
Loading…
Reference in New Issue