@gamelearn/arcade-components 1.2.1 → 1.3.0
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.
|
@@ -31,10 +31,11 @@ var ElementsList = function ElementsList(_ref) {
|
|
|
31
31
|
var status = _ref2.status;
|
|
32
32
|
var invisibleStatus = ['invisible', 'used'];
|
|
33
33
|
return !invisibleStatus.includes(status);
|
|
34
|
-
};
|
|
34
|
+
}; // Por alguna razon el puto raycast esta pillando elementos sin padre/hijo
|
|
35
|
+
|
|
35
36
|
|
|
36
37
|
var handleClick = function handleClick(e, props) {
|
|
37
|
-
eventHandler({
|
|
38
|
+
if (e.eventObject.parent !== null) eventHandler({
|
|
38
39
|
type: 'click',
|
|
39
40
|
event: e,
|
|
40
41
|
props: props
|
|
@@ -42,7 +43,7 @@ var ElementsList = function ElementsList(_ref) {
|
|
|
42
43
|
};
|
|
43
44
|
|
|
44
45
|
var onHover = function onHover(e, props) {
|
|
45
|
-
eventHandler({
|
|
46
|
+
if (e.eventObject.parent !== null) eventHandler({
|
|
46
47
|
type: 'hover',
|
|
47
48
|
event: e,
|
|
48
49
|
props: props
|
|
@@ -50,7 +51,7 @@ var ElementsList = function ElementsList(_ref) {
|
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
var onOut = function onOut(e, props) {
|
|
53
|
-
eventHandler({
|
|
54
|
+
if (e.eventObject.parent !== null) eventHandler({
|
|
54
55
|
type: 'out',
|
|
55
56
|
event: e,
|
|
56
57
|
props: props
|
|
@@ -181,7 +181,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
}, _callee);
|
|
184
|
-
})), [currentLine.voice, getVoice, currentMessage.text, emitEvent]);
|
|
184
|
+
})), [currentLine === null || currentLine === void 0 ? void 0 : currentLine.voice, getVoice, currentMessage.text, emitEvent]);
|
|
185
185
|
var getCurrentVisible = (0, _react.useCallback)(function (uid) {
|
|
186
186
|
var object;
|
|
187
187
|
scene.traverseVisible(function (node) {
|
|
@@ -295,7 +295,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
295
295
|
camera.copy(defaultCamera.current);
|
|
296
296
|
}, currentLine.decision ? 0 : 1200);
|
|
297
297
|
}
|
|
298
|
-
}, [camera, currentLine.decision, emitEvent, line, lines.length, resetAnims, resetCameraView]); // Position bubble over talking character/and switch emotions
|
|
298
|
+
}, [camera, currentLine === null || currentLine === void 0 ? void 0 : currentLine.decision, emitEvent, line, lines.length, resetAnims, resetCameraView]); // Position bubble over talking character/and switch emotions
|
|
299
299
|
|
|
300
300
|
(0, _react.useEffect)(function () {
|
|
301
301
|
if (currentLine.decision) {
|
|
@@ -432,8 +432,13 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
432
432
|
if (autoPlay) {
|
|
433
433
|
if (line >= lines.length - 1 && automatic) {
|
|
434
434
|
setAutomatic(false);
|
|
435
|
-
} else if (automatic && currentMessage.
|
|
436
|
-
var time =
|
|
435
|
+
} else if (automatic && currentMessage.show && !currentLine.decision) {
|
|
436
|
+
var time = 0;
|
|
437
|
+
|
|
438
|
+
if (currentMessage.text) {
|
|
439
|
+
time = 75 * (currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.text.length);
|
|
440
|
+
}
|
|
441
|
+
|
|
437
442
|
timeout = setTimeout(function () {
|
|
438
443
|
nextLine();
|
|
439
444
|
}, time < 1400 ? 1400 : time);
|
|
@@ -443,7 +448,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
443
448
|
return function () {
|
|
444
449
|
if (timeout) clearTimeout(timeout);
|
|
445
450
|
};
|
|
446
|
-
}, [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
|
|
451
|
+
}, [currentMessage, nextLine, autoPlay, lines.length, automatic, line, currentLine === null || currentLine === void 0 ? void 0 : 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
|
|
447
452
|
|
|
448
453
|
var checkBubblePosition = (0, _react.useCallback)(function () {
|
|
449
454
|
if (bubbleRef.current && currentLine.slots) {
|
|
@@ -488,7 +493,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
488
493
|
bubbleRef.current.parentNode.style.transform = '';
|
|
489
494
|
}
|
|
490
495
|
}
|
|
491
|
-
}, [camera.quaternion, currentLine.slots, currentMessage.inScene, getAvatarURL]);
|
|
496
|
+
}, [camera.quaternion, currentLine === null || currentLine === void 0 ? void 0 : currentLine.slots, currentMessage.inScene, getAvatarURL]);
|
|
492
497
|
(0, _react.useEffect)(function () {
|
|
493
498
|
checkBubblePosition();
|
|
494
499
|
}, [checkBubblePosition]); // Animate Camera
|
|
@@ -148,7 +148,7 @@ var TestComponent = function TestComponent(_ref) {
|
|
|
148
148
|
|
|
149
149
|
(0, _react.useEffect)(function () {
|
|
150
150
|
if (audio !== null && audio !== void 0 && audio.url) {
|
|
151
|
-
playSound(audio.url);
|
|
151
|
+
playSound(audio.url, 'test_bg');
|
|
152
152
|
}
|
|
153
153
|
}, [playSound, audio]);
|
|
154
154
|
(0, _react.useEffect)(function () {
|
|
@@ -169,7 +169,7 @@ var TestComponent = function TestComponent(_ref) {
|
|
|
169
169
|
answerPage(false);
|
|
170
170
|
setTimeOver(true);
|
|
171
171
|
changeView('results');
|
|
172
|
-
stop();
|
|
172
|
+
stop('test_bg');
|
|
173
173
|
}
|
|
174
174
|
}, [interval, stop, time]);
|
|
175
175
|
|
|
@@ -186,7 +186,7 @@ var TestComponent = function TestComponent(_ref) {
|
|
|
186
186
|
}
|
|
187
187
|
});
|
|
188
188
|
setShowingResult(parsedShowingResult);
|
|
189
|
-
stop();
|
|
189
|
+
stop('test_bg');
|
|
190
190
|
};
|
|
191
191
|
|
|
192
192
|
var finishTest = function finishTest() {
|
|
@@ -225,7 +225,7 @@ var TestComponent = function TestComponent(_ref) {
|
|
|
225
225
|
setResult({});
|
|
226
226
|
setTime(countdown.time);
|
|
227
227
|
setTimeOver(false);
|
|
228
|
-
stop();
|
|
228
|
+
stop('test_bg');
|
|
229
229
|
};
|
|
230
230
|
|
|
231
231
|
var translate = function translate(id, values) {
|