@gamelearn/arcade-components 2.31.2 → 2.31.4
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.
|
@@ -381,6 +381,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
381
381
|
var backLine = (0, _react.useCallback)(function () {
|
|
382
382
|
lastTalking.current = _objectSpread({}, talkingCharacter);
|
|
383
383
|
setAudioFailed(false);
|
|
384
|
+
resetTalkingAnimation();
|
|
384
385
|
if (isBranched) {
|
|
385
386
|
handleBranchDirection(false);
|
|
386
387
|
} else if (!previousLineWasDecision()) {
|
|
@@ -439,6 +440,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
439
440
|
lastTalking.current = _objectSpread({}, talkingCharacter);
|
|
440
441
|
setEdgesHistory([].concat(_toConsumableArray(edgesHistory), [currentLineData.id]));
|
|
441
442
|
setAudioFailed(false);
|
|
443
|
+
resetTalkingAnimation();
|
|
442
444
|
if (isBranched) {
|
|
443
445
|
if (choice) {
|
|
444
446
|
handleDecisionBranch(choice, reset);
|
|
@@ -577,11 +579,15 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
577
579
|
if (element && !lastSet.current) {
|
|
578
580
|
setTimeout(function () {
|
|
579
581
|
if (talkingCharacter.uid === element.uid) {
|
|
582
|
+
var _userData$active, _userData$active2;
|
|
580
583
|
moveBubble(element);
|
|
581
|
-
var isSeated = element.isSeated
|
|
584
|
+
var isSeated = element.isSeated,
|
|
585
|
+
userData = element.userData;
|
|
582
586
|
var emotion = talkingCharacter.emotion;
|
|
583
587
|
var includesSeated = emotion.includes('seated');
|
|
584
|
-
|
|
588
|
+
if (!((_userData$active = userData.active) !== null && _userData$active !== void 0 && _userData$active.includes('talking')) && !((_userData$active2 = userData.active) !== null && _userData$active2 !== void 0 && _userData$active2.includes(emotion))) {
|
|
589
|
+
startAnimation(talkingCharacter.uid, isSeated && !includesSeated ? "".concat(emotion, "-seated") : emotion);
|
|
590
|
+
}
|
|
585
591
|
var setMessage = function setMessage() {
|
|
586
592
|
var _talkingCharacter$cha;
|
|
587
593
|
setCurrentMessage({
|
|
@@ -53,21 +53,20 @@ function useStateMachine(lines) {
|
|
|
53
53
|
_step2;
|
|
54
54
|
try {
|
|
55
55
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
56
|
-
var _slot$
|
|
56
|
+
var _slot$character;
|
|
57
57
|
var slot = _step2.value;
|
|
58
58
|
if (!slot.uid) continue;
|
|
59
|
+
var animations = (_slot$character = slot.character) === null || _slot$character === void 0 ? void 0 : _slot$character.resource.animations;
|
|
59
60
|
if (!urls[slot.uid]) {
|
|
60
|
-
|
|
61
|
-
urls[slot.uid] = _defineProperty({}, slot.emotion, (_slot$character = slot.character) === null || _slot$character === void 0 ? void 0 : _slot$character.resource.animations[slot.emotion].url);
|
|
61
|
+
urls[slot.uid] = _defineProperty({}, slot.emotion, animations[slot.emotion].url);
|
|
62
62
|
} else {
|
|
63
|
-
|
|
64
|
-
urls[slot.uid] = _objectSpread(_objectSpread({}, urls[slot.uid]), {}, _defineProperty({}, slot.emotion, (_slot$character2 = slot.character) === null || _slot$character2 === void 0 ? void 0 : _slot$character2.resource.animations[slot.emotion].url));
|
|
63
|
+
urls[slot.uid] = _objectSpread(_objectSpread({}, urls[slot.uid]), {}, _defineProperty({}, slot.emotion, animations[slot.emotion].url));
|
|
65
64
|
}
|
|
66
|
-
if (!slot.emotion.includes('seated')
|
|
67
|
-
var
|
|
68
|
-
urls[slot.uid] = _objectSpread(_objectSpread({}, urls[slot.uid]), {}, _defineProperty({}, "".concat(slot.emotion, "-seated"), (
|
|
65
|
+
if (!slot.emotion.includes('seated')) {
|
|
66
|
+
var _animations;
|
|
67
|
+
urls[slot.uid] = _objectSpread(_objectSpread({}, urls[slot.uid]), {}, _defineProperty({}, "".concat(slot.emotion, "-seated"), ((_animations = animations["".concat(slot.emotion, "-seated")]) === null || _animations === void 0 ? void 0 : _animations.url) || animations['idle-seated'].url));
|
|
69
68
|
}
|
|
70
|
-
urls[slot.uid].talking =
|
|
69
|
+
urls[slot.uid].talking = animations.talking.url;
|
|
71
70
|
}
|
|
72
71
|
} catch (err) {
|
|
73
72
|
_iterator2.e(err);
|
|
@@ -200,6 +199,7 @@ function useStateMachine(lines) {
|
|
|
200
199
|
if (emotion !== 'talking' && actionList.talking) {
|
|
201
200
|
clone = clip.clone();
|
|
202
201
|
clone.name = "".concat(emotion, "_talking");
|
|
202
|
+
actionList.talking.reset();
|
|
203
203
|
talkingClip = actionList.talking.getClip();
|
|
204
204
|
_action = (0, _.mixWithTalkingClip)(root, talkingClip, clone);
|
|
205
205
|
(0, _.activateAction)(_action, 0);
|