@gamelearn/arcade-components 1.4.22 → 1.4.25

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.
@@ -125,11 +125,19 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
125
125
  setFeedbackResult(true);
126
126
  setFeedbackIsShown(true);
127
127
  } else {
128
+ var _info$solution, _specificFeedbacks$co;
129
+
128
130
  setFeedbackResult(true);
129
131
  setFeedbackIsShown(true);
130
132
  setFinished(true);
131
- var rewards = info.solution.right.rewards;
132
- var rewardsData = [].concat(_toConsumableArray(accRewards), _toConsumableArray(rewards));
133
+
134
+ var _info$solution$right = info === null || info === void 0 ? void 0 : (_info$solution = info.solution) === null || _info$solution === void 0 ? void 0 : _info$solution.right,
135
+ rewards = _info$solution$right.rewards;
136
+
137
+ var specificRewards = (specificFeedbacks === null || specificFeedbacks === void 0 ? void 0 : (_specificFeedbacks$co = specificFeedbacks.correctFeedbacks) === null || _specificFeedbacks$co === void 0 ? void 0 : _specificFeedbacks$co.map(function (spReward) {
138
+ return spReward.rewards;
139
+ }).flat()) || [];
140
+ var rewardsData = [].concat(_toConsumableArray(accRewards), _toConsumableArray(rewards), _toConsumableArray(specificRewards));
133
141
  setTimeout(function () {
134
142
  playSound('score');
135
143
  closeFeedbackAndShowPoints(rewardsData);
@@ -178,7 +186,6 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
178
186
 
179
187
  setRightPick(true);
180
188
  setFeedbackIsShown(true);
181
- setRewards([].concat(_toConsumableArray(accRewards), _toConsumableArray(pickedCard === null || pickedCard === void 0 ? void 0 : pickedCard.rewards)));
182
189
  emitEvent({
183
190
  type: 'hidePuzzleButtons',
184
191
  payload: true
@@ -227,7 +227,7 @@ var DialogComponent = function DialogComponent(_ref) {
227
227
  var animation = (_slot$character2 = slot.character) === null || _slot$character2 === void 0 ? void 0 : _slot$character2.resource.animations[slot.emotion];
228
228
  var mixer = element.userData.mixer;
229
229
 
230
- if (animation && animation.url) {
230
+ if (animation && animation.url && !element.isSeated) {
231
231
  loader.load(animation.url, function (anim) {
232
232
  var emotionClip = anim.animations[0];
233
233
  var defaultClip = element.userData.defaultAnim;
@@ -327,17 +327,15 @@ var DialogComponent = function DialogComponent(_ref) {
327
327
  return parseInt(edge.fromPointIndex) === currentId;
328
328
  });
329
329
  var destinationEdge = lines.findIndex(function (l) {
330
- return l.id === currentEdge.toId;
330
+ return l.id === (currentEdge === null || currentEdge === void 0 ? void 0 : currentEdge.toId);
331
331
  });
332
332
 
333
- if (destinationEdge) {
334
- if (currentEdge.fromId === currentEdge.toId) {
333
+ if (destinationEdge >= 0) {
334
+ if ((currentEdge === null || currentEdge === void 0 ? void 0 : currentEdge.fromId) === (currentEdge === null || currentEdge === void 0 ? void 0 : currentEdge.toId)) {
335
335
  reset();
336
- } else if (destinationEdge >= 0) {
336
+ } else {
337
337
  setCurrentMessage({});
338
338
  changeLine(destinationEdge);
339
- } else {
340
- finishConversation();
341
339
  }
342
340
  } else {
343
341
  finishConversation();
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "author": "Gamelearn",
4
4
  "license": "unlicense",
5
- "version": "1.4.22",
5
+ "version": "1.4.25",
6
6
  "main": "dist/index.js",
7
7
  "files": [
8
8
  "dist",