@gamelearn/arcade-components 1.27.1 → 1.27.3
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.
|
@@ -40,7 +40,7 @@ var BubbleWrapper = function BubbleWrapper(_ref) {
|
|
|
40
40
|
ref: group,
|
|
41
41
|
position: position
|
|
42
42
|
}, /*#__PURE__*/_react.default.createElement(_arcadeThreeCore.HtmlPro, {
|
|
43
|
-
zIndexRange: [
|
|
43
|
+
zIndexRange: [1, 1],
|
|
44
44
|
calculatePosition: currentMessage.inScene ? undefined : function () {
|
|
45
45
|
return [0, 0];
|
|
46
46
|
},
|
|
@@ -392,13 +392,13 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
392
392
|
target.applyQuaternion(camera.quaternion);
|
|
393
393
|
var distance = camera.position.distanceTo(target.position);
|
|
394
394
|
var staticDisplay = distance > 70 && !zoomInActor && !showArrowTop;
|
|
395
|
-
target.translateY(staticDisplay || showArrowTop ?
|
|
395
|
+
target.translateY(staticDisplay || showArrowTop ? -1 : 0); // Detectar posicion de personaje a izq o derecha de pantalla
|
|
396
396
|
|
|
397
397
|
var vector = new _three.Vector3();
|
|
398
398
|
vector.setFromMatrixPosition(head.matrixWorld);
|
|
399
399
|
var p = vector.project(defaultCamera);
|
|
400
|
-
target.translateX(headSize);
|
|
401
400
|
var isLeft = p.x < 0;
|
|
401
|
+
target.translateX(-1);
|
|
402
402
|
messagePosition.current = {
|
|
403
403
|
pos: target.position.toArray(),
|
|
404
404
|
child: head,
|
|
@@ -570,7 +570,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
570
570
|
}, [currentMessage, nextLine, start, stop, currentLine === null || currentLine === void 0 ? void 0 : currentLine.audioType, autoPlayCond, audio, voice, audioFailed]); // Positioning Bubble Message logic
|
|
571
571
|
|
|
572
572
|
var checkBubbleBounds = (0, _react.useCallback)(function (group, bubble) {
|
|
573
|
-
if (currentLine !== null && currentLine !== void 0 && currentLine.slots && currentMessage.show) {
|
|
573
|
+
if (currentLine !== null && currentLine !== void 0 && currentLine.slots && currentMessage.show && bubble !== null && bubble !== void 0 && bubble.current) {
|
|
574
574
|
var talkingCharacter = currentLine === null || currentLine === void 0 ? void 0 : currentLine.slots.find(function (slot) {
|
|
575
575
|
return slot.talking;
|
|
576
576
|
});
|
|
@@ -633,7 +633,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
633
633
|
|
|
634
634
|
messagePosition.current.pos[0] -= headSpace;
|
|
635
635
|
animationTarget.current.translateX(-10 + headSpace);
|
|
636
|
-
animationTarget.current.translateY(
|
|
636
|
+
animationTarget.current.translateY(0);
|
|
637
637
|
animationTarget.current.translateZ(30);
|
|
638
638
|
}
|
|
639
639
|
|
|
@@ -700,7 +700,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
700
700
|
});
|
|
701
701
|
|
|
702
702
|
return /*#__PURE__*/_react.default.createElement(_arcadeThreeCore.HtmlPro, {
|
|
703
|
-
zIndexRange: [
|
|
703
|
+
zIndexRange: [2, 2],
|
|
704
704
|
style: cleanStyle,
|
|
705
705
|
calculatePosition: function calculatePosition() {
|
|
706
706
|
return [0, 0];
|
|
@@ -708,8 +708,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
708
708
|
}, /*#__PURE__*/_react.default.createElement(_decisionComponent.default, _extends({
|
|
709
709
|
inScene: true
|
|
710
710
|
}, decisionPayload)));
|
|
711
|
-
}
|
|
712
|
-
|
|
711
|
+
}
|
|
713
712
|
|
|
714
713
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, currentMessage.text ? /*#__PURE__*/_react.default.createElement(_BubbleWrapper.default, {
|
|
715
714
|
position: messagePosition.current.pos,
|
|
@@ -720,7 +719,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
720
719
|
width: '100vw',
|
|
721
720
|
height: '100vh'
|
|
722
721
|
},
|
|
723
|
-
zIndexRange: [
|
|
722
|
+
zIndexRange: [2, 2],
|
|
724
723
|
onOcclude: function onOcclude() {},
|
|
725
724
|
calculatePosition: function calculatePosition() {
|
|
726
725
|
return [0, 0];
|
package/dist/helpers/index.js
CHANGED
|
@@ -158,6 +158,7 @@ var setWeight = function setWeight(action, weight) {
|
|
|
158
158
|
|
|
159
159
|
var executeCrossFade = function executeCrossFade(startAction, endAction, duration) {
|
|
160
160
|
if (startAction === endAction) return;
|
|
161
|
+
if (!startAction || !endAction) return;
|
|
161
162
|
startAction.play();
|
|
162
163
|
startAction.reset();
|
|
163
164
|
endAction.reset();
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@gamelearn/arcade-components",
|
|
3
3
|
"author": "Gamelearn",
|
|
4
4
|
"license": "unlicense",
|
|
5
|
-
"version": "1.27.
|
|
5
|
+
"version": "1.27.3",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"url": "https://github.com/gamelearn/arcade-components"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@gamelearn/arcade-styles": "0.13.
|
|
16
|
+
"@gamelearn/arcade-styles": "0.13.1",
|
|
17
17
|
"@gamelearn/arcade-three-core": "1.13.0",
|
|
18
18
|
"@react-three/drei": "9.4.3",
|
|
19
19
|
"@react-three/fiber": "8.0.10",
|