@rpg-engine/long-bow 0.2.90 → 0.2.91
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/Abstractions/SlotsContainer.d.ts +1 -0
- package/dist/components/DraggableContainer.d.ts +1 -0
- package/dist/components/Equipment/EquipmentSet.d.ts +6 -0
- package/dist/components/Input.d.ts +1 -0
- package/dist/components/Item/Inventory/ItemContainer.d.ts +10 -0
- package/dist/components/Item/Inventory/ItemQuantitySelector.d.ts +7 -0
- package/dist/components/Item/Inventory/ItemSlot.d.ts +7 -0
- package/dist/components/RangeSlider.d.ts +1 -0
- package/dist/index.d.ts +4 -5
- package/dist/long-bow.cjs.development.js +522 -220
- 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 +523 -220
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/ItemQuantitySelector.stories.d.ts +5 -0
- package/package.json +1 -1
- package/src/components/Abstractions/SlotsContainer.tsx +3 -0
- package/src/components/CraftBook/CraftBook.tsx +82 -92
- package/src/components/CraftBook/MockItems.ts +23 -20
- package/src/components/DraggableContainer.tsx +3 -0
- package/src/components/Equipment/EquipmentSet.tsx +40 -0
- package/src/components/Input.tsx +6 -2
- package/src/components/Item/Inventory/ItemContainer.tsx +98 -6
- package/src/components/Item/Inventory/ItemQuantitySelector.tsx +142 -0
- package/src/components/Item/Inventory/ItemSlot.tsx +169 -24
- package/src/components/RangeSlider.tsx +37 -14
- package/src/index.tsx +4 -5
- package/src/mocks/itemContainer.mocks.ts +1 -1
- package/src/stories/EquipmentSet.stories.tsx +10 -0
- package/src/stories/ItemContainer.stories.tsx +83 -15
- package/src/stories/ItemQuantitySelector.stories.tsx +26 -0
- package/src/stories/RangeSlider.stories.tsx +10 -9
- package/src/.DS_Store +0 -0
- package/src/components/NPCDialog/.DS_Store +0 -0
- package/src/components/NPCDialog/img/.DS_Store +0 -0
- package/src/mocks/.DS_Store +0 -0
- package/src/mocks/atlas/.DS_Store +0 -0
package/dist/long-bow.esm.js
CHANGED
|
@@ -5,10 +5,10 @@ import dayjs from 'dayjs';
|
|
|
5
5
|
import { ErrorBoundary as ErrorBoundary$1 } from 'react-error-boundary';
|
|
6
6
|
import Draggable from 'react-draggable';
|
|
7
7
|
import { v4 } from 'uuid';
|
|
8
|
-
import 'rpgui/rpgui.min.css';
|
|
9
|
-
import 'rpgui/rpgui.min.js';
|
|
10
8
|
import { observer } from 'mobx-react-lite';
|
|
11
9
|
import isMobile from 'is-mobile';
|
|
10
|
+
import 'rpgui/rpgui.min.css';
|
|
11
|
+
import 'rpgui/rpgui.min.js';
|
|
12
12
|
import _ from 'lodash-es';
|
|
13
13
|
import capitalize from 'lodash-es/capitalize';
|
|
14
14
|
|
|
@@ -32718,9 +32718,13 @@ var uiColors = {
|
|
|
32718
32718
|
brownGreen: '#346524'
|
|
32719
32719
|
};
|
|
32720
32720
|
|
|
32721
|
+
var _excluded$2 = ["innerRef"];
|
|
32721
32722
|
var Input = function Input(_ref) {
|
|
32722
32723
|
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
32723
|
-
|
|
32724
|
+
var rest = _objectWithoutPropertiesLoose(props, _excluded$2);
|
|
32725
|
+
return React.createElement("input", Object.assign({}, rest, {
|
|
32726
|
+
ref: props.innerRef
|
|
32727
|
+
}));
|
|
32724
32728
|
};
|
|
32725
32729
|
|
|
32726
32730
|
var RPGUIContainerTypes;
|
|
@@ -32960,7 +32964,12 @@ var DraggableContainer = function DraggableContainer(_ref) {
|
|
|
32960
32964
|
imgWidth = _ref$imgWidth === void 0 ? '20px' : _ref$imgWidth,
|
|
32961
32965
|
cancelDrag = _ref.cancelDrag,
|
|
32962
32966
|
onPositionChange = _ref.onPositionChange,
|
|
32963
|
-
onOutsideClick = _ref.onOutsideClick
|
|
32967
|
+
onOutsideClick = _ref.onOutsideClick,
|
|
32968
|
+
_ref$initialPosition = _ref.initialPosition,
|
|
32969
|
+
initialPosition = _ref$initialPosition === void 0 ? {
|
|
32970
|
+
x: 0,
|
|
32971
|
+
y: 0
|
|
32972
|
+
} : _ref$initialPosition;
|
|
32964
32973
|
var draggableRef = useRef(null);
|
|
32965
32974
|
useOutsideClick(draggableRef, 'item-container');
|
|
32966
32975
|
useEffect(function () {
|
|
@@ -32985,7 +32994,8 @@ var DraggableContainer = function DraggableContainer(_ref) {
|
|
|
32985
32994
|
y: data.y
|
|
32986
32995
|
});
|
|
32987
32996
|
}
|
|
32988
|
-
}
|
|
32997
|
+
},
|
|
32998
|
+
defaultPosition: initialPosition
|
|
32989
32999
|
}, React.createElement(Container$6, {
|
|
32990
33000
|
ref: draggableRef,
|
|
32991
33001
|
width: width,
|
|
@@ -33100,41 +33110,6 @@ var DropdownOptions = /*#__PURE__*/styled.ul.withConfig({
|
|
|
33100
33110
|
return props.opened ? 'block' : 'none';
|
|
33101
33111
|
});
|
|
33102
33112
|
|
|
33103
|
-
//@ts-ignore
|
|
33104
|
-
var _RPGUI = RPGUI;
|
|
33105
|
-
var RPGUIRoot = function RPGUIRoot(_ref) {
|
|
33106
|
-
var children = _ref.children;
|
|
33107
|
-
return React.createElement("div", {
|
|
33108
|
-
className: "rpgui-content"
|
|
33109
|
-
}, children);
|
|
33110
|
-
};
|
|
33111
|
-
|
|
33112
|
-
var RPGUIForceRenderStart = function RPGUIForceRenderStart(_ref) {
|
|
33113
|
-
var children = _ref.children,
|
|
33114
|
-
elementDOMId = _ref.elementDOMId,
|
|
33115
|
-
elementRenderedDOMKey = _ref.elementRenderedDOMKey,
|
|
33116
|
-
RPGUICreateFunction = _ref.RPGUICreateFunction;
|
|
33117
|
-
var _useState = useState(false),
|
|
33118
|
-
isRendered = _useState[0],
|
|
33119
|
-
setIsRendered = _useState[1];
|
|
33120
|
-
useEffect(function () {
|
|
33121
|
-
if (_RPGUI) {
|
|
33122
|
-
var element = document.getElementById(elementDOMId);
|
|
33123
|
-
// create an interval to wait for the element to be rendered
|
|
33124
|
-
// if it's not, trigger the rendering forcefully
|
|
33125
|
-
var interval = setInterval(function () {
|
|
33126
|
-
var dropdown = document.querySelector(elementRenderedDOMKey);
|
|
33127
|
-
if (!dropdown && !isRendered) {
|
|
33128
|
-
_RPGUI.__create_funcs[RPGUICreateFunction](element);
|
|
33129
|
-
setIsRendered(true);
|
|
33130
|
-
clearInterval(interval);
|
|
33131
|
-
}
|
|
33132
|
-
}, 10);
|
|
33133
|
-
}
|
|
33134
|
-
}, []);
|
|
33135
|
-
return React.createElement(React.Fragment, null, children);
|
|
33136
|
-
};
|
|
33137
|
-
|
|
33138
33113
|
var CraftBook = function CraftBook(_ref) {
|
|
33139
33114
|
var atlasIMG = _ref.atlasIMG,
|
|
33140
33115
|
atlasJSON = _ref.atlasJSON,
|
|
@@ -33179,16 +33154,10 @@ var CraftBook = function CraftBook(_ref) {
|
|
|
33179
33154
|
name = modifiedWords.join(' ');
|
|
33180
33155
|
return name;
|
|
33181
33156
|
};
|
|
33182
|
-
var handleClick = function handleClick() {
|
|
33183
|
-
|
|
33184
|
-
var elementValue = element.value;
|
|
33185
|
-
setCraftItem(elementValue);
|
|
33157
|
+
var handleClick = function handleClick(value) {
|
|
33158
|
+
setCraftItem(value);
|
|
33186
33159
|
};
|
|
33187
|
-
return React.createElement(
|
|
33188
|
-
elementDOMId: "radioInput",
|
|
33189
|
-
elementRenderedDOMKey: "rpgui-radio",
|
|
33190
|
-
RPGUICreateFunction: "radio"
|
|
33191
|
-
}, React.createElement(DraggableContainer, {
|
|
33160
|
+
return React.createElement(DraggableContainer, {
|
|
33192
33161
|
type: RPGUIContainerTypes.Framed,
|
|
33193
33162
|
width: "500px",
|
|
33194
33163
|
cancelDrag: ".equipment-container-body .arrow-selector",
|
|
@@ -33223,9 +33192,14 @@ var CraftBook = function CraftBook(_ref) {
|
|
|
33223
33192
|
value: option.name,
|
|
33224
33193
|
name: "test",
|
|
33225
33194
|
disabled: !option.canCraft,
|
|
33226
|
-
|
|
33195
|
+
checked: craftItem === option.key,
|
|
33196
|
+
onChange: function onChange() {
|
|
33197
|
+
return handleClick(option.key);
|
|
33198
|
+
}
|
|
33227
33199
|
}), React.createElement("label", {
|
|
33228
|
-
onClick:
|
|
33200
|
+
onClick: function onClick() {
|
|
33201
|
+
return handleClick(option.key);
|
|
33202
|
+
},
|
|
33229
33203
|
style: {
|
|
33230
33204
|
display: 'flex',
|
|
33231
33205
|
alignItems: 'center'
|
|
@@ -33260,7 +33234,7 @@ var CraftBook = function CraftBook(_ref) {
|
|
|
33260
33234
|
onClick: function onClick() {
|
|
33261
33235
|
return onCraftItem(craftItem);
|
|
33262
33236
|
}
|
|
33263
|
-
}, "Craft")))
|
|
33237
|
+
}, "Craft")));
|
|
33264
33238
|
};
|
|
33265
33239
|
var StyledItem = /*#__PURE__*/styled.div.withConfig({
|
|
33266
33240
|
displayName: "CraftBook__StyledItem",
|
|
@@ -33494,26 +33468,57 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
33494
33468
|
slotSpriteMask = _ref.slotSpriteMask,
|
|
33495
33469
|
_onMouseOver = _ref.onMouseOver,
|
|
33496
33470
|
_onMouseOut = _ref.onMouseOut,
|
|
33497
|
-
|
|
33471
|
+
onClick = _ref.onClick,
|
|
33498
33472
|
_onSelected = _ref.onSelected,
|
|
33499
33473
|
atlasJSON = _ref.atlasJSON,
|
|
33500
33474
|
atlasIMG = _ref.atlasIMG,
|
|
33501
33475
|
_ref$isContextMenuDis = _ref.isContextMenuDisabled,
|
|
33502
|
-
isContextMenuDisabled = _ref$isContextMenuDis === void 0 ? false : _ref$isContextMenuDis
|
|
33476
|
+
isContextMenuDisabled = _ref$isContextMenuDis === void 0 ? false : _ref$isContextMenuDis,
|
|
33477
|
+
onDragEnd = _ref.onDragEnd,
|
|
33478
|
+
onDragStart = _ref.onDragStart,
|
|
33479
|
+
onPlaceDrop = _ref.onPlaceDrop,
|
|
33480
|
+
onDrop = _ref.onOutsideDrop,
|
|
33481
|
+
checkIfItemCanBeMoved = _ref.checkIfItemCanBeMoved,
|
|
33482
|
+
openQuantitySelector = _ref.openQuantitySelector;
|
|
33503
33483
|
var _useState = useState(false),
|
|
33504
33484
|
isTooltipVisible = _useState[0],
|
|
33505
33485
|
setTooltipVisible = _useState[1];
|
|
33506
33486
|
var _useState2 = useState(false),
|
|
33507
33487
|
isContextMenuVisible = _useState2[0],
|
|
33508
33488
|
setIsContextMenuVisible = _useState2[1];
|
|
33509
|
-
var _useState3 = useState(
|
|
33510
|
-
|
|
33511
|
-
|
|
33489
|
+
var _useState3 = useState(false),
|
|
33490
|
+
isFocused = _useState3[0],
|
|
33491
|
+
setIsFocused = _useState3[1];
|
|
33492
|
+
var _useState4 = useState(false),
|
|
33493
|
+
wasDragged = _useState4[0],
|
|
33494
|
+
setWasDragged = _useState4[1];
|
|
33495
|
+
var _useState5 = useState({
|
|
33496
|
+
x: 0,
|
|
33497
|
+
y: 0
|
|
33498
|
+
}),
|
|
33499
|
+
dragPosition = _useState5[0],
|
|
33500
|
+
setDragPosition = _useState5[1];
|
|
33501
|
+
var _useState6 = useState(null),
|
|
33502
|
+
dropPosition = _useState6[0],
|
|
33503
|
+
setDropPosition = _useState6[1];
|
|
33504
|
+
var dragContainer = useRef(null);
|
|
33505
|
+
var _useState7 = useState([]),
|
|
33506
|
+
contextActions = _useState7[0],
|
|
33507
|
+
setContextActions = _useState7[1];
|
|
33512
33508
|
useEffect(function () {
|
|
33509
|
+
setDragPosition({
|
|
33510
|
+
x: 0,
|
|
33511
|
+
y: 0
|
|
33512
|
+
});
|
|
33513
33513
|
if (item) {
|
|
33514
33514
|
setContextActions(generateContextMenu(item, containerType));
|
|
33515
33515
|
}
|
|
33516
33516
|
}, [item]);
|
|
33517
|
+
useEffect(function () {
|
|
33518
|
+
if (onDrop && item && dropPosition) {
|
|
33519
|
+
onDrop(item, dropPosition);
|
|
33520
|
+
}
|
|
33521
|
+
}, [dropPosition]);
|
|
33517
33522
|
var getStackInfo = function getStackInfo(itemId, stackQty) {
|
|
33518
33523
|
// if (itemToRender?.isStackable && itemToRender?.stackQty) {
|
|
33519
33524
|
var isFractionalStackQty = stackQty % 1 !== 0;
|
|
@@ -33601,30 +33606,115 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
33601
33606
|
return renderItem(itemToRender);
|
|
33602
33607
|
}
|
|
33603
33608
|
};
|
|
33609
|
+
var resetItem = function resetItem() {
|
|
33610
|
+
setTooltipVisible(false);
|
|
33611
|
+
setIsFocused(false);
|
|
33612
|
+
setWasDragged(false);
|
|
33613
|
+
};
|
|
33614
|
+
var onSuccesfulDrag = function onSuccesfulDrag(quantity) {
|
|
33615
|
+
resetItem();
|
|
33616
|
+
if (quantity === -1) setDragPosition({
|
|
33617
|
+
x: 0,
|
|
33618
|
+
y: 0
|
|
33619
|
+
});else if (item) {
|
|
33620
|
+
onDragEnd(quantity);
|
|
33621
|
+
resetItem();
|
|
33622
|
+
}
|
|
33623
|
+
};
|
|
33604
33624
|
return React.createElement(Container$a, {
|
|
33605
33625
|
className: "rpgui-icon empty-slot",
|
|
33626
|
+
onMouseUp: function onMouseUp() {
|
|
33627
|
+
var data = item ? item : null;
|
|
33628
|
+
if (onPlaceDrop) onPlaceDrop(data, slotIndex, containerType);
|
|
33629
|
+
},
|
|
33630
|
+
onTouchEnd: function onTouchEnd(e) {
|
|
33631
|
+
var _document$elementFrom;
|
|
33632
|
+
var _e$changedTouches$ = e.changedTouches[0],
|
|
33633
|
+
clientX = _e$changedTouches$.clientX,
|
|
33634
|
+
clientY = _e$changedTouches$.clientY;
|
|
33635
|
+
var simulatedEvent = new MouseEvent('mouseup', {
|
|
33636
|
+
clientX: clientX,
|
|
33637
|
+
clientY: clientY,
|
|
33638
|
+
bubbles: true
|
|
33639
|
+
});
|
|
33640
|
+
(_document$elementFrom = document.elementFromPoint(clientX, clientY)) == null ? void 0 : _document$elementFrom.dispatchEvent(simulatedEvent);
|
|
33641
|
+
}
|
|
33642
|
+
}, React.createElement(Draggable, {
|
|
33643
|
+
defaultClassName: item ? 'draggable' : 'empty-slot',
|
|
33644
|
+
onStop: function onStop(e, data) {
|
|
33645
|
+
if (wasDragged && item) {
|
|
33646
|
+
var _e$target;
|
|
33647
|
+
//@ts-ignore
|
|
33648
|
+
var classes = Array.from((_e$target = e.target) == null ? void 0 : _e$target.classList);
|
|
33649
|
+
var isOutsideDrop = classes.some(function (elm) {
|
|
33650
|
+
//elm matches ItemContainer string
|
|
33651
|
+
return elm.includes('rpgui-content');
|
|
33652
|
+
});
|
|
33653
|
+
if (isOutsideDrop) {
|
|
33654
|
+
setDropPosition({
|
|
33655
|
+
x: data.x,
|
|
33656
|
+
y: data.y
|
|
33657
|
+
});
|
|
33658
|
+
}
|
|
33659
|
+
setWasDragged(false);
|
|
33660
|
+
var target = dragContainer.current;
|
|
33661
|
+
if (!target || !wasDragged) return;
|
|
33662
|
+
var style = window.getComputedStyle(target);
|
|
33663
|
+
var matrix = new DOMMatrixReadOnly(style.transform);
|
|
33664
|
+
var x = matrix.m41;
|
|
33665
|
+
var y = matrix.m42;
|
|
33666
|
+
setDragPosition({
|
|
33667
|
+
x: x,
|
|
33668
|
+
y: y
|
|
33669
|
+
});
|
|
33670
|
+
setTimeout(function () {
|
|
33671
|
+
if (checkIfItemCanBeMoved()) {
|
|
33672
|
+
if (item.stackQty && item.stackQty !== 1 && openQuantitySelector) openQuantitySelector(item.stackQty, onSuccesfulDrag);else onSuccesfulDrag(item.stackQty);
|
|
33673
|
+
} else {
|
|
33674
|
+
resetItem();
|
|
33675
|
+
setDragPosition({
|
|
33676
|
+
x: 0,
|
|
33677
|
+
y: 0
|
|
33678
|
+
});
|
|
33679
|
+
}
|
|
33680
|
+
}, 100);
|
|
33681
|
+
} else if (item) {
|
|
33682
|
+
if (!isContextMenuDisabled) setIsContextMenuVisible(!isContextMenuVisible);
|
|
33683
|
+
onClick(item.type, containerType, item);
|
|
33684
|
+
}
|
|
33685
|
+
},
|
|
33686
|
+
onStart: function onStart() {
|
|
33687
|
+
if (!item) {
|
|
33688
|
+
return;
|
|
33689
|
+
}
|
|
33690
|
+
if (onDragStart) {
|
|
33691
|
+
onDragStart(item, slotIndex, containerType);
|
|
33692
|
+
}
|
|
33693
|
+
},
|
|
33694
|
+
onDrag: function onDrag() {
|
|
33695
|
+
setWasDragged(true);
|
|
33696
|
+
setIsFocused(true);
|
|
33697
|
+
},
|
|
33698
|
+
position: dragPosition,
|
|
33699
|
+
cancel: ".empty-slot"
|
|
33700
|
+
}, React.createElement(ItemContainer, {
|
|
33701
|
+
ref: dragContainer,
|
|
33702
|
+
isFocused: isFocused,
|
|
33606
33703
|
onMouseOver: function onMouseOver(event) {
|
|
33607
|
-
|
|
33704
|
+
_onMouseOver(event, slotIndex, item, event.clientX, event.clientY);
|
|
33608
33705
|
},
|
|
33609
33706
|
onMouseOut: function onMouseOut() {
|
|
33610
33707
|
if (_onMouseOut) _onMouseOut();
|
|
33611
33708
|
},
|
|
33612
33709
|
onMouseEnter: function onMouseEnter() {
|
|
33613
|
-
|
|
33710
|
+
setTooltipVisible(true);
|
|
33614
33711
|
},
|
|
33615
33712
|
onMouseLeave: function onMouseLeave() {
|
|
33616
|
-
return setTooltipVisible(false);
|
|
33617
|
-
},
|
|
33618
|
-
onClick: function onClick() {
|
|
33619
33713
|
setTooltipVisible(false);
|
|
33620
|
-
if (item) {
|
|
33621
|
-
if (!isContextMenuDisabled) {
|
|
33622
|
-
setIsContextMenuVisible(!isContextMenuVisible);
|
|
33623
|
-
}
|
|
33624
|
-
_onClick(item.type, containerType, item);
|
|
33625
|
-
}
|
|
33626
33714
|
}
|
|
33627
|
-
},
|
|
33715
|
+
}, onRenderSlot(item))), isTooltipVisible && item && React.createElement(ItemTooltip, {
|
|
33716
|
+
label: item.name
|
|
33717
|
+
}), !isContextMenuDisabled && isContextMenuVisible && contextActions && React.createElement(RelativeListMenu, {
|
|
33628
33718
|
options: contextActions,
|
|
33629
33719
|
onSelected: function onSelected(optionId) {
|
|
33630
33720
|
setIsContextMenuVisible(false);
|
|
@@ -33635,21 +33725,25 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
33635
33725
|
onOutsideClick: function onOutsideClick() {
|
|
33636
33726
|
setIsContextMenuVisible(false);
|
|
33637
33727
|
}
|
|
33638
|
-
})
|
|
33639
|
-
label: item.name
|
|
33640
|
-
}), onRenderSlot(item));
|
|
33728
|
+
}));
|
|
33641
33729
|
});
|
|
33642
33730
|
var Container$a = /*#__PURE__*/styled.div.withConfig({
|
|
33643
33731
|
displayName: "ItemSlot__Container",
|
|
33644
33732
|
componentId: "sc-l2j5ef-0"
|
|
33645
33733
|
})(["margin:0.1rem;.sprite-from-atlas-img{position:relative;top:1.5rem;left:1.5rem;}position:relative;"]);
|
|
33734
|
+
var ItemContainer = /*#__PURE__*/styled.div.withConfig({
|
|
33735
|
+
displayName: "ItemSlot__ItemContainer",
|
|
33736
|
+
componentId: "sc-l2j5ef-1"
|
|
33737
|
+
})(["width:100%;height:100%;position:relative;", ""], function (props) {
|
|
33738
|
+
return props.isFocused && 'z-index: 100; pointer-events: none;';
|
|
33739
|
+
});
|
|
33646
33740
|
var ItemQtyContainer = /*#__PURE__*/styled.div.withConfig({
|
|
33647
33741
|
displayName: "ItemSlot__ItemQtyContainer",
|
|
33648
|
-
componentId: "sc-l2j5ef-
|
|
33649
|
-
})(["position:relative;width:85%;height:16px;top:25px;left:2px;display:flex;justify-content:flex-end;"]);
|
|
33742
|
+
componentId: "sc-l2j5ef-2"
|
|
33743
|
+
})(["position:relative;width:85%;height:16px;top:25px;left:2px;pointer-events:none;display:flex;justify-content:flex-end;"]);
|
|
33650
33744
|
var ItemQty = /*#__PURE__*/styled.span.withConfig({
|
|
33651
33745
|
displayName: "ItemSlot__ItemQty",
|
|
33652
|
-
componentId: "sc-l2j5ef-
|
|
33746
|
+
componentId: "sc-l2j5ef-3"
|
|
33653
33747
|
})(["&.regular{font-size:", ";}&.small{font-size:", ";}"], uiFonts.size.small, uiFonts.size.xsmall);
|
|
33654
33748
|
|
|
33655
33749
|
var EquipmentSet = function EquipmentSet(_ref) {
|
|
@@ -33659,7 +33753,12 @@ var EquipmentSet = function EquipmentSet(_ref) {
|
|
|
33659
33753
|
_onSelected = _ref.onSelected,
|
|
33660
33754
|
onItemClick = _ref.onItemClick,
|
|
33661
33755
|
atlasIMG = _ref.atlasIMG,
|
|
33662
|
-
atlasJSON = _ref.atlasJSON
|
|
33756
|
+
atlasJSON = _ref.atlasJSON,
|
|
33757
|
+
onItemDragEnd = _ref.onItemDragEnd,
|
|
33758
|
+
onItemDragStart = _ref.onItemDragStart,
|
|
33759
|
+
onItemPlaceDrop = _ref.onItemPlaceDrop,
|
|
33760
|
+
onItemOutsideDrop = _ref.onItemOutsideDrop,
|
|
33761
|
+
checkIfItemCanBeMoved = _ref.checkIfItemCanBeMoved;
|
|
33663
33762
|
var neck = equipmentSet.neck,
|
|
33664
33763
|
leftHand = equipmentSet.leftHand,
|
|
33665
33764
|
ring = equipmentSet.ring,
|
|
@@ -33695,6 +33794,22 @@ var EquipmentSet = function EquipmentSet(_ref) {
|
|
|
33695
33794
|
onSelected: function onSelected(optionId) {
|
|
33696
33795
|
if (_onSelected) _onSelected(optionId);
|
|
33697
33796
|
},
|
|
33797
|
+
onDragStart: function onDragStart(item, slotIndex, itemContainerType) {
|
|
33798
|
+
if (!item) {
|
|
33799
|
+
return;
|
|
33800
|
+
}
|
|
33801
|
+
if (onItemDragStart) onItemDragStart(item, slotIndex, itemContainerType);
|
|
33802
|
+
},
|
|
33803
|
+
onDragEnd: function onDragEnd(quantity) {
|
|
33804
|
+
if (onItemDragEnd) onItemDragEnd(quantity);
|
|
33805
|
+
},
|
|
33806
|
+
checkIfItemCanBeMoved: checkIfItemCanBeMoved,
|
|
33807
|
+
onPlaceDrop: function onPlaceDrop(item, slotIndex, itemContainerType) {
|
|
33808
|
+
if (onItemPlaceDrop) onItemPlaceDrop(item, slotIndex, itemContainerType);
|
|
33809
|
+
},
|
|
33810
|
+
onOutsideDrop: function onOutsideDrop(item, position) {
|
|
33811
|
+
if (onItemOutsideDrop) onItemOutsideDrop(item, position);
|
|
33812
|
+
},
|
|
33698
33813
|
atlasIMG: atlasIMG,
|
|
33699
33814
|
atlasJSON: atlasJSON
|
|
33700
33815
|
});
|
|
@@ -33715,11 +33830,11 @@ var EquipmentSet = function EquipmentSet(_ref) {
|
|
|
33715
33830
|
var EquipmentSetContainer = /*#__PURE__*/styled.div.withConfig({
|
|
33716
33831
|
displayName: "EquipmentSet__EquipmentSetContainer",
|
|
33717
33832
|
componentId: "sc-1wuddg2-0"
|
|
33718
|
-
})(["width:inherit;display:flex;justify-content:center;flex-wrap:wrap;flex-direction:row;"]);
|
|
33833
|
+
})(["width:inherit;display:flex;justify-content:center;flex-wrap:wrap;flex-direction:row;touch-action:none;"]);
|
|
33719
33834
|
var EquipmentColumn = /*#__PURE__*/styled.div.withConfig({
|
|
33720
33835
|
displayName: "EquipmentSet__EquipmentColumn",
|
|
33721
33836
|
componentId: "sc-1wuddg2-1"
|
|
33722
|
-
})(["display:flex;justify-content:center;flex-wrap:wrap;flex-direction:column;"]);
|
|
33837
|
+
})(["display:flex;justify-content:center;flex-wrap:wrap;flex-direction:column;touch-action:none;"]);
|
|
33723
33838
|
|
|
33724
33839
|
var IS_MOBILE_OR_TABLET = /*#__PURE__*/isMobile({
|
|
33725
33840
|
tablet: true
|
|
@@ -34268,7 +34383,8 @@ var SlotsContainer = function SlotsContainer(_ref) {
|
|
|
34268
34383
|
title = _ref.title,
|
|
34269
34384
|
onClose = _ref.onClose,
|
|
34270
34385
|
_onPositionChange = _ref.onPositionChange,
|
|
34271
|
-
onOutsideClick = _ref.onOutsideClick
|
|
34386
|
+
onOutsideClick = _ref.onOutsideClick,
|
|
34387
|
+
initialPosition = _ref.initialPosition;
|
|
34272
34388
|
return React.createElement(DraggableContainer, {
|
|
34273
34389
|
title: title,
|
|
34274
34390
|
type: RPGUIContainerTypes.Framed,
|
|
@@ -34289,11 +34405,168 @@ var SlotsContainer = function SlotsContainer(_ref) {
|
|
|
34289
34405
|
});
|
|
34290
34406
|
}
|
|
34291
34407
|
},
|
|
34292
|
-
onOutsideClick: onOutsideClick
|
|
34408
|
+
onOutsideClick: onOutsideClick,
|
|
34409
|
+
initialPosition: initialPosition
|
|
34293
34410
|
}, children);
|
|
34294
34411
|
};
|
|
34295
34412
|
|
|
34296
|
-
var
|
|
34413
|
+
var RangeSliderType;
|
|
34414
|
+
(function (RangeSliderType) {
|
|
34415
|
+
RangeSliderType["Slider"] = "rpgui-slider";
|
|
34416
|
+
RangeSliderType["GoldSlider"] = "rpgui-slider golden";
|
|
34417
|
+
})(RangeSliderType || (RangeSliderType = {}));
|
|
34418
|
+
var RangeSlider = function RangeSlider(_ref) {
|
|
34419
|
+
var type = _ref.type,
|
|
34420
|
+
valueMin = _ref.valueMin,
|
|
34421
|
+
valueMax = _ref.valueMax,
|
|
34422
|
+
width = _ref.width,
|
|
34423
|
+
_onChange = _ref.onChange,
|
|
34424
|
+
value = _ref.value;
|
|
34425
|
+
var sliderId = v4();
|
|
34426
|
+
var containerRef = useRef(null);
|
|
34427
|
+
var _useState = useState(0),
|
|
34428
|
+
left = _useState[0],
|
|
34429
|
+
setLeft = _useState[1];
|
|
34430
|
+
useEffect(function () {
|
|
34431
|
+
var _containerRef$current;
|
|
34432
|
+
var calculatedWidth = ((_containerRef$current = containerRef.current) == null ? void 0 : _containerRef$current.clientWidth) || 0;
|
|
34433
|
+
setLeft(Math.max((value - valueMin) / (valueMax - valueMin) * (calculatedWidth - 35) + 10));
|
|
34434
|
+
}, [value, valueMin, valueMax]);
|
|
34435
|
+
var typeClass = type === RangeSliderType.GoldSlider ? 'golden' : '';
|
|
34436
|
+
return React.createElement("div", {
|
|
34437
|
+
style: {
|
|
34438
|
+
width: width,
|
|
34439
|
+
position: 'relative'
|
|
34440
|
+
},
|
|
34441
|
+
className: "rpgui-slider-container " + typeClass,
|
|
34442
|
+
id: "rpgui-slider-" + sliderId,
|
|
34443
|
+
ref: containerRef
|
|
34444
|
+
}, React.createElement("div", {
|
|
34445
|
+
style: {
|
|
34446
|
+
pointerEvents: 'none'
|
|
34447
|
+
}
|
|
34448
|
+
}, React.createElement("div", {
|
|
34449
|
+
className: "rpgui-slider-track " + typeClass
|
|
34450
|
+
}), React.createElement("div", {
|
|
34451
|
+
className: "rpgui-slider-left-edge " + typeClass
|
|
34452
|
+
}), React.createElement("div", {
|
|
34453
|
+
className: "rpgui-slider-right-edge " + typeClass
|
|
34454
|
+
}), React.createElement("div", {
|
|
34455
|
+
className: "rpgui-slider-thumb " + typeClass,
|
|
34456
|
+
style: {
|
|
34457
|
+
left: left
|
|
34458
|
+
}
|
|
34459
|
+
})), React.createElement(Input$1, {
|
|
34460
|
+
type: "range",
|
|
34461
|
+
style: {
|
|
34462
|
+
width: width
|
|
34463
|
+
},
|
|
34464
|
+
min: valueMin,
|
|
34465
|
+
max: valueMax,
|
|
34466
|
+
onChange: function onChange(e) {
|
|
34467
|
+
return _onChange(Number(e.target.value));
|
|
34468
|
+
},
|
|
34469
|
+
value: value,
|
|
34470
|
+
className: "rpgui-cursor-point"
|
|
34471
|
+
}));
|
|
34472
|
+
};
|
|
34473
|
+
var Input$1 = /*#__PURE__*/styled.input.withConfig({
|
|
34474
|
+
displayName: "RangeSlider__Input",
|
|
34475
|
+
componentId: "sc-v8mte9-0"
|
|
34476
|
+
})(["opacity:0;position:absolute;width:100%;height:100%;top:0;left:0;margin-top:-5px;"]);
|
|
34477
|
+
|
|
34478
|
+
var ItemQuantitySelector = function ItemQuantitySelector(_ref) {
|
|
34479
|
+
var quantity = _ref.quantity,
|
|
34480
|
+
onConfirm = _ref.onConfirm,
|
|
34481
|
+
onClose = _ref.onClose;
|
|
34482
|
+
var _useState = useState(quantity),
|
|
34483
|
+
value = _useState[0],
|
|
34484
|
+
setValue = _useState[1];
|
|
34485
|
+
var inputRef = useRef(null);
|
|
34486
|
+
useEffect(function () {
|
|
34487
|
+
if (inputRef.current) {
|
|
34488
|
+
inputRef.current.focus();
|
|
34489
|
+
inputRef.current.select();
|
|
34490
|
+
var closeSelector = function closeSelector(e) {
|
|
34491
|
+
if (e.key === 'Escape') {
|
|
34492
|
+
onClose();
|
|
34493
|
+
}
|
|
34494
|
+
};
|
|
34495
|
+
document.addEventListener('keydown', closeSelector);
|
|
34496
|
+
return function () {
|
|
34497
|
+
document.removeEventListener('keydown', closeSelector);
|
|
34498
|
+
};
|
|
34499
|
+
}
|
|
34500
|
+
return function () {};
|
|
34501
|
+
}, []);
|
|
34502
|
+
return React.createElement(StyledContainer, {
|
|
34503
|
+
type: RPGUIContainerTypes.Framed,
|
|
34504
|
+
width: "25rem"
|
|
34505
|
+
}, React.createElement(CloseButton$2, {
|
|
34506
|
+
className: "container-close",
|
|
34507
|
+
onClick: onClose,
|
|
34508
|
+
onTouchStart: onClose
|
|
34509
|
+
}, "X"), React.createElement("h2", null, "Select quantity to move"), React.createElement(StyledForm, {
|
|
34510
|
+
style: {
|
|
34511
|
+
width: '100%'
|
|
34512
|
+
},
|
|
34513
|
+
onSubmit: function onSubmit(e) {
|
|
34514
|
+
e.preventDefault();
|
|
34515
|
+
var numberValue = Number(value);
|
|
34516
|
+
if (Number.isNaN(numberValue)) {
|
|
34517
|
+
return;
|
|
34518
|
+
}
|
|
34519
|
+
onConfirm(Math.max(1, Math.min(quantity, numberValue)));
|
|
34520
|
+
},
|
|
34521
|
+
noValidate: true
|
|
34522
|
+
}, React.createElement(StyledInput, {
|
|
34523
|
+
innerRef: inputRef,
|
|
34524
|
+
placeholder: "Enter quantity",
|
|
34525
|
+
type: "number",
|
|
34526
|
+
min: 1,
|
|
34527
|
+
max: quantity,
|
|
34528
|
+
value: value,
|
|
34529
|
+
onChange: function onChange(e) {
|
|
34530
|
+
if (Number(e.target.value) >= quantity) {
|
|
34531
|
+
setValue(quantity);
|
|
34532
|
+
return;
|
|
34533
|
+
}
|
|
34534
|
+
setValue(e.target.value);
|
|
34535
|
+
},
|
|
34536
|
+
onBlur: function onBlur(e) {
|
|
34537
|
+
var newValue = Math.max(1, Math.min(quantity, Number(e.target.value)));
|
|
34538
|
+
setValue(newValue);
|
|
34539
|
+
}
|
|
34540
|
+
}), React.createElement(RangeSlider, {
|
|
34541
|
+
type: RangeSliderType.Slider,
|
|
34542
|
+
valueMin: 1,
|
|
34543
|
+
valueMax: quantity,
|
|
34544
|
+
width: "100%",
|
|
34545
|
+
onChange: setValue,
|
|
34546
|
+
value: value
|
|
34547
|
+
}), React.createElement(Button, {
|
|
34548
|
+
buttonType: ButtonTypes.RPGUIButton,
|
|
34549
|
+
type: "submit"
|
|
34550
|
+
}, "Confirm")));
|
|
34551
|
+
};
|
|
34552
|
+
var StyledContainer = /*#__PURE__*/styled(RPGUIContainer).withConfig({
|
|
34553
|
+
displayName: "ItemQuantitySelector__StyledContainer",
|
|
34554
|
+
componentId: "sc-yfdtpn-0"
|
|
34555
|
+
})(["display:flex;flex-direction:column;align-items:center;"]);
|
|
34556
|
+
var StyledForm = /*#__PURE__*/styled.form.withConfig({
|
|
34557
|
+
displayName: "ItemQuantitySelector__StyledForm",
|
|
34558
|
+
componentId: "sc-yfdtpn-1"
|
|
34559
|
+
})(["display:flex;flex-direction:column;align-items:center;width:100%;"]);
|
|
34560
|
+
var StyledInput = /*#__PURE__*/styled(Input).withConfig({
|
|
34561
|
+
displayName: "ItemQuantitySelector__StyledInput",
|
|
34562
|
+
componentId: "sc-yfdtpn-2"
|
|
34563
|
+
})(["text-align:center;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}&[type='number']{-moz-appearance:textfield;}"]);
|
|
34564
|
+
var CloseButton$2 = /*#__PURE__*/styled.div.withConfig({
|
|
34565
|
+
displayName: "ItemQuantitySelector__CloseButton",
|
|
34566
|
+
componentId: "sc-yfdtpn-3"
|
|
34567
|
+
})(["position:absolute;top:3px;right:0px;color:white;z-index:22;font-size:0.8rem;"]);
|
|
34568
|
+
|
|
34569
|
+
var ItemContainer$1 = function ItemContainer(_ref) {
|
|
34297
34570
|
var itemContainer = _ref.itemContainer,
|
|
34298
34571
|
onClose = _ref.onClose,
|
|
34299
34572
|
_onMouseOver = _ref.onMouseOver,
|
|
@@ -34303,7 +34576,20 @@ var ItemContainer = function ItemContainer(_ref) {
|
|
|
34303
34576
|
atlasJSON = _ref.atlasJSON,
|
|
34304
34577
|
atlasIMG = _ref.atlasIMG,
|
|
34305
34578
|
_ref$disableContextMe = _ref.disableContextMenu,
|
|
34306
|
-
disableContextMenu = _ref$disableContextMe === void 0 ? false : _ref$disableContextMe
|
|
34579
|
+
disableContextMenu = _ref$disableContextMe === void 0 ? false : _ref$disableContextMe,
|
|
34580
|
+
onItemDragEnd = _ref.onItemDragEnd,
|
|
34581
|
+
onItemDragStart = _ref.onItemDragStart,
|
|
34582
|
+
onItemPlaceDrop = _ref.onItemPlaceDrop,
|
|
34583
|
+
_onOutsideDrop = _ref.onOutsideDrop,
|
|
34584
|
+
checkIfItemCanBeMoved = _ref.checkIfItemCanBeMoved,
|
|
34585
|
+
initialPosition = _ref.initialPosition;
|
|
34586
|
+
var _useState = useState({
|
|
34587
|
+
isOpen: false,
|
|
34588
|
+
maxQuantity: 1,
|
|
34589
|
+
callback: function callback(_quantity) {}
|
|
34590
|
+
}),
|
|
34591
|
+
quantitySelect = _useState[0],
|
|
34592
|
+
setQuantitySelect = _useState[1];
|
|
34307
34593
|
var onRenderSlots = function onRenderSlots() {
|
|
34308
34594
|
var slots = [];
|
|
34309
34595
|
for (var i = 0; i < itemContainer.slotQty; i++) {
|
|
@@ -34323,109 +34609,66 @@ var ItemContainer = function ItemContainer(_ref) {
|
|
|
34323
34609
|
onSelected: function onSelected(optionId, item) {
|
|
34324
34610
|
if (_onSelected) _onSelected(optionId, item);
|
|
34325
34611
|
},
|
|
34612
|
+
onDragStart: function onDragStart(item, slotIndex, itemContainerType) {
|
|
34613
|
+
if (onItemDragStart) onItemDragStart(item, slotIndex, itemContainerType);
|
|
34614
|
+
},
|
|
34615
|
+
onDragEnd: function onDragEnd(quantity) {
|
|
34616
|
+
if (onItemDragEnd) onItemDragEnd(quantity);
|
|
34617
|
+
},
|
|
34618
|
+
checkIfItemCanBeMoved: checkIfItemCanBeMoved,
|
|
34619
|
+
openQuantitySelector: function openQuantitySelector(maxQuantity, callback) {
|
|
34620
|
+
setQuantitySelect({
|
|
34621
|
+
isOpen: true,
|
|
34622
|
+
maxQuantity: maxQuantity,
|
|
34623
|
+
callback: callback
|
|
34624
|
+
});
|
|
34625
|
+
},
|
|
34626
|
+
onPlaceDrop: function onPlaceDrop(item, slotIndex, itemContainerType) {
|
|
34627
|
+
if (onItemPlaceDrop) onItemPlaceDrop(item, slotIndex, itemContainerType);
|
|
34628
|
+
},
|
|
34629
|
+
onOutsideDrop: function onOutsideDrop(item, position) {
|
|
34630
|
+
if (_onOutsideDrop) _onOutsideDrop(item, position);
|
|
34631
|
+
},
|
|
34326
34632
|
atlasIMG: atlasIMG,
|
|
34327
34633
|
atlasJSON: atlasJSON
|
|
34328
34634
|
}));
|
|
34329
34635
|
}
|
|
34330
34636
|
return slots;
|
|
34331
34637
|
};
|
|
34332
|
-
return React.createElement(SlotsContainer, {
|
|
34638
|
+
return React.createElement(React.Fragment, null, React.createElement(SlotsContainer, {
|
|
34333
34639
|
title: itemContainer.name || 'Container',
|
|
34334
|
-
onClose: onClose
|
|
34640
|
+
onClose: onClose,
|
|
34641
|
+
initialPosition: initialPosition
|
|
34335
34642
|
}, React.createElement(ItemsContainer, {
|
|
34336
34643
|
className: "item-container-body"
|
|
34337
|
-
}, onRenderSlots()))
|
|
34644
|
+
}, onRenderSlots())), quantitySelect.isOpen && React.createElement(QuantitySelectorContainer, null, React.createElement(ItemQuantitySelector, {
|
|
34645
|
+
quantity: quantitySelect.maxQuantity,
|
|
34646
|
+
onConfirm: function onConfirm(quantity) {
|
|
34647
|
+
quantitySelect.callback(quantity);
|
|
34648
|
+
setQuantitySelect({
|
|
34649
|
+
isOpen: false,
|
|
34650
|
+
maxQuantity: 1,
|
|
34651
|
+
callback: function callback() {}
|
|
34652
|
+
});
|
|
34653
|
+
},
|
|
34654
|
+
onClose: function onClose() {
|
|
34655
|
+
quantitySelect.callback(-1);
|
|
34656
|
+
setQuantitySelect({
|
|
34657
|
+
isOpen: false,
|
|
34658
|
+
maxQuantity: 1,
|
|
34659
|
+
callback: function callback() {}
|
|
34660
|
+
});
|
|
34661
|
+
}
|
|
34662
|
+
})));
|
|
34338
34663
|
};
|
|
34339
34664
|
var ItemsContainer = /*#__PURE__*/styled.div.withConfig({
|
|
34340
34665
|
displayName: "ItemContainer__ItemsContainer",
|
|
34341
34666
|
componentId: "sc-15y5p9l-0"
|
|
34342
34667
|
})(["max-width:280px;display:flex;justify-content:center;flex-wrap:wrap;"]);
|
|
34343
|
-
|
|
34344
|
-
|
|
34345
|
-
|
|
34346
|
-
|
|
34347
|
-
options = _ref.options,
|
|
34348
|
-
onClose = _ref.onClose,
|
|
34349
|
-
onSelect = _ref.onSelect;
|
|
34350
|
-
var _useState = useState(),
|
|
34351
|
-
selectedValue = _useState[0],
|
|
34352
|
-
setSelectedValue = _useState[1];
|
|
34353
|
-
var handleClick = function handleClick() {
|
|
34354
|
-
var element = document.querySelector("input[name='test']:checked");
|
|
34355
|
-
var elementValue = element.value;
|
|
34356
|
-
setSelectedValue(elementValue);
|
|
34357
|
-
};
|
|
34358
|
-
useEffect(function () {
|
|
34359
|
-
if (selectedValue) {
|
|
34360
|
-
onSelect(selectedValue);
|
|
34361
|
-
}
|
|
34362
|
-
}, [selectedValue]);
|
|
34363
|
-
return React.createElement(DraggableContainer, {
|
|
34364
|
-
type: RPGUIContainerTypes.Framed,
|
|
34365
|
-
width: "500px",
|
|
34366
|
-
cancelDrag: ".equipment-container-body .arrow-selector",
|
|
34367
|
-
onCloseButton: function onCloseButton() {
|
|
34368
|
-
if (onClose) {
|
|
34369
|
-
onClose();
|
|
34370
|
-
}
|
|
34371
|
-
}
|
|
34372
|
-
}, React.createElement("div", {
|
|
34373
|
-
style: {
|
|
34374
|
-
width: '100%'
|
|
34375
|
-
}
|
|
34376
|
-
}, React.createElement(Title$2, null, 'Harvesting instruments'), React.createElement(Subtitle$1, null, 'Use the tool, you need it'), React.createElement("hr", {
|
|
34377
|
-
className: "golden"
|
|
34378
|
-
})), React.createElement(RadioInputScroller$1, null, options == null ? void 0 : options.map(function (option, index) {
|
|
34379
|
-
return React.createElement(RadioOptionsWrapper$1, {
|
|
34380
|
-
key: index
|
|
34381
|
-
}, React.createElement(SpriteAtlasWrapper$1, null, React.createElement(SpriteFromAtlas, {
|
|
34382
|
-
atlasIMG: atlasIMG,
|
|
34383
|
-
atlasJSON: atlasJSON,
|
|
34384
|
-
spriteKey: option.imageKey,
|
|
34385
|
-
imgScale: 3
|
|
34386
|
-
})), React.createElement("div", null, React.createElement("input", {
|
|
34387
|
-
className: "rpgui-radio",
|
|
34388
|
-
type: "radio",
|
|
34389
|
-
value: option.name,
|
|
34390
|
-
name: "test"
|
|
34391
|
-
}), React.createElement("label", {
|
|
34392
|
-
onClick: handleClick,
|
|
34393
|
-
style: {
|
|
34394
|
-
display: 'flex',
|
|
34395
|
-
alignItems: 'center'
|
|
34396
|
-
}
|
|
34397
|
-
}, option.name, " ", React.createElement("br", null), option.description)));
|
|
34398
|
-
})), React.createElement(ButtonWrapper$1, null, React.createElement(Button, {
|
|
34399
|
-
buttonType: ButtonTypes.RPGUIButton,
|
|
34400
|
-
onClick: onClose
|
|
34401
|
-
}, "Cancel"), React.createElement(Button, {
|
|
34402
|
-
buttonType: ButtonTypes.RPGUIButton
|
|
34403
|
-
}, "Select")));
|
|
34404
|
-
};
|
|
34405
|
-
var Title$2 = /*#__PURE__*/styled.h1.withConfig({
|
|
34406
|
-
displayName: "ItemSelector__Title",
|
|
34407
|
-
componentId: "sc-gptoxp-0"
|
|
34408
|
-
})(["font-size:0.6rem;color:yellow !important;"]);
|
|
34409
|
-
var Subtitle$1 = /*#__PURE__*/styled.h1.withConfig({
|
|
34410
|
-
displayName: "ItemSelector__Subtitle",
|
|
34411
|
-
componentId: "sc-gptoxp-1"
|
|
34412
|
-
})(["font-size:0.4rem;color:yellow !important;"]);
|
|
34413
|
-
var RadioInputScroller$1 = /*#__PURE__*/styled.div.withConfig({
|
|
34414
|
-
displayName: "ItemSelector__RadioInputScroller",
|
|
34415
|
-
componentId: "sc-gptoxp-2"
|
|
34416
|
-
})(["padding-left:15px;padding-top:10px;width:100%;margin-top:1rem;align-items:center;margin-left:20px;align-items:flex-start;overflow-y:scroll;height:360px;"]);
|
|
34417
|
-
var SpriteAtlasWrapper$1 = /*#__PURE__*/styled.div.withConfig({
|
|
34418
|
-
displayName: "ItemSelector__SpriteAtlasWrapper",
|
|
34419
|
-
componentId: "sc-gptoxp-3"
|
|
34420
|
-
})(["margin-right:40px;"]);
|
|
34421
|
-
var RadioOptionsWrapper$1 = /*#__PURE__*/styled.div.withConfig({
|
|
34422
|
-
displayName: "ItemSelector__RadioOptionsWrapper",
|
|
34423
|
-
componentId: "sc-gptoxp-4"
|
|
34424
|
-
})(["display:flex;align-items:stretch;margin-bottom:40px;"]);
|
|
34425
|
-
var ButtonWrapper$1 = /*#__PURE__*/styled.div.withConfig({
|
|
34426
|
-
displayName: "ItemSelector__ButtonWrapper",
|
|
34427
|
-
componentId: "sc-gptoxp-5"
|
|
34428
|
-
})(["display:flex;justify-content:space-around;padding-top:20px;width:100%;"]);
|
|
34668
|
+
var QuantitySelectorContainer = /*#__PURE__*/styled.div.withConfig({
|
|
34669
|
+
displayName: "ItemContainer__QuantitySelectorContainer",
|
|
34670
|
+
componentId: "sc-15y5p9l-1"
|
|
34671
|
+
})(["position:absolute;top:0;left:0;width:100vw;height:100vh;z-index:100;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,0.5);"]);
|
|
34429
34672
|
|
|
34430
34673
|
var ListMenu = function ListMenu(_ref) {
|
|
34431
34674
|
var options = _ref.options,
|
|
@@ -34562,7 +34805,7 @@ var QuestInfo = function QuestInfo(_ref) {
|
|
|
34562
34805
|
onTouchStart: onRightClick
|
|
34563
34806
|
}), React.createElement(QuestContainer, null, React.createElement(TitleContainer$1, {
|
|
34564
34807
|
className: "drag-handler"
|
|
34565
|
-
}, React.createElement(Title$
|
|
34808
|
+
}, React.createElement(Title$2, null, React.createElement(Thumbnail, {
|
|
34566
34809
|
src: quests[currentIndex].thumbnail || img$9
|
|
34567
34810
|
}), quests[currentIndex].title), React.createElement(QuestSplitDiv, null, React.createElement("hr", {
|
|
34568
34811
|
className: "golden"
|
|
@@ -34581,7 +34824,7 @@ var QuestInfo = function QuestInfo(_ref) {
|
|
|
34581
34824
|
}, button.title);
|
|
34582
34825
|
})))) : React.createElement(QuestsContainer, null, React.createElement(QuestContainer, null, React.createElement(TitleContainer$1, {
|
|
34583
34826
|
className: "drag-handler"
|
|
34584
|
-
}, React.createElement(Title$
|
|
34827
|
+
}, React.createElement(Title$2, null, React.createElement(Thumbnail, {
|
|
34585
34828
|
src: quests[0].thumbnail || img$9
|
|
34586
34829
|
}), quests[0].title), React.createElement(QuestSplitDiv, null, React.createElement("hr", {
|
|
34587
34830
|
className: "golden"
|
|
@@ -34628,7 +34871,7 @@ var TitleContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
|
34628
34871
|
displayName: "QuestInfo__TitleContainer",
|
|
34629
34872
|
componentId: "sc-15s2boc-6"
|
|
34630
34873
|
})(["width:100%;display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:center;margin-top:1rem;"]);
|
|
34631
|
-
var Title$
|
|
34874
|
+
var Title$2 = /*#__PURE__*/styled.h1.withConfig({
|
|
34632
34875
|
displayName: "QuestInfo__Title",
|
|
34633
34876
|
componentId: "sc-15s2boc-7"
|
|
34634
34877
|
})(["color:white;z-index:22;font-size:", " !important;color:", " !important;"], uiFonts.size.medium, uiColors.yellow);
|
|
@@ -34650,7 +34893,7 @@ var QuestList = function QuestList(_ref) {
|
|
|
34650
34893
|
style: {
|
|
34651
34894
|
width: '100%'
|
|
34652
34895
|
}
|
|
34653
|
-
}, React.createElement(Title$
|
|
34896
|
+
}, React.createElement(Title$3, null, "Quests"), React.createElement("hr", {
|
|
34654
34897
|
className: "golden"
|
|
34655
34898
|
}), React.createElement(QuestListContainer, null, quests ? quests.map(function (quest, i) {
|
|
34656
34899
|
return React.createElement("div", {
|
|
@@ -34671,7 +34914,7 @@ var QuestDraggableContainer$1 = /*#__PURE__*/styled(DraggableContainer).withConf
|
|
|
34671
34914
|
displayName: "QuestList__QuestDraggableContainer",
|
|
34672
34915
|
componentId: "sc-1a2vx6q-0"
|
|
34673
34916
|
})([".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;}"]);
|
|
34674
|
-
var Title$
|
|
34917
|
+
var Title$3 = /*#__PURE__*/styled.h1.withConfig({
|
|
34675
34918
|
displayName: "QuestList__Title",
|
|
34676
34919
|
componentId: "sc-1a2vx6q-1"
|
|
34677
34920
|
})(["z-index:22;font-size:", " !important;color:yellow !important;"], uiFonts.size.medium);
|
|
@@ -34684,6 +34927,15 @@ var NoQuestContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
34684
34927
|
componentId: "sc-1a2vx6q-3"
|
|
34685
34928
|
})(["text-align:center;p{margin-top:5px;}"]);
|
|
34686
34929
|
|
|
34930
|
+
//@ts-ignore
|
|
34931
|
+
var _RPGUI = RPGUI;
|
|
34932
|
+
var RPGUIRoot = function RPGUIRoot(_ref) {
|
|
34933
|
+
var children = _ref.children;
|
|
34934
|
+
return React.createElement("div", {
|
|
34935
|
+
className: "rpgui-content"
|
|
34936
|
+
}, children);
|
|
34937
|
+
};
|
|
34938
|
+
|
|
34687
34939
|
var InputRadio = function InputRadio(_ref) {
|
|
34688
34940
|
var name = _ref.name,
|
|
34689
34941
|
items = _ref.items,
|
|
@@ -34716,41 +34968,6 @@ var InputRadio = function InputRadio(_ref) {
|
|
|
34716
34968
|
}));
|
|
34717
34969
|
};
|
|
34718
34970
|
|
|
34719
|
-
var RangeSliderType;
|
|
34720
|
-
(function (RangeSliderType) {
|
|
34721
|
-
RangeSliderType["Slider"] = "rpgui-slider";
|
|
34722
|
-
RangeSliderType["GoldSlider"] = "rpgui-slider golden";
|
|
34723
|
-
})(RangeSliderType || (RangeSliderType = {}));
|
|
34724
|
-
var RangeSlider = function RangeSlider(_ref) {
|
|
34725
|
-
var type = _ref.type,
|
|
34726
|
-
valueMin = _ref.valueMin,
|
|
34727
|
-
valueMax = _ref.valueMax,
|
|
34728
|
-
width = _ref.width,
|
|
34729
|
-
onChange = _ref.onChange;
|
|
34730
|
-
var sliderId = v4();
|
|
34731
|
-
var onHandleMouseUp = function onHandleMouseUp() {
|
|
34732
|
-
var rpguiSlider = document.getElementById("rpgui-slider-" + sliderId);
|
|
34733
|
-
var value = _RPGUI.get_value(rpguiSlider);
|
|
34734
|
-
onChange(Number(value));
|
|
34735
|
-
};
|
|
34736
|
-
return React.createElement("div", {
|
|
34737
|
-
onMouseUp: onHandleMouseUp
|
|
34738
|
-
}, React.createElement(Input$1, {
|
|
34739
|
-
className: type === RangeSliderType.Slider ? RangeSliderType.Slider : RangeSliderType.GoldSlider,
|
|
34740
|
-
type: "range",
|
|
34741
|
-
style: {
|
|
34742
|
-
width: width
|
|
34743
|
-
},
|
|
34744
|
-
min: valueMin,
|
|
34745
|
-
max: valueMax,
|
|
34746
|
-
id: "rpgui-slider-" + sliderId
|
|
34747
|
-
}));
|
|
34748
|
-
};
|
|
34749
|
-
var Input$1 = /*#__PURE__*/styled.input.withConfig({
|
|
34750
|
-
displayName: "RangeSlider__Input",
|
|
34751
|
-
componentId: "sc-v8mte9-0"
|
|
34752
|
-
})(["opacity:0;"]);
|
|
34753
|
-
|
|
34754
34971
|
var SimpleProgressBar = function SimpleProgressBar(_ref) {
|
|
34755
34972
|
var value = _ref.value,
|
|
34756
34973
|
_ref$bgColor = _ref.bgColor,
|
|
@@ -34920,7 +35137,7 @@ var SkillsContainer = function SkillsContainer(_ref) {
|
|
|
34920
35137
|
};
|
|
34921
35138
|
return React.createElement(SkillsDraggableContainer, {
|
|
34922
35139
|
title: "Skills"
|
|
34923
|
-
}, onCloseButton && React.createElement(CloseButton$
|
|
35140
|
+
}, onCloseButton && React.createElement(CloseButton$3, {
|
|
34924
35141
|
onClick: onCloseButton,
|
|
34925
35142
|
onTouchStart: onCloseButton
|
|
34926
35143
|
}, "X"), React.createElement(SkillSplitDiv, null, React.createElement("p", null, "General"), React.createElement("hr", {
|
|
@@ -34950,7 +35167,7 @@ var SkillSplitDiv = /*#__PURE__*/styled.div.withConfig({
|
|
|
34950
35167
|
displayName: "SkillsContainer__SkillSplitDiv",
|
|
34951
35168
|
componentId: "sc-1g0c67q-1"
|
|
34952
35169
|
})(["width:100%;font-size:11px;hr{margin:0;margin-bottom:1rem;padding:0px;}p{margin-bottom:0px;}"]);
|
|
34953
|
-
var CloseButton$
|
|
35170
|
+
var CloseButton$3 = /*#__PURE__*/styled.div.withConfig({
|
|
34954
35171
|
displayName: "SkillsContainer__CloseButton",
|
|
34955
35172
|
componentId: "sc-1g0c67q-2"
|
|
34956
35173
|
})(["position:absolute;top:2px;right:2px;color:white;z-index:22;font-size:0.7rem;"]);
|
|
@@ -34985,7 +35202,7 @@ var TimeWidget = function TimeWidget(_ref) {
|
|
|
34985
35202
|
var onClose = _ref.onClose,
|
|
34986
35203
|
TimeClock = _ref.TimeClock,
|
|
34987
35204
|
periodOfDay = _ref.periodOfDay;
|
|
34988
|
-
return React.createElement(Draggable, null, React.createElement(WidgetContainer, null, React.createElement(CloseButton$
|
|
35205
|
+
return React.createElement(Draggable, null, React.createElement(WidgetContainer, null, React.createElement(CloseButton$4, {
|
|
34989
35206
|
onClick: onClose
|
|
34990
35207
|
}, "X"), React.createElement(DayNightContainer, null, React.createElement(DayNightPeriod, {
|
|
34991
35208
|
periodOfDay: periodOfDay
|
|
@@ -34999,7 +35216,7 @@ var Time = /*#__PURE__*/styled.div.withConfig({
|
|
|
34999
35216
|
displayName: "TimeWidget__Time",
|
|
35000
35217
|
componentId: "sc-1ja236h-1"
|
|
35001
35218
|
})(["top:0.75rem;right:0.5rem;position:absolute;font-size:", ";color:white;"], uiFonts.size.small);
|
|
35002
|
-
var CloseButton$
|
|
35219
|
+
var CloseButton$4 = /*#__PURE__*/styled.p.withConfig({
|
|
35003
35220
|
displayName: "TimeWidget__CloseButton",
|
|
35004
35221
|
componentId: "sc-1ja236h-2"
|
|
35005
35222
|
})(["position:absolute;top:-0.5rem;margin:0;right:-0.2rem;font-size:", " !important;z-index:1;"], uiFonts.size.small);
|
|
@@ -35155,7 +35372,7 @@ var TradingMenu = function TradingMenu(_ref) {
|
|
|
35155
35372
|
style: {
|
|
35156
35373
|
width: '100%'
|
|
35157
35374
|
}
|
|
35158
|
-
}, React.createElement(Title$
|
|
35375
|
+
}, React.createElement(Title$4, null, Capitalize(type), " Menu"), React.createElement("hr", {
|
|
35159
35376
|
className: "golden"
|
|
35160
35377
|
})), React.createElement(TradingComponentScrollWrapper, null, traderItems.map(function (tradeItem, index) {
|
|
35161
35378
|
var _qtyMap$get;
|
|
@@ -35168,7 +35385,7 @@ var TradingMenu = function TradingMenu(_ref) {
|
|
|
35168
35385
|
traderItem: tradeItem,
|
|
35169
35386
|
selectedQty: (_qtyMap$get = qtyMap.get(tradeItem.key)) != null ? _qtyMap$get : 0
|
|
35170
35387
|
}));
|
|
35171
|
-
})), React.createElement(GoldWrapper, null, React.createElement("p", null, "Available Gold:"), React.createElement("p", null, "$", characterAvailableGold)), React.createElement(TotalWrapper, null, React.createElement("p", null, "Total:"), React.createElement("p", null, "$", sum)), !hasGoldForSale() ? React.createElement(AlertWrapper, null, React.createElement("p", null, " Sorry, not enough money.")) : React.createElement(GoldWrapper, null, React.createElement("p", null, "Final Gold:"), React.createElement("p", null, "$", getFinalGold())), React.createElement(ButtonWrapper$
|
|
35388
|
+
})), React.createElement(GoldWrapper, null, React.createElement("p", null, "Available Gold:"), React.createElement("p", null, "$", characterAvailableGold)), React.createElement(TotalWrapper, null, React.createElement("p", null, "Total:"), React.createElement("p", null, "$", sum)), !hasGoldForSale() ? React.createElement(AlertWrapper, null, React.createElement("p", null, " Sorry, not enough money.")) : React.createElement(GoldWrapper, null, React.createElement("p", null, "Final Gold:"), React.createElement("p", null, "$", getFinalGold())), React.createElement(ButtonWrapper$1, null, React.createElement(Button, {
|
|
35172
35389
|
buttonType: ButtonTypes.RPGUIButton,
|
|
35173
35390
|
disabled: !hasGoldForSale(),
|
|
35174
35391
|
onClick: function onClick() {
|
|
@@ -35181,7 +35398,7 @@ var TradingMenu = function TradingMenu(_ref) {
|
|
|
35181
35398
|
}
|
|
35182
35399
|
}, "Cancel"))));
|
|
35183
35400
|
};
|
|
35184
|
-
var Title$
|
|
35401
|
+
var Title$4 = /*#__PURE__*/styled.h1.withConfig({
|
|
35185
35402
|
displayName: "TradingMenu__Title",
|
|
35186
35403
|
componentId: "sc-1wjsz1l-0"
|
|
35187
35404
|
})(["z-index:22;font-size:0.6rem;color:yellow !important;"]);
|
|
@@ -35205,7 +35422,7 @@ var AlertWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
|
35205
35422
|
displayName: "TradingMenu__AlertWrapper",
|
|
35206
35423
|
componentId: "sc-1wjsz1l-5"
|
|
35207
35424
|
})(["margin-top:1rem;display:flex;width:100%;justify-content:center;height:20px;p{color:red !important;}"]);
|
|
35208
|
-
var ButtonWrapper$
|
|
35425
|
+
var ButtonWrapper$1 = /*#__PURE__*/styled.div.withConfig({
|
|
35209
35426
|
displayName: "TradingMenu__ButtonWrapper",
|
|
35210
35427
|
componentId: "sc-1wjsz1l-6"
|
|
35211
35428
|
})(["display:flex;justify-content:space-around;padding-top:20px;width:100%;margin-top:1rem;"]);
|
|
@@ -35226,5 +35443,91 @@ var Container$i = /*#__PURE__*/styled.div.withConfig({
|
|
|
35226
35443
|
return props.maxLines;
|
|
35227
35444
|
});
|
|
35228
35445
|
|
|
35229
|
-
|
|
35446
|
+
var ItemSelector = function ItemSelector(_ref) {
|
|
35447
|
+
var atlasIMG = _ref.atlasIMG,
|
|
35448
|
+
atlasJSON = _ref.atlasJSON,
|
|
35449
|
+
options = _ref.options,
|
|
35450
|
+
onClose = _ref.onClose,
|
|
35451
|
+
onSelect = _ref.onSelect;
|
|
35452
|
+
var _useState = useState(),
|
|
35453
|
+
selectedValue = _useState[0],
|
|
35454
|
+
setSelectedValue = _useState[1];
|
|
35455
|
+
var handleClick = function handleClick() {
|
|
35456
|
+
var element = document.querySelector("input[name='test']:checked");
|
|
35457
|
+
var elementValue = element.value;
|
|
35458
|
+
setSelectedValue(elementValue);
|
|
35459
|
+
};
|
|
35460
|
+
useEffect(function () {
|
|
35461
|
+
if (selectedValue) {
|
|
35462
|
+
onSelect(selectedValue);
|
|
35463
|
+
}
|
|
35464
|
+
}, [selectedValue]);
|
|
35465
|
+
return React.createElement(DraggableContainer, {
|
|
35466
|
+
type: RPGUIContainerTypes.Framed,
|
|
35467
|
+
width: "500px",
|
|
35468
|
+
cancelDrag: ".equipment-container-body .arrow-selector",
|
|
35469
|
+
onCloseButton: function onCloseButton() {
|
|
35470
|
+
if (onClose) {
|
|
35471
|
+
onClose();
|
|
35472
|
+
}
|
|
35473
|
+
}
|
|
35474
|
+
}, React.createElement("div", {
|
|
35475
|
+
style: {
|
|
35476
|
+
width: '100%'
|
|
35477
|
+
}
|
|
35478
|
+
}, React.createElement(Title$5, null, 'Harvesting instruments'), React.createElement(Subtitle$1, null, 'Use the tool, you need it'), React.createElement("hr", {
|
|
35479
|
+
className: "golden"
|
|
35480
|
+
})), React.createElement(RadioInputScroller$1, null, options == null ? void 0 : options.map(function (option, index) {
|
|
35481
|
+
return React.createElement(RadioOptionsWrapper$1, {
|
|
35482
|
+
key: index
|
|
35483
|
+
}, React.createElement(SpriteAtlasWrapper$1, null, React.createElement(SpriteFromAtlas, {
|
|
35484
|
+
atlasIMG: atlasIMG,
|
|
35485
|
+
atlasJSON: atlasJSON,
|
|
35486
|
+
spriteKey: option.imageKey,
|
|
35487
|
+
imgScale: 3
|
|
35488
|
+
})), React.createElement("div", null, React.createElement("input", {
|
|
35489
|
+
className: "rpgui-radio",
|
|
35490
|
+
type: "radio",
|
|
35491
|
+
value: option.name,
|
|
35492
|
+
name: "test"
|
|
35493
|
+
}), React.createElement("label", {
|
|
35494
|
+
onClick: handleClick,
|
|
35495
|
+
style: {
|
|
35496
|
+
display: 'flex',
|
|
35497
|
+
alignItems: 'center'
|
|
35498
|
+
}
|
|
35499
|
+
}, option.name, " ", React.createElement("br", null), option.description)));
|
|
35500
|
+
})), React.createElement(ButtonWrapper$2, null, React.createElement(Button, {
|
|
35501
|
+
buttonType: ButtonTypes.RPGUIButton,
|
|
35502
|
+
onClick: onClose
|
|
35503
|
+
}, "Cancel"), React.createElement(Button, {
|
|
35504
|
+
buttonType: ButtonTypes.RPGUIButton
|
|
35505
|
+
}, "Select")));
|
|
35506
|
+
};
|
|
35507
|
+
var Title$5 = /*#__PURE__*/styled.h1.withConfig({
|
|
35508
|
+
displayName: "ItemSelector__Title",
|
|
35509
|
+
componentId: "sc-gptoxp-0"
|
|
35510
|
+
})(["font-size:0.6rem;color:yellow !important;"]);
|
|
35511
|
+
var Subtitle$1 = /*#__PURE__*/styled.h1.withConfig({
|
|
35512
|
+
displayName: "ItemSelector__Subtitle",
|
|
35513
|
+
componentId: "sc-gptoxp-1"
|
|
35514
|
+
})(["font-size:0.4rem;color:yellow !important;"]);
|
|
35515
|
+
var RadioInputScroller$1 = /*#__PURE__*/styled.div.withConfig({
|
|
35516
|
+
displayName: "ItemSelector__RadioInputScroller",
|
|
35517
|
+
componentId: "sc-gptoxp-2"
|
|
35518
|
+
})(["padding-left:15px;padding-top:10px;width:100%;margin-top:1rem;align-items:center;margin-left:20px;align-items:flex-start;overflow-y:scroll;height:360px;"]);
|
|
35519
|
+
var SpriteAtlasWrapper$1 = /*#__PURE__*/styled.div.withConfig({
|
|
35520
|
+
displayName: "ItemSelector__SpriteAtlasWrapper",
|
|
35521
|
+
componentId: "sc-gptoxp-3"
|
|
35522
|
+
})(["margin-right:40px;"]);
|
|
35523
|
+
var RadioOptionsWrapper$1 = /*#__PURE__*/styled.div.withConfig({
|
|
35524
|
+
displayName: "ItemSelector__RadioOptionsWrapper",
|
|
35525
|
+
componentId: "sc-gptoxp-4"
|
|
35526
|
+
})(["display:flex;align-items:stretch;margin-bottom:40px;"]);
|
|
35527
|
+
var ButtonWrapper$2 = /*#__PURE__*/styled.div.withConfig({
|
|
35528
|
+
displayName: "ItemSelector__ButtonWrapper",
|
|
35529
|
+
componentId: "sc-gptoxp-5"
|
|
35530
|
+
})(["display:flex;justify-content:space-around;padding-top:20px;width:100%;"]);
|
|
35531
|
+
|
|
35532
|
+
export { Button, ButtonTypes, CharacterSelection, Chat, CheckButton, CraftBook, DraggableContainer, Dropdown, DropdownSelectorContainer, DynamicText, EquipmentSet, ErrorBoundary, HistoryDialog, ImgSide, Input, InputRadio, ItemContainer$1 as ItemContainer, ItemSelector, ItemSlot, ListMenu, NPCDialog, NPCDialogType, NPCMultiDialog, ProgressBar, PropertySelect, QuestInfo, QuestList, QuestionDialog, RPGUIContainer, RPGUIContainerTypes, RPGUIRoot, RangeSlider, RangeSliderType, SkillProgressBar, SkillsContainer, SpriteFromAtlas, TextArea, TimeWidget, TradingMenu, Truncate, _RPGUI, useEventListener };
|
|
35230
35533
|
//# sourceMappingURL=long-bow.esm.js.map
|