@gamelearn/arcade-components 2.12.12 → 2.13.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.
@@ -69,7 +69,11 @@ function Panel(_ref) {
69
69
  var defaultClip = (0, _react.useRef)();
70
70
  var emotion = (0, _react.useMemo)(function () {
71
71
  if (isCharacter) {
72
- var _character$resource, _character$resource$a, _character$resource$a2, _character$resource3, _character$resource3$;
72
+ var _character$animation, _character$resource, _character$resource$a, _character$resource$a2, _character$resource3, _character$resource3$;
73
+
74
+ if (character.animationId && (_character$animation = character.animation) !== null && _character$animation !== void 0 && _character$animation.url) {
75
+ return character.animation;
76
+ }
73
77
 
74
78
  if (character !== null && character !== void 0 && (_character$resource = character.resource) !== null && _character$resource !== void 0 && (_character$resource$a = _character$resource.animations) !== null && _character$resource$a !== void 0 && (_character$resource$a2 = _character$resource$a[character.emotion]) !== null && _character$resource$a2 !== void 0 && _character$resource$a2.url) {
75
79
  var _character$resource2, _character$resource2$;
@@ -81,7 +85,7 @@ function Panel(_ref) {
81
85
  }
82
86
 
83
87
  return {};
84
- }, [character.emotion, character === null || character === void 0 ? void 0 : (_character$resource4 = character.resource) === null || _character$resource4 === void 0 ? void 0 : _character$resource4.animations, isCharacter]);
88
+ }, [character.emotion, character === null || character === void 0 ? void 0 : character.animationId, character === null || character === void 0 ? void 0 : character.animation, character === null || character === void 0 ? void 0 : (_character$resource4 = character.resource) === null || _character$resource4 === void 0 ? void 0 : _character$resource4.animations, isCharacter]);
85
89
  var resetAnimation = (0, _react.useCallback)(function () {
86
90
  var _model$current$userDa = model.current.userData,
87
91
  mixer = _model$current$userDa.mixer,
@@ -248,10 +248,19 @@ var DialogComponent = function DialogComponent(_ref) {
248
248
  return (slot === null || slot === void 0 ? void 0 : (_slot$character = slot.character) === null || _slot$character === void 0 ? void 0 : (_slot$character$resou = _slot$character.resource) === null || _slot$character$resou === void 0 ? void 0 : _slot$character$resou.url) || (object === null || object === void 0 ? void 0 : object.completeUrl) || '';
249
249
  }, [actors]);
250
250
  var loadEmotion = (0, _react.useCallback)(function (slot, element) {
251
- var _slot$character2;
251
+ var _slot$animation;
252
252
 
253
253
  var onLoadAnim = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {};
254
- var animation = (_slot$character2 = slot.character) === null || _slot$character2 === void 0 ? void 0 : _slot$character2.resource.animations[element.isSeated ? "".concat(slot.emotion, "-seated") : slot.emotion];
254
+ var animation;
255
+
256
+ if (slot !== null && slot !== void 0 && slot.animationId && slot !== null && slot !== void 0 && (_slot$animation = slot.animation) !== null && _slot$animation !== void 0 && _slot$animation.url) {
257
+ animation = slot.animation;
258
+ } else {
259
+ var _slot$character2;
260
+
261
+ animation = (_slot$character2 = slot.character) === null || _slot$character2 === void 0 ? void 0 : _slot$character2.resource.animations[element.isSeated ? "".concat(slot.emotion, "-seated") : slot.emotion];
262
+ }
263
+
255
264
  var mixer = element.userData.mixer;
256
265
 
257
266
  if (animation && animation.url) {
@@ -398,6 +398,10 @@ var ImageClickWrapperComponent = function ImageClickWrapperComponent(props) {
398
398
  if (hasClickOrder && area.index === clickedZones.length || !hasClickOrder) {
399
399
  var _specificFeedbacks$co2;
400
400
 
401
+ if (timer) {
402
+ pauseTheCounter();
403
+ }
404
+
401
405
  handleClick();
402
406
 
403
407
  if (specificFeedbacks !== null && specificFeedbacks !== void 0 && (_specificFeedbacks$co2 = specificFeedbacks.correctFeedbacks) !== null && _specificFeedbacks$co2 !== void 0 && _specificFeedbacks$co2.length) {
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.12.12",
5
+ "version": "2.13.0",
6
6
  "main": "dist/index.js",
7
7
  "files": [
8
8
  "dist",