@gamelearn/arcade-components 1.4.26 → 1.4.29
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.
|
@@ -115,7 +115,7 @@ var Board = function Board(_ref) {
|
|
|
115
115
|
}
|
|
116
116
|
}, [flipAllCorrect, resolvePuzzle]);
|
|
117
117
|
(0, _react.useEffect)(function () {
|
|
118
|
-
if (correctCards === numberOfCorrectCards) {
|
|
118
|
+
if (correctCards === numberOfCorrectCards && numberOfCorrectCards > 0) {
|
|
119
119
|
endPuzzle();
|
|
120
120
|
setCorrectCards(0);
|
|
121
121
|
}
|
|
@@ -184,11 +184,13 @@ Board.defaultProps = {
|
|
|
184
184
|
handleError: function handleError() {},
|
|
185
185
|
endPuzzle: function endPuzzle() {},
|
|
186
186
|
handleSuccess: function handleSuccess() {},
|
|
187
|
+
setForceFlipCard: function setForceFlipCard() {},
|
|
187
188
|
documentsDict: {},
|
|
188
189
|
cards: [],
|
|
189
190
|
currentOrder: 1,
|
|
190
191
|
resolvePuzzle: false,
|
|
191
|
-
feedbackIsShown: false
|
|
192
|
+
feedbackIsShown: false,
|
|
193
|
+
forceFlipCard: false
|
|
192
194
|
};
|
|
193
195
|
var _default = Board;
|
|
194
196
|
exports.default = _default;
|
package/dist/components/cards-selector-puzzle-component/components/CardsSelectorPuzzleComponent.js
CHANGED
|
@@ -151,6 +151,8 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
|
|
|
151
151
|
};
|
|
152
152
|
|
|
153
153
|
var handleFeedbackFuncionOnClose = function handleFeedbackFuncionOnClose() {
|
|
154
|
+
var isCorrect = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
155
|
+
|
|
154
156
|
if (feedbackResult) {
|
|
155
157
|
endPuzzle();
|
|
156
158
|
} else {
|
|
@@ -165,12 +167,14 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
|
|
|
165
167
|
|
|
166
168
|
setFeedBackText('');
|
|
167
169
|
|
|
168
|
-
if (!feedbackResult && !
|
|
170
|
+
if (!feedbackResult && !isCorrect) {
|
|
169
171
|
setForceFlipCard(true);
|
|
170
172
|
}
|
|
171
173
|
};
|
|
172
174
|
|
|
173
175
|
var handleSuccessPick = function handleSuccessPick(cardId) {
|
|
176
|
+
setRightPick(true);
|
|
177
|
+
|
|
174
178
|
if (specificFeedbacks !== null && specificFeedbacks !== void 0 && specificFeedbacks.specificCorrectFeedbacks) {
|
|
175
179
|
var pickedCard = specificFeedbacks.correctFeedbacks.find(function (greenCard) {
|
|
176
180
|
return greenCard.id === cardId;
|
|
@@ -181,7 +185,7 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
|
|
|
181
185
|
} else {
|
|
182
186
|
setTimeout(function () {
|
|
183
187
|
playSound('score');
|
|
184
|
-
handleFeedbackFuncionOnClose();
|
|
188
|
+
handleFeedbackFuncionOnClose(true);
|
|
185
189
|
emitEvent({
|
|
186
190
|
type: 'hidePuzzleButtons',
|
|
187
191
|
payload: false
|
|
@@ -189,7 +193,6 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
|
|
|
189
193
|
}, 2000);
|
|
190
194
|
}
|
|
191
195
|
|
|
192
|
-
setRightPick(true);
|
|
193
196
|
setFeedbackIsShown(true);
|
|
194
197
|
emitEvent({
|
|
195
198
|
type: 'hidePuzzleButtons',
|
|
@@ -419,7 +419,25 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
419
419
|
head.getWorldPosition(target.position);
|
|
420
420
|
target.applyQuaternion(camera.quaternion);
|
|
421
421
|
target.translateX(1.25);
|
|
422
|
-
|
|
422
|
+
var distanceToCam = camera.position.distanceTo(element.position);
|
|
423
|
+
var bbox = new _three.Box3().setFromObject(element);
|
|
424
|
+
var size = bbox.getSize(new _three.Vector3());
|
|
425
|
+
var distanceMultiplier = 1;
|
|
426
|
+
|
|
427
|
+
if (distanceToCam > 200 && !zoomInActor) {
|
|
428
|
+
distanceMultiplier = size.y / 3.5;
|
|
429
|
+
|
|
430
|
+
if (distanceToCam > 400) {
|
|
431
|
+
distanceMultiplier = size.y / 2;
|
|
432
|
+
|
|
433
|
+
if (distanceToCam > 600) {
|
|
434
|
+
distanceMultiplier = size.y / 1.5;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
var baseY = 3 * distanceMultiplier;
|
|
440
|
+
target.translateY(showArrowTop ? 1.25 : baseY);
|
|
423
441
|
messagePosition.current = {
|
|
424
442
|
pos: target.position.toArray(),
|
|
425
443
|
child: head,
|