@gamelearn/arcade-components 2.25.0 → 2.25.2

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.
@@ -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 () {
@@ -51,7 +51,7 @@ var Container = function Container(_ref) {
51
51
  paused = _ref.paused,
52
52
  view = _ref.view,
53
53
  correctQuestions = _ref.correctQuestions,
54
- immediateFeedbacks = _ref.immediateFeedbacks;
54
+ feedbacksOnlyWhenReview = _ref.feedbacksOnlyWhenReview;
55
55
  var layerToBeScrolled = document.querySelector(".test--container");
56
56
 
57
57
  var _useState = (0, _react.useState)(0),
@@ -69,7 +69,6 @@ var Container = function Container(_ref) {
69
69
  var _soundActions = _slicedToArray(soundActions, 1),
70
70
  play = _soundActions[0];
71
71
 
72
- var showImmediateFeedbacks = immediateFeedbacks || immediateFeedbacks === undefined;
73
72
  (0, _react.useEffect)(function () {
74
73
  if (time >= 0 && !disabled && !paused) {
75
74
  var timeout = setInterval(function () {
@@ -93,7 +92,7 @@ var Container = function Container(_ref) {
93
92
  play('click-ui');
94
93
 
95
94
  if (answered) {
96
- if (result[qid][0].feedback && !disabled && showImmediateFeedbacks) {
95
+ if (result[qid][0].feedback && !disabled && !feedbacksOnlyWhenReview) {
97
96
  setFeedback(true);
98
97
  } else {
99
98
  answerPage(false);
@@ -123,7 +122,7 @@ var Container = function Container(_ref) {
123
122
  layerToBeScrolled.scrollTo(0, 0);
124
123
  setTries(tries + 1);
125
124
 
126
- if (result[qid][0].feedback && !disabled && showImmediateFeedbacks) {
125
+ if (result[qid][0].feedback && !disabled && !feedbacksOnlyWhenReview) {
127
126
  setFeedback(true);
128
127
  } else {
129
128
  showResults();
@@ -56,7 +56,7 @@ var TestComponent = function TestComponent(_ref) {
56
56
  pause = _ref.pause,
57
57
  _ref$minimumPercentag = _ref.minimumPercentage,
58
58
  minimumPercentage = _ref$minimumPercentag === void 0 ? 100 : _ref$minimumPercentag,
59
- immediateFeedbacks = _ref.immediateFeedbacks;
59
+ feedbacksOnlyWhenReview = _ref.feedbacksOnlyWhenReview;
60
60
  var questions = test.questions;
61
61
 
62
62
  var _useState = (0, _react.useState)({}),
@@ -328,7 +328,7 @@ var TestComponent = function TestComponent(_ref) {
328
328
  soundActions: soundActions,
329
329
  view: view,
330
330
  correctQuestions: correctQuestions,
331
- immediateFeedbacks: immediateFeedbacks
331
+ feedbacksOnlyWhenReview: feedbacksOnlyWhenReview
332
332
  }) : /*#__PURE__*/_react.default.createElement(_Results.default, {
333
333
  reviewTest: function reviewTest() {
334
334
  changeFirst(false);
@@ -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.0",
5
+ "version": "2.25.2",
6
6
  "main": "dist/index.js",
7
7
  "files": [
8
8
  "dist",