@gamelearn/arcade-components 1.22.13 → 1.22.16
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.
|
@@ -466,48 +466,52 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
466
466
|
(0, _helpers.executeCrossFade)(startAction, action, crossFadeDuration);
|
|
467
467
|
}
|
|
468
468
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
469
|
+
setTimeout(function () {
|
|
470
|
+
if (talkingCharacter.uid === element.uid) {
|
|
471
|
+
var showArrowTop = talkingCharacter.text.length > maxCharacterToSwitch;
|
|
472
|
+
var head = element.getObjectByName('Head_M');
|
|
473
|
+
var target = new _three.Object3D();
|
|
474
|
+
head.updateMatrix();
|
|
475
|
+
head.updateMatrixWorld();
|
|
476
|
+
head.getWorldPosition(target.position);
|
|
477
|
+
target.applyQuaternion(camera.quaternion);
|
|
478
|
+
var distance = camera.position.distanceTo(target.position);
|
|
479
|
+
var staticDisplay = distance > 70 && !zoomInActor && !showArrowTop;
|
|
480
|
+
target.translateY(staticDisplay || showArrowTop ? 0 : 3); // Detectar posicion de personaje a izq o derecha de pantalla
|
|
481
|
+
|
|
482
|
+
var vector = new _three.Vector3();
|
|
483
|
+
vector.setFromMatrixPosition(head.matrixWorld);
|
|
484
|
+
var p = vector.project(defaultCamera);
|
|
485
|
+
var isLeft = p.x < 0;
|
|
486
|
+
messagePosition.current = {
|
|
487
|
+
pos: target.position.toArray(),
|
|
488
|
+
child: head,
|
|
489
|
+
parent: element,
|
|
490
|
+
isLeft: isLeft
|
|
491
|
+
};
|
|
492
|
+
|
|
493
|
+
if (zoomInActor) {
|
|
494
|
+
setAnimationRunning(true);
|
|
495
|
+
} // Ugly timeout to wait for zoom in ( maybe use tween (?))
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
setTimeout(function () {
|
|
499
|
+
var _talkingCharacter$cha;
|
|
500
|
+
|
|
501
|
+
distance = camera.position.distanceTo(target.position);
|
|
502
|
+
setCurrentMessage({
|
|
503
|
+
text: talkingCharacter.text,
|
|
504
|
+
name: talkingCharacter.alias || ((_talkingCharacter$cha = talkingCharacter.character) === null || _talkingCharacter$cha === void 0 ? void 0 : _talkingCharacter$cha.name),
|
|
505
|
+
left: true,
|
|
506
|
+
top: showArrowTop || distance > 70,
|
|
507
|
+
inScene: true,
|
|
508
|
+
thinkful: talkingCharacter.emotion === 'thinkful',
|
|
509
|
+
avatar: '',
|
|
510
|
+
show: true
|
|
511
|
+
});
|
|
512
|
+
}, zoomInActor ? 1200 : 0);
|
|
513
|
+
}
|
|
514
|
+
}, crossFadeDuration * 100);
|
|
511
515
|
});
|
|
512
516
|
} else {
|
|
513
517
|
var _talkingCharacter$cha2;
|
|
@@ -630,9 +634,9 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
630
634
|
}
|
|
631
635
|
|
|
632
636
|
var mult = messagePosition.current.isLeft ? -1 : 1;
|
|
633
|
-
var headSpace = 2
|
|
637
|
+
var headSpace = 2 * mult; // move bubble
|
|
634
638
|
|
|
635
|
-
messagePosition.current.pos[0] -=
|
|
639
|
+
messagePosition.current.pos[0] -= headSpace;
|
|
636
640
|
animationTarget.current.translateX(-10 * mult - headSpace);
|
|
637
641
|
animationTarget.current.translateY(-5);
|
|
638
642
|
animationTarget.current.translateZ(30);
|