@rpg-engine/long-bow 0.5.13 → 0.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/TradingMenu/TradingItemRow.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +60 -53
- 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 +61 -54
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Item/Inventory/ItemContainer.tsx +4 -59
- package/src/components/Spellbook/mockSpells.ts +5 -0
- package/src/components/TradingMenu/TradingItemRow.tsx +58 -0
- package/src/components/TradingMenu/TradingMenu.tsx +1 -0
- package/src/mocks/itemContainer.mocks.ts +36 -32
|
@@ -15580,7 +15580,6 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
15580
15580
|
isDepotSystem = _ref.isDepotSystem,
|
|
15581
15581
|
onPositionChangeEnd = _ref.onPositionChangeEnd,
|
|
15582
15582
|
onPositionChangeStart = _ref.onPositionChangeStart;
|
|
15583
|
-
var MAX_SLOTS_PER_PAGE = 20;
|
|
15584
15583
|
var _useState = React.useState({
|
|
15585
15584
|
isOpen: false,
|
|
15586
15585
|
maxQuantity: 1,
|
|
@@ -15591,10 +15590,6 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
15591
15590
|
var _useState2 = React.useState(-1),
|
|
15592
15591
|
settingShortcutIndex = _useState2[0],
|
|
15593
15592
|
setSettingShortcutIndex = _useState2[1];
|
|
15594
|
-
var _useState3 = React.useState(1),
|
|
15595
|
-
currentPage = _useState3[0],
|
|
15596
|
-
setCurrentPage = _useState3[1];
|
|
15597
|
-
var totalPages = Math.ceil(itemContainer.slotQty / MAX_SLOTS_PER_PAGE);
|
|
15598
15593
|
var handleSetShortcut = function handleSetShortcut(item, index) {
|
|
15599
15594
|
if (item.type === shared.ItemType.Consumable || item.type === shared.ItemType.Tool) {
|
|
15600
15595
|
setItemShortcut == null ? void 0 : setItemShortcut(item.key, index);
|
|
@@ -15602,11 +15597,8 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
15602
15597
|
};
|
|
15603
15598
|
var onRenderSlots = function onRenderSlots() {
|
|
15604
15599
|
var slots = [];
|
|
15605
|
-
var
|
|
15606
|
-
var end = start + MAX_SLOTS_PER_PAGE;
|
|
15607
|
-
for (var i = start; i < end && i < itemContainer.slotQty; i++) {
|
|
15600
|
+
for (var i = 0; i < itemContainer.slotQty; i++) {
|
|
15608
15601
|
var _itemContainer$slots;
|
|
15609
|
-
console.log(itemContainer);
|
|
15610
15602
|
slots.push(React__default.createElement(ItemSlot, {
|
|
15611
15603
|
isContextMenuDisabled: disableContextMenu,
|
|
15612
15604
|
key: i,
|
|
@@ -15657,16 +15649,6 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
15657
15649
|
}
|
|
15658
15650
|
return slots;
|
|
15659
15651
|
};
|
|
15660
|
-
var goToNextPage = function goToNextPage() {
|
|
15661
|
-
setCurrentPage(function (current) {
|
|
15662
|
-
return Math.min(current + 1, totalPages);
|
|
15663
|
-
});
|
|
15664
|
-
};
|
|
15665
|
-
var goToPreviousPage = function goToPreviousPage() {
|
|
15666
|
-
setCurrentPage(function (current) {
|
|
15667
|
-
return Math.max(current - 1, 1);
|
|
15668
|
-
});
|
|
15669
|
-
};
|
|
15670
15652
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement(SlotsContainer, {
|
|
15671
15653
|
title: itemContainer.name || 'Container',
|
|
15672
15654
|
onClose: onClose,
|
|
@@ -15683,23 +15665,7 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
15683
15665
|
atlasJSON: atlasJSON
|
|
15684
15666
|
}), React__default.createElement(ItemsContainer, {
|
|
15685
15667
|
className: "item-container-body"
|
|
15686
|
-
}, onRenderSlots()),
|
|
15687
|
-
className: 'arrow .arrow-up',
|
|
15688
|
-
direction: "left",
|
|
15689
|
-
onPointerDown: function onPointerDown() {
|
|
15690
|
-
if (currentPage > 1) {
|
|
15691
|
-
goToPreviousPage();
|
|
15692
|
-
}
|
|
15693
|
-
}
|
|
15694
|
-
}), currentPage < totalPages && React__default.createElement(SelectArrow, {
|
|
15695
|
-
className: 'arrow .arrow-down',
|
|
15696
|
-
direction: "right",
|
|
15697
|
-
onPointerDown: function onPointerDown() {
|
|
15698
|
-
if (currentPage < totalPages) {
|
|
15699
|
-
goToNextPage();
|
|
15700
|
-
}
|
|
15701
|
-
}
|
|
15702
|
-
}))), quantitySelect.isOpen && React__default.createElement(ModalPortal, null, React__default.createElement(QuantitySelectorContainer, null, React__default.createElement(ItemQuantitySelector, {
|
|
15668
|
+
}, onRenderSlots())), quantitySelect.isOpen && React__default.createElement(ModalPortal, null, React__default.createElement(QuantitySelectorContainer, null, React__default.createElement(ItemQuantitySelector, {
|
|
15703
15669
|
quantity: quantitySelect.maxQuantity,
|
|
15704
15670
|
onConfirm: function onConfirm(quantity) {
|
|
15705
15671
|
quantitySelect.callback(quantity);
|
|
@@ -15727,10 +15693,6 @@ var QuantitySelectorContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
15727
15693
|
displayName: "ItemContainer__QuantitySelectorContainer",
|
|
15728
15694
|
componentId: "sc-15y5p9l-1"
|
|
15729
15695
|
})(["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);"]);
|
|
15730
|
-
var ArrowContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
15731
|
-
displayName: "ItemContainer__ArrowContainer",
|
|
15732
|
-
componentId: "sc-15y5p9l-2"
|
|
15733
|
-
})(["margin-top:10px;margin-bottom:30px;span:first-child{margin-left:20px;}span:last-child{margin-right:20px;}"]);
|
|
15734
15696
|
|
|
15735
15697
|
var LeaderboardTable = function LeaderboardTable(props) {
|
|
15736
15698
|
var items = props.items,
|
|
@@ -18001,7 +17963,8 @@ var TradingItemRow = function TradingItemRow(_ref) {
|
|
|
18001
17963
|
traderItem = _ref.traderItem,
|
|
18002
17964
|
selectedQty = _ref.selectedQty,
|
|
18003
17965
|
equipmentSet = _ref.equipmentSet,
|
|
18004
|
-
scale = _ref.scale
|
|
17966
|
+
scale = _ref.scale,
|
|
17967
|
+
isBuy = _ref.isBuy;
|
|
18005
17968
|
var onLeftClick = function onLeftClick(qty) {
|
|
18006
17969
|
if (qty === void 0) {
|
|
18007
17970
|
qty = 1;
|
|
@@ -18015,6 +17978,39 @@ var TradingItemRow = function TradingItemRow(_ref) {
|
|
|
18015
17978
|
}
|
|
18016
17979
|
onQuantityChange(traderItem, Math.min((_traderItem$stackQty = traderItem.stackQty) != null ? _traderItem$stackQty : 999, selectedQty + qty));
|
|
18017
17980
|
};
|
|
17981
|
+
var renderAccountTypeIndicator = function renderAccountTypeIndicator() {
|
|
17982
|
+
if (isBuy && traderItem.canBePurchasedOnlyByPremiumPlans) {
|
|
17983
|
+
return traderItem.canBePurchasedOnlyByPremiumPlans.map(function (accountType) {
|
|
17984
|
+
if (accountType !== shared.UserAccountTypes.Free) {
|
|
17985
|
+
var backgroundColor;
|
|
17986
|
+
var textColor = 'black';
|
|
17987
|
+
switch (accountType) {
|
|
17988
|
+
case shared.UserAccountTypes.PremiumBronze:
|
|
17989
|
+
backgroundColor = '#CD7F32';
|
|
17990
|
+
break;
|
|
17991
|
+
case shared.UserAccountTypes.PremiumSilver:
|
|
17992
|
+
backgroundColor = '#C0C0C0';
|
|
17993
|
+
break;
|
|
17994
|
+
case shared.UserAccountTypes.PremiumGold:
|
|
17995
|
+
backgroundColor = '#FFD700';
|
|
17996
|
+
break;
|
|
17997
|
+
case shared.UserAccountTypes.PremiumUltimate:
|
|
17998
|
+
backgroundColor = '#002E99';
|
|
17999
|
+
break;
|
|
18000
|
+
default:
|
|
18001
|
+
return null;
|
|
18002
|
+
}
|
|
18003
|
+
return React__default.createElement(PremiumLabel, {
|
|
18004
|
+
backgroundColor: backgroundColor,
|
|
18005
|
+
textColor: textColor,
|
|
18006
|
+
key: accountType
|
|
18007
|
+
}, capitalize(accountType) + ' PA');
|
|
18008
|
+
}
|
|
18009
|
+
return null;
|
|
18010
|
+
});
|
|
18011
|
+
}
|
|
18012
|
+
return null;
|
|
18013
|
+
};
|
|
18018
18014
|
return React__default.createElement(ItemWrapper, null, React__default.createElement(ItemIconContainer$1, null, React__default.createElement(SpriteContainer$2, null, React__default.createElement(ItemInfoWrapper, {
|
|
18019
18015
|
atlasIMG: atlasIMG,
|
|
18020
18016
|
atlasJSON: atlasJSON,
|
|
@@ -18034,7 +18030,7 @@ var TradingItemRow = function TradingItemRow(_ref) {
|
|
|
18034
18030
|
})))), React__default.createElement(ItemNameContainer, null, React__default.createElement(NameValue, null, React__default.createElement("p", null, React__default.createElement(Ellipsis, {
|
|
18035
18031
|
maxLines: 1,
|
|
18036
18032
|
maxWidth: "250px"
|
|
18037
|
-
}, capitalize(traderItem.name))), React__default.createElement("p", null, "$", traderItem.price))), React__default.createElement(QuantityContainer$1, null, React__default.createElement(SelectArrow, {
|
|
18033
|
+
}, capitalize(traderItem.name))), React__default.createElement("p", null, "$", traderItem.price), React__default.createElement("p", null, renderAccountTypeIndicator()))), React__default.createElement(QuantityContainer$1, null, React__default.createElement(SelectArrow, {
|
|
18038
18034
|
size: 32,
|
|
18039
18035
|
className: "arrow-selector",
|
|
18040
18036
|
direction: "left",
|
|
@@ -18056,45 +18052,55 @@ var TradingItemRow = function TradingItemRow(_ref) {
|
|
|
18056
18052
|
onPointerDown: onRightClick.bind(null, outerQty)
|
|
18057
18053
|
})));
|
|
18058
18054
|
};
|
|
18055
|
+
var PremiumLabel = /*#__PURE__*/styled.span.withConfig({
|
|
18056
|
+
displayName: "TradingItemRow__PremiumLabel",
|
|
18057
|
+
componentId: "sc-mja0b5-0"
|
|
18058
|
+
})(["background-color:", ";color:", ";font-weight:bold;padding:2px 5px;border-radius:5px;margin-right:5px;margin-bottom:5px;display:inline-block;"], function (_ref2) {
|
|
18059
|
+
var backgroundColor = _ref2.backgroundColor;
|
|
18060
|
+
return backgroundColor;
|
|
18061
|
+
}, function (_ref3) {
|
|
18062
|
+
var textColor = _ref3.textColor;
|
|
18063
|
+
return textColor;
|
|
18064
|
+
});
|
|
18059
18065
|
var StyledArrow = /*#__PURE__*/styled(SelectArrow).withConfig({
|
|
18060
18066
|
displayName: "TradingItemRow__StyledArrow",
|
|
18061
|
-
componentId: "sc-mja0b5-
|
|
18067
|
+
componentId: "sc-mja0b5-1"
|
|
18062
18068
|
})(["margin:40px;"]);
|
|
18063
18069
|
var ItemWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
18064
18070
|
displayName: "TradingItemRow__ItemWrapper",
|
|
18065
|
-
componentId: "sc-mja0b5-
|
|
18071
|
+
componentId: "sc-mja0b5-2"
|
|
18066
18072
|
})(["width:100%;margin:auto;display:flex;justify-content:space-between;margin-bottom:1rem;&:hover{background-color:", ";}padding:0.5rem;"], uiColors.darkGray);
|
|
18067
18073
|
var ItemNameContainer = /*#__PURE__*/styled.div.withConfig({
|
|
18068
18074
|
displayName: "TradingItemRow__ItemNameContainer",
|
|
18069
|
-
componentId: "sc-mja0b5-
|
|
18075
|
+
componentId: "sc-mja0b5-3"
|
|
18070
18076
|
})(["flex:60%;"]);
|
|
18071
18077
|
var ItemIconContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
18072
18078
|
displayName: "TradingItemRow__ItemIconContainer",
|
|
18073
|
-
componentId: "sc-mja0b5-
|
|
18079
|
+
componentId: "sc-mja0b5-4"
|
|
18074
18080
|
})(["display:flex;justify-content:flex-start;align-items:center;flex:0 0 58px;"]);
|
|
18075
18081
|
var SpriteContainer$2 = /*#__PURE__*/styled.div.withConfig({
|
|
18076
18082
|
displayName: "TradingItemRow__SpriteContainer",
|
|
18077
|
-
componentId: "sc-mja0b5-
|
|
18083
|
+
componentId: "sc-mja0b5-5"
|
|
18078
18084
|
})(["position:relative;top:-0.5rem;left:0.5rem;"]);
|
|
18079
18085
|
var NameValue = /*#__PURE__*/styled.div.withConfig({
|
|
18080
18086
|
displayName: "TradingItemRow__NameValue",
|
|
18081
|
-
componentId: "sc-mja0b5-
|
|
18087
|
+
componentId: "sc-mja0b5-6"
|
|
18082
18088
|
})(["p{font-size:0.75rem;margin:0;}"]);
|
|
18083
18089
|
var Item$1 = /*#__PURE__*/styled.span.withConfig({
|
|
18084
18090
|
displayName: "TradingItemRow__Item",
|
|
18085
|
-
componentId: "sc-mja0b5-
|
|
18091
|
+
componentId: "sc-mja0b5-7"
|
|
18086
18092
|
})(["color:white;text-align:center;z-index:1;width:100%;"]);
|
|
18087
18093
|
var TextOverlay$2 = /*#__PURE__*/styled.div.withConfig({
|
|
18088
18094
|
displayName: "TradingItemRow__TextOverlay",
|
|
18089
|
-
componentId: "sc-mja0b5-
|
|
18095
|
+
componentId: "sc-mja0b5-8"
|
|
18090
18096
|
})(["width:100%;position:relative;"]);
|
|
18091
18097
|
var QuantityContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
18092
18098
|
displayName: "TradingItemRow__QuantityContainer",
|
|
18093
|
-
componentId: "sc-mja0b5-
|
|
18099
|
+
componentId: "sc-mja0b5-9"
|
|
18094
18100
|
})(["position:relative;display:flex;min-width:100px;width:40%;justify-content:center;align-items:center;flex:40%;"]);
|
|
18095
18101
|
var QuantityDisplay = /*#__PURE__*/styled.div.withConfig({
|
|
18096
18102
|
displayName: "TradingItemRow__QuantityDisplay",
|
|
18097
|
-
componentId: "sc-mja0b5-
|
|
18103
|
+
componentId: "sc-mja0b5-10"
|
|
18098
18104
|
})(["font-size:", ";"], uiFonts.size.small);
|
|
18099
18105
|
|
|
18100
18106
|
var TradingMenu = function TradingMenu(_ref) {
|
|
@@ -18180,7 +18186,8 @@ var TradingMenu = function TradingMenu(_ref) {
|
|
|
18180
18186
|
traderItem: tradeItem,
|
|
18181
18187
|
selectedQty: (_qtyMap$get = qtyMap.get(tradeItem.key)) != null ? _qtyMap$get : 0,
|
|
18182
18188
|
equipmentSet: equipmentSet,
|
|
18183
|
-
scale: scale
|
|
18189
|
+
scale: scale,
|
|
18190
|
+
isBuy: isBuy()
|
|
18184
18191
|
}));
|
|
18185
18192
|
})), React__default.createElement(GoldWrapper, null, React__default.createElement("p", null, "Available Gold:"), React__default.createElement("p", null, "$", characterAvailableGold)), React__default.createElement(TotalWrapper, null, React__default.createElement("p", null, "Total:"), React__default.createElement("p", null, "$", sum)), !hasGoldForSale() ? React__default.createElement(AlertWrapper, null, React__default.createElement("p", null, " Sorry, not enough money.")) : React__default.createElement(GoldWrapper, null, React__default.createElement("p", null, "Final Gold:"), React__default.createElement("p", null, "$", getFinalGold())), React__default.createElement(ButtonWrapper$2, null, React__default.createElement(Button, {
|
|
18186
18193
|
buttonType: exports.ButtonTypes.RPGUIButton,
|