@gamelearn/arcade-components 1.4.12 → 1.4.14
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.
package/dist/components/cards-selector-puzzle-component/components/CardsSelectorPuzzleComponent.js
CHANGED
|
@@ -196,11 +196,9 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
|
|
|
196
196
|
});
|
|
197
197
|
}, [setResolveAction, disableExit, accRewards, info.resolve.rewards, emitEvent, closeFeedbackAndShowPoints]);
|
|
198
198
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
199
|
-
className: "cards-selector",
|
|
199
|
+
className: "cards-selector ".concat(backgroundImage !== null && backgroundImage !== void 0 && backgroundImage.url ? 'cards-selector--with-custom-bg' : ''),
|
|
200
200
|
style: backgroundImage !== null && backgroundImage !== void 0 && backgroundImage.url ? {
|
|
201
|
-
backgroundImage: "url(".concat(backgroundImage.url, ")")
|
|
202
|
-
backgroundRepeat: 'no-repeat',
|
|
203
|
-
backgroundSize: 'cover'
|
|
201
|
+
backgroundImage: "url(".concat(backgroundImage.url, ")")
|
|
204
202
|
} : {}
|
|
205
203
|
}, /*#__PURE__*/_react.default.createElement(_Board.default, {
|
|
206
204
|
setCurrentOrder: setCurrentOrder,
|
|
@@ -59,6 +59,7 @@ var isMobile = (0, _deviceDetection.DeviceDetection)();
|
|
|
59
59
|
var crossFadeDuration = 0.5; // Mobile always zoom in?
|
|
60
60
|
|
|
61
61
|
var raycast = new _three.Raycaster();
|
|
62
|
+
var maxCharacterToSwitch = 70;
|
|
62
63
|
raycast.firstHitOnly = true;
|
|
63
64
|
|
|
64
65
|
var DialogComponent = function DialogComponent(_ref) {
|
|
@@ -86,6 +87,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
86
87
|
text: '',
|
|
87
88
|
name: '',
|
|
88
89
|
left: false,
|
|
90
|
+
top: false,
|
|
89
91
|
inScene: false,
|
|
90
92
|
thinkful: false,
|
|
91
93
|
voiceOver: false,
|
|
@@ -364,6 +366,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
364
366
|
inScene: false,
|
|
365
367
|
voiceOver: true,
|
|
366
368
|
thinkful: false,
|
|
369
|
+
top: false,
|
|
367
370
|
avatar: '',
|
|
368
371
|
show: true
|
|
369
372
|
});
|
|
@@ -408,12 +411,13 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
408
411
|
|
|
409
412
|
setTimeout(function () {
|
|
410
413
|
if (talkingCharacter.uid === element.uid) {
|
|
414
|
+
var showArrowTop = talkingCharacter.text.length > maxCharacterToSwitch;
|
|
411
415
|
var head = element.getObjectByName('Head_M');
|
|
412
416
|
var target = new _three.Object3D();
|
|
413
417
|
head.getWorldPosition(target.position);
|
|
414
418
|
target.applyQuaternion(camera.quaternion);
|
|
415
419
|
target.translateX(1.25);
|
|
416
|
-
target.translateY(2);
|
|
420
|
+
target.translateY(showArrowTop ? 1.25 : 2);
|
|
417
421
|
messagePosition.current = {
|
|
418
422
|
pos: target.position.toArray(),
|
|
419
423
|
child: head,
|
|
@@ -432,6 +436,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
432
436
|
text: talkingCharacter.text,
|
|
433
437
|
name: talkingCharacter.alias || ((_talkingCharacter$cha = talkingCharacter.character) === null || _talkingCharacter$cha === void 0 ? void 0 : _talkingCharacter$cha.name),
|
|
434
438
|
left: true,
|
|
439
|
+
top: showArrowTop,
|
|
435
440
|
inScene: true,
|
|
436
441
|
thinkful: talkingCharacter.emotion === 'thinkful',
|
|
437
442
|
avatar: '',
|
|
@@ -449,6 +454,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
449
454
|
text: talkingCharacter.text,
|
|
450
455
|
name: talkingCharacter.alias || ((_talkingCharacter$cha2 = talkingCharacter.character) === null || _talkingCharacter$cha2 === void 0 ? void 0 : _talkingCharacter$cha2.name) || object.name,
|
|
451
456
|
left: false,
|
|
457
|
+
top: talkingCharacter.text.length > maxCharacterToSwitch,
|
|
452
458
|
inScene: false,
|
|
453
459
|
thinkful: talkingCharacter.emotion === 'thinkful',
|
|
454
460
|
avatar: getAvatarURL(talkingCharacter),
|
|
@@ -542,6 +548,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
542
548
|
setCurrentMessage(function (old) {
|
|
543
549
|
return _objectSpread(_objectSpread({}, old), {}, {
|
|
544
550
|
left: false,
|
|
551
|
+
top: false,
|
|
545
552
|
inScene: !completeOutside,
|
|
546
553
|
avatar: getAvatarURL(talkingCharacter),
|
|
547
554
|
show: true
|
|
@@ -29,7 +29,7 @@ var SpeechBubbleComponent = /*#__PURE__*/_react.default.forwardRef(function (_re
|
|
|
29
29
|
|
|
30
30
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
31
31
|
ref: ref,
|
|
32
|
-
className: "\n speech-bubble\n ".concat(message.left && message.inScene ? 'speech-bubble--arrow-left' : '', "\n ").concat(!message.left && message.inScene ? 'speech-bubble--arrow-right' : '', "\n ").concat(message.thinkful || message.voiceOver ? 'speech-bubble--italic' : '', "\n ")
|
|
32
|
+
className: "\n speech-bubble\n ".concat(message.left && message.inScene ? 'speech-bubble--arrow-left' : '', "\n ").concat(!message.left && message.inScene ? 'speech-bubble--arrow-right' : '', "\n ").concat(message.top && message.inScene ? 'arrow-top' : '', "\n ").concat(message.thinkful || message.voiceOver ? 'speech-bubble--italic' : '', "\n ")
|
|
33
33
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
34
34
|
className: "speech-bubble__content"
|
|
35
35
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
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.
|
|
5
|
+
"version": "1.4.14",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@babel/eslint-parser": "^7.15.8",
|
|
65
65
|
"@babel/preset-env": "7.12.11",
|
|
66
66
|
"@babel/preset-react": "7.12.10",
|
|
67
|
-
"@gamelearn/arcade-styles": "0.5.
|
|
67
|
+
"@gamelearn/arcade-styles": "0.5.10",
|
|
68
68
|
"@gamelearn/version": "^1.3.1",
|
|
69
69
|
"@react-three/test-renderer": "6.0.6",
|
|
70
70
|
"@storybook/addon-actions": "6.1.11",
|