@gamelearn/arcade-components 2.29.4-hotfix-animations → 2.29.4-hotfix-animationsv2
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()) {
|
|
@@ -401,6 +402,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
401
402
|
lastTalking.current = _objectSpread({}, talkingCharacter);
|
|
402
403
|
setEdgesHistory([].concat(_toConsumableArray(edgesHistory), [currentLineData.id]));
|
|
403
404
|
setAudioFailed(false);
|
|
405
|
+
resetTalkingAnimation();
|
|
404
406
|
if (isBranched) {
|
|
405
407
|
if (choice) {
|
|
406
408
|
handleDecisionBranch(choice, reset);
|
|
@@ -539,11 +541,15 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
539
541
|
if (element && !lastSet.current) {
|
|
540
542
|
setTimeout(function () {
|
|
541
543
|
if (talkingCharacter.uid === element.uid) {
|
|
544
|
+
var _userData$active, _userData$active2;
|
|
542
545
|
moveBubble(element);
|
|
543
|
-
var isSeated = element.isSeated
|
|
546
|
+
var isSeated = element.isSeated,
|
|
547
|
+
userData = element.userData;
|
|
544
548
|
var emotion = talkingCharacter.emotion;
|
|
545
549
|
var includesSeated = emotion.includes('seated');
|
|
546
|
-
|
|
550
|
+
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))) {
|
|
551
|
+
startAnimation(talkingCharacter.uid, isSeated && !includesSeated ? "".concat(emotion, "-seated") : emotion);
|
|
552
|
+
}
|
|
547
553
|
var setMessage = function setMessage() {
|
|
548
554
|
var _talkingCharacter$cha;
|
|
549
555
|
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);
|