@rpg-engine/long-bow 0.2.28 → 0.2.33
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/Arrow/SelectArrow.d.ts +8 -0
- package/dist/components/SkillProgressBar.d.ts +2 -0
- package/dist/components/SkillsContainer.d.ts +2 -0
- package/dist/components/TradingMenu/TradingItemRow.d.ts +9 -0
- package/dist/components/TradingMenu/TradingMenu.d.ts +12 -0
- package/dist/components/TradingMenu/items.mock.d.ts +2 -0
- package/dist/components/shared/Ellipsis.d.ts +3 -1
- package/dist/index.d.ts +3 -2
- package/dist/long-bow.cjs.development.js +748 -686
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +749 -692
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/Arrow.stories.d.ts +5 -0
- package/dist/stories/ItemTradingComponent.stories.d.ts +5 -0
- package/dist/stories/TradingMenu.stories.d.ts +5 -0
- package/package.json +2 -2
- package/src/components/Arrow/SelectArrow.tsx +65 -0
- package/src/components/{PropertySelect/img/ui-arrows → Arrow/img}/arrow01-left-clicked.png +0 -0
- package/src/components/{PropertySelect/img/ui-arrows → Arrow/img}/arrow01-left.png +0 -0
- package/src/components/{PropertySelect/img/ui-arrows → Arrow/img}/arrow01-right-clicked.png +0 -0
- package/src/components/{PropertySelect/img/ui-arrows → Arrow/img}/arrow01-right.png +0 -0
- package/src/components/{PropertySelect/img/ui-arrows → Arrow/img}/arrow02-left-clicked.png +0 -0
- package/src/components/{PropertySelect/img/ui-arrows → Arrow/img}/arrow02-left.png +0 -0
- package/src/components/{PropertySelect/img/ui-arrows → Arrow/img}/arrow02-right-clicked.png +0 -0
- package/src/components/{PropertySelect/img/ui-arrows → Arrow/img}/arrow02-right.png +0 -0
- package/src/components/Item/Inventory/ItemSlot.tsx +5 -3
- package/src/components/NPCDialog/.DS_Store +0 -0
- package/src/components/NPCDialog/img/.DS_Store +0 -0
- package/src/components/PropertySelect/PropertySelect.tsx +12 -34
- package/src/components/QuestInfo/QuestInfo.tsx +8 -34
- package/src/components/ScrollList.tsx +2 -1
- package/src/components/SkillProgressBar.tsx +4 -2
- package/src/components/SkillsContainer.tsx +8 -37
- package/src/components/TradingMenu/TradingItemRow.tsx +172 -0
- package/src/components/TradingMenu/TradingMenu.tsx +188 -0
- package/src/components/TradingMenu/items.mock.ts +88 -0
- package/src/components/shared/Ellipsis.tsx +25 -6
- package/src/index.tsx +3 -2
- package/src/mocks/.DS_Store +0 -0
- package/src/stories/Arrow.stories.tsx +26 -0
- package/src/stories/ItemTradingComponent.stories.tsx +39 -0
- package/src/stories/SkillProgressBar.stories.tsx +4 -0
- package/src/stories/SkillsContainer.stories.tsx +4 -0
- package/src/stories/TradingMenu.stories.tsx +38 -0
|
@@ -16,31 +16,27 @@ require('rpgui/rpgui.min.css');
|
|
|
16
16
|
require('rpgui/rpgui.min.js');
|
|
17
17
|
var mobxReactLite = require('mobx-react-lite');
|
|
18
18
|
var _ = _interopDefault(require('lodash'));
|
|
19
|
+
var capitalize = _interopDefault(require('lodash/capitalize'));
|
|
19
20
|
|
|
20
21
|
function _extends() {
|
|
21
22
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
22
23
|
for (var i = 1; i < arguments.length; i++) {
|
|
23
24
|
var source = arguments[i];
|
|
24
|
-
|
|
25
25
|
for (var key in source) {
|
|
26
26
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
27
27
|
target[key] = source[key];
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
|
|
32
31
|
return target;
|
|
33
32
|
};
|
|
34
33
|
return _extends.apply(this, arguments);
|
|
35
34
|
}
|
|
36
|
-
|
|
37
35
|
function _inheritsLoose(subClass, superClass) {
|
|
38
36
|
subClass.prototype = Object.create(superClass.prototype);
|
|
39
37
|
subClass.prototype.constructor = subClass;
|
|
40
|
-
|
|
41
38
|
_setPrototypeOf(subClass, superClass);
|
|
42
39
|
}
|
|
43
|
-
|
|
44
40
|
function _setPrototypeOf(o, p) {
|
|
45
41
|
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
46
42
|
o.__proto__ = p;
|
|
@@ -48,36 +44,33 @@ function _setPrototypeOf(o, p) {
|
|
|
48
44
|
};
|
|
49
45
|
return _setPrototypeOf(o, p);
|
|
50
46
|
}
|
|
51
|
-
|
|
47
|
+
function _objectDestructuringEmpty(obj) {
|
|
48
|
+
if (obj == null) throw new TypeError("Cannot destructure " + obj);
|
|
49
|
+
}
|
|
52
50
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
53
51
|
if (source == null) return {};
|
|
54
52
|
var target = {};
|
|
55
53
|
var sourceKeys = Object.keys(source);
|
|
56
54
|
var key, i;
|
|
57
|
-
|
|
58
55
|
for (i = 0; i < sourceKeys.length; i++) {
|
|
59
56
|
key = sourceKeys[i];
|
|
60
57
|
if (excluded.indexOf(key) >= 0) continue;
|
|
61
58
|
target[key] = source[key];
|
|
62
59
|
}
|
|
63
|
-
|
|
64
60
|
return target;
|
|
65
61
|
}
|
|
66
62
|
|
|
67
63
|
var _excluded = ["disabled", "children", "buttonType"];
|
|
68
|
-
|
|
69
64
|
(function (ButtonTypes) {
|
|
70
65
|
ButtonTypes["RPGUIButton"] = "rpgui-button";
|
|
71
66
|
ButtonTypes["RPGUIGoldButton"] = "rpgui-button golden";
|
|
72
67
|
})(exports.ButtonTypes || (exports.ButtonTypes = {}));
|
|
73
|
-
|
|
74
68
|
var Button = function Button(_ref) {
|
|
75
69
|
var _ref$disabled = _ref.disabled,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
70
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
71
|
+
children = _ref.children,
|
|
72
|
+
buttonType = _ref.buttonType,
|
|
73
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
81
74
|
return React__default.createElement(ButtonContainer, Object.assign({
|
|
82
75
|
className: "" + buttonType,
|
|
83
76
|
disabled: disabled
|
|
@@ -90,21 +83,21 @@ var ButtonContainer = /*#__PURE__*/styled.button.withConfig({
|
|
|
90
83
|
|
|
91
84
|
var SpriteFromAtlas = function SpriteFromAtlas(_ref) {
|
|
92
85
|
var atlasJSON = _ref.atlasJSON,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
86
|
+
atlasIMG = _ref.atlasIMG,
|
|
87
|
+
spriteKey = _ref.spriteKey,
|
|
88
|
+
_ref$width = _ref.width,
|
|
89
|
+
width = _ref$width === void 0 ? shared.GRID_WIDTH : _ref$width,
|
|
90
|
+
_ref$height = _ref.height,
|
|
91
|
+
height = _ref$height === void 0 ? shared.GRID_HEIGHT : _ref$height,
|
|
92
|
+
_ref$imgScale = _ref.imgScale,
|
|
93
|
+
imgScale = _ref$imgScale === void 0 ? 2 : _ref$imgScale,
|
|
94
|
+
imgStyle = _ref.imgStyle,
|
|
95
|
+
onClick = _ref.onClick,
|
|
96
|
+
containerStyle = _ref.containerStyle,
|
|
97
|
+
_ref$grayScale = _ref.grayScale,
|
|
98
|
+
grayScale = _ref$grayScale === void 0 ? false : _ref$grayScale,
|
|
99
|
+
_ref$opacity = _ref.opacity,
|
|
100
|
+
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity;
|
|
108
101
|
//! If an item is not showing, remember that you MUST run yarn atlas:copy everytime you add a new item to the atlas (it will sync our public folder atlas with src/atlas).
|
|
109
102
|
//!Due to React's limitations, we cannot import it from the public folder directly!
|
|
110
103
|
var spriteData = atlasJSON.frames[spriteKey];
|
|
@@ -27261,34 +27254,27 @@ var img$1 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAAFACAMAAAD6TlWYA
|
|
|
27261
27254
|
|
|
27262
27255
|
var ErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
27263
27256
|
_inheritsLoose(ErrorBoundary, _Component);
|
|
27264
|
-
|
|
27265
27257
|
function ErrorBoundary() {
|
|
27266
27258
|
var _this;
|
|
27267
|
-
|
|
27268
27259
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
27269
27260
|
args[_key] = arguments[_key];
|
|
27270
27261
|
}
|
|
27271
|
-
|
|
27272
27262
|
_this = _Component.call.apply(_Component, [this].concat(args)) || this;
|
|
27273
27263
|
_this.state = {
|
|
27274
27264
|
hasError: false
|
|
27275
27265
|
};
|
|
27276
27266
|
return _this;
|
|
27277
27267
|
}
|
|
27278
|
-
|
|
27279
27268
|
ErrorBoundary.getDerivedStateFromError = function getDerivedStateFromError(_) {
|
|
27280
27269
|
// Update state so the next render will show the fallback UI.
|
|
27281
27270
|
return {
|
|
27282
27271
|
hasError: true
|
|
27283
27272
|
};
|
|
27284
27273
|
};
|
|
27285
|
-
|
|
27286
27274
|
var _proto = ErrorBoundary.prototype;
|
|
27287
|
-
|
|
27288
27275
|
_proto.componentDidCatch = function componentDidCatch(error, errorInfo) {
|
|
27289
27276
|
console.error('Uncaught error:', error, errorInfo);
|
|
27290
27277
|
};
|
|
27291
|
-
|
|
27292
27278
|
_proto.render = function render() {
|
|
27293
27279
|
if (this.state.hasError) {
|
|
27294
27280
|
return React__default.createElement(SpriteFromAtlas, {
|
|
@@ -27298,80 +27284,121 @@ var ErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
|
27298
27284
|
imgScale: 3
|
|
27299
27285
|
});
|
|
27300
27286
|
}
|
|
27301
|
-
|
|
27302
27287
|
return this.props.children;
|
|
27303
27288
|
};
|
|
27304
|
-
|
|
27305
27289
|
return ErrorBoundary;
|
|
27306
27290
|
}(React.Component);
|
|
27307
27291
|
|
|
27292
|
+
var img$2 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAASRJREFUWIXtl7EKwjAQhn8llg4dOig4uApu+gaib+Fj+CL6MO6Kk6N1ExRdHDJ06NChFEEnL6kmGkE5wf7TJVzbn+96uRb4d1VcE+tB62VO4HkUp3l+MeWEvk/P3Md7VF0NfEvsBsT9hg21C940zynuNZvG+0RS6tdW2AmwGxBAEXvo+xQnWUa4XPAOOmdtpeLF9qHSJHYC7AYEYMfuhtosHXskJcWB59FBFOMHCLAbEIAduwvqd6V3E/ADBNgN3LqA3kz9rJ6MQkqcre2HyTvSZ0rZBYDqAtrot2tUjuE0MY7d+Tg0bT+R6qxyHN9LAECcnmhjuSt8EVE5ui3VBbbS6LKVKZLFNTsBdgMf/S/Qy7Q5nY1lajfUOF4dD/wE2A2UYtcVzKJVOti5A44AAAAASUVORK5CYII=';
|
|
27293
|
+
|
|
27294
|
+
var img$3 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAASZJREFUWIVjYBjpgJFYhSI8MgTVGBoJwNnnz334j02Nk5MY3M5Vm84xMBHrAFqBAXcARhTgCmpighcZHDvhhFXcymIfnP3myxPGAQ+BAXcAIwMDarA7OYnB2fv2vcIa1LiC98fKc1jFOcKN4OzRKEAHLAwMuIOd1KDGBZCD3dBIAJ7zdh96MvAhMOAOYGFgwB3spAY1MeD8uQ8o/AEPgQF3ACwXwFOmlcU+eHTsKxTApocioC/DAmfvvTEIQmDAHYBRF9irssLZB2//xloXFDqIEDTY1/APVnGnfkQuGK0LGBigueDNlydwgYO3UVpE8NwhI4CImv4Dbwi2iBgYCEcTA8MgCIEBdwBV+wXI0fTkA/YcpCrKBrfz+P17Ax8CA+6AUTDgAACD+FSXdO/L2QAAAABJRU5ErkJggg==';
|
|
27295
|
+
|
|
27296
|
+
var img$4 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAARlJREFUWIXtl78KwjAQxr9IFIcODh0cuigKburoJLr7bD6S+ga6CV07CHZw6FCqoFPzp1w0g3KK/abjeinH78s1DfDvEgAwCAcqccnzO1UYtFqijLOiePniNEu8Gmh4VX1Q7A1IwMY+6XbJwv3pRFpjyrQJQUTWVK1hJ8DegHz2cDG6GXGo4s2RXuayqdNua2ugrUmzhJ8AewMSsHevjVFPhG2Hjm29niDTjjT7AgLsDUjA79vuIx9rKpMi2AmwN1BOgUq8y47VVNux3qYqrqegKgEAYRCRx7G5q02kLi3XFzI/HzYV9l18Vfn6LACI49iF3YXX1DiSCvUh0Wur2E2xE2BvQADArNdXifhckH81Lrwu1feCWj+jBx1LX0kx8GexAAAAAElFTkSuQmCC';
|
|
27297
|
+
|
|
27298
|
+
var img$5 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAS5JREFUWIXtl7Fqw0AMhv8LLmTI4KFk8pJAtkKJpzRDCoasHZvnyJP0OZqx3Y90KZ3OdM7qKfHgIUNpAu1U+TA654YGUXr/JGRx/vmEdDbw36UA4P4upYTW2y+ucJzG6ifOTXXy4HJfeBnoeFWdUeIGFABc9hLC/vqWsYXTiT55mE+bmq0RJyBuIGp7+PFoKNbLmOLuIuXKMZ1odoKyrE+t0VYny30hT0DcgAKA+eyKErmpCKON3UctraHYbsfqycgTEDcQAX673Uf21Niyl1tjUpQ4AXEDEQBcJ/U+ei+Ov/4S9xSERcRcx67l85y3XhsAgId1yeZvRxeE/WVzoHy4CwDmOnahduG1lcQ16qKqUTex2xInIG5AAcDNYEiJze6T/apx4XUp/BcE/Rl9A77uW6caXAGtAAAAAElFTkSuQmCC';
|
|
27299
|
+
|
|
27300
|
+
var _excluded$1 = ["direction", "size", "onClick"];
|
|
27301
|
+
var SelectArrow = function SelectArrow(_ref) {
|
|
27302
|
+
var _ref$direction = _ref.direction,
|
|
27303
|
+
direction = _ref$direction === void 0 ? 'left' : _ref$direction,
|
|
27304
|
+
size = _ref.size,
|
|
27305
|
+
_onClick = _ref.onClick,
|
|
27306
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
27307
|
+
return React__default.createElement(React__default.Fragment, null, direction === 'left' ? React__default.createElement(LeftArrow, Object.assign({
|
|
27308
|
+
size: size,
|
|
27309
|
+
onClick: function onClick() {
|
|
27310
|
+
return _onClick();
|
|
27311
|
+
}
|
|
27312
|
+
}, props)) : React__default.createElement(RightArrow, Object.assign({
|
|
27313
|
+
size: size,
|
|
27314
|
+
onClick: function onClick() {
|
|
27315
|
+
return _onClick();
|
|
27316
|
+
}
|
|
27317
|
+
}, props)));
|
|
27318
|
+
};
|
|
27319
|
+
var LeftArrow = /*#__PURE__*/styled.span.withConfig({
|
|
27320
|
+
displayName: "SelectArrow__LeftArrow",
|
|
27321
|
+
componentId: "sc-1h7cpoe-0"
|
|
27322
|
+
})(["background-image:url(", ");background-size:100% 100%;left:0;position:absolute;width:", "px;height:", "px;:active{background-image:url(", ");}z-index:2;"], img$3, function (props) {
|
|
27323
|
+
return props.size || 40;
|
|
27324
|
+
}, function (props) {
|
|
27325
|
+
return props.size || 42;
|
|
27326
|
+
}, img$2);
|
|
27327
|
+
var RightArrow = /*#__PURE__*/styled.span.withConfig({
|
|
27328
|
+
displayName: "SelectArrow__RightArrow",
|
|
27329
|
+
componentId: "sc-1h7cpoe-1"
|
|
27330
|
+
})(["background-image:url(", ");right:0;position:absolute;width:", "px;height:", "px;background-size:100% 100%;:active{background-image:url(", ");}z-index:2;"], img$5, function (props) {
|
|
27331
|
+
return props.size || 40;
|
|
27332
|
+
}, function (props) {
|
|
27333
|
+
return props.size || 42;
|
|
27334
|
+
}, img$4);
|
|
27335
|
+
|
|
27308
27336
|
var Ellipsis = function Ellipsis(_ref) {
|
|
27309
27337
|
var children = _ref.children,
|
|
27310
|
-
|
|
27311
|
-
|
|
27338
|
+
maxLines = _ref.maxLines,
|
|
27339
|
+
maxWidth = _ref.maxWidth,
|
|
27340
|
+
fontSize = _ref.fontSize;
|
|
27341
|
+
return React__default.createElement(Container$1, {
|
|
27342
|
+
maxWidth: maxWidth,
|
|
27343
|
+
fontSize: fontSize
|
|
27344
|
+
}, React__default.createElement("p", {
|
|
27312
27345
|
className: "ellipsis-" + maxLines + "-lines"
|
|
27313
27346
|
}, children));
|
|
27314
27347
|
};
|
|
27315
27348
|
var Container$1 = /*#__PURE__*/styled.div.withConfig({
|
|
27316
27349
|
displayName: "Ellipsis__Container",
|
|
27317
27350
|
componentId: "sc-ysrlju-0"
|
|
27318
|
-
})([".ellipsis-1-lines{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}.ellipsis-2-lines{display:-webkit-box;max-width:
|
|
27319
|
-
|
|
27320
|
-
|
|
27321
|
-
|
|
27322
|
-
|
|
27323
|
-
|
|
27324
|
-
|
|
27325
|
-
|
|
27326
|
-
|
|
27351
|
+
})(["p{font-size:", ";}.ellipsis-1-lines{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:", "px;}.ellipsis-2-lines{display:-webkit-box;max-width:", "px;height:25px;margin:0 auto;line-height:1;-webkit-line-clamp:2;-webkit-box-orient:vertical;text-overflow:ellipsis;overflow:hidden;}.ellipsis-3-lines{display:-webkit-box;max-width:", "px;height:43px;margin:0 auto;line-height:1;-webkit-line-clamp:3;-webkit-box-orient:vertical;text-overflow:ellipsis;overflow:hidden;}"], function (props) {
|
|
27352
|
+
return props.fontSize || '1rem';
|
|
27353
|
+
}, function (props) {
|
|
27354
|
+
return props.maxWidth;
|
|
27355
|
+
}, function (props) {
|
|
27356
|
+
return props.maxWidth;
|
|
27357
|
+
}, function (props) {
|
|
27358
|
+
return props.maxWidth;
|
|
27359
|
+
});
|
|
27327
27360
|
|
|
27328
27361
|
var PropertySelect = function PropertySelect(_ref) {
|
|
27329
27362
|
var availableProperties = _ref.availableProperties,
|
|
27330
|
-
|
|
27331
|
-
|
|
27363
|
+
onChange = _ref.onChange;
|
|
27332
27364
|
var _useState = React.useState(0),
|
|
27333
|
-
|
|
27334
|
-
|
|
27335
|
-
|
|
27365
|
+
currentIndex = _useState[0],
|
|
27366
|
+
setCurrentIndex = _useState[1];
|
|
27336
27367
|
var propertiesLength = availableProperties.length - 1;
|
|
27337
|
-
|
|
27338
27368
|
var onLeftClick = function onLeftClick() {
|
|
27339
27369
|
if (currentIndex === 0) setCurrentIndex(propertiesLength);else setCurrentIndex(function (index) {
|
|
27340
27370
|
return index - 1;
|
|
27341
27371
|
});
|
|
27342
27372
|
};
|
|
27343
|
-
|
|
27344
27373
|
var onRightClick = function onRightClick() {
|
|
27345
27374
|
if (currentIndex === propertiesLength) setCurrentIndex(0);else setCurrentIndex(function (index) {
|
|
27346
27375
|
return index + 1;
|
|
27347
27376
|
});
|
|
27348
27377
|
};
|
|
27349
|
-
|
|
27350
27378
|
React.useEffect(function () {
|
|
27351
27379
|
onChange(availableProperties[currentIndex]);
|
|
27352
27380
|
}, [currentIndex]);
|
|
27353
27381
|
React.useEffect(function () {
|
|
27354
27382
|
setCurrentIndex(0);
|
|
27355
27383
|
}, [JSON.stringify(availableProperties)]);
|
|
27356
|
-
|
|
27357
27384
|
var getCurrentSelectionName = function getCurrentSelectionName() {
|
|
27358
27385
|
var item = availableProperties[currentIndex];
|
|
27359
|
-
|
|
27360
27386
|
if (item) {
|
|
27361
27387
|
return item.name;
|
|
27362
27388
|
}
|
|
27363
|
-
|
|
27364
27389
|
return '';
|
|
27365
27390
|
};
|
|
27366
|
-
|
|
27367
27391
|
return React__default.createElement(Container$2, null, React__default.createElement(TextOverlay, null, React__default.createElement(Item, null, React__default.createElement(Ellipsis, {
|
|
27368
|
-
maxLines: 1
|
|
27392
|
+
maxLines: 1,
|
|
27393
|
+
maxWidth: 200
|
|
27369
27394
|
}, getCurrentSelectionName()))), React__default.createElement("div", {
|
|
27370
27395
|
className: "rpgui-progress-track"
|
|
27371
|
-
}), React__default.createElement(
|
|
27396
|
+
}), React__default.createElement(SelectArrow, {
|
|
27397
|
+
direction: "left",
|
|
27372
27398
|
onClick: onLeftClick,
|
|
27373
27399
|
onTouchStart: onLeftClick
|
|
27374
|
-
}), React__default.createElement(
|
|
27400
|
+
}), React__default.createElement(SelectArrow, {
|
|
27401
|
+
direction: "right",
|
|
27375
27402
|
onClick: onRightClick,
|
|
27376
27403
|
onTouchStart: onRightClick
|
|
27377
27404
|
}));
|
|
@@ -27388,45 +27415,31 @@ var Container$2 = /*#__PURE__*/styled.div.withConfig({
|
|
|
27388
27415
|
displayName: "PropertySelect__Container",
|
|
27389
27416
|
componentId: "sc-12uqx6s-2"
|
|
27390
27417
|
})(["position:relative;display:flex;flex-direction:column;justify-content:start;align-items:flex-start;min-width:100px;width:40%;"]);
|
|
27391
|
-
var LeftArrow = /*#__PURE__*/styled.div.withConfig({
|
|
27392
|
-
displayName: "PropertySelect__LeftArrow",
|
|
27393
|
-
componentId: "sc-12uqx6s-3"
|
|
27394
|
-
})(["background-image:url(", ");background-size:100% 100%;left:0;position:absolute;width:40px;height:42px;:active{background-image:url(", ");}z-index:2;"], img$3, img$2);
|
|
27395
|
-
var RightArrow = /*#__PURE__*/styled.div.withConfig({
|
|
27396
|
-
displayName: "PropertySelect__RightArrow",
|
|
27397
|
-
componentId: "sc-12uqx6s-4"
|
|
27398
|
-
})(["background-image:url(", ");right:0;position:absolute;width:40px;background-size:100% 100%;height:42px;:active{background-image:url(", ");}z-index:2;"], img$5, img$4);
|
|
27399
27418
|
|
|
27400
27419
|
var CharacterSelection = function CharacterSelection(_ref) {
|
|
27401
27420
|
var availableCharacters = _ref.availableCharacters,
|
|
27402
|
-
|
|
27421
|
+
onChange = _ref.onChange;
|
|
27403
27422
|
var propertySelectValues = availableCharacters.map(function (item) {
|
|
27404
27423
|
return {
|
|
27405
27424
|
id: item.textureKey,
|
|
27406
27425
|
name: item.name
|
|
27407
27426
|
};
|
|
27408
27427
|
});
|
|
27409
|
-
|
|
27410
27428
|
var _useState = React.useState(),
|
|
27411
|
-
|
|
27412
|
-
|
|
27413
|
-
|
|
27429
|
+
selectedValue = _useState[0],
|
|
27430
|
+
setSelectedValue = _useState[1];
|
|
27414
27431
|
var _useState2 = React.useState(''),
|
|
27415
|
-
|
|
27416
|
-
|
|
27417
|
-
|
|
27432
|
+
selectedSpriteKey = _useState2[0],
|
|
27433
|
+
setSelectedSpriteKey = _useState2[1];
|
|
27418
27434
|
var onSelectedValueChange = function onSelectedValueChange() {
|
|
27419
27435
|
var textureKey = selectedValue ? selectedValue.id : '';
|
|
27420
27436
|
var spriteKey = textureKey ? textureKey + '/down/standing/0.png' : '';
|
|
27421
|
-
|
|
27422
27437
|
if (spriteKey === selectedSpriteKey) {
|
|
27423
27438
|
return;
|
|
27424
27439
|
}
|
|
27425
|
-
|
|
27426
27440
|
setSelectedSpriteKey(spriteKey);
|
|
27427
27441
|
onChange(textureKey);
|
|
27428
27442
|
};
|
|
27429
|
-
|
|
27430
27443
|
React.useEffect(function () {
|
|
27431
27444
|
onSelectedValueChange();
|
|
27432
27445
|
}, [selectedValue]);
|
|
@@ -27472,8 +27485,7 @@ var colors = {
|
|
|
27472
27485
|
};
|
|
27473
27486
|
|
|
27474
27487
|
var Input = function Input(_ref) {
|
|
27475
|
-
var props = _extends({}, _ref);
|
|
27476
|
-
|
|
27488
|
+
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
27477
27489
|
return React__default.createElement("input", Object.assign({}, props));
|
|
27478
27490
|
};
|
|
27479
27491
|
|
|
@@ -27483,14 +27495,13 @@ var Input = function Input(_ref) {
|
|
|
27483
27495
|
RPGUIContainerTypes["FramedGold2"] = "framed-golden-2";
|
|
27484
27496
|
RPGUIContainerTypes["FramedGrey"] = "framed-grey";
|
|
27485
27497
|
})(exports.RPGUIContainerTypes || (exports.RPGUIContainerTypes = {}));
|
|
27486
|
-
|
|
27487
27498
|
var RPGUIContainer = function RPGUIContainer(_ref) {
|
|
27488
27499
|
var children = _ref.children,
|
|
27489
|
-
|
|
27490
|
-
|
|
27491
|
-
|
|
27492
|
-
|
|
27493
|
-
|
|
27500
|
+
type = _ref.type,
|
|
27501
|
+
_ref$width = _ref.width,
|
|
27502
|
+
width = _ref$width === void 0 ? '50%' : _ref$width,
|
|
27503
|
+
height = _ref.height,
|
|
27504
|
+
className = _ref.className;
|
|
27494
27505
|
return React__default.createElement(Container$4, {
|
|
27495
27506
|
width: width,
|
|
27496
27507
|
height: height || 'auto',
|
|
@@ -27522,60 +27533,51 @@ var Column = /*#__PURE__*/styled.div.withConfig({
|
|
|
27522
27533
|
|
|
27523
27534
|
var Chat = function Chat(_ref) {
|
|
27524
27535
|
var chatMessages = _ref.chatMessages,
|
|
27525
|
-
|
|
27526
|
-
|
|
27527
|
-
|
|
27528
|
-
|
|
27529
|
-
|
|
27530
|
-
|
|
27531
|
-
|
|
27532
|
-
|
|
27533
|
-
|
|
27536
|
+
onSendChatMessage = _ref.onSendChatMessage,
|
|
27537
|
+
_ref$opacity = _ref.opacity,
|
|
27538
|
+
opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
|
|
27539
|
+
_ref$width = _ref.width,
|
|
27540
|
+
width = _ref$width === void 0 ? '100%' : _ref$width,
|
|
27541
|
+
_ref$height = _ref.height,
|
|
27542
|
+
height = _ref$height === void 0 ? '250px' : _ref$height,
|
|
27543
|
+
onCloseButton = _ref.onCloseButton;
|
|
27534
27544
|
var _useState = React.useState(''),
|
|
27535
|
-
|
|
27536
|
-
|
|
27537
|
-
|
|
27545
|
+
message = _useState[0],
|
|
27546
|
+
setMessage = _useState[1];
|
|
27538
27547
|
React.useEffect(function () {
|
|
27539
27548
|
scrollChatToBottom();
|
|
27540
27549
|
}, []);
|
|
27541
27550
|
React.useEffect(function () {
|
|
27542
27551
|
scrollChatToBottom();
|
|
27543
27552
|
}, [chatMessages]);
|
|
27544
|
-
|
|
27545
27553
|
var scrollChatToBottom = function scrollChatToBottom() {
|
|
27546
27554
|
var scrollingElement = document.querySelector('.chat-body');
|
|
27547
|
-
|
|
27548
27555
|
if (scrollingElement) {
|
|
27549
27556
|
scrollingElement.scrollTop = scrollingElement.scrollHeight;
|
|
27550
27557
|
}
|
|
27551
27558
|
};
|
|
27552
|
-
|
|
27553
27559
|
var handleSubmit = function handleSubmit(event) {
|
|
27554
27560
|
event.preventDefault();
|
|
27555
27561
|
onSendChatMessage(message);
|
|
27556
27562
|
setMessage('');
|
|
27557
27563
|
};
|
|
27558
|
-
|
|
27559
27564
|
var getInputValue = function getInputValue(value) {
|
|
27560
27565
|
setMessage(value);
|
|
27561
27566
|
};
|
|
27562
|
-
|
|
27563
27567
|
var onRenderMessageLines = function onRenderMessageLines(emitter, createdAt, message) {
|
|
27564
27568
|
return dayjs(createdAt || new Date()).format('HH:mm') + " " + (emitter != null && emitter.name ? emitter.name + ": " : 'Unknown: ') + " " + message;
|
|
27565
27569
|
};
|
|
27566
|
-
|
|
27567
27570
|
var onRenderChatMessages = function onRenderChatMessages(chatMessages) {
|
|
27568
27571
|
return chatMessages != null && chatMessages.length ? chatMessages == null ? void 0 : chatMessages.map(function (_ref2, index) {
|
|
27569
27572
|
var _id = _ref2._id,
|
|
27570
|
-
|
|
27571
|
-
|
|
27572
|
-
|
|
27573
|
+
createdAt = _ref2.createdAt,
|
|
27574
|
+
emitter = _ref2.emitter,
|
|
27575
|
+
message = _ref2.message;
|
|
27573
27576
|
return React__default.createElement(MessageText, {
|
|
27574
27577
|
key: _id + "_" + index
|
|
27575
27578
|
}, onRenderMessageLines(emitter, createdAt, message));
|
|
27576
27579
|
}) : React__default.createElement(MessageText, null, "No messages available.");
|
|
27577
27580
|
};
|
|
27578
|
-
|
|
27579
27581
|
return React__default.createElement(Container$5, null, React__default.createElement(CustomContainer, {
|
|
27580
27582
|
type: exports.RPGUIContainerTypes.FramedGrey,
|
|
27581
27583
|
width: width,
|
|
@@ -27642,8 +27644,7 @@ var MessageText = /*#__PURE__*/styled.p.withConfig({
|
|
|
27642
27644
|
|
|
27643
27645
|
var CheckButton = function CheckButton(_ref) {
|
|
27644
27646
|
var items = _ref.items,
|
|
27645
|
-
|
|
27646
|
-
|
|
27647
|
+
onChange = _ref.onChange;
|
|
27647
27648
|
var generateSelectedValuesList = function generateSelectedValuesList() {
|
|
27648
27649
|
var selectedValues = {};
|
|
27649
27650
|
items.forEach(function (item) {
|
|
@@ -27651,17 +27652,13 @@ var CheckButton = function CheckButton(_ref) {
|
|
|
27651
27652
|
});
|
|
27652
27653
|
return selectedValues;
|
|
27653
27654
|
};
|
|
27654
|
-
|
|
27655
27655
|
var _useState = React.useState(generateSelectedValuesList()),
|
|
27656
|
-
|
|
27657
|
-
|
|
27658
|
-
|
|
27656
|
+
selectedValues = _useState[0],
|
|
27657
|
+
setSelectedValues = _useState[1];
|
|
27659
27658
|
var handleClick = function handleClick(label) {
|
|
27660
27659
|
var _extends2;
|
|
27661
|
-
|
|
27662
27660
|
setSelectedValues(_extends({}, selectedValues, (_extends2 = {}, _extends2[label] = !selectedValues[label], _extends2)));
|
|
27663
27661
|
};
|
|
27664
|
-
|
|
27665
27662
|
React.useEffect(function () {
|
|
27666
27663
|
if (selectedValues) {
|
|
27667
27664
|
onChange(selectedValues);
|
|
@@ -27697,12 +27694,10 @@ function useOutsideClick(ref, id) {
|
|
|
27697
27694
|
id: id
|
|
27698
27695
|
}
|
|
27699
27696
|
});
|
|
27700
|
-
|
|
27701
27697
|
document.dispatchEvent(_event);
|
|
27702
27698
|
}
|
|
27703
|
-
}
|
|
27704
|
-
|
|
27705
|
-
|
|
27699
|
+
}
|
|
27700
|
+
// Bind the event listener
|
|
27706
27701
|
document.addEventListener('mousedown', handleClickOutside);
|
|
27707
27702
|
return function () {
|
|
27708
27703
|
// Unbind the event listener on clean up
|
|
@@ -27713,26 +27708,25 @@ function useOutsideClick(ref, id) {
|
|
|
27713
27708
|
|
|
27714
27709
|
var DraggableContainer = function DraggableContainer(_ref) {
|
|
27715
27710
|
var children = _ref.children,
|
|
27716
|
-
|
|
27717
|
-
|
|
27718
|
-
|
|
27719
|
-
|
|
27720
|
-
|
|
27721
|
-
|
|
27722
|
-
|
|
27723
|
-
|
|
27724
|
-
|
|
27725
|
-
|
|
27726
|
-
|
|
27727
|
-
|
|
27728
|
-
|
|
27729
|
-
|
|
27711
|
+
_ref$width = _ref.width,
|
|
27712
|
+
width = _ref$width === void 0 ? '50%' : _ref$width,
|
|
27713
|
+
height = _ref.height,
|
|
27714
|
+
className = _ref.className,
|
|
27715
|
+
_ref$type = _ref.type,
|
|
27716
|
+
type = _ref$type === void 0 ? exports.RPGUIContainerTypes.FramedGold : _ref$type,
|
|
27717
|
+
onCloseButton = _ref.onCloseButton,
|
|
27718
|
+
title = _ref.title,
|
|
27719
|
+
imgSrc = _ref.imgSrc,
|
|
27720
|
+
_ref$imgWidth = _ref.imgWidth,
|
|
27721
|
+
imgWidth = _ref$imgWidth === void 0 ? '20px' : _ref$imgWidth,
|
|
27722
|
+
cancelDrag = _ref.cancelDrag,
|
|
27723
|
+
onPositionChange = _ref.onPositionChange,
|
|
27724
|
+
onOutsideClick = _ref.onOutsideClick;
|
|
27730
27725
|
var draggableRef = React.useRef(null);
|
|
27731
27726
|
useOutsideClick(draggableRef, 'item-container');
|
|
27732
27727
|
React.useEffect(function () {
|
|
27733
27728
|
document.addEventListener('clickOutside', function (event) {
|
|
27734
27729
|
var e = event;
|
|
27735
|
-
|
|
27736
27730
|
if (e.detail.id === 'item-container') {
|
|
27737
27731
|
if (onOutsideClick) {
|
|
27738
27732
|
onOutsideClick();
|
|
@@ -27797,6 +27791,7 @@ var Icon = /*#__PURE__*/styled.img.withConfig({
|
|
|
27797
27791
|
return props.width;
|
|
27798
27792
|
});
|
|
27799
27793
|
|
|
27794
|
+
//@ts-ignore
|
|
27800
27795
|
var _RPGUI = RPGUI;
|
|
27801
27796
|
var RPGUIRoot = function RPGUIRoot(_ref) {
|
|
27802
27797
|
var children = _ref.children;
|
|
@@ -27807,19 +27802,15 @@ var RPGUIRoot = function RPGUIRoot(_ref) {
|
|
|
27807
27802
|
|
|
27808
27803
|
var Dropdown = function Dropdown(_ref) {
|
|
27809
27804
|
var options = _ref.options,
|
|
27810
|
-
|
|
27811
|
-
|
|
27805
|
+
width = _ref.width,
|
|
27806
|
+
onChange = _ref.onChange;
|
|
27812
27807
|
var dropdownId = uuid.v4();
|
|
27813
|
-
|
|
27814
27808
|
var _useState = React.useState(''),
|
|
27815
|
-
|
|
27816
|
-
|
|
27817
|
-
|
|
27809
|
+
selectedValue = _useState[0],
|
|
27810
|
+
setSelectedValue = _useState[1];
|
|
27818
27811
|
React.useEffect(function () {
|
|
27819
27812
|
var element = document.getElementById("rpgui-dropdown-" + dropdownId);
|
|
27820
|
-
|
|
27821
27813
|
var dropdownValue = _RPGUI.get_value(element);
|
|
27822
|
-
|
|
27823
27814
|
setSelectedValue(dropdownValue);
|
|
27824
27815
|
element == null ? void 0 : element.addEventListener('change', function (event) {
|
|
27825
27816
|
setSelectedValue(event == null ? void 0 : event.target.value);
|
|
@@ -27846,16 +27837,15 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
27846
27837
|
|
|
27847
27838
|
var RelativeListMenu = function RelativeListMenu(_ref) {
|
|
27848
27839
|
var options = _ref.options,
|
|
27849
|
-
|
|
27850
|
-
|
|
27851
|
-
|
|
27852
|
-
|
|
27840
|
+
onSelected = _ref.onSelected,
|
|
27841
|
+
onOutsideClick = _ref.onOutsideClick,
|
|
27842
|
+
_ref$fontSize = _ref.fontSize,
|
|
27843
|
+
fontSize = _ref$fontSize === void 0 ? 0.8 : _ref$fontSize;
|
|
27853
27844
|
var ref = React.useRef(null);
|
|
27854
27845
|
useOutsideClick(ref, 'relative-context-menu');
|
|
27855
27846
|
React.useEffect(function () {
|
|
27856
27847
|
document.addEventListener('clickOutside', function (event) {
|
|
27857
27848
|
var e = event;
|
|
27858
|
-
|
|
27859
27849
|
if (e.detail.id === 'relative-context-menu') {
|
|
27860
27850
|
if (onOutsideClick) {
|
|
27861
27851
|
onOutsideClick();
|
|
@@ -27912,10 +27902,8 @@ var generateContextMenuListOptions = function generateContextMenuListOptions(act
|
|
|
27912
27902
|
});
|
|
27913
27903
|
return contextMenu;
|
|
27914
27904
|
};
|
|
27915
|
-
|
|
27916
27905
|
var generateContextMenu = function generateContextMenu(itemType, itemContainerType) {
|
|
27917
27906
|
var contextActionMenu = [];
|
|
27918
|
-
|
|
27919
27907
|
if (itemContainerType === shared.ItemContainerType.Inventory) {
|
|
27920
27908
|
switch (itemType) {
|
|
27921
27909
|
case shared.ItemType.Weapon:
|
|
@@ -27924,40 +27912,32 @@ var generateContextMenu = function generateContextMenu(itemType, itemContainerTy
|
|
|
27924
27912
|
case shared.ItemType.Jewelry:
|
|
27925
27913
|
contextActionMenu = generateContextMenuListOptions(shared.ActionsForInventory.Equipment);
|
|
27926
27914
|
break;
|
|
27927
|
-
|
|
27928
27915
|
case shared.ItemType.Container:
|
|
27929
27916
|
contextActionMenu = generateContextMenuListOptions(shared.ActionsForInventory.Container);
|
|
27930
27917
|
break;
|
|
27931
|
-
|
|
27932
27918
|
case shared.ItemType.Consumable:
|
|
27933
27919
|
contextActionMenu = generateContextMenuListOptions(shared.ActionsForInventory.Consumable);
|
|
27934
27920
|
break;
|
|
27935
|
-
|
|
27936
27921
|
case shared.ItemType.CraftMaterial:
|
|
27937
27922
|
contextActionMenu = generateContextMenuListOptions(shared.ActionsForInventory.CraftMaterial);
|
|
27938
27923
|
break;
|
|
27939
|
-
|
|
27940
27924
|
case shared.ItemType.Tool:
|
|
27941
27925
|
contextActionMenu = generateContextMenuListOptions(shared.ActionsForInventory.Tool);
|
|
27942
27926
|
break;
|
|
27943
|
-
|
|
27944
27927
|
default:
|
|
27945
27928
|
contextActionMenu = generateContextMenuListOptions(shared.ActionsForInventory.Other);
|
|
27946
27929
|
break;
|
|
27947
27930
|
}
|
|
27948
27931
|
}
|
|
27949
|
-
|
|
27950
27932
|
if (itemContainerType === shared.ItemContainerType.Equipment) {
|
|
27951
27933
|
switch (itemType) {
|
|
27952
27934
|
case shared.ItemType.Container:
|
|
27953
27935
|
contextActionMenu = generateContextMenuListOptions(shared.ActionsForEquipmentSet.Container);
|
|
27954
27936
|
break;
|
|
27955
|
-
|
|
27956
27937
|
default:
|
|
27957
27938
|
contextActionMenu = generateContextMenuListOptions(shared.ActionsForEquipmentSet.Equipment);
|
|
27958
27939
|
}
|
|
27959
27940
|
}
|
|
27960
|
-
|
|
27961
27941
|
if (itemContainerType === shared.ItemContainerType.Loot) {
|
|
27962
27942
|
switch (itemType) {
|
|
27963
27943
|
case shared.ItemType.Weapon:
|
|
@@ -27966,25 +27946,20 @@ var generateContextMenu = function generateContextMenu(itemType, itemContainerTy
|
|
|
27966
27946
|
case shared.ItemType.Jewelry:
|
|
27967
27947
|
contextActionMenu = generateContextMenuListOptions(shared.ActionsForLoot.Equipment);
|
|
27968
27948
|
break;
|
|
27969
|
-
|
|
27970
27949
|
case shared.ItemType.Consumable:
|
|
27971
27950
|
contextActionMenu = generateContextMenuListOptions(shared.ActionsForLoot.Consumable);
|
|
27972
27951
|
break;
|
|
27973
|
-
|
|
27974
27952
|
case shared.ItemType.CraftMaterial:
|
|
27975
27953
|
contextActionMenu = generateContextMenuListOptions(shared.ActionsForLoot.CraftMaterial);
|
|
27976
27954
|
break;
|
|
27977
|
-
|
|
27978
27955
|
case shared.ItemType.Tool:
|
|
27979
27956
|
contextActionMenu = generateContextMenuListOptions(shared.ActionsForLoot.Tool);
|
|
27980
27957
|
break;
|
|
27981
|
-
|
|
27982
27958
|
default:
|
|
27983
27959
|
contextActionMenu = generateContextMenuListOptions(shared.ActionsForLoot.Other);
|
|
27984
27960
|
break;
|
|
27985
27961
|
}
|
|
27986
27962
|
}
|
|
27987
|
-
|
|
27988
27963
|
if (itemContainerType === shared.ItemContainerType.MapContainer) {
|
|
27989
27964
|
switch (itemType) {
|
|
27990
27965
|
case shared.ItemType.Weapon:
|
|
@@ -27993,25 +27968,20 @@ var generateContextMenu = function generateContextMenu(itemType, itemContainerTy
|
|
|
27993
27968
|
case shared.ItemType.Jewelry:
|
|
27994
27969
|
contextActionMenu = generateContextMenuListOptions(shared.ActionsForMapContainer.Equipment);
|
|
27995
27970
|
break;
|
|
27996
|
-
|
|
27997
27971
|
case shared.ItemType.Consumable:
|
|
27998
27972
|
contextActionMenu = generateContextMenuListOptions(shared.ActionsForMapContainer.Consumable);
|
|
27999
27973
|
break;
|
|
28000
|
-
|
|
28001
27974
|
case shared.ItemType.CraftMaterial:
|
|
28002
27975
|
contextActionMenu = generateContextMenuListOptions(shared.ActionsForMapContainer.CraftMaterial);
|
|
28003
27976
|
break;
|
|
28004
|
-
|
|
28005
27977
|
case shared.ItemType.Tool:
|
|
28006
27978
|
contextActionMenu = generateContextMenuListOptions(shared.ActionsForMapContainer.Tool);
|
|
28007
27979
|
break;
|
|
28008
|
-
|
|
28009
27980
|
default:
|
|
28010
27981
|
contextActionMenu = generateContextMenuListOptions(shared.ActionsForMapContainer.Other);
|
|
28011
27982
|
break;
|
|
28012
27983
|
}
|
|
28013
27984
|
}
|
|
28014
|
-
|
|
28015
27985
|
return contextActionMenu;
|
|
28016
27986
|
};
|
|
28017
27987
|
|
|
@@ -28029,39 +27999,33 @@ var EquipmentSlotSpriteByType = {
|
|
|
28029
27999
|
};
|
|
28030
28000
|
var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
28031
28001
|
var slotIndex = _ref.slotIndex,
|
|
28032
|
-
|
|
28033
|
-
|
|
28034
|
-
|
|
28035
|
-
|
|
28036
|
-
|
|
28037
|
-
|
|
28038
|
-
|
|
28039
|
-
|
|
28040
|
-
|
|
28041
|
-
|
|
28002
|
+
item = _ref.item,
|
|
28003
|
+
containerType = _ref.itemContainerType,
|
|
28004
|
+
slotSpriteMask = _ref.slotSpriteMask,
|
|
28005
|
+
_onMouseOver = _ref.onMouseOver,
|
|
28006
|
+
_onMouseOut = _ref.onMouseOut,
|
|
28007
|
+
_onClick = _ref.onClick,
|
|
28008
|
+
_onSelected = _ref.onSelected,
|
|
28009
|
+
atlasJSON = _ref.atlasJSON,
|
|
28010
|
+
atlasIMG = _ref.atlasIMG;
|
|
28042
28011
|
var _useState = React.useState(false),
|
|
28043
|
-
|
|
28044
|
-
|
|
28045
|
-
|
|
28012
|
+
isTooltipVisible = _useState[0],
|
|
28013
|
+
setTooltipVisible = _useState[1];
|
|
28046
28014
|
var _useState2 = React.useState(false),
|
|
28047
|
-
|
|
28048
|
-
|
|
28049
|
-
|
|
28015
|
+
isContextMenuVisible = _useState2[0],
|
|
28016
|
+
setIsContextMenuVisible = _useState2[1];
|
|
28050
28017
|
var _useState3 = React.useState([]),
|
|
28051
|
-
|
|
28052
|
-
|
|
28053
|
-
|
|
28018
|
+
contextActions = _useState3[0],
|
|
28019
|
+
setContextActions = _useState3[1];
|
|
28054
28020
|
React.useEffect(function () {
|
|
28055
28021
|
if (item) {
|
|
28056
28022
|
setContextActions(generateContextMenu(item.type, containerType));
|
|
28057
28023
|
}
|
|
28058
28024
|
}, [item]);
|
|
28059
|
-
|
|
28060
28025
|
var getLeftPositionValue = function getLeftPositionValue(quantity) {
|
|
28061
28026
|
if (quantity > 0 && quantity < 10) return '2.5rem';else if (quantity > 9 && quantity < 100) return '2.0rem';else if (quantity > 99) return '1rem';
|
|
28062
28027
|
return '2.5rem';
|
|
28063
28028
|
};
|
|
28064
|
-
|
|
28065
28029
|
var getStackInfo = function getStackInfo(itemId, stackQty) {
|
|
28066
28030
|
// if (itemToRender?.isStackable && itemToRender?.stackQty) {
|
|
28067
28031
|
if (stackQty > 1) {
|
|
@@ -28070,17 +28034,15 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
28070
28034
|
key: "qty-" + itemId
|
|
28071
28035
|
}, ' ', stackQty, ' ');
|
|
28072
28036
|
}
|
|
28073
|
-
|
|
28074
28037
|
return undefined;
|
|
28075
28038
|
};
|
|
28076
|
-
|
|
28077
28039
|
var renderItem = function renderItem(itemToRender) {
|
|
28078
28040
|
var _itemToRender$_id, _itemToRender$stackQt;
|
|
28079
|
-
|
|
28080
28041
|
var element = [];
|
|
28081
|
-
|
|
28082
28042
|
if (itemToRender != null && itemToRender.texturePath) {
|
|
28083
|
-
element.push(React__default.createElement(ErrorBoundary,
|
|
28043
|
+
element.push(React__default.createElement(ErrorBoundary, {
|
|
28044
|
+
key: itemToRender._id
|
|
28045
|
+
}, React__default.createElement(SpriteFromAtlas, {
|
|
28084
28046
|
key: itemToRender._id,
|
|
28085
28047
|
atlasIMG: atlasIMG,
|
|
28086
28048
|
atlasJSON: atlasJSON,
|
|
@@ -28088,24 +28050,20 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
28088
28050
|
imgScale: 3
|
|
28089
28051
|
})));
|
|
28090
28052
|
}
|
|
28091
|
-
|
|
28092
28053
|
var stackInfo = getStackInfo((_itemToRender$_id = itemToRender == null ? void 0 : itemToRender._id) != null ? _itemToRender$_id : '', (_itemToRender$stackQt = itemToRender == null ? void 0 : itemToRender.stackQty) != null ? _itemToRender$stackQt : 0);
|
|
28093
|
-
|
|
28094
28054
|
if (stackInfo) {
|
|
28095
28055
|
element.push(stackInfo);
|
|
28096
28056
|
}
|
|
28097
|
-
|
|
28098
28057
|
return element;
|
|
28099
28058
|
};
|
|
28100
|
-
|
|
28101
28059
|
var renderEquipment = function renderEquipment(itemToRender) {
|
|
28102
28060
|
var _itemToRender$allowed;
|
|
28103
|
-
|
|
28104
28061
|
if (itemToRender != null && itemToRender.texturePath && (_itemToRender$allowed = itemToRender.allowedEquipSlotType) != null && _itemToRender$allowed.includes(slotSpriteMask)) {
|
|
28105
28062
|
var _itemToRender$_id2, _itemToRender$stackQt2;
|
|
28106
|
-
|
|
28107
28063
|
var element = [];
|
|
28108
|
-
element.push(React__default.createElement(ErrorBoundary,
|
|
28064
|
+
element.push(React__default.createElement(ErrorBoundary, {
|
|
28065
|
+
key: itemToRender._id
|
|
28066
|
+
}, React__default.createElement(SpriteFromAtlas, {
|
|
28109
28067
|
key: itemToRender._id,
|
|
28110
28068
|
atlasIMG: atlasIMG,
|
|
28111
28069
|
atlasJSON: atlasJSON,
|
|
@@ -28113,14 +28071,15 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
28113
28071
|
imgScale: 3
|
|
28114
28072
|
})));
|
|
28115
28073
|
var stackInfo = getStackInfo((_itemToRender$_id2 = itemToRender == null ? void 0 : itemToRender._id) != null ? _itemToRender$_id2 : '', (_itemToRender$stackQt2 = itemToRender == null ? void 0 : itemToRender.stackQty) != null ? _itemToRender$stackQt2 : 0);
|
|
28116
|
-
|
|
28117
28074
|
if (stackInfo) {
|
|
28118
28075
|
element.push(stackInfo);
|
|
28119
28076
|
}
|
|
28120
|
-
|
|
28121
28077
|
return element;
|
|
28122
28078
|
} else {
|
|
28123
|
-
return React__default.createElement(ErrorBoundary,
|
|
28079
|
+
return React__default.createElement(ErrorBoundary, {
|
|
28080
|
+
key: uuid.v4()
|
|
28081
|
+
}, React__default.createElement(SpriteFromAtlas, {
|
|
28082
|
+
key: uuid.v4(),
|
|
28124
28083
|
atlasIMG: atlasIMG,
|
|
28125
28084
|
atlasJSON: atlasJSON,
|
|
28126
28085
|
spriteKey: EquipmentSlotSpriteByType[slotSpriteMask],
|
|
@@ -28130,20 +28089,16 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
28130
28089
|
}));
|
|
28131
28090
|
}
|
|
28132
28091
|
};
|
|
28133
|
-
|
|
28134
28092
|
var onRenderSlot = function onRenderSlot(itemToRender) {
|
|
28135
28093
|
switch (containerType) {
|
|
28136
28094
|
case shared.ItemContainerType.Equipment:
|
|
28137
28095
|
return renderEquipment(itemToRender);
|
|
28138
|
-
|
|
28139
28096
|
case shared.ItemContainerType.Inventory:
|
|
28140
28097
|
return renderItem(itemToRender);
|
|
28141
|
-
|
|
28142
28098
|
default:
|
|
28143
28099
|
return renderItem(itemToRender);
|
|
28144
28100
|
}
|
|
28145
28101
|
};
|
|
28146
|
-
|
|
28147
28102
|
return React__default.createElement(Container$9, {
|
|
28148
28103
|
className: "rpgui-icon empty-slot",
|
|
28149
28104
|
onMouseOver: function onMouseOver(event) {
|
|
@@ -28160,10 +28115,8 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
28160
28115
|
},
|
|
28161
28116
|
onClick: function onClick() {
|
|
28162
28117
|
setTooltipVisible(false);
|
|
28163
|
-
|
|
28164
28118
|
if (item) {
|
|
28165
28119
|
setIsContextMenuVisible(!isContextMenuVisible);
|
|
28166
|
-
|
|
28167
28120
|
_onClick(item.type, containerType, item);
|
|
28168
28121
|
}
|
|
28169
28122
|
}
|
|
@@ -28171,7 +28124,6 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
28171
28124
|
options: contextActions,
|
|
28172
28125
|
onSelected: function onSelected(optionId) {
|
|
28173
28126
|
setIsContextMenuVisible(false);
|
|
28174
|
-
|
|
28175
28127
|
if (item) {
|
|
28176
28128
|
_onSelected(optionId, item);
|
|
28177
28129
|
}
|
|
@@ -28196,31 +28148,29 @@ var ItemQty = /*#__PURE__*/styled.span.withConfig({
|
|
|
28196
28148
|
|
|
28197
28149
|
var EquipmentSet = function EquipmentSet(_ref) {
|
|
28198
28150
|
var equipmentSet = _ref.equipmentSet,
|
|
28199
|
-
|
|
28200
|
-
|
|
28201
|
-
|
|
28202
|
-
|
|
28203
|
-
|
|
28204
|
-
|
|
28151
|
+
onClose = _ref.onClose,
|
|
28152
|
+
_onMouseOver = _ref.onMouseOver,
|
|
28153
|
+
_onSelected = _ref.onSelected,
|
|
28154
|
+
onItemClick = _ref.onItemClick,
|
|
28155
|
+
atlasIMG = _ref.atlasIMG,
|
|
28156
|
+
atlasJSON = _ref.atlasJSON;
|
|
28205
28157
|
var neck = equipmentSet.neck,
|
|
28206
|
-
|
|
28207
|
-
|
|
28208
|
-
|
|
28209
|
-
|
|
28210
|
-
|
|
28211
|
-
|
|
28212
|
-
|
|
28213
|
-
|
|
28214
|
-
|
|
28158
|
+
leftHand = equipmentSet.leftHand,
|
|
28159
|
+
ring = equipmentSet.ring,
|
|
28160
|
+
head = equipmentSet.head,
|
|
28161
|
+
armor = equipmentSet.armor,
|
|
28162
|
+
legs = equipmentSet.legs,
|
|
28163
|
+
boot = equipmentSet.boot,
|
|
28164
|
+
inventory = equipmentSet.inventory,
|
|
28165
|
+
rightHand = equipmentSet.rightHand,
|
|
28166
|
+
accessory = equipmentSet.accessory;
|
|
28215
28167
|
var equipmentData = [neck, leftHand, ring, head, armor, legs, boot, inventory, rightHand, accessory];
|
|
28216
28168
|
var equipmentMaskSlots = [shared.ItemSlotType.Neck, shared.ItemSlotType.LeftHand, shared.ItemSlotType.Ring, shared.ItemSlotType.Head, shared.ItemSlotType.Torso, shared.ItemSlotType.Legs, shared.ItemSlotType.Feet, shared.ItemSlotType.Inventory, shared.ItemSlotType.RightHand, shared.ItemSlotType.Accessory];
|
|
28217
|
-
|
|
28218
28169
|
var onRenderEquipmentSlotRange = function onRenderEquipmentSlotRange(start, end) {
|
|
28219
28170
|
var equipmentRange = equipmentData.slice(start, end);
|
|
28220
28171
|
var slotMaksRange = equipmentMaskSlots.slice(start, end);
|
|
28221
28172
|
return equipmentRange.map(function (data, i) {
|
|
28222
28173
|
var _ref2;
|
|
28223
|
-
|
|
28224
28174
|
var item = data;
|
|
28225
28175
|
var itemContainer = (_ref2 = item && item.itemContainer) != null ? _ref2 : null;
|
|
28226
28176
|
return React__default.createElement(ItemSlot, {
|
|
@@ -28244,7 +28194,6 @@ var EquipmentSet = function EquipmentSet(_ref) {
|
|
|
28244
28194
|
});
|
|
28245
28195
|
});
|
|
28246
28196
|
};
|
|
28247
|
-
|
|
28248
28197
|
return React__default.createElement(DraggableContainer, {
|
|
28249
28198
|
title: 'Equipments',
|
|
28250
28199
|
type: exports.RPGUIContainerTypes.Framed,
|
|
@@ -28266,127 +28215,6 @@ var EquipmentColumn = /*#__PURE__*/styled.div.withConfig({
|
|
|
28266
28215
|
componentId: "sc-1wuddg2-1"
|
|
28267
28216
|
})(["display:flex;justify-content:center;flex-wrap:wrap;flex-direction:column;"]);
|
|
28268
28217
|
|
|
28269
|
-
var SlotsContainer = function SlotsContainer(_ref) {
|
|
28270
|
-
var children = _ref.children,
|
|
28271
|
-
title = _ref.title,
|
|
28272
|
-
onClose = _ref.onClose,
|
|
28273
|
-
_onPositionChange = _ref.onPositionChange,
|
|
28274
|
-
onOutsideClick = _ref.onOutsideClick;
|
|
28275
|
-
return React__default.createElement(DraggableContainer, {
|
|
28276
|
-
title: title,
|
|
28277
|
-
type: exports.RPGUIContainerTypes.Framed,
|
|
28278
|
-
onCloseButton: function onCloseButton() {
|
|
28279
|
-
if (onClose) {
|
|
28280
|
-
onClose();
|
|
28281
|
-
}
|
|
28282
|
-
},
|
|
28283
|
-
width: "330px",
|
|
28284
|
-
cancelDrag: ".item-container-body",
|
|
28285
|
-
onPositionChange: function onPositionChange(_ref2) {
|
|
28286
|
-
var x = _ref2.x,
|
|
28287
|
-
y = _ref2.y;
|
|
28288
|
-
|
|
28289
|
-
if (_onPositionChange) {
|
|
28290
|
-
_onPositionChange({
|
|
28291
|
-
x: x,
|
|
28292
|
-
y: y
|
|
28293
|
-
});
|
|
28294
|
-
}
|
|
28295
|
-
},
|
|
28296
|
-
onOutsideClick: onOutsideClick
|
|
28297
|
-
}, children);
|
|
28298
|
-
};
|
|
28299
|
-
|
|
28300
|
-
var ItemContainer = function ItemContainer(_ref) {
|
|
28301
|
-
var itemContainer = _ref.itemContainer,
|
|
28302
|
-
onClose = _ref.onClose,
|
|
28303
|
-
_onMouseOver = _ref.onMouseOver,
|
|
28304
|
-
_onSelected = _ref.onSelected,
|
|
28305
|
-
onItemClick = _ref.onItemClick,
|
|
28306
|
-
type = _ref.type,
|
|
28307
|
-
atlasJSON = _ref.atlasJSON,
|
|
28308
|
-
atlasIMG = _ref.atlasIMG;
|
|
28309
|
-
|
|
28310
|
-
var onRenderSlots = function onRenderSlots() {
|
|
28311
|
-
var slots = [];
|
|
28312
|
-
|
|
28313
|
-
for (var i = 0; i < itemContainer.slotQty; i++) {
|
|
28314
|
-
var _itemContainer$slots;
|
|
28315
|
-
|
|
28316
|
-
slots.push(React__default.createElement(ItemSlot, {
|
|
28317
|
-
key: i,
|
|
28318
|
-
slotIndex: i,
|
|
28319
|
-
item: ((_itemContainer$slots = itemContainer.slots) == null ? void 0 : _itemContainer$slots[i]) || null,
|
|
28320
|
-
itemContainerType: type,
|
|
28321
|
-
onMouseOver: function onMouseOver(event, slotIndex, item) {
|
|
28322
|
-
if (_onMouseOver) _onMouseOver(event, slotIndex, item);
|
|
28323
|
-
},
|
|
28324
|
-
onClick: function onClick(ItemType, ContainerType, item) {
|
|
28325
|
-
if (onItemClick) onItemClick(item, ItemType, ContainerType);
|
|
28326
|
-
},
|
|
28327
|
-
onSelected: function onSelected(optionId, item) {
|
|
28328
|
-
if (_onSelected) _onSelected(optionId, item);
|
|
28329
|
-
},
|
|
28330
|
-
atlasIMG: atlasIMG,
|
|
28331
|
-
atlasJSON: atlasJSON
|
|
28332
|
-
}));
|
|
28333
|
-
}
|
|
28334
|
-
|
|
28335
|
-
return slots;
|
|
28336
|
-
};
|
|
28337
|
-
|
|
28338
|
-
return React__default.createElement(SlotsContainer, {
|
|
28339
|
-
title: itemContainer.name || 'Container',
|
|
28340
|
-
onClose: onClose
|
|
28341
|
-
}, React__default.createElement(ItemsContainer, {
|
|
28342
|
-
className: "item-container-body"
|
|
28343
|
-
}, onRenderSlots()));
|
|
28344
|
-
};
|
|
28345
|
-
var ItemsContainer = /*#__PURE__*/styled.div.withConfig({
|
|
28346
|
-
displayName: "ItemContainer__ItemsContainer",
|
|
28347
|
-
componentId: "sc-15y5p9l-0"
|
|
28348
|
-
})(["max-width:280px;display:flex;justify-content:center;flex-wrap:wrap;"]);
|
|
28349
|
-
|
|
28350
|
-
var ListMenu = function ListMenu(_ref) {
|
|
28351
|
-
var options = _ref.options,
|
|
28352
|
-
onSelected = _ref.onSelected,
|
|
28353
|
-
x = _ref.x,
|
|
28354
|
-
y = _ref.y,
|
|
28355
|
-
_ref$fontSize = _ref.fontSize,
|
|
28356
|
-
fontSize = _ref$fontSize === void 0 ? 0.8 : _ref$fontSize;
|
|
28357
|
-
return React__default.createElement(Container$a, {
|
|
28358
|
-
x: x,
|
|
28359
|
-
y: y,
|
|
28360
|
-
fontSize: fontSize
|
|
28361
|
-
}, React__default.createElement("ul", {
|
|
28362
|
-
className: "rpgui-list-imp",
|
|
28363
|
-
style: {
|
|
28364
|
-
overflow: 'hidden'
|
|
28365
|
-
}
|
|
28366
|
-
}, options.map(function (params, index) {
|
|
28367
|
-
return React__default.createElement(ListElement$1, {
|
|
28368
|
-
key: (params == null ? void 0 : params.id) || index,
|
|
28369
|
-
onClick: function onClick() {
|
|
28370
|
-
onSelected(params == null ? void 0 : params.id);
|
|
28371
|
-
}
|
|
28372
|
-
}, (params == null ? void 0 : params.text) || 'No text');
|
|
28373
|
-
})));
|
|
28374
|
-
};
|
|
28375
|
-
var Container$a = /*#__PURE__*/styled.div.withConfig({
|
|
28376
|
-
displayName: "ListMenu__Container",
|
|
28377
|
-
componentId: "sc-i9097t-0"
|
|
28378
|
-
})(["display:flex;flex-direction:column;width:100%;justify-content:start;align-items:flex-start;position:absolute;top:", "px;left:", "px;li{font-size:", "em;}"], function (props) {
|
|
28379
|
-
return props.y || 0;
|
|
28380
|
-
}, function (props) {
|
|
28381
|
-
return props.x || 0;
|
|
28382
|
-
}, function (props) {
|
|
28383
|
-
return props.fontSize;
|
|
28384
|
-
});
|
|
28385
|
-
var ListElement$1 = /*#__PURE__*/styled.li.withConfig({
|
|
28386
|
-
displayName: "ListMenu__ListElement",
|
|
28387
|
-
componentId: "sc-i9097t-1"
|
|
28388
|
-
})(["margin-right:0.5rem;"]);
|
|
28389
|
-
|
|
28390
28218
|
var img$6 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAP1BMVEUAAAA7FyVxQTsUEBPj5v////+5v/tCJDOOUlIiHBr1oJfptaO6dWr61rhzFy1bMTjoanMUNGQoXMQkn97+88DQ3IhAAAAAAXRSTlMAQObYZgAAAAFiS0dEBfhv6ccAAAAHdElNRQfmAw4VOBC7c5LYAAABM0lEQVQ4y3XRi5KDIAwFUAUkbrBgpP//rZsHVHQ009qZ3tPboNN0zmwzvcw8O5sX4y0NOg/Et3jRCXF+ziULorjkOQ9gE24dvuUAzq08DiCO4pe3WN7zCP56vmpubBReQYC11YPS86ySxxCsAABTSgjb5m4g8nfbxvFHBkH2OEEvAItVuCuIsgGgl+Gcr7kDXxhEAx55A2SQEEeQeZwUaIP8Tbo05B0RFPhItAjgj1w6cDnhLluDj+Egkh3pCCP4pKQAw1IPO0W9Nti5gW9RP2dKA3BZd2Dw+baYX+Nt4GM00O4S3kEpF6Alb2Bv4LeC3kkGfAW0/p0RPoJVKr63ghHsKuRh5DIUKOAlGOwrtt9fQekAEfmhZslHUDoglB0zjfkJigN7UnTQQ4GBWomoVhEN/AOPSBh38gy+fwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wMy0xNFQyMTo1NTo1MSswMDowMJcc0eEAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDMtMTRUMjE6NTU6NTErMDA6MDDmQWldAAAAAElFTkSuQmCC';
|
|
28391
28219
|
|
|
28392
28220
|
var img$7 = 'data:image/gif;base64,R0lGODlhQAAgAPIAAAAAAA0NDRERESIiIigoKFlZWf///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtJbWFnZU1hZ2ljaw5nYW1tYT0wLjQ1NDU0NQAh+QQBFAAAACwAAAAAQAAgAAAD/wi63P4wykmrvTjrzbv/YAgIZGmeaKquakQWcCzPdG3fNukIeO//PQGDBywafcIF8chswpKKZcxApTqvNOiIZi0YsODncFaFlcNOrdTbJVff0/c3Lp/Xs2N37cy2ndt6ZnhKXHdsc4d7VnwyfIxqPWWOXXWLgHSGYoSNbZKVZp2WiJyjg1GFcaClqaqJhasyUAFrh3Cur3KqubWXBQIBAAEDtDeMaEEDAcLEx2gCycvN0jHPysPT09XR2M3a19zH3gTM4EYCBNDD4yzs7e4r48nB6gT19vf4+fr7/P3P8sKGvRtIkMUAeQoCHlzIsKHDhxAjSoTWQJnFixgzatzIsQWjRQYJAAAh/wtJbWFnZU1hZ2ljaw5nYW1tYT0wLjQ1NDU0NQAh+QQBFAAAACwAAAAAQAAgAAAD8Ai63P4wykmrvTjrzbv/YCiOlGCeaKqubMtGZiHPdG3feI6bjqD/wOBPwPAJj0ggcWFMOp+ypaI5M1it0KxNCqDKsAWDdhwt1q5fMPnJ9aJt17g4HafJ3/et+Tzn99V+aThqfTNtcHlhhIBVWG+BdDSHOmiPeHdij3aYhZONf46YkZGanzpSAV6KjaOIpqWtNwIBAAEDqqKKhZuJnHSwAgMBtqo5sGs5wcO3yM01ysTO0gXQzNPN1cXXUNnbyNna3kcmwrW3Lujp6ugD5bbn6/HyLe20Cu/t+fr7/P3+/wCF2VswrKDBgwgTKlzIsCCDBAA7';
|
|
@@ -28397,13 +28225,11 @@ var chunkString = function chunkString(str, length) {
|
|
|
28397
28225
|
|
|
28398
28226
|
var DynamicText = function DynamicText(_ref) {
|
|
28399
28227
|
var text = _ref.text,
|
|
28400
|
-
|
|
28401
|
-
|
|
28402
|
-
|
|
28228
|
+
onFinish = _ref.onFinish,
|
|
28229
|
+
onStart = _ref.onStart;
|
|
28403
28230
|
var _useState = React.useState(''),
|
|
28404
|
-
|
|
28405
|
-
|
|
28406
|
-
|
|
28231
|
+
textState = _useState[0],
|
|
28232
|
+
setTextState = _useState[1];
|
|
28407
28233
|
React.useEffect(function () {
|
|
28408
28234
|
var i = 0;
|
|
28409
28235
|
var interval = setInterval(function () {
|
|
@@ -28413,13 +28239,11 @@ var DynamicText = function DynamicText(_ref) {
|
|
|
28413
28239
|
onStart();
|
|
28414
28240
|
}
|
|
28415
28241
|
}
|
|
28416
|
-
|
|
28417
28242
|
if (i < text.length) {
|
|
28418
28243
|
setTextState(text.substring(0, i + 1));
|
|
28419
28244
|
i++;
|
|
28420
28245
|
} else {
|
|
28421
28246
|
clearInterval(interval);
|
|
28422
|
-
|
|
28423
28247
|
if (onFinish) {
|
|
28424
28248
|
onFinish();
|
|
28425
28249
|
}
|
|
@@ -28438,19 +28262,16 @@ var TextContainer = /*#__PURE__*/styled.p.withConfig({
|
|
|
28438
28262
|
|
|
28439
28263
|
var NPCDialogText = function NPCDialogText(_ref) {
|
|
28440
28264
|
var text = _ref.text,
|
|
28441
|
-
|
|
28442
|
-
|
|
28443
|
-
|
|
28265
|
+
onClose = _ref.onClose,
|
|
28266
|
+
onEndStep = _ref.onEndStep,
|
|
28267
|
+
onStartStep = _ref.onStartStep;
|
|
28444
28268
|
var textChunks = chunkString(text, 85);
|
|
28445
|
-
|
|
28446
28269
|
var _useState = React.useState(0),
|
|
28447
|
-
|
|
28448
|
-
|
|
28449
|
-
|
|
28270
|
+
chunkIndex = _useState[0],
|
|
28271
|
+
setChunkIndex = _useState[1];
|
|
28450
28272
|
var onHandleSpacePress = function onHandleSpacePress(event) {
|
|
28451
28273
|
if (event.code === 'Space') {
|
|
28452
28274
|
var hasNextChunk = (textChunks == null ? void 0 : textChunks[chunkIndex + 1]) || false;
|
|
28453
|
-
|
|
28454
28275
|
if (hasNextChunk) {
|
|
28455
28276
|
setChunkIndex(function (prev) {
|
|
28456
28277
|
return prev + 1;
|
|
@@ -28461,29 +28282,28 @@ var NPCDialogText = function NPCDialogText(_ref) {
|
|
|
28461
28282
|
}
|
|
28462
28283
|
}
|
|
28463
28284
|
};
|
|
28464
|
-
|
|
28465
28285
|
React.useEffect(function () {
|
|
28466
28286
|
document.addEventListener('keydown', onHandleSpacePress);
|
|
28467
28287
|
return function () {
|
|
28468
28288
|
return document.removeEventListener('keydown', onHandleSpacePress);
|
|
28469
28289
|
};
|
|
28470
28290
|
}, [chunkIndex]);
|
|
28471
|
-
return React__default.createElement(Container$
|
|
28291
|
+
return React__default.createElement(Container$a, null, React__default.createElement(DynamicText, {
|
|
28472
28292
|
text: (textChunks == null ? void 0 : textChunks[chunkIndex]) || '',
|
|
28473
28293
|
onFinish: onEndStep,
|
|
28474
28294
|
onStart: onStartStep
|
|
28475
28295
|
}));
|
|
28476
28296
|
};
|
|
28477
|
-
var Container$
|
|
28297
|
+
var Container$a = /*#__PURE__*/styled.div.withConfig({
|
|
28478
28298
|
displayName: "NPCDialogText__Container",
|
|
28479
28299
|
componentId: "sc-1cxkdh9-0"
|
|
28480
28300
|
})([""]);
|
|
28481
28301
|
|
|
28302
|
+
//@ts-ignore
|
|
28482
28303
|
var useEventListener = function useEventListener(type, handler, el) {
|
|
28483
28304
|
if (el === void 0) {
|
|
28484
28305
|
el = window;
|
|
28485
28306
|
}
|
|
28486
|
-
|
|
28487
28307
|
var savedHandler = React__default.useRef();
|
|
28488
28308
|
React__default.useEffect(function () {
|
|
28489
28309
|
savedHandler.current = handler;
|
|
@@ -28493,7 +28313,6 @@ var useEventListener = function useEventListener(type, handler, el) {
|
|
|
28493
28313
|
var listener = function listener(e) {
|
|
28494
28314
|
return savedHandler.current(e);
|
|
28495
28315
|
};
|
|
28496
|
-
|
|
28497
28316
|
el.addEventListener(type, listener);
|
|
28498
28317
|
return function () {
|
|
28499
28318
|
el.removeEventListener(type, listener);
|
|
@@ -28503,36 +28322,29 @@ var useEventListener = function useEventListener(type, handler, el) {
|
|
|
28503
28322
|
|
|
28504
28323
|
var QuestionDialog = function QuestionDialog(_ref) {
|
|
28505
28324
|
var questions = _ref.questions,
|
|
28506
|
-
|
|
28507
|
-
|
|
28508
|
-
|
|
28325
|
+
answers = _ref.answers,
|
|
28326
|
+
onClose = _ref.onClose;
|
|
28509
28327
|
var _useState = React.useState(questions[0]),
|
|
28510
|
-
|
|
28511
|
-
|
|
28512
|
-
|
|
28328
|
+
currentQuestion = _useState[0],
|
|
28329
|
+
setCurrentQuestion = _useState[1];
|
|
28513
28330
|
var _useState2 = React.useState(false),
|
|
28514
|
-
|
|
28515
|
-
|
|
28516
|
-
|
|
28331
|
+
canShowAnswers = _useState2[0],
|
|
28332
|
+
setCanShowAnswers = _useState2[1];
|
|
28517
28333
|
var onGetFirstAnswer = function onGetFirstAnswer() {
|
|
28518
28334
|
if (!currentQuestion.answerIds || currentQuestion.answerIds.length === 0) {
|
|
28519
28335
|
return null;
|
|
28520
28336
|
}
|
|
28521
|
-
|
|
28522
28337
|
var firstAnswerId = currentQuestion.answerIds[0];
|
|
28523
28338
|
return answers.find(function (answer) {
|
|
28524
28339
|
return answer.id === firstAnswerId;
|
|
28525
28340
|
});
|
|
28526
28341
|
};
|
|
28527
|
-
|
|
28528
28342
|
var _useState3 = React.useState(onGetFirstAnswer()),
|
|
28529
|
-
|
|
28530
|
-
|
|
28531
|
-
|
|
28343
|
+
currentAnswer = _useState3[0],
|
|
28344
|
+
setCurrentAnswer = _useState3[1];
|
|
28532
28345
|
React.useEffect(function () {
|
|
28533
28346
|
setCurrentAnswer(onGetFirstAnswer());
|
|
28534
28347
|
}, [currentQuestion]);
|
|
28535
|
-
|
|
28536
28348
|
var onGetAnswers = function onGetAnswers(answerIds) {
|
|
28537
28349
|
return answerIds.map(function (answerId) {
|
|
28538
28350
|
return answers.find(function (answer) {
|
|
@@ -28540,7 +28352,6 @@ var QuestionDialog = function QuestionDialog(_ref) {
|
|
|
28540
28352
|
});
|
|
28541
28353
|
});
|
|
28542
28354
|
};
|
|
28543
|
-
|
|
28544
28355
|
var onKeyPress = function onKeyPress(e) {
|
|
28545
28356
|
switch (e.key) {
|
|
28546
28357
|
case 'ArrowDown':
|
|
@@ -28558,7 +28369,6 @@ var QuestionDialog = function QuestionDialog(_ref) {
|
|
|
28558
28369
|
});
|
|
28559
28370
|
setCurrentAnswer(nextAnswer || onGetFirstAnswer());
|
|
28560
28371
|
break;
|
|
28561
|
-
|
|
28562
28372
|
case 'ArrowUp':
|
|
28563
28373
|
// select previous answer, if any.
|
|
28564
28374
|
// if no previous answer, select last answer
|
|
@@ -28569,18 +28379,14 @@ var QuestionDialog = function QuestionDialog(_ref) {
|
|
|
28569
28379
|
var previousAnswer = onGetAnswers(currentQuestion.answerIds).find(function (answer) {
|
|
28570
28380
|
return (answer == null ? void 0 : answer.id) === previousAnswerID;
|
|
28571
28381
|
});
|
|
28572
|
-
|
|
28573
28382
|
if (previousAnswer) {
|
|
28574
28383
|
setCurrentAnswer(previousAnswer);
|
|
28575
28384
|
} else {
|
|
28576
28385
|
setCurrentAnswer(onGetAnswers(currentQuestion.answerIds).pop());
|
|
28577
28386
|
}
|
|
28578
|
-
|
|
28579
28387
|
break;
|
|
28580
|
-
|
|
28581
28388
|
case 'Enter':
|
|
28582
28389
|
setCanShowAnswers(false);
|
|
28583
|
-
|
|
28584
28390
|
if (!(currentAnswer != null && currentAnswer.nextQuestionId)) {
|
|
28585
28391
|
onClose();
|
|
28586
28392
|
return;
|
|
@@ -28589,16 +28395,12 @@ var QuestionDialog = function QuestionDialog(_ref) {
|
|
|
28589
28395
|
return question.id === currentAnswer.nextQuestionId;
|
|
28590
28396
|
}));
|
|
28591
28397
|
}
|
|
28592
|
-
|
|
28593
28398
|
break;
|
|
28594
28399
|
}
|
|
28595
28400
|
};
|
|
28596
|
-
|
|
28597
28401
|
useEventListener('keydown', onKeyPress);
|
|
28598
|
-
|
|
28599
28402
|
var onAnswerClick = function onAnswerClick(answer) {
|
|
28600
28403
|
setCanShowAnswers(false);
|
|
28601
|
-
|
|
28602
28404
|
if (answer.nextQuestionId) {
|
|
28603
28405
|
// if there is a next question, go to it
|
|
28604
28406
|
setCurrentQuestion(questions.find(function (question) {
|
|
@@ -28609,24 +28411,18 @@ var QuestionDialog = function QuestionDialog(_ref) {
|
|
|
28609
28411
|
onClose();
|
|
28610
28412
|
}
|
|
28611
28413
|
};
|
|
28612
|
-
|
|
28613
28414
|
var onRenderCurrentAnswers = function onRenderCurrentAnswers() {
|
|
28614
28415
|
var answerIds = currentQuestion.answerIds;
|
|
28615
|
-
|
|
28616
28416
|
if (!answerIds) {
|
|
28617
28417
|
return null;
|
|
28618
28418
|
}
|
|
28619
|
-
|
|
28620
28419
|
var answers = onGetAnswers(answerIds);
|
|
28621
|
-
|
|
28622
28420
|
if (!answers) {
|
|
28623
28421
|
return null;
|
|
28624
28422
|
}
|
|
28625
|
-
|
|
28626
28423
|
return answers.map(function (answer) {
|
|
28627
28424
|
var isSelected = (currentAnswer == null ? void 0 : currentAnswer.id) === (answer == null ? void 0 : answer.id);
|
|
28628
28425
|
var selectedColor = isSelected ? 'yellow' : 'white';
|
|
28629
|
-
|
|
28630
28426
|
if (answer) {
|
|
28631
28427
|
return React__default.createElement(AnswerRow, {
|
|
28632
28428
|
key: "answer_" + answer.id
|
|
@@ -28640,12 +28436,10 @@ var QuestionDialog = function QuestionDialog(_ref) {
|
|
|
28640
28436
|
color: selectedColor
|
|
28641
28437
|
}, answer.text));
|
|
28642
28438
|
}
|
|
28643
|
-
|
|
28644
28439
|
return null;
|
|
28645
28440
|
});
|
|
28646
28441
|
};
|
|
28647
|
-
|
|
28648
|
-
return React__default.createElement(Container$c, null, React__default.createElement(QuestionContainer, null, React__default.createElement(DynamicText, {
|
|
28442
|
+
return React__default.createElement(Container$b, null, React__default.createElement(QuestionContainer, null, React__default.createElement(DynamicText, {
|
|
28649
28443
|
text: currentQuestion.text,
|
|
28650
28444
|
onStart: function onStart() {
|
|
28651
28445
|
return setCanShowAnswers(false);
|
|
@@ -28655,7 +28449,7 @@ var QuestionDialog = function QuestionDialog(_ref) {
|
|
|
28655
28449
|
}
|
|
28656
28450
|
})), canShowAnswers && React__default.createElement(AnswersContainer, null, onRenderCurrentAnswers()));
|
|
28657
28451
|
};
|
|
28658
|
-
var Container$
|
|
28452
|
+
var Container$b = /*#__PURE__*/styled.div.withConfig({
|
|
28659
28453
|
displayName: "QuestionDialog__Container",
|
|
28660
28454
|
componentId: "sc-bxc5u0-0"
|
|
28661
28455
|
})(["display:flex;word-break:break-all;box-sizing:border-box;justify-content:flex-start;align-items:flex-start;flex-wrap:wrap;"]);
|
|
@@ -28688,21 +28482,18 @@ var AnswerRow = /*#__PURE__*/styled.div.withConfig({
|
|
|
28688
28482
|
NPCDialogType["TextOnly"] = "TextOnly";
|
|
28689
28483
|
NPCDialogType["TextAndThumbnail"] = "TextAndThumbnail";
|
|
28690
28484
|
})(exports.NPCDialogType || (exports.NPCDialogType = {}));
|
|
28691
|
-
|
|
28692
28485
|
var NPCDialog = function NPCDialog(_ref) {
|
|
28693
28486
|
var text = _ref.text,
|
|
28694
|
-
|
|
28695
|
-
|
|
28696
|
-
|
|
28697
|
-
|
|
28698
|
-
|
|
28699
|
-
|
|
28700
|
-
|
|
28701
|
-
|
|
28487
|
+
type = _ref.type,
|
|
28488
|
+
_onClose = _ref.onClose,
|
|
28489
|
+
imagePath = _ref.imagePath,
|
|
28490
|
+
_ref$isQuestionDialog = _ref.isQuestionDialog,
|
|
28491
|
+
isQuestionDialog = _ref$isQuestionDialog === void 0 ? false : _ref$isQuestionDialog,
|
|
28492
|
+
questions = _ref.questions,
|
|
28493
|
+
answers = _ref.answers;
|
|
28702
28494
|
var _useState = React.useState(false),
|
|
28703
|
-
|
|
28704
|
-
|
|
28705
|
-
|
|
28495
|
+
showGoNextIndicator = _useState[0],
|
|
28496
|
+
setShowGoNextIndicator = _useState[1];
|
|
28706
28497
|
return React__default.createElement(RPGUIContainer, {
|
|
28707
28498
|
type: exports.RPGUIContainerTypes.FramedGold,
|
|
28708
28499
|
width: isQuestionDialog ? '600px' : '50%',
|
|
@@ -28719,7 +28510,7 @@ var NPCDialog = function NPCDialog(_ref) {
|
|
|
28719
28510
|
}
|
|
28720
28511
|
})), type === exports.NPCDialogType.TextAndThumbnail && React__default.createElement(ThumbnailContainer, null, React__default.createElement(NPCThumbnail, {
|
|
28721
28512
|
src: imagePath || img$6
|
|
28722
|
-
}))) : React__default.createElement(React__default.Fragment, null, React__default.createElement(Container$
|
|
28513
|
+
}))) : React__default.createElement(React__default.Fragment, null, React__default.createElement(Container$c, null, React__default.createElement(TextContainer$1, {
|
|
28723
28514
|
flex: type === exports.NPCDialogType.TextAndThumbnail ? '70%' : '100%'
|
|
28724
28515
|
}, React__default.createElement(NPCDialogText, {
|
|
28725
28516
|
onStartStep: function onStartStep() {
|
|
@@ -28741,7 +28532,7 @@ var NPCDialog = function NPCDialog(_ref) {
|
|
|
28741
28532
|
src: img$7
|
|
28742
28533
|
})));
|
|
28743
28534
|
};
|
|
28744
|
-
var Container$
|
|
28535
|
+
var Container$c = /*#__PURE__*/styled.div.withConfig({
|
|
28745
28536
|
displayName: "NPCDialog__Container",
|
|
28746
28537
|
componentId: "sc-1b4aw74-0"
|
|
28747
28538
|
})(["display:flex;width:100%;height:100%;box-sizing:border-box;justify-content:center;align-items:flex-start;position:relative;"]);
|
|
@@ -28768,27 +28559,308 @@ var PressSpaceIndicator = /*#__PURE__*/styled.img.withConfig({
|
|
|
28768
28559
|
return right;
|
|
28769
28560
|
});
|
|
28770
28561
|
|
|
28562
|
+
(function (ImgSide) {
|
|
28563
|
+
ImgSide["right"] = "right";
|
|
28564
|
+
ImgSide["left"] = "left";
|
|
28565
|
+
})(exports.ImgSide || (exports.ImgSide = {}));
|
|
28566
|
+
var NPCMultiDialog = function NPCMultiDialog(_ref) {
|
|
28567
|
+
var _textAndTypeArray$sli;
|
|
28568
|
+
var _onClose = _ref.onClose,
|
|
28569
|
+
textAndTypeArray = _ref.textAndTypeArray;
|
|
28570
|
+
var _useState = React.useState(false),
|
|
28571
|
+
showGoNextIndicator = _useState[0],
|
|
28572
|
+
setShowGoNextIndicator = _useState[1];
|
|
28573
|
+
var _useState2 = React.useState(0),
|
|
28574
|
+
slide = _useState2[0],
|
|
28575
|
+
setSlide = _useState2[1];
|
|
28576
|
+
var onHandleSpacePress = function onHandleSpacePress(event) {
|
|
28577
|
+
if (event.code === 'Space') {
|
|
28578
|
+
if (slide < (textAndTypeArray == null ? void 0 : textAndTypeArray.length) - 1) {
|
|
28579
|
+
setSlide(function (prev) {
|
|
28580
|
+
return prev + 1;
|
|
28581
|
+
});
|
|
28582
|
+
} else {
|
|
28583
|
+
// if there's no more text chunks, close the dialog
|
|
28584
|
+
_onClose();
|
|
28585
|
+
}
|
|
28586
|
+
}
|
|
28587
|
+
};
|
|
28588
|
+
React.useEffect(function () {
|
|
28589
|
+
document.addEventListener('keydown', onHandleSpacePress);
|
|
28590
|
+
return function () {
|
|
28591
|
+
return document.removeEventListener('keydown', onHandleSpacePress);
|
|
28592
|
+
};
|
|
28593
|
+
}, [slide]);
|
|
28594
|
+
return React__default.createElement(RPGUIContainer, {
|
|
28595
|
+
type: exports.RPGUIContainerTypes.FramedGold,
|
|
28596
|
+
width: '50%',
|
|
28597
|
+
height: '180px'
|
|
28598
|
+
}, React__default.createElement(React__default.Fragment, null, React__default.createElement(Container$d, null, ((_textAndTypeArray$sli = textAndTypeArray[slide]) == null ? void 0 : _textAndTypeArray$sli.imageSide) === 'right' && React__default.createElement(React__default.Fragment, null, React__default.createElement(TextContainer$2, {
|
|
28599
|
+
flex: '70%'
|
|
28600
|
+
}, React__default.createElement(NPCDialogText, {
|
|
28601
|
+
onStartStep: function onStartStep() {
|
|
28602
|
+
return setShowGoNextIndicator(false);
|
|
28603
|
+
},
|
|
28604
|
+
onEndStep: function onEndStep() {
|
|
28605
|
+
return setShowGoNextIndicator(true);
|
|
28606
|
+
},
|
|
28607
|
+
text: textAndTypeArray[slide].text || 'No text provided.',
|
|
28608
|
+
onClose: function onClose() {
|
|
28609
|
+
if (_onClose) {
|
|
28610
|
+
_onClose();
|
|
28611
|
+
}
|
|
28612
|
+
}
|
|
28613
|
+
})), React__default.createElement(ThumbnailContainer$1, null, React__default.createElement(NPCThumbnail$1, {
|
|
28614
|
+
src: textAndTypeArray[slide].imagePath || img$6
|
|
28615
|
+
})), showGoNextIndicator && React__default.createElement(PressSpaceIndicator$1, {
|
|
28616
|
+
right: '10.5rem',
|
|
28617
|
+
src: img$7
|
|
28618
|
+
})), textAndTypeArray[slide].imageSide === 'left' && React__default.createElement(React__default.Fragment, null, React__default.createElement(ThumbnailContainer$1, null, React__default.createElement(NPCThumbnail$1, {
|
|
28619
|
+
src: textAndTypeArray[slide].imagePath || img$6
|
|
28620
|
+
})), React__default.createElement(TextContainer$2, {
|
|
28621
|
+
flex: '70%'
|
|
28622
|
+
}, React__default.createElement(NPCDialogText, {
|
|
28623
|
+
onStartStep: function onStartStep() {
|
|
28624
|
+
return setShowGoNextIndicator(false);
|
|
28625
|
+
},
|
|
28626
|
+
onEndStep: function onEndStep() {
|
|
28627
|
+
return setShowGoNextIndicator(true);
|
|
28628
|
+
},
|
|
28629
|
+
text: textAndTypeArray[slide].text || 'No text provided.',
|
|
28630
|
+
onClose: function onClose() {
|
|
28631
|
+
if (_onClose) {
|
|
28632
|
+
_onClose();
|
|
28633
|
+
}
|
|
28634
|
+
}
|
|
28635
|
+
})), showGoNextIndicator && React__default.createElement(PressSpaceIndicator$1, {
|
|
28636
|
+
right: '1rem',
|
|
28637
|
+
src: img$7
|
|
28638
|
+
}))), ")"));
|
|
28639
|
+
};
|
|
28640
|
+
var Container$d = /*#__PURE__*/styled.div.withConfig({
|
|
28641
|
+
displayName: "NPCMultiDialog__Container",
|
|
28642
|
+
componentId: "sc-rvu5wg-0"
|
|
28643
|
+
})(["display:flex;width:100%;height:100%;box-sizing:border-box;justify-content:center;align-items:flex-start;position:relative;"]);
|
|
28644
|
+
var TextContainer$2 = /*#__PURE__*/styled.div.withConfig({
|
|
28645
|
+
displayName: "NPCMultiDialog__TextContainer",
|
|
28646
|
+
componentId: "sc-rvu5wg-1"
|
|
28647
|
+
})(["flex:", " 0 0;width:355px;"], function (_ref2) {
|
|
28648
|
+
var flex = _ref2.flex;
|
|
28649
|
+
return flex;
|
|
28650
|
+
});
|
|
28651
|
+
var ThumbnailContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
28652
|
+
displayName: "NPCMultiDialog__ThumbnailContainer",
|
|
28653
|
+
componentId: "sc-rvu5wg-2"
|
|
28654
|
+
})(["flex:30% 0 0;display:flex;justify-content:flex-end;"]);
|
|
28655
|
+
var NPCThumbnail$1 = /*#__PURE__*/styled.img.withConfig({
|
|
28656
|
+
displayName: "NPCMultiDialog__NPCThumbnail",
|
|
28657
|
+
componentId: "sc-rvu5wg-3"
|
|
28658
|
+
})(["image-rendering:pixelated;height:128px;width:128px;"]);
|
|
28659
|
+
var PressSpaceIndicator$1 = /*#__PURE__*/styled.img.withConfig({
|
|
28660
|
+
displayName: "NPCMultiDialog__PressSpaceIndicator",
|
|
28661
|
+
componentId: "sc-rvu5wg-4"
|
|
28662
|
+
})(["position:absolute;right:", ";bottom:1rem;height:20.7px;image-rendering:-webkit-optimize-contrast;"], function (_ref3) {
|
|
28663
|
+
var right = _ref3.right;
|
|
28664
|
+
return right;
|
|
28665
|
+
});
|
|
28666
|
+
|
|
28667
|
+
var HistoryDialog = function HistoryDialog(_ref) {
|
|
28668
|
+
var backgroundImgPath = _ref.backgroundImgPath,
|
|
28669
|
+
fullCoverBackground = _ref.fullCoverBackground,
|
|
28670
|
+
questions = _ref.questions,
|
|
28671
|
+
answers = _ref.answers,
|
|
28672
|
+
text = _ref.text,
|
|
28673
|
+
imagePath = _ref.imagePath,
|
|
28674
|
+
textAndTypeArray = _ref.textAndTypeArray,
|
|
28675
|
+
onClose = _ref.onClose;
|
|
28676
|
+
var _useState = React.useState(0),
|
|
28677
|
+
img = _useState[0],
|
|
28678
|
+
setImage = _useState[1];
|
|
28679
|
+
var onHandleSpacePress = function onHandleSpacePress(event) {
|
|
28680
|
+
if (event.code === 'Space') {
|
|
28681
|
+
if (img < (backgroundImgPath == null ? void 0 : backgroundImgPath.length) - 1) {
|
|
28682
|
+
setImage(function (prev) {
|
|
28683
|
+
return prev + 1;
|
|
28684
|
+
});
|
|
28685
|
+
} else {
|
|
28686
|
+
// if there's no more text chunks, close the dialog
|
|
28687
|
+
onClose();
|
|
28688
|
+
}
|
|
28689
|
+
}
|
|
28690
|
+
};
|
|
28691
|
+
React.useEffect(function () {
|
|
28692
|
+
document.addEventListener('keydown', onHandleSpacePress);
|
|
28693
|
+
return function () {
|
|
28694
|
+
return document.removeEventListener('keydown', onHandleSpacePress);
|
|
28695
|
+
};
|
|
28696
|
+
}, [backgroundImgPath]);
|
|
28697
|
+
return React__default.createElement(BackgroundContainer, {
|
|
28698
|
+
imgPath: backgroundImgPath[img],
|
|
28699
|
+
fullImg: fullCoverBackground
|
|
28700
|
+
}, React__default.createElement(DialogContainer, null, textAndTypeArray ? React__default.createElement(NPCMultiDialog, {
|
|
28701
|
+
textAndTypeArray: textAndTypeArray,
|
|
28702
|
+
onClose: onClose
|
|
28703
|
+
}) : questions && answers ? React__default.createElement(QuestionDialog, {
|
|
28704
|
+
questions: questions,
|
|
28705
|
+
answers: answers,
|
|
28706
|
+
onClose: onClose
|
|
28707
|
+
}) : text && imagePath ? React__default.createElement(NPCDialog, {
|
|
28708
|
+
text: text,
|
|
28709
|
+
imagePath: imagePath,
|
|
28710
|
+
onClose: onClose,
|
|
28711
|
+
type: exports.NPCDialogType.TextAndThumbnail
|
|
28712
|
+
}) : React__default.createElement(NPCDialog, {
|
|
28713
|
+
text: text,
|
|
28714
|
+
onClose: onClose,
|
|
28715
|
+
type: exports.NPCDialogType.TextOnly
|
|
28716
|
+
})));
|
|
28717
|
+
};
|
|
28718
|
+
var BackgroundContainer = /*#__PURE__*/styled.div.withConfig({
|
|
28719
|
+
displayName: "HistoryDialog__BackgroundContainer",
|
|
28720
|
+
componentId: "sc-u6oe75-0"
|
|
28721
|
+
})(["width:100%;height:100%;background-image:url(", ");background-size:", ";display:flex;justify-content:space-evenly;align-items:center;"], function (props) {
|
|
28722
|
+
return props.imgPath;
|
|
28723
|
+
}, function (props) {
|
|
28724
|
+
return props.imgPath ? 'cover' : 'auto';
|
|
28725
|
+
});
|
|
28726
|
+
var DialogContainer = /*#__PURE__*/styled.div.withConfig({
|
|
28727
|
+
displayName: "HistoryDialog__DialogContainer",
|
|
28728
|
+
componentId: "sc-u6oe75-1"
|
|
28729
|
+
})(["display:flex;justify-content:center;padding-top:200px;"]);
|
|
28730
|
+
|
|
28731
|
+
var SlotsContainer = function SlotsContainer(_ref) {
|
|
28732
|
+
var children = _ref.children,
|
|
28733
|
+
title = _ref.title,
|
|
28734
|
+
onClose = _ref.onClose,
|
|
28735
|
+
_onPositionChange = _ref.onPositionChange,
|
|
28736
|
+
onOutsideClick = _ref.onOutsideClick;
|
|
28737
|
+
return React__default.createElement(DraggableContainer, {
|
|
28738
|
+
title: title,
|
|
28739
|
+
type: exports.RPGUIContainerTypes.Framed,
|
|
28740
|
+
onCloseButton: function onCloseButton() {
|
|
28741
|
+
if (onClose) {
|
|
28742
|
+
onClose();
|
|
28743
|
+
}
|
|
28744
|
+
},
|
|
28745
|
+
width: "330px",
|
|
28746
|
+
cancelDrag: ".item-container-body",
|
|
28747
|
+
onPositionChange: function onPositionChange(_ref2) {
|
|
28748
|
+
var x = _ref2.x,
|
|
28749
|
+
y = _ref2.y;
|
|
28750
|
+
if (_onPositionChange) {
|
|
28751
|
+
_onPositionChange({
|
|
28752
|
+
x: x,
|
|
28753
|
+
y: y
|
|
28754
|
+
});
|
|
28755
|
+
}
|
|
28756
|
+
},
|
|
28757
|
+
onOutsideClick: onOutsideClick
|
|
28758
|
+
}, children);
|
|
28759
|
+
};
|
|
28760
|
+
|
|
28761
|
+
var ItemContainer = function ItemContainer(_ref) {
|
|
28762
|
+
var itemContainer = _ref.itemContainer,
|
|
28763
|
+
onClose = _ref.onClose,
|
|
28764
|
+
_onMouseOver = _ref.onMouseOver,
|
|
28765
|
+
_onSelected = _ref.onSelected,
|
|
28766
|
+
onItemClick = _ref.onItemClick,
|
|
28767
|
+
type = _ref.type,
|
|
28768
|
+
atlasJSON = _ref.atlasJSON,
|
|
28769
|
+
atlasIMG = _ref.atlasIMG;
|
|
28770
|
+
var onRenderSlots = function onRenderSlots() {
|
|
28771
|
+
var slots = [];
|
|
28772
|
+
for (var i = 0; i < itemContainer.slotQty; i++) {
|
|
28773
|
+
var _itemContainer$slots;
|
|
28774
|
+
slots.push(React__default.createElement(ItemSlot, {
|
|
28775
|
+
key: i,
|
|
28776
|
+
slotIndex: i,
|
|
28777
|
+
item: ((_itemContainer$slots = itemContainer.slots) == null ? void 0 : _itemContainer$slots[i]) || null,
|
|
28778
|
+
itemContainerType: type,
|
|
28779
|
+
onMouseOver: function onMouseOver(event, slotIndex, item) {
|
|
28780
|
+
if (_onMouseOver) _onMouseOver(event, slotIndex, item);
|
|
28781
|
+
},
|
|
28782
|
+
onClick: function onClick(ItemType, ContainerType, item) {
|
|
28783
|
+
if (onItemClick) onItemClick(item, ItemType, ContainerType);
|
|
28784
|
+
},
|
|
28785
|
+
onSelected: function onSelected(optionId, item) {
|
|
28786
|
+
if (_onSelected) _onSelected(optionId, item);
|
|
28787
|
+
},
|
|
28788
|
+
atlasIMG: atlasIMG,
|
|
28789
|
+
atlasJSON: atlasJSON
|
|
28790
|
+
}));
|
|
28791
|
+
}
|
|
28792
|
+
return slots;
|
|
28793
|
+
};
|
|
28794
|
+
return React__default.createElement(SlotsContainer, {
|
|
28795
|
+
title: itemContainer.name || 'Container',
|
|
28796
|
+
onClose: onClose
|
|
28797
|
+
}, React__default.createElement(ItemsContainer, {
|
|
28798
|
+
className: "item-container-body"
|
|
28799
|
+
}, onRenderSlots()));
|
|
28800
|
+
};
|
|
28801
|
+
var ItemsContainer = /*#__PURE__*/styled.div.withConfig({
|
|
28802
|
+
displayName: "ItemContainer__ItemsContainer",
|
|
28803
|
+
componentId: "sc-15y5p9l-0"
|
|
28804
|
+
})(["max-width:280px;display:flex;justify-content:center;flex-wrap:wrap;"]);
|
|
28805
|
+
|
|
28806
|
+
var ListMenu = function ListMenu(_ref) {
|
|
28807
|
+
var options = _ref.options,
|
|
28808
|
+
onSelected = _ref.onSelected,
|
|
28809
|
+
x = _ref.x,
|
|
28810
|
+
y = _ref.y,
|
|
28811
|
+
_ref$fontSize = _ref.fontSize,
|
|
28812
|
+
fontSize = _ref$fontSize === void 0 ? 0.8 : _ref$fontSize;
|
|
28813
|
+
return React__default.createElement(Container$e, {
|
|
28814
|
+
x: x,
|
|
28815
|
+
y: y,
|
|
28816
|
+
fontSize: fontSize
|
|
28817
|
+
}, React__default.createElement("ul", {
|
|
28818
|
+
className: "rpgui-list-imp",
|
|
28819
|
+
style: {
|
|
28820
|
+
overflow: 'hidden'
|
|
28821
|
+
}
|
|
28822
|
+
}, options.map(function (params, index) {
|
|
28823
|
+
return React__default.createElement(ListElement$1, {
|
|
28824
|
+
key: (params == null ? void 0 : params.id) || index,
|
|
28825
|
+
onClick: function onClick() {
|
|
28826
|
+
onSelected(params == null ? void 0 : params.id);
|
|
28827
|
+
}
|
|
28828
|
+
}, (params == null ? void 0 : params.text) || 'No text');
|
|
28829
|
+
})));
|
|
28830
|
+
};
|
|
28831
|
+
var Container$e = /*#__PURE__*/styled.div.withConfig({
|
|
28832
|
+
displayName: "ListMenu__Container",
|
|
28833
|
+
componentId: "sc-i9097t-0"
|
|
28834
|
+
})(["display:flex;flex-direction:column;width:100%;justify-content:start;align-items:flex-start;position:absolute;top:", "px;left:", "px;li{font-size:", "em;}"], function (props) {
|
|
28835
|
+
return props.y || 0;
|
|
28836
|
+
}, function (props) {
|
|
28837
|
+
return props.x || 0;
|
|
28838
|
+
}, function (props) {
|
|
28839
|
+
return props.fontSize;
|
|
28840
|
+
});
|
|
28841
|
+
var ListElement$1 = /*#__PURE__*/styled.li.withConfig({
|
|
28842
|
+
displayName: "ListMenu__ListElement",
|
|
28843
|
+
componentId: "sc-i9097t-1"
|
|
28844
|
+
})(["margin-right:0.5rem;"]);
|
|
28845
|
+
|
|
28771
28846
|
var ProgressBar = function ProgressBar(_ref) {
|
|
28772
28847
|
var max = _ref.max,
|
|
28773
|
-
|
|
28774
|
-
|
|
28775
|
-
|
|
28776
|
-
|
|
28777
|
-
|
|
28778
|
-
|
|
28779
|
-
|
|
28780
|
-
|
|
28781
|
-
|
|
28782
|
-
|
|
28848
|
+
value = _ref.value,
|
|
28849
|
+
color = _ref.color,
|
|
28850
|
+
_ref$displayText = _ref.displayText,
|
|
28851
|
+
displayText = _ref$displayText === void 0 ? true : _ref$displayText,
|
|
28852
|
+
_ref$percentageWidth = _ref.percentageWidth,
|
|
28853
|
+
percentageWidth = _ref$percentageWidth === void 0 ? 40 : _ref$percentageWidth,
|
|
28854
|
+
_ref$minWidth = _ref.minWidth,
|
|
28855
|
+
minWidth = _ref$minWidth === void 0 ? 100 : _ref$minWidth,
|
|
28856
|
+
style = _ref.style;
|
|
28783
28857
|
var calculatePercentageValue = function calculatePercentageValue(max, value) {
|
|
28784
28858
|
if (value > max) {
|
|
28785
28859
|
value = max;
|
|
28786
28860
|
}
|
|
28787
|
-
|
|
28788
28861
|
return value * 100 / max;
|
|
28789
28862
|
};
|
|
28790
|
-
|
|
28791
|
-
return React__default.createElement(Container$e, {
|
|
28863
|
+
return React__default.createElement(Container$f, {
|
|
28792
28864
|
className: "rpgui-progress",
|
|
28793
28865
|
"data-value": calculatePercentageValue(max, value) / 100,
|
|
28794
28866
|
"data-rpguitype": "progress",
|
|
@@ -28817,7 +28889,7 @@ var TextOverlay$1 = /*#__PURE__*/styled.div.withConfig({
|
|
|
28817
28889
|
displayName: "ProgressBar__TextOverlay",
|
|
28818
28890
|
componentId: "sc-qa6fzh-1"
|
|
28819
28891
|
})(["width:100%;position:relative;"]);
|
|
28820
|
-
var Container$
|
|
28892
|
+
var Container$f = /*#__PURE__*/styled.div.withConfig({
|
|
28821
28893
|
displayName: "ProgressBar__Container",
|
|
28822
28894
|
componentId: "sc-qa6fzh-2"
|
|
28823
28895
|
})(["display:flex;flex-direction:column;min-width:", "px;width:", "%;justify-content:start;align-items:flex-start;", ""], function (props) {
|
|
@@ -28832,33 +28904,28 @@ var img$8 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCA
|
|
|
28832
28904
|
|
|
28833
28905
|
var QuestInfo = function QuestInfo(_ref) {
|
|
28834
28906
|
var quests = _ref.quests,
|
|
28835
|
-
|
|
28836
|
-
|
|
28837
|
-
|
|
28838
|
-
|
|
28907
|
+
onClose = _ref.onClose,
|
|
28908
|
+
buttons = _ref.buttons,
|
|
28909
|
+
onChangeQuest = _ref.onChangeQuest;
|
|
28839
28910
|
var _useState = React.useState(0),
|
|
28840
|
-
|
|
28841
|
-
|
|
28842
|
-
|
|
28911
|
+
currentIndex = _useState[0],
|
|
28912
|
+
setCurrentIndex = _useState[1];
|
|
28843
28913
|
var questsLength = quests.length - 1;
|
|
28844
28914
|
React.useEffect(function () {
|
|
28845
28915
|
if (onChangeQuest) {
|
|
28846
28916
|
onChangeQuest(currentIndex, quests[currentIndex]._id);
|
|
28847
28917
|
}
|
|
28848
28918
|
}, [currentIndex]);
|
|
28849
|
-
|
|
28850
28919
|
var onLeftClick = function onLeftClick() {
|
|
28851
28920
|
if (currentIndex === 0) setCurrentIndex(questsLength);else setCurrentIndex(function (index) {
|
|
28852
28921
|
return index - 1;
|
|
28853
28922
|
});
|
|
28854
28923
|
};
|
|
28855
|
-
|
|
28856
28924
|
var onRightClick = function onRightClick() {
|
|
28857
28925
|
if (currentIndex === questsLength) setCurrentIndex(0);else setCurrentIndex(function (index) {
|
|
28858
28926
|
return index + 1;
|
|
28859
28927
|
});
|
|
28860
28928
|
};
|
|
28861
|
-
|
|
28862
28929
|
return React__default.createElement(QuestDraggableContainer, {
|
|
28863
28930
|
type: exports.RPGUIContainerTypes.Framed,
|
|
28864
28931
|
onCloseButton: function onCloseButton() {
|
|
@@ -28866,12 +28933,12 @@ var QuestInfo = function QuestInfo(_ref) {
|
|
|
28866
28933
|
},
|
|
28867
28934
|
width: "730px",
|
|
28868
28935
|
cancelDrag: ".equipment-container-body .arrow-selector"
|
|
28869
|
-
}, quests.length >= 2 ? React__default.createElement(QuestsContainer, null, currentIndex !== 0 && React__default.createElement(
|
|
28870
|
-
|
|
28936
|
+
}, quests.length >= 2 ? React__default.createElement(QuestsContainer, null, currentIndex !== 0 && React__default.createElement(SelectArrow, {
|
|
28937
|
+
direction: "left",
|
|
28871
28938
|
onClick: onLeftClick,
|
|
28872
28939
|
onTouchStart: onLeftClick
|
|
28873
|
-
}), currentIndex !== quests.length - 1 && React__default.createElement(
|
|
28874
|
-
|
|
28940
|
+
}), currentIndex !== quests.length - 1 && React__default.createElement(SelectArrow, {
|
|
28941
|
+
direction: "right",
|
|
28875
28942
|
onClick: onRightClick,
|
|
28876
28943
|
onTouchStart: onRightClick
|
|
28877
28944
|
}), React__default.createElement(QuestContainer, null, React__default.createElement(TitleContainer$1, {
|
|
@@ -28950,18 +29017,10 @@ var Thumbnail = /*#__PURE__*/styled.img.withConfig({
|
|
|
28950
29017
|
displayName: "QuestInfo__Thumbnail",
|
|
28951
29018
|
componentId: "sc-15s2boc-8"
|
|
28952
29019
|
})(["color:white;z-index:22;font-size:10px;width:64px;margin-right:0.5rem;"]);
|
|
28953
|
-
var LeftArrow$1 = /*#__PURE__*/styled.div.withConfig({
|
|
28954
|
-
displayName: "QuestInfo__LeftArrow",
|
|
28955
|
-
componentId: "sc-15s2boc-9"
|
|
28956
|
-
})(["background-image:url(", ");background-size:100% 100%;left:0;position:absolute;width:40px;height:42px;:active{background-image:url(", ");}"], img$3, img$2);
|
|
28957
|
-
var RightArrow$1 = /*#__PURE__*/styled.div.withConfig({
|
|
28958
|
-
displayName: "QuestInfo__RightArrow",
|
|
28959
|
-
componentId: "sc-15s2boc-10"
|
|
28960
|
-
})(["background-image:url(", ");right:0;position:absolute;width:40px;background-size:100% 100%;height:42px;:active{background-image:url(", ");}"], img$5, img$4);
|
|
28961
29020
|
|
|
28962
29021
|
var QuestList = function QuestList(_ref) {
|
|
28963
29022
|
var quests = _ref.quests,
|
|
28964
|
-
|
|
29023
|
+
onClose = _ref.onClose;
|
|
28965
29024
|
return React__default.createElement(QuestDraggableContainer$1, {
|
|
28966
29025
|
type: exports.RPGUIContainerTypes.Framed,
|
|
28967
29026
|
onCloseButton: function onCloseButton() {
|
|
@@ -29008,19 +29067,16 @@ var NoQuestContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
29008
29067
|
|
|
29009
29068
|
var InputRadio = function InputRadio(_ref) {
|
|
29010
29069
|
var name = _ref.name,
|
|
29011
|
-
|
|
29012
|
-
|
|
29013
|
-
|
|
29070
|
+
items = _ref.items,
|
|
29071
|
+
onChange = _ref.onChange;
|
|
29014
29072
|
var _useState = React.useState(),
|
|
29015
|
-
|
|
29016
|
-
|
|
29017
|
-
|
|
29073
|
+
selectedValue = _useState[0],
|
|
29074
|
+
setSelectedValue = _useState[1];
|
|
29018
29075
|
var handleClick = function handleClick() {
|
|
29019
29076
|
var element = document.querySelector("input[name=" + name + "]:checked");
|
|
29020
29077
|
var elementValue = element.value;
|
|
29021
29078
|
setSelectedValue(elementValue);
|
|
29022
29079
|
};
|
|
29023
|
-
|
|
29024
29080
|
React.useEffect(function () {
|
|
29025
29081
|
if (selectedValue) {
|
|
29026
29082
|
onChange(selectedValue);
|
|
@@ -29045,23 +29101,18 @@ var InputRadio = function InputRadio(_ref) {
|
|
|
29045
29101
|
RangeSliderType["Slider"] = "rpgui-slider";
|
|
29046
29102
|
RangeSliderType["GoldSlider"] = "rpgui-slider golden";
|
|
29047
29103
|
})(exports.RangeSliderType || (exports.RangeSliderType = {}));
|
|
29048
|
-
|
|
29049
29104
|
var RangeSlider = function RangeSlider(_ref) {
|
|
29050
29105
|
var type = _ref.type,
|
|
29051
|
-
|
|
29052
|
-
|
|
29053
|
-
|
|
29054
|
-
|
|
29106
|
+
valueMin = _ref.valueMin,
|
|
29107
|
+
valueMax = _ref.valueMax,
|
|
29108
|
+
width = _ref.width,
|
|
29109
|
+
onChange = _ref.onChange;
|
|
29055
29110
|
var sliderId = uuid.v4();
|
|
29056
|
-
|
|
29057
29111
|
var onHandleMouseUp = function onHandleMouseUp() {
|
|
29058
29112
|
var rpguiSlider = document.getElementById("rpgui-slider-" + sliderId);
|
|
29059
|
-
|
|
29060
29113
|
var value = _RPGUI.get_value(rpguiSlider);
|
|
29061
|
-
|
|
29062
29114
|
onChange(Number(value));
|
|
29063
29115
|
};
|
|
29064
|
-
|
|
29065
29116
|
return React__default.createElement("div", {
|
|
29066
29117
|
onMouseUp: onHandleMouseUp
|
|
29067
29118
|
}, React__default.createElement(Input$1, {
|
|
@@ -29082,11 +29133,11 @@ var Input$1 = /*#__PURE__*/styled.input.withConfig({
|
|
|
29082
29133
|
|
|
29083
29134
|
var SimpleProgressBar = function SimpleProgressBar(_ref) {
|
|
29084
29135
|
var value = _ref.value,
|
|
29085
|
-
|
|
29086
|
-
|
|
29087
|
-
|
|
29088
|
-
|
|
29089
|
-
return React__default.createElement(Container$
|
|
29136
|
+
_ref$bgColor = _ref.bgColor,
|
|
29137
|
+
bgColor = _ref$bgColor === void 0 ? 'red' : _ref$bgColor,
|
|
29138
|
+
_ref$margin = _ref.margin,
|
|
29139
|
+
margin = _ref$margin === void 0 ? 20 : _ref$margin;
|
|
29140
|
+
return React__default.createElement(Container$g, {
|
|
29090
29141
|
className: "simple-progress-bar"
|
|
29091
29142
|
}, React__default.createElement(ProgressBarContainer, {
|
|
29092
29143
|
margin: margin
|
|
@@ -29095,7 +29146,7 @@ var SimpleProgressBar = function SimpleProgressBar(_ref) {
|
|
|
29095
29146
|
bgColor: bgColor
|
|
29096
29147
|
}))));
|
|
29097
29148
|
};
|
|
29098
|
-
var Container$
|
|
29149
|
+
var Container$g = /*#__PURE__*/styled.div.withConfig({
|
|
29099
29150
|
displayName: "SimpleProgressBar__Container",
|
|
29100
29151
|
componentId: "sc-mbeil3-0"
|
|
29101
29152
|
})(["display:flex;justify-content:center;align-items:center;width:100%;"]);
|
|
@@ -29120,16 +29171,18 @@ var ProgressBarContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
29120
29171
|
|
|
29121
29172
|
var SkillProgressBar = function SkillProgressBar(_ref) {
|
|
29122
29173
|
var bgColor = _ref.bgColor,
|
|
29123
|
-
|
|
29124
|
-
|
|
29125
|
-
|
|
29126
|
-
|
|
29127
|
-
|
|
29128
|
-
|
|
29174
|
+
skillName = _ref.skillName,
|
|
29175
|
+
level = _ref.level,
|
|
29176
|
+
skillPoints = _ref.skillPoints,
|
|
29177
|
+
texturePath = _ref.texturePath,
|
|
29178
|
+
_ref$showSkillPoints = _ref.showSkillPoints,
|
|
29179
|
+
showSkillPoints = _ref$showSkillPoints === void 0 ? true : _ref$showSkillPoints,
|
|
29180
|
+
atlasIMG = _ref.atlasIMG,
|
|
29181
|
+
atlasJSON = _ref.atlasJSON;
|
|
29129
29182
|
var spForNextLevel = shared.getSPForLevel(level + 1);
|
|
29130
29183
|
var ratio = skillPoints / spForNextLevel * 100;
|
|
29131
|
-
return React__default.createElement(React__default.Fragment, null, React__default.createElement(ProgressTitle, null, React__default.createElement(TitleName, null, skillName), React__default.createElement(ValueDisplay, null, "lv ", level)), React__default.createElement(ProgressBody, null, React__default.createElement(ProgressIconContainer, null,
|
|
29132
|
-
atlasIMG:
|
|
29184
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(ProgressTitle, null, React__default.createElement(TitleName, null, skillName), React__default.createElement(ValueDisplay, null, "lv ", level)), React__default.createElement(ProgressBody, null, React__default.createElement(ProgressIconContainer, null, atlasIMG && atlasJSON ? React__default.createElement(SpriteContainer, null, React__default.createElement(ErrorBoundary, null, React__default.createElement(SpriteFromAtlas, {
|
|
29185
|
+
atlasIMG: atlasIMG,
|
|
29133
29186
|
atlasJSON: atlasJSON,
|
|
29134
29187
|
spriteKey: texturePath,
|
|
29135
29188
|
imgScale: 1,
|
|
@@ -29214,17 +29267,17 @@ var skillProps = {
|
|
|
29214
29267
|
};
|
|
29215
29268
|
var SkillsContainer = function SkillsContainer(_ref) {
|
|
29216
29269
|
var onCloseButton = _ref.onCloseButton,
|
|
29217
|
-
|
|
29218
|
-
|
|
29270
|
+
skill = _ref.skill,
|
|
29271
|
+
atlasIMG = _ref.atlasIMG,
|
|
29272
|
+
atlasJSON = _ref.atlasJSON;
|
|
29219
29273
|
var onRenderSkillCategory = function onRenderSkillCategory(category) {
|
|
29220
29274
|
var skillCategory = skillProps[category];
|
|
29221
29275
|
var skillCategoryColor = skillCategory.color;
|
|
29222
29276
|
var output = [];
|
|
29223
|
-
|
|
29224
29277
|
for (var _i = 0, _Object$entries = Object.entries(skillCategory.values); _i < _Object$entries.length; _i++) {
|
|
29225
29278
|
var _Object$entries$_i = _Object$entries[_i],
|
|
29226
|
-
|
|
29227
|
-
|
|
29279
|
+
key = _Object$entries$_i[0],
|
|
29280
|
+
value = _Object$entries$_i[1];
|
|
29228
29281
|
//@ts-ignore
|
|
29229
29282
|
var skillDetails = skill[key];
|
|
29230
29283
|
output.push(React__default.createElement(SkillProgressBar, {
|
|
@@ -29234,13 +29287,13 @@ var SkillsContainer = function SkillsContainer(_ref) {
|
|
|
29234
29287
|
level: skillDetails.level || 0,
|
|
29235
29288
|
skillPoints: Math.round(skillDetails.skillPoints) || 0,
|
|
29236
29289
|
skillPointsToNextLevel: Math.round(skillDetails.skillPointsToNextLevel) || 0,
|
|
29237
|
-
texturePath: value
|
|
29290
|
+
texturePath: value,
|
|
29291
|
+
atlasIMG: atlasIMG,
|
|
29292
|
+
atlasJSON: atlasJSON
|
|
29238
29293
|
}));
|
|
29239
29294
|
}
|
|
29240
|
-
|
|
29241
29295
|
return output;
|
|
29242
29296
|
};
|
|
29243
|
-
|
|
29244
29297
|
return React__default.createElement(SkillsDraggableContainer, {
|
|
29245
29298
|
title: "Skills"
|
|
29246
29299
|
}, onCloseButton && React__default.createElement(CloseButton$2, {
|
|
@@ -29254,7 +29307,9 @@ var SkillsContainer = function SkillsContainer(_ref) {
|
|
|
29254
29307
|
level: Math.round(skill.level) || 0,
|
|
29255
29308
|
skillPoints: Math.round(skill.experience) || 0,
|
|
29256
29309
|
skillPointsToNextLevel: Math.round(skill.xpToNextLevel) || 0,
|
|
29257
|
-
texturePath: 'swords/broad-sword.png'
|
|
29310
|
+
texturePath: 'swords/broad-sword.png',
|
|
29311
|
+
atlasIMG: atlasIMG,
|
|
29312
|
+
atlasJSON: atlasJSON
|
|
29258
29313
|
}), React__default.createElement("p", null, "Combat Skills"), React__default.createElement("hr", {
|
|
29259
29314
|
className: "golden"
|
|
29260
29315
|
})), onRenderSkillCategory('combat'), React__default.createElement(SkillSplitDiv, null, React__default.createElement("p", null, "Crafting Skills"), React__default.createElement("hr", {
|
|
@@ -29277,204 +29332,210 @@ var CloseButton$2 = /*#__PURE__*/styled.div.withConfig({
|
|
|
29277
29332
|
})(["position:absolute;top:2px;right:2px;color:white;z-index:22;font-size:0.7rem;"]);
|
|
29278
29333
|
|
|
29279
29334
|
var TextArea = function TextArea(_ref) {
|
|
29280
|
-
var props = _extends({}, _ref);
|
|
29281
|
-
|
|
29335
|
+
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
29282
29336
|
return React__default.createElement("textarea", Object.assign({}, props));
|
|
29283
29337
|
};
|
|
29284
29338
|
|
|
29285
|
-
|
|
29286
|
-
var
|
|
29287
|
-
|
|
29288
|
-
|
|
29289
|
-
|
|
29290
|
-
|
|
29291
|
-
|
|
29292
|
-
|
|
29293
|
-
|
|
29294
|
-
|
|
29295
|
-
|
|
29296
|
-
|
|
29297
|
-
|
|
29298
|
-
|
|
29299
|
-
|
|
29300
|
-
|
|
29301
|
-
|
|
29302
|
-
|
|
29303
|
-
|
|
29304
|
-
})
|
|
29305
|
-
|
|
29306
|
-
var NPCMultiDialog = function NPCMultiDialog(_ref) {
|
|
29307
|
-
var _textAndTypeArray$sli;
|
|
29308
|
-
|
|
29309
|
-
var _onClose = _ref.onClose,
|
|
29310
|
-
textAndTypeArray = _ref.textAndTypeArray;
|
|
29311
|
-
|
|
29312
|
-
var _useState = React.useState(false),
|
|
29313
|
-
showGoNextIndicator = _useState[0],
|
|
29314
|
-
setShowGoNextIndicator = _useState[1];
|
|
29315
|
-
|
|
29316
|
-
var _useState2 = React.useState(0),
|
|
29317
|
-
slide = _useState2[0],
|
|
29318
|
-
setSlide = _useState2[1];
|
|
29319
|
-
|
|
29320
|
-
var onHandleSpacePress = function onHandleSpacePress(event) {
|
|
29321
|
-
if (event.code === 'Space') {
|
|
29322
|
-
if (slide < (textAndTypeArray == null ? void 0 : textAndTypeArray.length) - 1) {
|
|
29323
|
-
setSlide(function (prev) {
|
|
29324
|
-
return prev + 1;
|
|
29325
|
-
});
|
|
29326
|
-
} else {
|
|
29327
|
-
// if there's no more text chunks, close the dialog
|
|
29328
|
-
_onClose();
|
|
29329
|
-
}
|
|
29339
|
+
var TradingItemRow = function TradingItemRow(_ref) {
|
|
29340
|
+
var atlasIMG = _ref.atlasIMG,
|
|
29341
|
+
atlasJSON = _ref.atlasJSON,
|
|
29342
|
+
updateChartTotals = _ref.updateChartTotals,
|
|
29343
|
+
traderItem = _ref.traderItem;
|
|
29344
|
+
var _useState = React.useState(0),
|
|
29345
|
+
itemQuantity = _useState[0],
|
|
29346
|
+
setItemQuantity = _useState[1];
|
|
29347
|
+
var onLeftClick = function onLeftClick() {
|
|
29348
|
+
if (itemQuantity > 0) {
|
|
29349
|
+
var newQuantity = itemQuantity - 1;
|
|
29350
|
+
setItemQuantity(newQuantity);
|
|
29351
|
+
updateChartTotals({
|
|
29352
|
+
key: traderItem.key,
|
|
29353
|
+
itemId: traderItem.itemId,
|
|
29354
|
+
qty: newQuantity,
|
|
29355
|
+
price: traderItem.price,
|
|
29356
|
+
texturePath: traderItem.texturePath,
|
|
29357
|
+
name: traderItem.name
|
|
29358
|
+
});
|
|
29330
29359
|
}
|
|
29331
29360
|
};
|
|
29332
|
-
|
|
29333
|
-
|
|
29334
|
-
|
|
29335
|
-
|
|
29336
|
-
|
|
29337
|
-
|
|
29338
|
-
|
|
29339
|
-
|
|
29340
|
-
|
|
29341
|
-
|
|
29342
|
-
|
|
29343
|
-
|
|
29344
|
-
flex: '70%'
|
|
29345
|
-
}, React__default.createElement(NPCDialogText, {
|
|
29346
|
-
onStartStep: function onStartStep() {
|
|
29347
|
-
return setShowGoNextIndicator(false);
|
|
29348
|
-
},
|
|
29349
|
-
onEndStep: function onEndStep() {
|
|
29350
|
-
return setShowGoNextIndicator(true);
|
|
29351
|
-
},
|
|
29352
|
-
text: textAndTypeArray[slide].text || 'No text provided.',
|
|
29353
|
-
onClose: function onClose() {
|
|
29354
|
-
if (_onClose) {
|
|
29355
|
-
_onClose();
|
|
29356
|
-
}
|
|
29357
|
-
}
|
|
29358
|
-
})), React__default.createElement(ThumbnailContainer$1, null, React__default.createElement(NPCThumbnail$1, {
|
|
29359
|
-
src: textAndTypeArray[slide].imagePath || img$6
|
|
29360
|
-
})), showGoNextIndicator && React__default.createElement(PressSpaceIndicator$1, {
|
|
29361
|
-
right: '10.5rem',
|
|
29362
|
-
src: img$7
|
|
29363
|
-
})), textAndTypeArray[slide].imageSide === 'left' && React__default.createElement(React__default.Fragment, null, React__default.createElement(ThumbnailContainer$1, null, React__default.createElement(NPCThumbnail$1, {
|
|
29364
|
-
src: textAndTypeArray[slide].imagePath || img$6
|
|
29365
|
-
})), React__default.createElement(TextContainer$2, {
|
|
29366
|
-
flex: '70%'
|
|
29367
|
-
}, React__default.createElement(NPCDialogText, {
|
|
29368
|
-
onStartStep: function onStartStep() {
|
|
29369
|
-
return setShowGoNextIndicator(false);
|
|
29370
|
-
},
|
|
29371
|
-
onEndStep: function onEndStep() {
|
|
29372
|
-
return setShowGoNextIndicator(true);
|
|
29373
|
-
},
|
|
29374
|
-
text: textAndTypeArray[slide].text || 'No text provided.',
|
|
29375
|
-
onClose: function onClose() {
|
|
29376
|
-
if (_onClose) {
|
|
29377
|
-
_onClose();
|
|
29378
|
-
}
|
|
29361
|
+
var onRightClick = function onRightClick() {
|
|
29362
|
+
if (itemQuantity < 999) {
|
|
29363
|
+
var newQuantity = itemQuantity + 1;
|
|
29364
|
+
setItemQuantity(newQuantity);
|
|
29365
|
+
updateChartTotals({
|
|
29366
|
+
key: traderItem.key,
|
|
29367
|
+
itemId: traderItem.itemId,
|
|
29368
|
+
qty: newQuantity,
|
|
29369
|
+
price: traderItem.price,
|
|
29370
|
+
texturePath: traderItem.texturePath,
|
|
29371
|
+
name: traderItem.name
|
|
29372
|
+
});
|
|
29379
29373
|
}
|
|
29380
|
-
}
|
|
29381
|
-
|
|
29382
|
-
|
|
29383
|
-
|
|
29374
|
+
};
|
|
29375
|
+
return React__default.createElement(ItemWrapper, null, React__default.createElement(ItemIconContainer, null, React__default.createElement(SpriteContainer$1, null, React__default.createElement(SpriteFromAtlas, {
|
|
29376
|
+
atlasIMG: atlasIMG,
|
|
29377
|
+
atlasJSON: atlasJSON,
|
|
29378
|
+
spriteKey: traderItem.texturePath,
|
|
29379
|
+
imgScale: 2.5
|
|
29380
|
+
}))), React__default.createElement(ItemNameContainer, null, React__default.createElement(NameValue, null, React__default.createElement(Ellipsis, {
|
|
29381
|
+
maxLines: 1,
|
|
29382
|
+
maxWidth: 250
|
|
29383
|
+
}, capitalize(traderItem.name)), React__default.createElement("p", null, "$", traderItem.price))), React__default.createElement(QuantityContainer, null, React__default.createElement(SelectArrow, {
|
|
29384
|
+
size: 32,
|
|
29385
|
+
className: "arrow-selector",
|
|
29386
|
+
direction: "left",
|
|
29387
|
+
onClick: onLeftClick,
|
|
29388
|
+
onTouchStart: onLeftClick
|
|
29389
|
+
}), React__default.createElement(QuantityDisplay, null, React__default.createElement(TextOverlay$2, null, React__default.createElement(Item$1, null, itemQuantity))), React__default.createElement(SelectArrow, {
|
|
29390
|
+
size: 32,
|
|
29391
|
+
className: "arrow-selector",
|
|
29392
|
+
direction: "right",
|
|
29393
|
+
onClick: onRightClick,
|
|
29394
|
+
onTouchStart: onRightClick
|
|
29395
|
+
})));
|
|
29384
29396
|
};
|
|
29385
|
-
var
|
|
29386
|
-
displayName: "
|
|
29387
|
-
componentId: "sc-
|
|
29388
|
-
})(["
|
|
29389
|
-
var
|
|
29390
|
-
displayName: "
|
|
29391
|
-
componentId: "sc-
|
|
29392
|
-
})(["flex:"
|
|
29393
|
-
|
|
29394
|
-
|
|
29395
|
-
|
|
29396
|
-
|
|
29397
|
-
|
|
29398
|
-
|
|
29399
|
-
|
|
29400
|
-
|
|
29401
|
-
|
|
29402
|
-
|
|
29403
|
-
|
|
29404
|
-
|
|
29405
|
-
|
|
29406
|
-
|
|
29407
|
-
|
|
29408
|
-
|
|
29409
|
-
|
|
29410
|
-
|
|
29411
|
-
|
|
29412
|
-
|
|
29413
|
-
|
|
29414
|
-
|
|
29415
|
-
|
|
29416
|
-
|
|
29417
|
-
|
|
29418
|
-
|
|
29419
|
-
|
|
29420
|
-
|
|
29397
|
+
var ItemWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
29398
|
+
displayName: "TradingItemRow__ItemWrapper",
|
|
29399
|
+
componentId: "sc-mja0b5-0"
|
|
29400
|
+
})(["width:100%;margin:auto;display:flex;justify-content:space-between;margin-bottom:1rem;&:hover{background-color:", ";}padding:0.5rem;"], colors.darkGrey);
|
|
29401
|
+
var ItemNameContainer = /*#__PURE__*/styled.div.withConfig({
|
|
29402
|
+
displayName: "TradingItemRow__ItemNameContainer",
|
|
29403
|
+
componentId: "sc-mja0b5-1"
|
|
29404
|
+
})(["flex:60%;"]);
|
|
29405
|
+
var ItemIconContainer = /*#__PURE__*/styled.div.withConfig({
|
|
29406
|
+
displayName: "TradingItemRow__ItemIconContainer",
|
|
29407
|
+
componentId: "sc-mja0b5-2"
|
|
29408
|
+
})(["display:flex;justify-content:flex-start;align-items:center;flex:0 0 58px;"]);
|
|
29409
|
+
var SpriteContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
29410
|
+
displayName: "TradingItemRow__SpriteContainer",
|
|
29411
|
+
componentId: "sc-mja0b5-3"
|
|
29412
|
+
})(["position:relative;top:-0.5rem;left:0.5rem;"]);
|
|
29413
|
+
var NameValue = /*#__PURE__*/styled.div.withConfig({
|
|
29414
|
+
displayName: "TradingItemRow__NameValue",
|
|
29415
|
+
componentId: "sc-mja0b5-4"
|
|
29416
|
+
})(["p{font-size:0.75rem;margin:0;}"]);
|
|
29417
|
+
var Item$1 = /*#__PURE__*/styled.span.withConfig({
|
|
29418
|
+
displayName: "TradingItemRow__Item",
|
|
29419
|
+
componentId: "sc-mja0b5-5"
|
|
29420
|
+
})(["font-size:1rem;color:white;text-align:center;z-index:1;width:100%;"]);
|
|
29421
|
+
var TextOverlay$2 = /*#__PURE__*/styled.div.withConfig({
|
|
29422
|
+
displayName: "TradingItemRow__TextOverlay",
|
|
29423
|
+
componentId: "sc-mja0b5-6"
|
|
29424
|
+
})(["width:100%;position:relative;"]);
|
|
29425
|
+
var QuantityContainer = /*#__PURE__*/styled.div.withConfig({
|
|
29426
|
+
displayName: "TradingItemRow__QuantityContainer",
|
|
29427
|
+
componentId: "sc-mja0b5-7"
|
|
29428
|
+
})(["position:relative;display:flex;min-width:100px;width:40%;justify-content:center;align-items:center;flex:20%;"]);
|
|
29429
|
+
var QuantityDisplay = /*#__PURE__*/styled.div.withConfig({
|
|
29430
|
+
displayName: "TradingItemRow__QuantityDisplay",
|
|
29431
|
+
componentId: "sc-mja0b5-8"
|
|
29432
|
+
})(["font-size:0.8rem;"]);
|
|
29421
29433
|
|
|
29434
|
+
var TradingMenu = function TradingMenu(_ref) {
|
|
29435
|
+
var traderItems = _ref.traderItems,
|
|
29436
|
+
onClose = _ref.onClose,
|
|
29437
|
+
type = _ref.type,
|
|
29438
|
+
atlasJSON = _ref.atlasJSON,
|
|
29439
|
+
atlasIMG = _ref.atlasIMG,
|
|
29440
|
+
characterAvailableGold = _ref.characterAvailableGold,
|
|
29441
|
+
onChangeTraderItems = _ref.onChangeTraderItems;
|
|
29422
29442
|
var _useState = React.useState(0),
|
|
29423
|
-
|
|
29424
|
-
|
|
29425
|
-
|
|
29426
|
-
var
|
|
29427
|
-
|
|
29428
|
-
|
|
29429
|
-
|
|
29430
|
-
|
|
29431
|
-
|
|
29432
|
-
|
|
29433
|
-
|
|
29434
|
-
|
|
29435
|
-
|
|
29443
|
+
sum = _useState[0],
|
|
29444
|
+
setSum = _useState[1];
|
|
29445
|
+
var newSumArray = 0;
|
|
29446
|
+
var updateChartTotals = function updateChartTotals(item) {
|
|
29447
|
+
var itemIndex = traderItems.findIndex(function (itemArray) {
|
|
29448
|
+
return itemArray.itemId === item.itemId;
|
|
29449
|
+
});
|
|
29450
|
+
traderItems[itemIndex] = item;
|
|
29451
|
+
traderItems.forEach(function (item) {
|
|
29452
|
+
if (item.qty) newSumArray += item.qty * item.price;
|
|
29453
|
+
setSum(newSumArray);
|
|
29454
|
+
});
|
|
29455
|
+
};
|
|
29456
|
+
React.useEffect(function () {
|
|
29457
|
+
if (onChangeTraderItems) {
|
|
29458
|
+
onChangeTraderItems(traderItems);
|
|
29436
29459
|
}
|
|
29460
|
+
}, [traderItems]);
|
|
29461
|
+
var Capitalize = function Capitalize(word) {
|
|
29462
|
+
return word[0].toUpperCase() + word.substring(1);
|
|
29437
29463
|
};
|
|
29464
|
+
return React__default.createElement(TradingMenuDraggableContainer, {
|
|
29465
|
+
type: exports.RPGUIContainerTypes.Framed,
|
|
29466
|
+
onCloseButton: function onCloseButton() {
|
|
29467
|
+
if (onClose) onClose();
|
|
29468
|
+
},
|
|
29469
|
+
width: "500px",
|
|
29470
|
+
cancelDrag: ".equipment-container-body .arrow-selector"
|
|
29471
|
+
}, React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
29472
|
+
style: {
|
|
29473
|
+
width: '100%'
|
|
29474
|
+
}
|
|
29475
|
+
}, React__default.createElement(Title$3, null, Capitalize(type), " Menu"), React__default.createElement("hr", {
|
|
29476
|
+
className: "golden"
|
|
29477
|
+
})), React__default.createElement(TradingComponentScrollWrapper, null, traderItems.map(function (tradeItem) {
|
|
29478
|
+
return React__default.createElement(ItemWrapper$1, null, React__default.createElement(TradingItemRow, {
|
|
29479
|
+
atlasIMG: atlasIMG,
|
|
29480
|
+
atlasJSON: atlasJSON,
|
|
29481
|
+
updateChartTotals: updateChartTotals,
|
|
29482
|
+
traderItem: tradeItem
|
|
29483
|
+
}));
|
|
29484
|
+
})), React__default.createElement(GoldWrapper, null, React__default.createElement("p", null, "Available Gold:"), React__default.createElement("p", null, "$", characterAvailableGold)), React__default.createElement(TotalWrapper, null, React__default.createElement("p", null, "Total:"), React__default.createElement("p", null, "$", sum)), sum > characterAvailableGold ? React__default.createElement(AlertWrapper, null, React__default.createElement("p", null, " Sorry, not enough money.")) : React__default.createElement(GoldWrapper, null, React__default.createElement("p", null, "Final Gold:"), React__default.createElement("p", null, "$", characterAvailableGold - sum)), React__default.createElement(ButtonWrapper, null, React__default.createElement(Button, {
|
|
29485
|
+
buttonType: exports.ButtonTypes.RPGUIButton,
|
|
29486
|
+
disabled: sum > characterAvailableGold
|
|
29487
|
+
}, "Confirm"), React__default.createElement(Button, {
|
|
29488
|
+
buttonType: exports.ButtonTypes.RPGUIButton
|
|
29489
|
+
}, "Cancel"))));
|
|
29490
|
+
};
|
|
29491
|
+
var TradingMenuDraggableContainer = /*#__PURE__*/styled(DraggableContainer).withConfig({
|
|
29492
|
+
displayName: "TradingMenu__TradingMenuDraggableContainer",
|
|
29493
|
+
componentId: "sc-1wjsz1l-0"
|
|
29494
|
+
})([".container-close{top:10px;right:10px;}.quest-title{text-align:left;margin-left:44px;margin-top:20px;color:yellow;}.quest-desc{margin-top:12px;margin-left:44px;}.rpgui-progress{min-width:80%;margin:0 auto;}"]);
|
|
29495
|
+
var Title$3 = /*#__PURE__*/styled.h1.withConfig({
|
|
29496
|
+
displayName: "TradingMenu__Title",
|
|
29497
|
+
componentId: "sc-1wjsz1l-1"
|
|
29498
|
+
})(["z-index:22;font-size:0.6rem;color:yellow !important;"]);
|
|
29499
|
+
var TradingComponentScrollWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
29500
|
+
displayName: "TradingMenu__TradingComponentScrollWrapper",
|
|
29501
|
+
componentId: "sc-1wjsz1l-2"
|
|
29502
|
+
})(["overflow-y:scroll;height:500px;width:100%;margin-top:1rem;"]);
|
|
29503
|
+
var ItemWrapper$1 = /*#__PURE__*/styled.div.withConfig({
|
|
29504
|
+
displayName: "TradingMenu__ItemWrapper",
|
|
29505
|
+
componentId: "sc-1wjsz1l-3"
|
|
29506
|
+
})(["margin:auto;display:flex;justify-content:space-between;"]);
|
|
29507
|
+
var TotalWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
29508
|
+
displayName: "TradingMenu__TotalWrapper",
|
|
29509
|
+
componentId: "sc-1wjsz1l-4"
|
|
29510
|
+
})(["display:flex;margin:auto;justify-content:space-between;height:20px;margin-left:0.8rem;"]);
|
|
29511
|
+
var GoldWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
29512
|
+
displayName: "TradingMenu__GoldWrapper",
|
|
29513
|
+
componentId: "sc-1wjsz1l-5"
|
|
29514
|
+
})(["margin-top:1rem;display:flex;justify-content:space-between;height:20px;p{color:yellow !important;}width:100%;margin-left:0.8rem;"]);
|
|
29515
|
+
var AlertWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
29516
|
+
displayName: "TradingMenu__AlertWrapper",
|
|
29517
|
+
componentId: "sc-1wjsz1l-6"
|
|
29518
|
+
})(["display:flex;width:100%;justify-content:center;height:20px;p{color:red !important;}"]);
|
|
29519
|
+
var ButtonWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
29520
|
+
displayName: "TradingMenu__ButtonWrapper",
|
|
29521
|
+
componentId: "sc-1wjsz1l-7"
|
|
29522
|
+
})(["display:flex;justify-content:space-around;padding-top:20px;width:100%;margin-top:1rem;"]);
|
|
29438
29523
|
|
|
29439
|
-
|
|
29440
|
-
|
|
29441
|
-
|
|
29442
|
-
|
|
29443
|
-
|
|
29444
|
-
|
|
29445
|
-
|
|
29446
|
-
|
|
29447
|
-
fullImg: fullCoverBackground
|
|
29448
|
-
}, React__default.createElement(DialogContainer, null, textAndTypeArray ? React__default.createElement(NPCMultiDialog, {
|
|
29449
|
-
textAndTypeArray: textAndTypeArray,
|
|
29450
|
-
onClose: onClose
|
|
29451
|
-
}) : questions && answers ? React__default.createElement(QuestionDialog, {
|
|
29452
|
-
questions: questions,
|
|
29453
|
-
answers: answers,
|
|
29454
|
-
onClose: onClose
|
|
29455
|
-
}) : text && imagePath ? React__default.createElement(NPCDialog, {
|
|
29456
|
-
text: text,
|
|
29457
|
-
imagePath: imagePath,
|
|
29458
|
-
onClose: onClose,
|
|
29459
|
-
type: exports.NPCDialogType.TextAndThumbnail
|
|
29460
|
-
}) : React__default.createElement(NPCDialog, {
|
|
29461
|
-
text: text,
|
|
29462
|
-
onClose: onClose,
|
|
29463
|
-
type: exports.NPCDialogType.TextOnly
|
|
29464
|
-
})));
|
|
29524
|
+
/* eslint-disable react/require-default-props */
|
|
29525
|
+
var Truncate = function Truncate(_ref) {
|
|
29526
|
+
var _ref$maxLines = _ref.maxLines,
|
|
29527
|
+
maxLines = _ref$maxLines === void 0 ? 1 : _ref$maxLines,
|
|
29528
|
+
children = _ref.children;
|
|
29529
|
+
return React__default.createElement(Container$h, {
|
|
29530
|
+
maxLines: maxLines
|
|
29531
|
+
}, children);
|
|
29465
29532
|
};
|
|
29466
|
-
var
|
|
29467
|
-
displayName: "
|
|
29468
|
-
componentId: "sc-
|
|
29469
|
-
})(["width:100%;height:100
|
|
29470
|
-
return props.
|
|
29471
|
-
}, function (props) {
|
|
29472
|
-
return props.imgPath ? 'cover' : 'auto';
|
|
29533
|
+
var Container$h = /*#__PURE__*/styled.div.withConfig({
|
|
29534
|
+
displayName: "Truncate__Container",
|
|
29535
|
+
componentId: "sc-6x00qb-0"
|
|
29536
|
+
})(["display:-webkit-box;max-width:100%;max-height:100%;-webkit-line-clamp:", ";-webkit-box-orient:vertical;overflow:hidden;"], function (props) {
|
|
29537
|
+
return props.maxLines;
|
|
29473
29538
|
});
|
|
29474
|
-
var DialogContainer = /*#__PURE__*/styled.div.withConfig({
|
|
29475
|
-
displayName: "HistoryDialog__DialogContainer",
|
|
29476
|
-
componentId: "sc-u6oe75-1"
|
|
29477
|
-
})(["display:flex;justify-content:center;padding-top:200px;"]);
|
|
29478
29539
|
|
|
29479
29540
|
exports.Button = Button;
|
|
29480
29541
|
exports.CharacterSelection = CharacterSelection;
|
|
@@ -29504,6 +29565,7 @@ exports.SkillProgressBar = SkillProgressBar;
|
|
|
29504
29565
|
exports.SkillsContainer = SkillsContainer;
|
|
29505
29566
|
exports.SpriteFromAtlas = SpriteFromAtlas;
|
|
29506
29567
|
exports.TextArea = TextArea;
|
|
29568
|
+
exports.TradingMenu = TradingMenu;
|
|
29507
29569
|
exports.Truncate = Truncate;
|
|
29508
29570
|
exports._RPGUI = _RPGUI;
|
|
29509
29571
|
exports.useEventListener = useEventListener;
|