@gamelearn/arcade-components 0.26.0 → 0.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -23,6 +23,8 @@ var _helpers = require("../../../helpers");
|
|
|
23
23
|
|
|
24
24
|
var _HtmlPro = _interopRequireDefault(require("../../../helpers/HtmlPro"));
|
|
25
25
|
|
|
26
|
+
var _deviceDetection = require("../../../helpers/deviceDetection");
|
|
27
|
+
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
29
|
|
|
28
30
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
@@ -37,6 +39,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
37
39
|
|
|
38
40
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
39
41
|
|
|
42
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
43
|
+
|
|
44
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
45
|
+
|
|
40
46
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
41
47
|
|
|
42
48
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -49,9 +55,12 @@ function _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "und
|
|
|
49
55
|
|
|
50
56
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
51
57
|
|
|
52
|
-
var
|
|
58
|
+
var isMobile = (0, _deviceDetection.DeviceDetection)();
|
|
59
|
+
var crossFadeDuration = 0.5; // Mobile always zoom in?
|
|
53
60
|
|
|
54
61
|
var DialogComponent = function DialogComponent(_ref) {
|
|
62
|
+
var _currentLine$audio3, _currentLine$audio4;
|
|
63
|
+
|
|
55
64
|
var emitEvent = _ref.emitEvent,
|
|
56
65
|
lines = _ref.lines,
|
|
57
66
|
actors = _ref.actors,
|
|
@@ -82,6 +91,8 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
82
91
|
currentMessage = _useState6[0],
|
|
83
92
|
setCurrentMessage = _useState6[1];
|
|
84
93
|
|
|
94
|
+
var emitRef = (0, _react.useRef)(emitEvent);
|
|
95
|
+
|
|
85
96
|
var _useThree = (0, _fiber.useThree)(function (state) {
|
|
86
97
|
return [state.camera, state.scene];
|
|
87
98
|
}),
|
|
@@ -93,6 +104,11 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
93
104
|
return new _GLTFLoader.GLTFLoader();
|
|
94
105
|
}, []);
|
|
95
106
|
var defaultCamera = (0, _react.useRef)(camera.clone());
|
|
107
|
+
|
|
108
|
+
var _soundActions = _slicedToArray(soundActions, 2),
|
|
109
|
+
playSound = _soundActions[0],
|
|
110
|
+
stop = _soundActions[1];
|
|
111
|
+
|
|
96
112
|
var messagePosition = (0, _react.useRef)({
|
|
97
113
|
pos: [0, 0, 0],
|
|
98
114
|
child: null
|
|
@@ -105,11 +121,66 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
105
121
|
var lastLine = lines[line - 1];
|
|
106
122
|
var lastSet = (0, _react.useRef)(false);
|
|
107
123
|
var translate = (0, _react.useCallback)(function (id) {
|
|
108
|
-
return
|
|
124
|
+
return emitRef.current({
|
|
109
125
|
type: 'translate',
|
|
110
126
|
payload: id
|
|
111
127
|
});
|
|
112
|
-
}, [
|
|
128
|
+
}, []);
|
|
129
|
+
var getVoice = (0, _react.useCallback)(function (_ref2) {
|
|
130
|
+
var id = _ref2.id,
|
|
131
|
+
_ref2$type = _ref2.type,
|
|
132
|
+
type = _ref2$type === void 0 ? 'base' : _ref2$type;
|
|
133
|
+
var usedVoices = translate('usedVoices');
|
|
134
|
+
var gameChars = translate('gameCharacters');
|
|
135
|
+
|
|
136
|
+
if (type === 'base') {
|
|
137
|
+
return usedVoices === null || usedVoices === void 0 ? void 0 : usedVoices[id];
|
|
138
|
+
} else if (type === 'character') {
|
|
139
|
+
var _gameChars$id;
|
|
140
|
+
|
|
141
|
+
return gameChars === null || gameChars === void 0 ? void 0 : (_gameChars$id = gameChars[id]) === null || _gameChars$id === void 0 ? void 0 : _gameChars$id.voiceId;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return null;
|
|
145
|
+
}, [translate]);
|
|
146
|
+
var playSpeech = (0, _react.useCallback)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
147
|
+
var payload, speechUrl;
|
|
148
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
149
|
+
while (1) {
|
|
150
|
+
switch (_context.prev = _context.next) {
|
|
151
|
+
case 0:
|
|
152
|
+
if (!currentLine.voice.id) {
|
|
153
|
+
_context.next = 7;
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
payload = {
|
|
158
|
+
voiceId: getVoice(currentLine.voice),
|
|
159
|
+
text: currentMessage.text
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
if (!(payload.voiceId && payload.text)) {
|
|
163
|
+
_context.next = 7;
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
_context.next = 5;
|
|
168
|
+
return emitRef.current({
|
|
169
|
+
type: 'playSpeech',
|
|
170
|
+
payload: payload
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
case 5:
|
|
174
|
+
speechUrl = _context.sent;
|
|
175
|
+
playSound(speechUrl);
|
|
176
|
+
|
|
177
|
+
case 7:
|
|
178
|
+
case "end":
|
|
179
|
+
return _context.stop();
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}, _callee);
|
|
183
|
+
})), [currentLine.voice, getVoice, currentMessage.text, playSound]);
|
|
113
184
|
var getCurrentVisible = (0, _react.useCallback)(function (uid) {
|
|
114
185
|
var object;
|
|
115
186
|
scene.traverseVisible(function (node) {
|
|
@@ -201,11 +272,13 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
201
272
|
}, [zoomInActor]);
|
|
202
273
|
var backLine = (0, _react.useCallback)(function () {
|
|
203
274
|
if (lastLine && !lastLine.decision) {
|
|
275
|
+
setCurrentMessage({});
|
|
204
276
|
changeLine(line - 1);
|
|
205
277
|
}
|
|
206
278
|
}, [lastLine, line]);
|
|
207
279
|
var nextLine = (0, _react.useCallback)(function () {
|
|
208
280
|
if (line < lines.length - 1) {
|
|
281
|
+
setCurrentMessage({});
|
|
209
282
|
changeLine(line + 1);
|
|
210
283
|
} else {
|
|
211
284
|
resetAnims(true);
|
|
@@ -222,8 +295,6 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
222
295
|
}, [camera, currentLine.decision, emitEvent, line, lines.length, resetAnims, resetCameraView]); // Position bubble over talking character/and switch emotions
|
|
223
296
|
|
|
224
297
|
(0, _react.useEffect)(function () {
|
|
225
|
-
setCurrentMessage({});
|
|
226
|
-
|
|
227
298
|
if (currentLine.decision) {
|
|
228
299
|
resetCameraView();
|
|
229
300
|
return;
|
|
@@ -275,38 +346,42 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
275
346
|
if (startAction !== action) {
|
|
276
347
|
mixer.stopAllAction();
|
|
277
348
|
(0, _helpers.executeCrossFade)(startAction, action, crossFadeDuration);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
349
|
+
} // Ugly timeout to wait an animation transition
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
setTimeout(function () {
|
|
353
|
+
if (talkingCharacter.uid === element.uid) {
|
|
354
|
+
var head = element.getObjectByName('Head_M');
|
|
355
|
+
var target = new _three.Object3D();
|
|
356
|
+
head.getWorldPosition(target.position);
|
|
357
|
+
target.applyQuaternion(camera.quaternion);
|
|
358
|
+
target.translateX(1.25);
|
|
359
|
+
target.translateY(3);
|
|
360
|
+
messagePosition.current = {
|
|
361
|
+
pos: target.position.toArray(),
|
|
362
|
+
child: head,
|
|
363
|
+
parent: element
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
if (zoomInActor) {
|
|
367
|
+
animationStart.current = true;
|
|
368
|
+
} // Ugly timeout to wait for zoom in ( maybe use tween (?))
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
setTimeout(function () {
|
|
372
|
+
var _talkingCharacter$cha;
|
|
373
|
+
|
|
374
|
+
setCurrentMessage({
|
|
375
|
+
text: talkingCharacter.text,
|
|
376
|
+
name: talkingCharacter.alias || ((_talkingCharacter$cha = talkingCharacter.character) === null || _talkingCharacter$cha === void 0 ? void 0 : _talkingCharacter$cha.name),
|
|
377
|
+
left: true,
|
|
378
|
+
inScene: true,
|
|
379
|
+
thinkful: talkingCharacter.emotion === 'thinkful',
|
|
380
|
+
avatar: ''
|
|
381
|
+
});
|
|
382
|
+
}, zoomInActor ? 1200 : 0);
|
|
295
383
|
}
|
|
296
|
-
|
|
297
|
-
setTimeout(function () {
|
|
298
|
-
var _talkingCharacter$cha;
|
|
299
|
-
|
|
300
|
-
setCurrentMessage({
|
|
301
|
-
text: talkingCharacter.text,
|
|
302
|
-
name: talkingCharacter.alias || ((_talkingCharacter$cha = talkingCharacter.character) === null || _talkingCharacter$cha === void 0 ? void 0 : _talkingCharacter$cha.name),
|
|
303
|
-
left: true,
|
|
304
|
-
inScene: true,
|
|
305
|
-
thinkful: talkingCharacter.emotion === 'thinkful',
|
|
306
|
-
avatar: ''
|
|
307
|
-
});
|
|
308
|
-
}, zoomInActor ? 700 : 0);
|
|
309
|
-
}
|
|
384
|
+
}, 1000 * crossFadeDuration);
|
|
310
385
|
});
|
|
311
386
|
} else {
|
|
312
387
|
var _talkingCharacter$cha2;
|
|
@@ -323,7 +398,23 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
323
398
|
}
|
|
324
399
|
}
|
|
325
400
|
}
|
|
326
|
-
}, [actors, camera, currentLine, zoomInActor, getCurrentVisible, translate, getAvatarURL, loadEmotion, resetAnims, resetCameraView]); //
|
|
401
|
+
}, [actors, camera, currentLine, zoomInActor, getCurrentVisible, translate, getAvatarURL, loadEmotion, resetAnims, resetCameraView]); // Sound logic
|
|
402
|
+
|
|
403
|
+
(0, _react.useEffect)(function () {
|
|
404
|
+
var _currentLine$audio;
|
|
405
|
+
|
|
406
|
+
if ((currentLine === null || currentLine === void 0 ? void 0 : currentLine.audioType) === 'voice' && !lastSet.current) {
|
|
407
|
+
playSpeech();
|
|
408
|
+
} else if (currentLine !== null && currentLine !== void 0 && (_currentLine$audio = currentLine.audio) !== null && _currentLine$audio !== void 0 && _currentLine$audio.url) {
|
|
409
|
+
var _currentLine$audio2;
|
|
410
|
+
|
|
411
|
+
playSound(currentLine === null || currentLine === void 0 ? void 0 : (_currentLine$audio2 = currentLine.audio) === null || _currentLine$audio2 === void 0 ? void 0 : _currentLine$audio2.url);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
return function () {
|
|
415
|
+
stop();
|
|
416
|
+
};
|
|
417
|
+
}, [currentLine === null || currentLine === void 0 ? void 0 : (_currentLine$audio3 = currentLine.audio) === null || _currentLine$audio3 === void 0 ? void 0 : _currentLine$audio3.url, currentLine === null || currentLine === void 0 ? void 0 : currentLine.audioType, currentMessage, lines, playSound, playSpeech, stop]); // Autoplay logic
|
|
327
418
|
|
|
328
419
|
(0, _react.useEffect)(function () {
|
|
329
420
|
var timeout;
|
|
@@ -332,35 +423,41 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
332
423
|
if (line >= lines.length - 1 && automatic) {
|
|
333
424
|
setAutomatic(false);
|
|
334
425
|
} else if (automatic && currentMessage.text && !currentLine.decision) {
|
|
426
|
+
var time = 70 * (currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.text.length);
|
|
335
427
|
timeout = setTimeout(function () {
|
|
336
428
|
nextLine();
|
|
337
|
-
},
|
|
429
|
+
}, time < 1400 ? 1400 : time);
|
|
338
430
|
}
|
|
339
431
|
}
|
|
340
432
|
|
|
341
433
|
return function () {
|
|
342
434
|
if (timeout) clearTimeout(timeout);
|
|
343
435
|
};
|
|
344
|
-
}, [currentMessage, nextLine, autoPlay, lines.length, automatic, line, currentLine.decision]); //Positioning logic
|
|
436
|
+
}, [currentMessage, nextLine, autoPlay, lines.length, automatic, line, currentLine.decision, currentLine === null || currentLine === void 0 ? void 0 : currentLine.audioType, currentLine === null || currentLine === void 0 ? void 0 : (_currentLine$audio4 = currentLine.audio) === null || _currentLine$audio4 === void 0 ? void 0 : _currentLine$audio4.url]); //Positioning logic
|
|
345
437
|
|
|
346
|
-
(0, _react.
|
|
438
|
+
var checkBubblePosition = (0, _react.useCallback)(function () {
|
|
347
439
|
if (bubbleRef.current && currentLine.slots) {
|
|
348
440
|
var talkingCharacter = currentLine.slots.find(function (slot) {
|
|
349
441
|
return slot.talking;
|
|
350
442
|
});
|
|
351
443
|
var bubbleRect = bubbleRef.current.getBoundingClientRect();
|
|
352
|
-
var x = bubbleRect.x + bubbleRect.width
|
|
353
|
-
var y = bubbleRect.y - bubbleRect.height
|
|
444
|
+
var x = bubbleRect.x + bubbleRect.width - 75;
|
|
445
|
+
var y = bubbleRect.y - bubbleRect.height;
|
|
354
446
|
|
|
355
|
-
if ((x < 0 || x > window.innerWidth
|
|
447
|
+
if ((x < 0 || x > window.innerWidth) && currentMessage.inScene) {
|
|
356
448
|
var child = messagePosition.current.child;
|
|
357
449
|
|
|
358
450
|
if (child) {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
451
|
+
var target = new _three.Object3D();
|
|
452
|
+
child.getWorldPosition(target.position);
|
|
453
|
+
target.applyQuaternion(camera.quaternion);
|
|
454
|
+
groupRef.current.position.copy(target.position);
|
|
363
455
|
groupRef.current.updateMatrixWorld();
|
|
456
|
+
var divider = isMobile ? 10 : 6;
|
|
457
|
+
var distanceX = bubbleRect.width + bubbleRect.width / divider;
|
|
458
|
+
bubbleRef.current.parentNode.style.transform = "translate3d(-".concat(distanceX, "px, -").concat(bubbleRect.height, "px, 0px)");
|
|
459
|
+
bubbleRect = bubbleRef.current.getBoundingClientRect();
|
|
460
|
+
var completeOutside = x > window.innerWidth + bubbleRect.width || y < -bubbleRect.height || y > window.innerHeight || x < -bubbleRect.width;
|
|
364
461
|
|
|
365
462
|
if (completeOutside) {
|
|
366
463
|
bubbleRef.current.parentNode.style.transform = '';
|
|
@@ -380,10 +477,13 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
380
477
|
bubbleRef.current.parentNode.style.transform = '';
|
|
381
478
|
}
|
|
382
479
|
}
|
|
383
|
-
}, [
|
|
480
|
+
}, [camera.quaternion, currentLine.slots, currentMessage.inScene, getAvatarURL]);
|
|
481
|
+
(0, _react.useEffect)(function () {
|
|
482
|
+
checkBubblePosition();
|
|
483
|
+
}, [checkBubblePosition]); // Animate Camera
|
|
384
484
|
|
|
385
|
-
(0, _fiber.useFrame)(function (
|
|
386
|
-
var camera =
|
|
485
|
+
(0, _fiber.useFrame)(function (_ref4, delta) {
|
|
486
|
+
var camera = _ref4.camera;
|
|
387
487
|
|
|
388
488
|
if (animationStart.current) {
|
|
389
489
|
var targetPosition = messagePosition.current.child ? messagePosition.current.pos : defaultCamera.current.position.toArray();
|
|
@@ -394,7 +494,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
394
494
|
animationTarget.current.applyQuaternion(camera.quaternion);
|
|
395
495
|
}
|
|
396
496
|
|
|
397
|
-
animationTarget.current.translateX(
|
|
497
|
+
animationTarget.current.translateX(13);
|
|
398
498
|
animationTarget.current.translateY(-5);
|
|
399
499
|
animationTarget.current.translateZ(30);
|
|
400
500
|
}
|
|
@@ -405,6 +505,8 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
405
505
|
if (lastSet.current || !messagePosition.current.child) {
|
|
406
506
|
camera.copy(defaultCamera.current);
|
|
407
507
|
}
|
|
508
|
+
|
|
509
|
+
checkBubblePosition();
|
|
408
510
|
} else {
|
|
409
511
|
camera.position.lerp(animationTarget.current.position, delta * 2.5);
|
|
410
512
|
}
|
|
@@ -417,7 +519,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
417
519
|
disableBackground: true
|
|
418
520
|
},
|
|
419
521
|
onFinish: nextLine,
|
|
420
|
-
emitEvent:
|
|
522
|
+
emitEvent: emitRef.current,
|
|
421
523
|
soundActions: soundActions
|
|
422
524
|
});
|
|
423
525
|
|
|
@@ -121,25 +121,20 @@ var WriterPuzzleComponent = function WriterPuzzleComponent(_ref) {
|
|
|
121
121
|
feedbackScreen = _useState19[0],
|
|
122
122
|
setFeedbackScreen = _useState19[1];
|
|
123
123
|
|
|
124
|
-
var _useState20 = (0, _react.useState)(
|
|
124
|
+
var _useState20 = (0, _react.useState)(true),
|
|
125
125
|
_useState21 = _slicedToArray(_useState20, 2),
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
isActive = _useState21[0],
|
|
127
|
+
setIsActive = _useState21[1];
|
|
128
128
|
|
|
129
|
-
var _useState22 = (0, _react.useState)(
|
|
129
|
+
var _useState22 = (0, _react.useState)([]),
|
|
130
130
|
_useState23 = _slicedToArray(_useState22, 2),
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
rewardsStack = _useState23[0],
|
|
132
|
+
setRewardsStack = _useState23[1];
|
|
133
133
|
|
|
134
|
-
var _useState24 = (0, _react.useState)(
|
|
134
|
+
var _useState24 = (0, _react.useState)(true),
|
|
135
135
|
_useState25 = _slicedToArray(_useState24, 2),
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
var _useState26 = (0, _react.useState)(true),
|
|
140
|
-
_useState27 = _slicedToArray(_useState26, 2),
|
|
141
|
-
disableExit = _useState27[0],
|
|
142
|
-
setDisableExit = _useState27[1];
|
|
136
|
+
disableExit = _useState25[0],
|
|
137
|
+
setDisableExit = _useState25[1];
|
|
143
138
|
|
|
144
139
|
var _soundActions = _slicedToArray(soundActions, 1),
|
|
145
140
|
playSound = _soundActions[0];
|
|
@@ -231,7 +226,7 @@ var WriterPuzzleComponent = function WriterPuzzleComponent(_ref) {
|
|
|
231
226
|
var checkFeedbackScreen = function checkFeedbackScreen() {
|
|
232
227
|
return decisionsList.find(function (decision) {
|
|
233
228
|
var feedback = texts[decision.currenTextParagraph].electionTexts[decision.index].feedback;
|
|
234
|
-
return feedback.body
|
|
229
|
+
return feedback.body || feedback.rewards && feedback.rewards.length > 0;
|
|
235
230
|
});
|
|
236
231
|
};
|
|
237
232
|
|
|
@@ -301,7 +296,6 @@ var WriterPuzzleComponent = function WriterPuzzleComponent(_ref) {
|
|
|
301
296
|
} else if (checkAllDecisionsRightWrong()) {
|
|
302
297
|
// if all Decisions are right or wrong we just skip to end
|
|
303
298
|
setReviewDone(true);
|
|
304
|
-
setFeedbackScreenDone(true);
|
|
305
299
|
endGame();
|
|
306
300
|
}
|
|
307
301
|
|
|
@@ -312,22 +306,15 @@ var WriterPuzzleComponent = function WriterPuzzleComponent(_ref) {
|
|
|
312
306
|
if (checkFeedbackScreen()) {
|
|
313
307
|
// CHECK IF THERE IS NEED OF FEEDBACK SCREEN
|
|
314
308
|
setFeedbackScreen(true);
|
|
315
|
-
} else {
|
|
316
|
-
setFeedbackScreenDone(true);
|
|
317
309
|
}
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
if (reviewDone && !feedbackScreenDone) {
|
|
310
|
+
} else {
|
|
321
311
|
setIsActive(false); // Second EXECUTION shows Feedback Screen
|
|
322
312
|
|
|
323
|
-
if (feedbackScreen) {
|
|
313
|
+
if (feedbackScreen && !showFeedback) {
|
|
324
314
|
setShowFeedback(true);
|
|
315
|
+
} else if (showFeedback || !feedbackScreen && !showFeedback) {
|
|
316
|
+
endGame();
|
|
325
317
|
}
|
|
326
|
-
} // Third EXECUTION Give Points
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
if (feedbackScreenDone) {
|
|
330
|
-
endGame();
|
|
331
318
|
}
|
|
332
319
|
};
|
|
333
320
|
|
|
@@ -468,12 +455,7 @@ var WriterPuzzleComponent = function WriterPuzzleComponent(_ref) {
|
|
|
468
455
|
return _setFailed(true);
|
|
469
456
|
},
|
|
470
457
|
decisionsList: decisionsList,
|
|
471
|
-
closingAction:
|
|
472
|
-
return setShowFeedback(false);
|
|
473
|
-
},
|
|
474
|
-
feedbackIsDone: function feedbackIsDone() {
|
|
475
|
-
return setFeedbackScreenDone(true);
|
|
476
|
-
},
|
|
458
|
+
closingAction: handleFinish,
|
|
477
459
|
retry: retry,
|
|
478
460
|
skip: skip,
|
|
479
461
|
checkCorrect: checkAllDecisionsAreCorrect,
|