@rpg-engine/long-bow 0.2.90 → 0.2.92
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 +523 -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 +524 -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 +171 -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,116 @@ 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
|
+
console.log(classes);
|
|
33650
|
+
var isOutsideDrop = classes.some(function (elm) {
|
|
33651
|
+
//elm matches ItemContainer string
|
|
33652
|
+
return elm.includes('rpgui-content');
|
|
33653
|
+
});
|
|
33654
|
+
if (isOutsideDrop) {
|
|
33655
|
+
setDropPosition({
|
|
33656
|
+
x: data.x,
|
|
33657
|
+
y: data.y
|
|
33658
|
+
});
|
|
33659
|
+
}
|
|
33660
|
+
setWasDragged(false);
|
|
33661
|
+
var target = dragContainer.current;
|
|
33662
|
+
if (!target || !wasDragged) return;
|
|
33663
|
+
var style = window.getComputedStyle(target);
|
|
33664
|
+
var matrix = new DOMMatrixReadOnly(style.transform);
|
|
33665
|
+
var x = matrix.m41;
|
|
33666
|
+
var y = matrix.m42;
|
|
33667
|
+
setDragPosition({
|
|
33668
|
+
x: x,
|
|
33669
|
+
y: y
|
|
33670
|
+
});
|
|
33671
|
+
setTimeout(function () {
|
|
33672
|
+
if (checkIfItemCanBeMoved()) {
|
|
33673
|
+
if (item.stackQty && item.stackQty !== 1 && openQuantitySelector) openQuantitySelector(item.stackQty, onSuccesfulDrag);else onSuccesfulDrag(item.stackQty);
|
|
33674
|
+
} else {
|
|
33675
|
+
resetItem();
|
|
33676
|
+
setDragPosition({
|
|
33677
|
+
x: 0,
|
|
33678
|
+
y: 0
|
|
33679
|
+
});
|
|
33680
|
+
}
|
|
33681
|
+
}, 100);
|
|
33682
|
+
} else if (item) {
|
|
33683
|
+
if (!isContextMenuDisabled) setIsContextMenuVisible(!isContextMenuVisible);
|
|
33684
|
+
onClick(item.type, containerType, item);
|
|
33685
|
+
}
|
|
33686
|
+
},
|
|
33687
|
+
onStart: function onStart() {
|
|
33688
|
+
if (!item) {
|
|
33689
|
+
return;
|
|
33690
|
+
}
|
|
33691
|
+
if (onDragStart) {
|
|
33692
|
+
onDragStart(item, slotIndex, containerType);
|
|
33693
|
+
}
|
|
33694
|
+
},
|
|
33695
|
+
onDrag: function onDrag() {
|
|
33696
|
+
setWasDragged(true);
|
|
33697
|
+
setIsFocused(true);
|
|
33698
|
+
},
|
|
33699
|
+
position: dragPosition,
|
|
33700
|
+
cancel: ".empty-slot"
|
|
33701
|
+
}, React.createElement(ItemContainer, {
|
|
33702
|
+
ref: dragContainer,
|
|
33703
|
+
isFocused: isFocused,
|
|
33606
33704
|
onMouseOver: function onMouseOver(event) {
|
|
33607
|
-
|
|
33705
|
+
_onMouseOver(event, slotIndex, item, event.clientX, event.clientY);
|
|
33608
33706
|
},
|
|
33609
33707
|
onMouseOut: function onMouseOut() {
|
|
33610
33708
|
if (_onMouseOut) _onMouseOut();
|
|
33611
33709
|
},
|
|
33612
33710
|
onMouseEnter: function onMouseEnter() {
|
|
33613
|
-
|
|
33711
|
+
setTooltipVisible(true);
|
|
33614
33712
|
},
|
|
33615
33713
|
onMouseLeave: function onMouseLeave() {
|
|
33616
|
-
return setTooltipVisible(false);
|
|
33617
|
-
},
|
|
33618
|
-
onClick: function onClick() {
|
|
33619
33714
|
setTooltipVisible(false);
|
|
33620
|
-
if (item) {
|
|
33621
|
-
if (!isContextMenuDisabled) {
|
|
33622
|
-
setIsContextMenuVisible(!isContextMenuVisible);
|
|
33623
|
-
}
|
|
33624
|
-
_onClick(item.type, containerType, item);
|
|
33625
|
-
}
|
|
33626
33715
|
}
|
|
33627
|
-
},
|
|
33716
|
+
}, onRenderSlot(item))), isTooltipVisible && item && React.createElement(ItemTooltip, {
|
|
33717
|
+
label: item.name
|
|
33718
|
+
}), !isContextMenuDisabled && isContextMenuVisible && contextActions && React.createElement(RelativeListMenu, {
|
|
33628
33719
|
options: contextActions,
|
|
33629
33720
|
onSelected: function onSelected(optionId) {
|
|
33630
33721
|
setIsContextMenuVisible(false);
|
|
@@ -33635,21 +33726,25 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
33635
33726
|
onOutsideClick: function onOutsideClick() {
|
|
33636
33727
|
setIsContextMenuVisible(false);
|
|
33637
33728
|
}
|
|
33638
|
-
})
|
|
33639
|
-
label: item.name
|
|
33640
|
-
}), onRenderSlot(item));
|
|
33729
|
+
}));
|
|
33641
33730
|
});
|
|
33642
33731
|
var Container$a = /*#__PURE__*/styled.div.withConfig({
|
|
33643
33732
|
displayName: "ItemSlot__Container",
|
|
33644
33733
|
componentId: "sc-l2j5ef-0"
|
|
33645
33734
|
})(["margin:0.1rem;.sprite-from-atlas-img{position:relative;top:1.5rem;left:1.5rem;}position:relative;"]);
|
|
33735
|
+
var ItemContainer = /*#__PURE__*/styled.div.withConfig({
|
|
33736
|
+
displayName: "ItemSlot__ItemContainer",
|
|
33737
|
+
componentId: "sc-l2j5ef-1"
|
|
33738
|
+
})(["width:100%;height:100%;position:relative;", ""], function (props) {
|
|
33739
|
+
return props.isFocused && 'z-index: 100; pointer-events: none;';
|
|
33740
|
+
});
|
|
33646
33741
|
var ItemQtyContainer = /*#__PURE__*/styled.div.withConfig({
|
|
33647
33742
|
displayName: "ItemSlot__ItemQtyContainer",
|
|
33648
|
-
componentId: "sc-l2j5ef-
|
|
33649
|
-
})(["position:relative;width:85%;height:16px;top:25px;left:2px;display:flex;justify-content:flex-end;"]);
|
|
33743
|
+
componentId: "sc-l2j5ef-2"
|
|
33744
|
+
})(["position:relative;width:85%;height:16px;top:25px;left:2px;pointer-events:none;display:flex;justify-content:flex-end;"]);
|
|
33650
33745
|
var ItemQty = /*#__PURE__*/styled.span.withConfig({
|
|
33651
33746
|
displayName: "ItemSlot__ItemQty",
|
|
33652
|
-
componentId: "sc-l2j5ef-
|
|
33747
|
+
componentId: "sc-l2j5ef-3"
|
|
33653
33748
|
})(["&.regular{font-size:", ";}&.small{font-size:", ";}"], uiFonts.size.small, uiFonts.size.xsmall);
|
|
33654
33749
|
|
|
33655
33750
|
var EquipmentSet = function EquipmentSet(_ref) {
|
|
@@ -33659,7 +33754,12 @@ var EquipmentSet = function EquipmentSet(_ref) {
|
|
|
33659
33754
|
_onSelected = _ref.onSelected,
|
|
33660
33755
|
onItemClick = _ref.onItemClick,
|
|
33661
33756
|
atlasIMG = _ref.atlasIMG,
|
|
33662
|
-
atlasJSON = _ref.atlasJSON
|
|
33757
|
+
atlasJSON = _ref.atlasJSON,
|
|
33758
|
+
onItemDragEnd = _ref.onItemDragEnd,
|
|
33759
|
+
onItemDragStart = _ref.onItemDragStart,
|
|
33760
|
+
onItemPlaceDrop = _ref.onItemPlaceDrop,
|
|
33761
|
+
onItemOutsideDrop = _ref.onItemOutsideDrop,
|
|
33762
|
+
checkIfItemCanBeMoved = _ref.checkIfItemCanBeMoved;
|
|
33663
33763
|
var neck = equipmentSet.neck,
|
|
33664
33764
|
leftHand = equipmentSet.leftHand,
|
|
33665
33765
|
ring = equipmentSet.ring,
|
|
@@ -33695,6 +33795,22 @@ var EquipmentSet = function EquipmentSet(_ref) {
|
|
|
33695
33795
|
onSelected: function onSelected(optionId) {
|
|
33696
33796
|
if (_onSelected) _onSelected(optionId);
|
|
33697
33797
|
},
|
|
33798
|
+
onDragStart: function onDragStart(item, slotIndex, itemContainerType) {
|
|
33799
|
+
if (!item) {
|
|
33800
|
+
return;
|
|
33801
|
+
}
|
|
33802
|
+
if (onItemDragStart) onItemDragStart(item, slotIndex, itemContainerType);
|
|
33803
|
+
},
|
|
33804
|
+
onDragEnd: function onDragEnd(quantity) {
|
|
33805
|
+
if (onItemDragEnd) onItemDragEnd(quantity);
|
|
33806
|
+
},
|
|
33807
|
+
checkIfItemCanBeMoved: checkIfItemCanBeMoved,
|
|
33808
|
+
onPlaceDrop: function onPlaceDrop(item, slotIndex, itemContainerType) {
|
|
33809
|
+
if (onItemPlaceDrop) onItemPlaceDrop(item, slotIndex, itemContainerType);
|
|
33810
|
+
},
|
|
33811
|
+
onOutsideDrop: function onOutsideDrop(item, position) {
|
|
33812
|
+
if (onItemOutsideDrop) onItemOutsideDrop(item, position);
|
|
33813
|
+
},
|
|
33698
33814
|
atlasIMG: atlasIMG,
|
|
33699
33815
|
atlasJSON: atlasJSON
|
|
33700
33816
|
});
|
|
@@ -33715,11 +33831,11 @@ var EquipmentSet = function EquipmentSet(_ref) {
|
|
|
33715
33831
|
var EquipmentSetContainer = /*#__PURE__*/styled.div.withConfig({
|
|
33716
33832
|
displayName: "EquipmentSet__EquipmentSetContainer",
|
|
33717
33833
|
componentId: "sc-1wuddg2-0"
|
|
33718
|
-
})(["width:inherit;display:flex;justify-content:center;flex-wrap:wrap;flex-direction:row;"]);
|
|
33834
|
+
})(["width:inherit;display:flex;justify-content:center;flex-wrap:wrap;flex-direction:row;touch-action:none;"]);
|
|
33719
33835
|
var EquipmentColumn = /*#__PURE__*/styled.div.withConfig({
|
|
33720
33836
|
displayName: "EquipmentSet__EquipmentColumn",
|
|
33721
33837
|
componentId: "sc-1wuddg2-1"
|
|
33722
|
-
})(["display:flex;justify-content:center;flex-wrap:wrap;flex-direction:column;"]);
|
|
33838
|
+
})(["display:flex;justify-content:center;flex-wrap:wrap;flex-direction:column;touch-action:none;"]);
|
|
33723
33839
|
|
|
33724
33840
|
var IS_MOBILE_OR_TABLET = /*#__PURE__*/isMobile({
|
|
33725
33841
|
tablet: true
|
|
@@ -34268,7 +34384,8 @@ var SlotsContainer = function SlotsContainer(_ref) {
|
|
|
34268
34384
|
title = _ref.title,
|
|
34269
34385
|
onClose = _ref.onClose,
|
|
34270
34386
|
_onPositionChange = _ref.onPositionChange,
|
|
34271
|
-
onOutsideClick = _ref.onOutsideClick
|
|
34387
|
+
onOutsideClick = _ref.onOutsideClick,
|
|
34388
|
+
initialPosition = _ref.initialPosition;
|
|
34272
34389
|
return React.createElement(DraggableContainer, {
|
|
34273
34390
|
title: title,
|
|
34274
34391
|
type: RPGUIContainerTypes.Framed,
|
|
@@ -34289,11 +34406,168 @@ var SlotsContainer = function SlotsContainer(_ref) {
|
|
|
34289
34406
|
});
|
|
34290
34407
|
}
|
|
34291
34408
|
},
|
|
34292
|
-
onOutsideClick: onOutsideClick
|
|
34409
|
+
onOutsideClick: onOutsideClick,
|
|
34410
|
+
initialPosition: initialPosition
|
|
34293
34411
|
}, children);
|
|
34294
34412
|
};
|
|
34295
34413
|
|
|
34296
|
-
var
|
|
34414
|
+
var RangeSliderType;
|
|
34415
|
+
(function (RangeSliderType) {
|
|
34416
|
+
RangeSliderType["Slider"] = "rpgui-slider";
|
|
34417
|
+
RangeSliderType["GoldSlider"] = "rpgui-slider golden";
|
|
34418
|
+
})(RangeSliderType || (RangeSliderType = {}));
|
|
34419
|
+
var RangeSlider = function RangeSlider(_ref) {
|
|
34420
|
+
var type = _ref.type,
|
|
34421
|
+
valueMin = _ref.valueMin,
|
|
34422
|
+
valueMax = _ref.valueMax,
|
|
34423
|
+
width = _ref.width,
|
|
34424
|
+
_onChange = _ref.onChange,
|
|
34425
|
+
value = _ref.value;
|
|
34426
|
+
var sliderId = v4();
|
|
34427
|
+
var containerRef = useRef(null);
|
|
34428
|
+
var _useState = useState(0),
|
|
34429
|
+
left = _useState[0],
|
|
34430
|
+
setLeft = _useState[1];
|
|
34431
|
+
useEffect(function () {
|
|
34432
|
+
var _containerRef$current;
|
|
34433
|
+
var calculatedWidth = ((_containerRef$current = containerRef.current) == null ? void 0 : _containerRef$current.clientWidth) || 0;
|
|
34434
|
+
setLeft(Math.max((value - valueMin) / (valueMax - valueMin) * (calculatedWidth - 35) + 10));
|
|
34435
|
+
}, [value, valueMin, valueMax]);
|
|
34436
|
+
var typeClass = type === RangeSliderType.GoldSlider ? 'golden' : '';
|
|
34437
|
+
return React.createElement("div", {
|
|
34438
|
+
style: {
|
|
34439
|
+
width: width,
|
|
34440
|
+
position: 'relative'
|
|
34441
|
+
},
|
|
34442
|
+
className: "rpgui-slider-container " + typeClass,
|
|
34443
|
+
id: "rpgui-slider-" + sliderId,
|
|
34444
|
+
ref: containerRef
|
|
34445
|
+
}, React.createElement("div", {
|
|
34446
|
+
style: {
|
|
34447
|
+
pointerEvents: 'none'
|
|
34448
|
+
}
|
|
34449
|
+
}, React.createElement("div", {
|
|
34450
|
+
className: "rpgui-slider-track " + typeClass
|
|
34451
|
+
}), React.createElement("div", {
|
|
34452
|
+
className: "rpgui-slider-left-edge " + typeClass
|
|
34453
|
+
}), React.createElement("div", {
|
|
34454
|
+
className: "rpgui-slider-right-edge " + typeClass
|
|
34455
|
+
}), React.createElement("div", {
|
|
34456
|
+
className: "rpgui-slider-thumb " + typeClass,
|
|
34457
|
+
style: {
|
|
34458
|
+
left: left
|
|
34459
|
+
}
|
|
34460
|
+
})), React.createElement(Input$1, {
|
|
34461
|
+
type: "range",
|
|
34462
|
+
style: {
|
|
34463
|
+
width: width
|
|
34464
|
+
},
|
|
34465
|
+
min: valueMin,
|
|
34466
|
+
max: valueMax,
|
|
34467
|
+
onChange: function onChange(e) {
|
|
34468
|
+
return _onChange(Number(e.target.value));
|
|
34469
|
+
},
|
|
34470
|
+
value: value,
|
|
34471
|
+
className: "rpgui-cursor-point"
|
|
34472
|
+
}));
|
|
34473
|
+
};
|
|
34474
|
+
var Input$1 = /*#__PURE__*/styled.input.withConfig({
|
|
34475
|
+
displayName: "RangeSlider__Input",
|
|
34476
|
+
componentId: "sc-v8mte9-0"
|
|
34477
|
+
})(["opacity:0;position:absolute;width:100%;height:100%;top:0;left:0;margin-top:-5px;"]);
|
|
34478
|
+
|
|
34479
|
+
var ItemQuantitySelector = function ItemQuantitySelector(_ref) {
|
|
34480
|
+
var quantity = _ref.quantity,
|
|
34481
|
+
onConfirm = _ref.onConfirm,
|
|
34482
|
+
onClose = _ref.onClose;
|
|
34483
|
+
var _useState = useState(quantity),
|
|
34484
|
+
value = _useState[0],
|
|
34485
|
+
setValue = _useState[1];
|
|
34486
|
+
var inputRef = useRef(null);
|
|
34487
|
+
useEffect(function () {
|
|
34488
|
+
if (inputRef.current) {
|
|
34489
|
+
inputRef.current.focus();
|
|
34490
|
+
inputRef.current.select();
|
|
34491
|
+
var closeSelector = function closeSelector(e) {
|
|
34492
|
+
if (e.key === 'Escape') {
|
|
34493
|
+
onClose();
|
|
34494
|
+
}
|
|
34495
|
+
};
|
|
34496
|
+
document.addEventListener('keydown', closeSelector);
|
|
34497
|
+
return function () {
|
|
34498
|
+
document.removeEventListener('keydown', closeSelector);
|
|
34499
|
+
};
|
|
34500
|
+
}
|
|
34501
|
+
return function () {};
|
|
34502
|
+
}, []);
|
|
34503
|
+
return React.createElement(StyledContainer, {
|
|
34504
|
+
type: RPGUIContainerTypes.Framed,
|
|
34505
|
+
width: "25rem"
|
|
34506
|
+
}, React.createElement(CloseButton$2, {
|
|
34507
|
+
className: "container-close",
|
|
34508
|
+
onClick: onClose,
|
|
34509
|
+
onTouchStart: onClose
|
|
34510
|
+
}, "X"), React.createElement("h2", null, "Select quantity to move"), React.createElement(StyledForm, {
|
|
34511
|
+
style: {
|
|
34512
|
+
width: '100%'
|
|
34513
|
+
},
|
|
34514
|
+
onSubmit: function onSubmit(e) {
|
|
34515
|
+
e.preventDefault();
|
|
34516
|
+
var numberValue = Number(value);
|
|
34517
|
+
if (Number.isNaN(numberValue)) {
|
|
34518
|
+
return;
|
|
34519
|
+
}
|
|
34520
|
+
onConfirm(Math.max(1, Math.min(quantity, numberValue)));
|
|
34521
|
+
},
|
|
34522
|
+
noValidate: true
|
|
34523
|
+
}, React.createElement(StyledInput, {
|
|
34524
|
+
innerRef: inputRef,
|
|
34525
|
+
placeholder: "Enter quantity",
|
|
34526
|
+
type: "number",
|
|
34527
|
+
min: 1,
|
|
34528
|
+
max: quantity,
|
|
34529
|
+
value: value,
|
|
34530
|
+
onChange: function onChange(e) {
|
|
34531
|
+
if (Number(e.target.value) >= quantity) {
|
|
34532
|
+
setValue(quantity);
|
|
34533
|
+
return;
|
|
34534
|
+
}
|
|
34535
|
+
setValue(e.target.value);
|
|
34536
|
+
},
|
|
34537
|
+
onBlur: function onBlur(e) {
|
|
34538
|
+
var newValue = Math.max(1, Math.min(quantity, Number(e.target.value)));
|
|
34539
|
+
setValue(newValue);
|
|
34540
|
+
}
|
|
34541
|
+
}), React.createElement(RangeSlider, {
|
|
34542
|
+
type: RangeSliderType.Slider,
|
|
34543
|
+
valueMin: 1,
|
|
34544
|
+
valueMax: quantity,
|
|
34545
|
+
width: "100%",
|
|
34546
|
+
onChange: setValue,
|
|
34547
|
+
value: value
|
|
34548
|
+
}), React.createElement(Button, {
|
|
34549
|
+
buttonType: ButtonTypes.RPGUIButton,
|
|
34550
|
+
type: "submit"
|
|
34551
|
+
}, "Confirm")));
|
|
34552
|
+
};
|
|
34553
|
+
var StyledContainer = /*#__PURE__*/styled(RPGUIContainer).withConfig({
|
|
34554
|
+
displayName: "ItemQuantitySelector__StyledContainer",
|
|
34555
|
+
componentId: "sc-yfdtpn-0"
|
|
34556
|
+
})(["display:flex;flex-direction:column;align-items:center;"]);
|
|
34557
|
+
var StyledForm = /*#__PURE__*/styled.form.withConfig({
|
|
34558
|
+
displayName: "ItemQuantitySelector__StyledForm",
|
|
34559
|
+
componentId: "sc-yfdtpn-1"
|
|
34560
|
+
})(["display:flex;flex-direction:column;align-items:center;width:100%;"]);
|
|
34561
|
+
var StyledInput = /*#__PURE__*/styled(Input).withConfig({
|
|
34562
|
+
displayName: "ItemQuantitySelector__StyledInput",
|
|
34563
|
+
componentId: "sc-yfdtpn-2"
|
|
34564
|
+
})(["text-align:center;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}&[type='number']{-moz-appearance:textfield;}"]);
|
|
34565
|
+
var CloseButton$2 = /*#__PURE__*/styled.div.withConfig({
|
|
34566
|
+
displayName: "ItemQuantitySelector__CloseButton",
|
|
34567
|
+
componentId: "sc-yfdtpn-3"
|
|
34568
|
+
})(["position:absolute;top:3px;right:0px;color:white;z-index:22;font-size:0.8rem;"]);
|
|
34569
|
+
|
|
34570
|
+
var ItemContainer$1 = function ItemContainer(_ref) {
|
|
34297
34571
|
var itemContainer = _ref.itemContainer,
|
|
34298
34572
|
onClose = _ref.onClose,
|
|
34299
34573
|
_onMouseOver = _ref.onMouseOver,
|
|
@@ -34303,7 +34577,20 @@ var ItemContainer = function ItemContainer(_ref) {
|
|
|
34303
34577
|
atlasJSON = _ref.atlasJSON,
|
|
34304
34578
|
atlasIMG = _ref.atlasIMG,
|
|
34305
34579
|
_ref$disableContextMe = _ref.disableContextMenu,
|
|
34306
|
-
disableContextMenu = _ref$disableContextMe === void 0 ? false : _ref$disableContextMe
|
|
34580
|
+
disableContextMenu = _ref$disableContextMe === void 0 ? false : _ref$disableContextMe,
|
|
34581
|
+
onItemDragEnd = _ref.onItemDragEnd,
|
|
34582
|
+
onItemDragStart = _ref.onItemDragStart,
|
|
34583
|
+
onItemPlaceDrop = _ref.onItemPlaceDrop,
|
|
34584
|
+
_onOutsideDrop = _ref.onOutsideDrop,
|
|
34585
|
+
checkIfItemCanBeMoved = _ref.checkIfItemCanBeMoved,
|
|
34586
|
+
initialPosition = _ref.initialPosition;
|
|
34587
|
+
var _useState = useState({
|
|
34588
|
+
isOpen: false,
|
|
34589
|
+
maxQuantity: 1,
|
|
34590
|
+
callback: function callback(_quantity) {}
|
|
34591
|
+
}),
|
|
34592
|
+
quantitySelect = _useState[0],
|
|
34593
|
+
setQuantitySelect = _useState[1];
|
|
34307
34594
|
var onRenderSlots = function onRenderSlots() {
|
|
34308
34595
|
var slots = [];
|
|
34309
34596
|
for (var i = 0; i < itemContainer.slotQty; i++) {
|
|
@@ -34323,109 +34610,66 @@ var ItemContainer = function ItemContainer(_ref) {
|
|
|
34323
34610
|
onSelected: function onSelected(optionId, item) {
|
|
34324
34611
|
if (_onSelected) _onSelected(optionId, item);
|
|
34325
34612
|
},
|
|
34613
|
+
onDragStart: function onDragStart(item, slotIndex, itemContainerType) {
|
|
34614
|
+
if (onItemDragStart) onItemDragStart(item, slotIndex, itemContainerType);
|
|
34615
|
+
},
|
|
34616
|
+
onDragEnd: function onDragEnd(quantity) {
|
|
34617
|
+
if (onItemDragEnd) onItemDragEnd(quantity);
|
|
34618
|
+
},
|
|
34619
|
+
checkIfItemCanBeMoved: checkIfItemCanBeMoved,
|
|
34620
|
+
openQuantitySelector: function openQuantitySelector(maxQuantity, callback) {
|
|
34621
|
+
setQuantitySelect({
|
|
34622
|
+
isOpen: true,
|
|
34623
|
+
maxQuantity: maxQuantity,
|
|
34624
|
+
callback: callback
|
|
34625
|
+
});
|
|
34626
|
+
},
|
|
34627
|
+
onPlaceDrop: function onPlaceDrop(item, slotIndex, itemContainerType) {
|
|
34628
|
+
if (onItemPlaceDrop) onItemPlaceDrop(item, slotIndex, itemContainerType);
|
|
34629
|
+
},
|
|
34630
|
+
onOutsideDrop: function onOutsideDrop(item, position) {
|
|
34631
|
+
if (_onOutsideDrop) _onOutsideDrop(item, position);
|
|
34632
|
+
},
|
|
34326
34633
|
atlasIMG: atlasIMG,
|
|
34327
34634
|
atlasJSON: atlasJSON
|
|
34328
34635
|
}));
|
|
34329
34636
|
}
|
|
34330
34637
|
return slots;
|
|
34331
34638
|
};
|
|
34332
|
-
return React.createElement(SlotsContainer, {
|
|
34639
|
+
return React.createElement(React.Fragment, null, React.createElement(SlotsContainer, {
|
|
34333
34640
|
title: itemContainer.name || 'Container',
|
|
34334
|
-
onClose: onClose
|
|
34641
|
+
onClose: onClose,
|
|
34642
|
+
initialPosition: initialPosition
|
|
34335
34643
|
}, React.createElement(ItemsContainer, {
|
|
34336
34644
|
className: "item-container-body"
|
|
34337
|
-
}, onRenderSlots()))
|
|
34645
|
+
}, onRenderSlots())), quantitySelect.isOpen && React.createElement(QuantitySelectorContainer, null, React.createElement(ItemQuantitySelector, {
|
|
34646
|
+
quantity: quantitySelect.maxQuantity,
|
|
34647
|
+
onConfirm: function onConfirm(quantity) {
|
|
34648
|
+
quantitySelect.callback(quantity);
|
|
34649
|
+
setQuantitySelect({
|
|
34650
|
+
isOpen: false,
|
|
34651
|
+
maxQuantity: 1,
|
|
34652
|
+
callback: function callback() {}
|
|
34653
|
+
});
|
|
34654
|
+
},
|
|
34655
|
+
onClose: function onClose() {
|
|
34656
|
+
quantitySelect.callback(-1);
|
|
34657
|
+
setQuantitySelect({
|
|
34658
|
+
isOpen: false,
|
|
34659
|
+
maxQuantity: 1,
|
|
34660
|
+
callback: function callback() {}
|
|
34661
|
+
});
|
|
34662
|
+
}
|
|
34663
|
+
})));
|
|
34338
34664
|
};
|
|
34339
34665
|
var ItemsContainer = /*#__PURE__*/styled.div.withConfig({
|
|
34340
34666
|
displayName: "ItemContainer__ItemsContainer",
|
|
34341
34667
|
componentId: "sc-15y5p9l-0"
|
|
34342
34668
|
})(["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%;"]);
|
|
34669
|
+
var QuantitySelectorContainer = /*#__PURE__*/styled.div.withConfig({
|
|
34670
|
+
displayName: "ItemContainer__QuantitySelectorContainer",
|
|
34671
|
+
componentId: "sc-15y5p9l-1"
|
|
34672
|
+
})(["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
34673
|
|
|
34430
34674
|
var ListMenu = function ListMenu(_ref) {
|
|
34431
34675
|
var options = _ref.options,
|
|
@@ -34562,7 +34806,7 @@ var QuestInfo = function QuestInfo(_ref) {
|
|
|
34562
34806
|
onTouchStart: onRightClick
|
|
34563
34807
|
}), React.createElement(QuestContainer, null, React.createElement(TitleContainer$1, {
|
|
34564
34808
|
className: "drag-handler"
|
|
34565
|
-
}, React.createElement(Title$
|
|
34809
|
+
}, React.createElement(Title$2, null, React.createElement(Thumbnail, {
|
|
34566
34810
|
src: quests[currentIndex].thumbnail || img$9
|
|
34567
34811
|
}), quests[currentIndex].title), React.createElement(QuestSplitDiv, null, React.createElement("hr", {
|
|
34568
34812
|
className: "golden"
|
|
@@ -34581,7 +34825,7 @@ var QuestInfo = function QuestInfo(_ref) {
|
|
|
34581
34825
|
}, button.title);
|
|
34582
34826
|
})))) : React.createElement(QuestsContainer, null, React.createElement(QuestContainer, null, React.createElement(TitleContainer$1, {
|
|
34583
34827
|
className: "drag-handler"
|
|
34584
|
-
}, React.createElement(Title$
|
|
34828
|
+
}, React.createElement(Title$2, null, React.createElement(Thumbnail, {
|
|
34585
34829
|
src: quests[0].thumbnail || img$9
|
|
34586
34830
|
}), quests[0].title), React.createElement(QuestSplitDiv, null, React.createElement("hr", {
|
|
34587
34831
|
className: "golden"
|
|
@@ -34628,7 +34872,7 @@ var TitleContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
|
34628
34872
|
displayName: "QuestInfo__TitleContainer",
|
|
34629
34873
|
componentId: "sc-15s2boc-6"
|
|
34630
34874
|
})(["width:100%;display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:center;margin-top:1rem;"]);
|
|
34631
|
-
var Title$
|
|
34875
|
+
var Title$2 = /*#__PURE__*/styled.h1.withConfig({
|
|
34632
34876
|
displayName: "QuestInfo__Title",
|
|
34633
34877
|
componentId: "sc-15s2boc-7"
|
|
34634
34878
|
})(["color:white;z-index:22;font-size:", " !important;color:", " !important;"], uiFonts.size.medium, uiColors.yellow);
|
|
@@ -34650,7 +34894,7 @@ var QuestList = function QuestList(_ref) {
|
|
|
34650
34894
|
style: {
|
|
34651
34895
|
width: '100%'
|
|
34652
34896
|
}
|
|
34653
|
-
}, React.createElement(Title$
|
|
34897
|
+
}, React.createElement(Title$3, null, "Quests"), React.createElement("hr", {
|
|
34654
34898
|
className: "golden"
|
|
34655
34899
|
}), React.createElement(QuestListContainer, null, quests ? quests.map(function (quest, i) {
|
|
34656
34900
|
return React.createElement("div", {
|
|
@@ -34671,7 +34915,7 @@ var QuestDraggableContainer$1 = /*#__PURE__*/styled(DraggableContainer).withConf
|
|
|
34671
34915
|
displayName: "QuestList__QuestDraggableContainer",
|
|
34672
34916
|
componentId: "sc-1a2vx6q-0"
|
|
34673
34917
|
})([".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$
|
|
34918
|
+
var Title$3 = /*#__PURE__*/styled.h1.withConfig({
|
|
34675
34919
|
displayName: "QuestList__Title",
|
|
34676
34920
|
componentId: "sc-1a2vx6q-1"
|
|
34677
34921
|
})(["z-index:22;font-size:", " !important;color:yellow !important;"], uiFonts.size.medium);
|
|
@@ -34684,6 +34928,15 @@ var NoQuestContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
34684
34928
|
componentId: "sc-1a2vx6q-3"
|
|
34685
34929
|
})(["text-align:center;p{margin-top:5px;}"]);
|
|
34686
34930
|
|
|
34931
|
+
//@ts-ignore
|
|
34932
|
+
var _RPGUI = RPGUI;
|
|
34933
|
+
var RPGUIRoot = function RPGUIRoot(_ref) {
|
|
34934
|
+
var children = _ref.children;
|
|
34935
|
+
return React.createElement("div", {
|
|
34936
|
+
className: "rpgui-content"
|
|
34937
|
+
}, children);
|
|
34938
|
+
};
|
|
34939
|
+
|
|
34687
34940
|
var InputRadio = function InputRadio(_ref) {
|
|
34688
34941
|
var name = _ref.name,
|
|
34689
34942
|
items = _ref.items,
|
|
@@ -34716,41 +34969,6 @@ var InputRadio = function InputRadio(_ref) {
|
|
|
34716
34969
|
}));
|
|
34717
34970
|
};
|
|
34718
34971
|
|
|
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
34972
|
var SimpleProgressBar = function SimpleProgressBar(_ref) {
|
|
34755
34973
|
var value = _ref.value,
|
|
34756
34974
|
_ref$bgColor = _ref.bgColor,
|
|
@@ -34920,7 +35138,7 @@ var SkillsContainer = function SkillsContainer(_ref) {
|
|
|
34920
35138
|
};
|
|
34921
35139
|
return React.createElement(SkillsDraggableContainer, {
|
|
34922
35140
|
title: "Skills"
|
|
34923
|
-
}, onCloseButton && React.createElement(CloseButton$
|
|
35141
|
+
}, onCloseButton && React.createElement(CloseButton$3, {
|
|
34924
35142
|
onClick: onCloseButton,
|
|
34925
35143
|
onTouchStart: onCloseButton
|
|
34926
35144
|
}, "X"), React.createElement(SkillSplitDiv, null, React.createElement("p", null, "General"), React.createElement("hr", {
|
|
@@ -34950,7 +35168,7 @@ var SkillSplitDiv = /*#__PURE__*/styled.div.withConfig({
|
|
|
34950
35168
|
displayName: "SkillsContainer__SkillSplitDiv",
|
|
34951
35169
|
componentId: "sc-1g0c67q-1"
|
|
34952
35170
|
})(["width:100%;font-size:11px;hr{margin:0;margin-bottom:1rem;padding:0px;}p{margin-bottom:0px;}"]);
|
|
34953
|
-
var CloseButton$
|
|
35171
|
+
var CloseButton$3 = /*#__PURE__*/styled.div.withConfig({
|
|
34954
35172
|
displayName: "SkillsContainer__CloseButton",
|
|
34955
35173
|
componentId: "sc-1g0c67q-2"
|
|
34956
35174
|
})(["position:absolute;top:2px;right:2px;color:white;z-index:22;font-size:0.7rem;"]);
|
|
@@ -34985,7 +35203,7 @@ var TimeWidget = function TimeWidget(_ref) {
|
|
|
34985
35203
|
var onClose = _ref.onClose,
|
|
34986
35204
|
TimeClock = _ref.TimeClock,
|
|
34987
35205
|
periodOfDay = _ref.periodOfDay;
|
|
34988
|
-
return React.createElement(Draggable, null, React.createElement(WidgetContainer, null, React.createElement(CloseButton$
|
|
35206
|
+
return React.createElement(Draggable, null, React.createElement(WidgetContainer, null, React.createElement(CloseButton$4, {
|
|
34989
35207
|
onClick: onClose
|
|
34990
35208
|
}, "X"), React.createElement(DayNightContainer, null, React.createElement(DayNightPeriod, {
|
|
34991
35209
|
periodOfDay: periodOfDay
|
|
@@ -34999,7 +35217,7 @@ var Time = /*#__PURE__*/styled.div.withConfig({
|
|
|
34999
35217
|
displayName: "TimeWidget__Time",
|
|
35000
35218
|
componentId: "sc-1ja236h-1"
|
|
35001
35219
|
})(["top:0.75rem;right:0.5rem;position:absolute;font-size:", ";color:white;"], uiFonts.size.small);
|
|
35002
|
-
var CloseButton$
|
|
35220
|
+
var CloseButton$4 = /*#__PURE__*/styled.p.withConfig({
|
|
35003
35221
|
displayName: "TimeWidget__CloseButton",
|
|
35004
35222
|
componentId: "sc-1ja236h-2"
|
|
35005
35223
|
})(["position:absolute;top:-0.5rem;margin:0;right:-0.2rem;font-size:", " !important;z-index:1;"], uiFonts.size.small);
|
|
@@ -35155,7 +35373,7 @@ var TradingMenu = function TradingMenu(_ref) {
|
|
|
35155
35373
|
style: {
|
|
35156
35374
|
width: '100%'
|
|
35157
35375
|
}
|
|
35158
|
-
}, React.createElement(Title$
|
|
35376
|
+
}, React.createElement(Title$4, null, Capitalize(type), " Menu"), React.createElement("hr", {
|
|
35159
35377
|
className: "golden"
|
|
35160
35378
|
})), React.createElement(TradingComponentScrollWrapper, null, traderItems.map(function (tradeItem, index) {
|
|
35161
35379
|
var _qtyMap$get;
|
|
@@ -35168,7 +35386,7 @@ var TradingMenu = function TradingMenu(_ref) {
|
|
|
35168
35386
|
traderItem: tradeItem,
|
|
35169
35387
|
selectedQty: (_qtyMap$get = qtyMap.get(tradeItem.key)) != null ? _qtyMap$get : 0
|
|
35170
35388
|
}));
|
|
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$
|
|
35389
|
+
})), 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
35390
|
buttonType: ButtonTypes.RPGUIButton,
|
|
35173
35391
|
disabled: !hasGoldForSale(),
|
|
35174
35392
|
onClick: function onClick() {
|
|
@@ -35181,7 +35399,7 @@ var TradingMenu = function TradingMenu(_ref) {
|
|
|
35181
35399
|
}
|
|
35182
35400
|
}, "Cancel"))));
|
|
35183
35401
|
};
|
|
35184
|
-
var Title$
|
|
35402
|
+
var Title$4 = /*#__PURE__*/styled.h1.withConfig({
|
|
35185
35403
|
displayName: "TradingMenu__Title",
|
|
35186
35404
|
componentId: "sc-1wjsz1l-0"
|
|
35187
35405
|
})(["z-index:22;font-size:0.6rem;color:yellow !important;"]);
|
|
@@ -35205,7 +35423,7 @@ var AlertWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
|
35205
35423
|
displayName: "TradingMenu__AlertWrapper",
|
|
35206
35424
|
componentId: "sc-1wjsz1l-5"
|
|
35207
35425
|
})(["margin-top:1rem;display:flex;width:100%;justify-content:center;height:20px;p{color:red !important;}"]);
|
|
35208
|
-
var ButtonWrapper$
|
|
35426
|
+
var ButtonWrapper$1 = /*#__PURE__*/styled.div.withConfig({
|
|
35209
35427
|
displayName: "TradingMenu__ButtonWrapper",
|
|
35210
35428
|
componentId: "sc-1wjsz1l-6"
|
|
35211
35429
|
})(["display:flex;justify-content:space-around;padding-top:20px;width:100%;margin-top:1rem;"]);
|
|
@@ -35226,5 +35444,91 @@ var Container$i = /*#__PURE__*/styled.div.withConfig({
|
|
|
35226
35444
|
return props.maxLines;
|
|
35227
35445
|
});
|
|
35228
35446
|
|
|
35229
|
-
|
|
35447
|
+
var ItemSelector = function ItemSelector(_ref) {
|
|
35448
|
+
var atlasIMG = _ref.atlasIMG,
|
|
35449
|
+
atlasJSON = _ref.atlasJSON,
|
|
35450
|
+
options = _ref.options,
|
|
35451
|
+
onClose = _ref.onClose,
|
|
35452
|
+
onSelect = _ref.onSelect;
|
|
35453
|
+
var _useState = useState(),
|
|
35454
|
+
selectedValue = _useState[0],
|
|
35455
|
+
setSelectedValue = _useState[1];
|
|
35456
|
+
var handleClick = function handleClick() {
|
|
35457
|
+
var element = document.querySelector("input[name='test']:checked");
|
|
35458
|
+
var elementValue = element.value;
|
|
35459
|
+
setSelectedValue(elementValue);
|
|
35460
|
+
};
|
|
35461
|
+
useEffect(function () {
|
|
35462
|
+
if (selectedValue) {
|
|
35463
|
+
onSelect(selectedValue);
|
|
35464
|
+
}
|
|
35465
|
+
}, [selectedValue]);
|
|
35466
|
+
return React.createElement(DraggableContainer, {
|
|
35467
|
+
type: RPGUIContainerTypes.Framed,
|
|
35468
|
+
width: "500px",
|
|
35469
|
+
cancelDrag: ".equipment-container-body .arrow-selector",
|
|
35470
|
+
onCloseButton: function onCloseButton() {
|
|
35471
|
+
if (onClose) {
|
|
35472
|
+
onClose();
|
|
35473
|
+
}
|
|
35474
|
+
}
|
|
35475
|
+
}, React.createElement("div", {
|
|
35476
|
+
style: {
|
|
35477
|
+
width: '100%'
|
|
35478
|
+
}
|
|
35479
|
+
}, React.createElement(Title$5, null, 'Harvesting instruments'), React.createElement(Subtitle$1, null, 'Use the tool, you need it'), React.createElement("hr", {
|
|
35480
|
+
className: "golden"
|
|
35481
|
+
})), React.createElement(RadioInputScroller$1, null, options == null ? void 0 : options.map(function (option, index) {
|
|
35482
|
+
return React.createElement(RadioOptionsWrapper$1, {
|
|
35483
|
+
key: index
|
|
35484
|
+
}, React.createElement(SpriteAtlasWrapper$1, null, React.createElement(SpriteFromAtlas, {
|
|
35485
|
+
atlasIMG: atlasIMG,
|
|
35486
|
+
atlasJSON: atlasJSON,
|
|
35487
|
+
spriteKey: option.imageKey,
|
|
35488
|
+
imgScale: 3
|
|
35489
|
+
})), React.createElement("div", null, React.createElement("input", {
|
|
35490
|
+
className: "rpgui-radio",
|
|
35491
|
+
type: "radio",
|
|
35492
|
+
value: option.name,
|
|
35493
|
+
name: "test"
|
|
35494
|
+
}), React.createElement("label", {
|
|
35495
|
+
onClick: handleClick,
|
|
35496
|
+
style: {
|
|
35497
|
+
display: 'flex',
|
|
35498
|
+
alignItems: 'center'
|
|
35499
|
+
}
|
|
35500
|
+
}, option.name, " ", React.createElement("br", null), option.description)));
|
|
35501
|
+
})), React.createElement(ButtonWrapper$2, null, React.createElement(Button, {
|
|
35502
|
+
buttonType: ButtonTypes.RPGUIButton,
|
|
35503
|
+
onClick: onClose
|
|
35504
|
+
}, "Cancel"), React.createElement(Button, {
|
|
35505
|
+
buttonType: ButtonTypes.RPGUIButton
|
|
35506
|
+
}, "Select")));
|
|
35507
|
+
};
|
|
35508
|
+
var Title$5 = /*#__PURE__*/styled.h1.withConfig({
|
|
35509
|
+
displayName: "ItemSelector__Title",
|
|
35510
|
+
componentId: "sc-gptoxp-0"
|
|
35511
|
+
})(["font-size:0.6rem;color:yellow !important;"]);
|
|
35512
|
+
var Subtitle$1 = /*#__PURE__*/styled.h1.withConfig({
|
|
35513
|
+
displayName: "ItemSelector__Subtitle",
|
|
35514
|
+
componentId: "sc-gptoxp-1"
|
|
35515
|
+
})(["font-size:0.4rem;color:yellow !important;"]);
|
|
35516
|
+
var RadioInputScroller$1 = /*#__PURE__*/styled.div.withConfig({
|
|
35517
|
+
displayName: "ItemSelector__RadioInputScroller",
|
|
35518
|
+
componentId: "sc-gptoxp-2"
|
|
35519
|
+
})(["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;"]);
|
|
35520
|
+
var SpriteAtlasWrapper$1 = /*#__PURE__*/styled.div.withConfig({
|
|
35521
|
+
displayName: "ItemSelector__SpriteAtlasWrapper",
|
|
35522
|
+
componentId: "sc-gptoxp-3"
|
|
35523
|
+
})(["margin-right:40px;"]);
|
|
35524
|
+
var RadioOptionsWrapper$1 = /*#__PURE__*/styled.div.withConfig({
|
|
35525
|
+
displayName: "ItemSelector__RadioOptionsWrapper",
|
|
35526
|
+
componentId: "sc-gptoxp-4"
|
|
35527
|
+
})(["display:flex;align-items:stretch;margin-bottom:40px;"]);
|
|
35528
|
+
var ButtonWrapper$2 = /*#__PURE__*/styled.div.withConfig({
|
|
35529
|
+
displayName: "ItemSelector__ButtonWrapper",
|
|
35530
|
+
componentId: "sc-gptoxp-5"
|
|
35531
|
+
})(["display:flex;justify-content:space-around;padding-top:20px;width:100%;"]);
|
|
35532
|
+
|
|
35533
|
+
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
35534
|
//# sourceMappingURL=long-bow.esm.js.map
|