@gamelearn/arcade-components 1.2.2 → 1.3.1
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
|
package/dist/components/conversational-pro-component/components/ConversationalProComponent.js
CHANGED
|
@@ -43,6 +43,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
43
43
|
|
|
44
44
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
45
45
|
|
|
46
|
+
// Remove emitRef after sounds fix
|
|
46
47
|
var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
47
48
|
var _background$img, _currentLineData$slot;
|
|
48
49
|
|
|
@@ -74,12 +75,13 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
74
75
|
var voiceOver = currentLineData.voiceOver,
|
|
75
76
|
decision = currentLineData.decision;
|
|
76
77
|
var isFlex = currentLineData.flex;
|
|
78
|
+
var emitRef = (0, _react.useRef)(emitEvent);
|
|
77
79
|
var translate = (0, _react.useCallback)(function (id) {
|
|
78
|
-
return
|
|
80
|
+
return emitRef.current({
|
|
79
81
|
type: 'translate',
|
|
80
82
|
payload: id
|
|
81
83
|
});
|
|
82
|
-
}, [
|
|
84
|
+
}, []);
|
|
83
85
|
var getCurrentMessage = (0, _react.useCallback)(function () {
|
|
84
86
|
if (voiceOver) {
|
|
85
87
|
return currentLineData;
|
|
@@ -142,7 +144,7 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
142
144
|
}
|
|
143
145
|
|
|
144
146
|
_context.next = 5;
|
|
145
|
-
return
|
|
147
|
+
return emitRef.current({
|
|
146
148
|
type: 'playSpeech',
|
|
147
149
|
payload: payload
|
|
148
150
|
});
|
|
@@ -153,7 +155,7 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
153
155
|
}
|
|
154
156
|
}
|
|
155
157
|
}, _callee);
|
|
156
|
-
})), [currentLineData.voice, currentMessage,
|
|
158
|
+
})), [currentLineData.voice, currentMessage, getVoice]); // Recupera la antigua linea de la conversacion para conservar los personajes en voice-over
|
|
157
159
|
|
|
158
160
|
var leftWithSlots = lines.slice(0, currentLine + 1).reverse().find(function (line) {
|
|
159
161
|
return line.slots;
|
|
@@ -239,7 +241,7 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
239
241
|
setCurrentLine(line + 1);
|
|
240
242
|
} else {
|
|
241
243
|
setFinished(true);
|
|
242
|
-
|
|
244
|
+
emitRef.current({
|
|
243
245
|
type: 'success'
|
|
244
246
|
});
|
|
245
247
|
}
|
|
@@ -271,7 +273,7 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
271
273
|
|
|
272
274
|
var decisionPayload = _objectSpread(_objectSpread({}, currentLineData.payload), {}, {
|
|
273
275
|
onFinish: handleClickNext,
|
|
274
|
-
emitEvent:
|
|
276
|
+
emitEvent: emitRef.current,
|
|
275
277
|
soundActions: soundActions,
|
|
276
278
|
inheritProps: {
|
|
277
279
|
characters: currentCharacters,
|
|
@@ -123,12 +123,13 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
123
123
|
var currentLine = lines[line];
|
|
124
124
|
var lastLine = lines[line - 1];
|
|
125
125
|
var lastSet = (0, _react.useRef)(false);
|
|
126
|
+
var emitRef = (0, _react.useRef)(emitEvent);
|
|
126
127
|
var translate = (0, _react.useCallback)(function (id) {
|
|
127
|
-
return
|
|
128
|
+
return emitRef.current({
|
|
128
129
|
type: 'translate',
|
|
129
130
|
payload: id
|
|
130
131
|
});
|
|
131
|
-
}, [
|
|
132
|
+
}, []);
|
|
132
133
|
var getVoice = (0, _react.useCallback)(function (_ref2) {
|
|
133
134
|
var id = _ref2.id,
|
|
134
135
|
_ref2$type = _ref2.type,
|
|
@@ -170,7 +171,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
170
171
|
}
|
|
171
172
|
|
|
172
173
|
_context.next = 5;
|
|
173
|
-
return
|
|
174
|
+
return emitRef.current({
|
|
174
175
|
type: 'playSpeech',
|
|
175
176
|
payload: payload
|
|
176
177
|
});
|
|
@@ -181,7 +182,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
181
182
|
}
|
|
182
183
|
}
|
|
183
184
|
}, _callee);
|
|
184
|
-
})), [currentLine === null || currentLine === void 0 ? void 0 : currentLine.voice, getVoice, currentMessage.text
|
|
185
|
+
})), [currentLine === null || currentLine === void 0 ? void 0 : currentLine.voice, getVoice, currentMessage.text]);
|
|
185
186
|
var getCurrentVisible = (0, _react.useCallback)(function (uid) {
|
|
186
187
|
var object;
|
|
187
188
|
scene.traverseVisible(function (node) {
|
|
@@ -289,13 +290,13 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
289
290
|
setCurrentMessage({});
|
|
290
291
|
resetCameraView();
|
|
291
292
|
setTimeout(function () {
|
|
292
|
-
|
|
293
|
+
emitRef.current({
|
|
293
294
|
type: 'success'
|
|
294
295
|
});
|
|
295
296
|
camera.copy(defaultCamera.current);
|
|
296
297
|
}, currentLine.decision ? 0 : 1200);
|
|
297
298
|
}
|
|
298
|
-
}, [camera, currentLine === null || currentLine === void 0 ? void 0 : currentLine.decision,
|
|
299
|
+
}, [camera, currentLine === null || currentLine === void 0 ? void 0 : currentLine.decision, line, lines.length, resetAnims, resetCameraView]); // Position bubble over talking character/and switch emotions
|
|
299
300
|
|
|
300
301
|
(0, _react.useEffect)(function () {
|
|
301
302
|
if (currentLine.decision) {
|
|
@@ -554,7 +555,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
554
555
|
disableBackground: true
|
|
555
556
|
},
|
|
556
557
|
onFinish: nextLine,
|
|
557
|
-
emitEvent:
|
|
558
|
+
emitEvent: emitRef.current,
|
|
558
559
|
soundActions: soundActions
|
|
559
560
|
});
|
|
560
561
|
|