@gamelearn/arcade-components 2.25.1 → 2.26.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.
@@ -11,7 +11,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
11
11
 
12
12
  var FeedBack = function FeedBack(_ref) {
13
13
  var choice = _ref.choice,
14
- inherited = _ref.inherited;
14
+ inherited = _ref.inherited,
15
+ question = _ref.question;
15
16
 
16
17
  var Wrapper = function Wrapper(_ref2) {
17
18
  var children = _ref2.children;
@@ -34,7 +35,7 @@ var FeedBack = function FeedBack(_ref) {
34
35
  if (!choice.feedback) return null;
35
36
  return /*#__PURE__*/_react.default.createElement(Wrapper, null, choice.feedback ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
36
37
  className: "conversation--feedback__title"
37
- }, "Feedback"), /*#__PURE__*/_react.default.createElement("div", {
38
+ }, question), /*#__PURE__*/_react.default.createElement("div", {
38
39
  className: "conversation--feedback__text",
39
40
  dir: "auto"
40
41
  }, choice.right ? /*#__PURE__*/_react.default.createElement("span", {
@@ -295,7 +295,7 @@ var DialogComponent = function DialogComponent(_ref) {
295
295
  onLoadAnim(mixer, emotionAction, defaultAction);
296
296
  });
297
297
  } else {
298
- onLoadAnim();
298
+ onLoadAnim(mixer);
299
299
  }
300
300
  }, [loader]); // Force default animation without transition
301
301
 
@@ -696,9 +696,17 @@ var DialogComponent = function DialogComponent(_ref) {
696
696
  var element = getCurrentVisible(slot.uid);
697
697
 
698
698
  if (element) {
699
- loadEmotion(slot, element, function (_, action, defaultAction) {
699
+ loadEmotion(slot, element, function (mixer, action, defaultAction) {
700
700
  var startAction = element.userData.lastEmotion ? element.userData.lastEmotion : defaultAction;
701
- (0, _helpers.executeCrossFade)(startAction, action, crossFadeDuration);
701
+
702
+ if (startAction !== action && action) {
703
+ var clip = action.getClip();
704
+ var actionS = mixer.existingAction(clip, element);
705
+
706
+ if (!actionS.isRunning()) {
707
+ (0, _helpers.executeCrossFade)(startAction, action, crossFadeDuration);
708
+ }
709
+ }
702
710
  });
703
711
  }
704
712
  });
@@ -712,8 +720,13 @@ var DialogComponent = function DialogComponent(_ref) {
712
720
  var startAction = element.userData.lastEmotion ? element.userData.lastEmotion : defaultAction;
713
721
 
714
722
  if (startAction && action && startAction !== action) {
715
- (0, _helpers.executeCrossFade)(startAction, action, crossFadeDuration);
716
- element.userData.defaultAnim = action.getClip();
723
+ var clip = action.getClip();
724
+ var actionS = mixer.existingAction(clip, element);
725
+
726
+ if (!actionS.isRunning()) {
727
+ (0, _helpers.executeCrossFade)(startAction, action, crossFadeDuration);
728
+ element.userData.defaultAnim = action.getClip();
729
+ }
717
730
  }
718
731
 
719
732
  setTimeout(function () {
@@ -185,7 +185,6 @@ var executeCrossFade = function executeCrossFade(startAction, endAction) {
185
185
  startAction.play();
186
186
  startAction.reset();
187
187
  endAction.reset();
188
- endAction.time = 0;
189
188
  setWeight(endAction, 1);
190
189
  endAction.crossFadeFrom(startAction, crossFadeDuration, true);
191
190
  endAction.play();
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.25.1",
5
+ "version": "2.26.0",
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.17.2",
17
+ "@gamelearn/arcade-styles": "2.18.0",
18
18
  "@gamelearn/arcade-three-core": "1.24.3",
19
19
  "@react-three/a11y": "^3.0.0",
20
20
  "@react-three/drei": "9.4.3",