@gamelearn/arcade-components 2.8.4 → 2.8.6-hotfix-zoom

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.
@@ -152,6 +152,7 @@ var DialogComponent = function DialogComponent(_ref) {
152
152
  var talkingCharacter = currentLineData === null || currentLineData === void 0 ? void 0 : (_currentLineData$slot = currentLineData.slots) === null || _currentLineData$slot === void 0 ? void 0 : _currentLineData$slot.find(function (slot) {
153
153
  return slot.talking;
154
154
  });
155
+ var zoomStarted = (0, _react.useRef)(false);
155
156
  var autoPlayCond = automatic && !(currentLineData !== null && currentLineData !== void 0 && currentLineData.decision);
156
157
  var audio = Object.keys((currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audio) || {}).length;
157
158
  var voice = Object.keys((currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.voice) || {}).length;
@@ -591,6 +592,7 @@ var DialogComponent = function DialogComponent(_ref) {
591
592
  avatar: getAvatarURL(talkingCharacter),
592
593
  show: true
593
594
  });
595
+ setAnimationRunning(false);
594
596
  }, zoomInActor ? 1200 : 0);
595
597
  }
596
598
  });
@@ -680,7 +682,8 @@ var DialogComponent = function DialogComponent(_ref) {
680
682
  };
681
683
  }, [currentMessage, nextLine, start, stop, currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audioType, autoPlayCond, audio, voice, audioFailed]);
682
684
  (0, _react.useEffect)(function () {
683
- if (animationRunning) {
685
+ if (animationRunning && !zoomStarted.current) {
686
+ zoomStarted.current = true;
684
687
  var cam = camera;
685
688
  var targetPosition = messagePosition.current.child ? messagePosition.current.pos : defaultCamera.position.toArray();
686
689
  animationTarget.current.position.fromArray(targetPosition);
@@ -701,6 +704,7 @@ var DialogComponent = function DialogComponent(_ref) {
701
704
  duration: 1,
702
705
  ease: 'power3.easeInOut',
703
706
  onComplete: function onComplete() {
707
+ zoomStarted.current = false;
704
708
  setAnimationRunning(false);
705
709
  raycast.set(cam.getWorldPosition(new _three.Vector3(0, 0, 0)), cam.getWorldDirection(new _three.Vector3()));
706
710
  var objects = raycast.intersectObjects(scene.children, true);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "author": "Gamelearn",
4
4
  "license": "unlicense",
5
- "version": "2.8.4",
5
+ "version": "2.8.6-hotfix-zoom",
6
6
  "main": "dist/index.js",
7
7
  "files": [
8
8
  "dist",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "@babel/runtime": "^7.18.6",
17
- "@gamelearn/arcade-styles": "2.8.2",
17
+ "@gamelearn/arcade-styles": "2.9.0",
18
18
  "@gamelearn/arcade-three-core": "1.17.2",
19
19
  "@react-three/drei": "9.4.3",
20
20
  "@react-three/fiber": "8.0.17",