@rpg-engine/long-bow 0.7.82 → 0.7.84
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/PremiumLabel.d.ts +7 -0
- package/dist/components/TradingMenu/useTradingGold.d.ts +16 -0
- package/dist/long-bow.cjs.development.js +189 -149
- 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 +189 -149
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Marketplace/MarketplaceRows.tsx +16 -0
- package/src/components/TradingMenu/PremiumLabel.tsx +62 -0
- package/src/components/TradingMenu/TradingItemRow.tsx +36 -88
- package/src/components/TradingMenu/TradingMenu.tsx +77 -136
- package/src/components/TradingMenu/useTradingGold.ts +64 -0
package/dist/long-bow.esm.js
CHANGED
|
@@ -31136,13 +31136,16 @@ var MarketplaceRows = function MarketplaceRows(_ref) {
|
|
|
31136
31136
|
onMarketPlaceItemBuy = _ref.onMarketPlaceItemBuy,
|
|
31137
31137
|
onMarketPlaceItemRemove = _ref.onMarketPlaceItemRemove,
|
|
31138
31138
|
disabled = _ref.disabled;
|
|
31139
|
+
var renderGems = function renderGems(item) {
|
|
31140
|
+
return item.attachedGems && onRenderGems(item);
|
|
31141
|
+
};
|
|
31139
31142
|
return React.createElement(MarketplaceWrapper, null, React.createElement(ItemIconContainer, null, React.createElement(SpriteContainer$1, null, React.createElement(ItemInfoWrapper, {
|
|
31140
31143
|
item: item,
|
|
31141
31144
|
atlasIMG: atlasIMG,
|
|
31142
31145
|
atlasJSON: atlasJSON,
|
|
31143
31146
|
equipmentSet: equipmentSet,
|
|
31144
31147
|
scale: scale
|
|
31145
|
-
}, React.createElement(RarityContainer, {
|
|
31148
|
+
}, React.createElement(GemContainer, null, renderGems(item)), React.createElement(RarityContainer, {
|
|
31146
31149
|
item: item
|
|
31147
31150
|
}, React.createElement(SpriteFromAtlas, {
|
|
31148
31151
|
atlasIMG: atlasIMG,
|
|
@@ -31153,7 +31156,8 @@ var MarketplaceRows = function MarketplaceRows(_ref) {
|
|
|
31153
31156
|
texturePath: item.texturePath,
|
|
31154
31157
|
isStackable: item.isStackable
|
|
31155
31158
|
}, atlasJSON),
|
|
31156
|
-
imgScale: 2
|
|
31159
|
+
imgScale: 2,
|
|
31160
|
+
imgClassname: "sprite-from-atlas-img--item"
|
|
31157
31161
|
})), React.createElement(QuantityContainer, null, item.stackQty && item.stackQty > 1 && "x" + Math.round(item.stackQty * 10) / 10))), React.createElement(PriceValue, null, React.createElement("p", null, React.createElement(Ellipsis, {
|
|
31158
31162
|
maxLines: 1,
|
|
31159
31163
|
maxWidth: "200px",
|
|
@@ -31185,33 +31189,37 @@ var QuantityContainer = /*#__PURE__*/styled.p.withConfig({
|
|
|
31185
31189
|
displayName: "MarketplaceRows__QuantityContainer",
|
|
31186
31190
|
componentId: "sc-wmpr1o-1"
|
|
31187
31191
|
})(["position:absolute;display:block;top:15px;left:25px;font-size:", " !important;"], uiFonts.size.xsmall);
|
|
31192
|
+
var GemContainer = /*#__PURE__*/styled.p.withConfig({
|
|
31193
|
+
displayName: "MarketplaceRows__GemContainer",
|
|
31194
|
+
componentId: "sc-wmpr1o-2"
|
|
31195
|
+
})(["position:absolute;display:block;top:-5px;left:-10px;font-size:", " !important;"], uiFonts.size.xsmall);
|
|
31188
31196
|
var Flex$1 = /*#__PURE__*/styled.div.withConfig({
|
|
31189
31197
|
displayName: "MarketplaceRows__Flex",
|
|
31190
|
-
componentId: "sc-wmpr1o-
|
|
31198
|
+
componentId: "sc-wmpr1o-3"
|
|
31191
31199
|
})(["display:flex;gap:24px;"]);
|
|
31192
31200
|
var ItemIconContainer = /*#__PURE__*/styled.div.withConfig({
|
|
31193
31201
|
displayName: "MarketplaceRows__ItemIconContainer",
|
|
31194
|
-
componentId: "sc-wmpr1o-
|
|
31202
|
+
componentId: "sc-wmpr1o-4"
|
|
31195
31203
|
})(["display:flex;justify-content:flex-start;align-items:center;"]);
|
|
31196
31204
|
var GoldContainer = /*#__PURE__*/styled.div.withConfig({
|
|
31197
31205
|
displayName: "MarketplaceRows__GoldContainer",
|
|
31198
|
-
componentId: "sc-wmpr1o-
|
|
31206
|
+
componentId: "sc-wmpr1o-5"
|
|
31199
31207
|
})(["position:relative;top:-0.5rem;left:0.5rem;"]);
|
|
31200
31208
|
var SpriteContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
31201
31209
|
displayName: "MarketplaceRows__SpriteContainer",
|
|
31202
|
-
componentId: "sc-wmpr1o-
|
|
31210
|
+
componentId: "sc-wmpr1o-6"
|
|
31203
31211
|
})(["position:relative;left:0.5rem;"]);
|
|
31204
31212
|
var PriceValue = /*#__PURE__*/styled.div.withConfig({
|
|
31205
31213
|
displayName: "MarketplaceRows__PriceValue",
|
|
31206
|
-
componentId: "sc-wmpr1o-
|
|
31214
|
+
componentId: "sc-wmpr1o-7"
|
|
31207
31215
|
})(["margin-left:40px;"]);
|
|
31208
31216
|
var ButtonContainer$2 = /*#__PURE__*/styled.div.withConfig({
|
|
31209
31217
|
displayName: "MarketplaceRows__ButtonContainer",
|
|
31210
|
-
componentId: "sc-wmpr1o-
|
|
31218
|
+
componentId: "sc-wmpr1o-8"
|
|
31211
31219
|
})(["margin:auto;"]);
|
|
31212
31220
|
var RarityContainer = /*#__PURE__*/styled.div.withConfig({
|
|
31213
31221
|
displayName: "MarketplaceRows__RarityContainer",
|
|
31214
|
-
componentId: "sc-wmpr1o-
|
|
31222
|
+
componentId: "sc-wmpr1o-9"
|
|
31215
31223
|
})(["border-color:", ";box-shadow:", " inset,", ";width:32px;height:32px;"], function (_ref2) {
|
|
31216
31224
|
var item = _ref2.item;
|
|
31217
31225
|
return rarityColor(item);
|
|
@@ -33581,6 +33589,52 @@ var DayNightContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
33581
33589
|
componentId: "sc-1ja236h-3"
|
|
33582
33590
|
})(["margin-top:-0.3rem;margin-left:-0.3rem;"]);
|
|
33583
33591
|
|
|
33592
|
+
var PremiumLabel = function PremiumLabel(_ref) {
|
|
33593
|
+
var accountType = _ref.accountType;
|
|
33594
|
+
if (accountType === UserAccountTypes.Free) return null;
|
|
33595
|
+
var getBackgroundColor = function getBackgroundColor() {
|
|
33596
|
+
switch (accountType) {
|
|
33597
|
+
case UserAccountTypes.PremiumBronze:
|
|
33598
|
+
return '#CD7F32';
|
|
33599
|
+
case UserAccountTypes.PremiumSilver:
|
|
33600
|
+
return '#C0C0C0';
|
|
33601
|
+
case UserAccountTypes.PremiumGold:
|
|
33602
|
+
return '#FFD700';
|
|
33603
|
+
case UserAccountTypes.PremiumUltimate:
|
|
33604
|
+
return '#002E99';
|
|
33605
|
+
default:
|
|
33606
|
+
return 'transparent';
|
|
33607
|
+
}
|
|
33608
|
+
};
|
|
33609
|
+
var getShortLabel = function getShortLabel() {
|
|
33610
|
+
switch (accountType) {
|
|
33611
|
+
case UserAccountTypes.PremiumBronze:
|
|
33612
|
+
return 'Bronze PA';
|
|
33613
|
+
case UserAccountTypes.PremiumSilver:
|
|
33614
|
+
return 'Silver PA';
|
|
33615
|
+
case UserAccountTypes.PremiumGold:
|
|
33616
|
+
return 'Gold PA';
|
|
33617
|
+
case UserAccountTypes.PremiumUltimate:
|
|
33618
|
+
return 'Ultimate PA';
|
|
33619
|
+
default:
|
|
33620
|
+
return '';
|
|
33621
|
+
}
|
|
33622
|
+
};
|
|
33623
|
+
return React.createElement(StyledLabel, {
|
|
33624
|
+
backgroundColor: getBackgroundColor()
|
|
33625
|
+
}, getShortLabel());
|
|
33626
|
+
};
|
|
33627
|
+
var StyledLabel = /*#__PURE__*/styled.span.withConfig({
|
|
33628
|
+
displayName: "PremiumLabel__StyledLabel",
|
|
33629
|
+
componentId: "sc-5bsloi-0"
|
|
33630
|
+
})(["background-color:", ";color:", ";font-weight:bold;padding:0 0.4rem;border-radius:3px;margin-right:3px;margin-bottom:2px;display:inline-block;font-size:0.5rem !important;"], function (_ref2) {
|
|
33631
|
+
var backgroundColor = _ref2.backgroundColor;
|
|
33632
|
+
return backgroundColor;
|
|
33633
|
+
}, function (_ref3) {
|
|
33634
|
+
var backgroundColor = _ref3.backgroundColor;
|
|
33635
|
+
return backgroundColor === '#002E99' ? 'white' : 'black';
|
|
33636
|
+
});
|
|
33637
|
+
|
|
33584
33638
|
var outerQty = 10;
|
|
33585
33639
|
var TradingItemRow = function TradingItemRow(_ref) {
|
|
33586
33640
|
var atlasIMG = _ref.atlasIMG,
|
|
@@ -33627,32 +33681,10 @@ var TradingItemRow = function TradingItemRow(_ref) {
|
|
|
33627
33681
|
var renderAccountTypeIndicator = function renderAccountTypeIndicator() {
|
|
33628
33682
|
if (isBuy && traderItem.canBePurchasedOnlyByPremiumPlans) {
|
|
33629
33683
|
return traderItem.canBePurchasedOnlyByPremiumPlans.map(function (accountType) {
|
|
33630
|
-
|
|
33631
|
-
|
|
33632
|
-
|
|
33633
|
-
|
|
33634
|
-
case UserAccountTypes.PremiumBronze:
|
|
33635
|
-
backgroundColor = '#CD7F32';
|
|
33636
|
-
break;
|
|
33637
|
-
case UserAccountTypes.PremiumSilver:
|
|
33638
|
-
backgroundColor = '#C0C0C0';
|
|
33639
|
-
break;
|
|
33640
|
-
case UserAccountTypes.PremiumGold:
|
|
33641
|
-
backgroundColor = '#FFD700';
|
|
33642
|
-
break;
|
|
33643
|
-
case UserAccountTypes.PremiumUltimate:
|
|
33644
|
-
backgroundColor = '#002E99';
|
|
33645
|
-
break;
|
|
33646
|
-
default:
|
|
33647
|
-
return null;
|
|
33648
|
-
}
|
|
33649
|
-
return React.createElement(PremiumLabel, {
|
|
33650
|
-
backgroundColor: backgroundColor,
|
|
33651
|
-
textColor: textColor,
|
|
33652
|
-
key: accountType
|
|
33653
|
-
}, capitalize(accountType) + ' PA');
|
|
33654
|
-
}
|
|
33655
|
-
return null;
|
|
33684
|
+
return React.createElement(PremiumLabel, {
|
|
33685
|
+
key: accountType,
|
|
33686
|
+
accountType: accountType
|
|
33687
|
+
});
|
|
33656
33688
|
});
|
|
33657
33689
|
}
|
|
33658
33690
|
return null;
|
|
@@ -33672,220 +33704,228 @@ var TradingItemRow = function TradingItemRow(_ref) {
|
|
|
33672
33704
|
texturePath: traderItem.texturePath,
|
|
33673
33705
|
isStackable: traderItem.isStackable
|
|
33674
33706
|
}, atlasJSON),
|
|
33675
|
-
imgScale: 2
|
|
33707
|
+
imgScale: 2
|
|
33676
33708
|
})))), React.createElement(ItemNameContainer, null, React.createElement(NameValue, null, React.createElement("p", null, React.createElement(Ellipsis, {
|
|
33677
33709
|
maxLines: 1,
|
|
33678
|
-
maxWidth: "
|
|
33710
|
+
maxWidth: "180px"
|
|
33679
33711
|
}, capitalize(traderItem.name))), React.createElement("p", null, "$", traderItem.price), React.createElement("p", null, renderAccountTypeIndicator()))), React.createElement(QuantityContainer$1, null, React.createElement(SelectArrow, {
|
|
33680
|
-
size:
|
|
33712
|
+
size: 24,
|
|
33681
33713
|
className: "arrow-selector",
|
|
33682
33714
|
direction: "left",
|
|
33683
|
-
onPointerDown:
|
|
33684
|
-
|
|
33715
|
+
onPointerDown: function onPointerDown() {
|
|
33716
|
+
return onLeftClick(outerQty);
|
|
33717
|
+
},
|
|
33718
|
+
scale: 0.7
|
|
33685
33719
|
}), React.createElement(StyledArrow, {
|
|
33686
|
-
size:
|
|
33720
|
+
size: 24,
|
|
33687
33721
|
className: "arrow-selector",
|
|
33688
33722
|
direction: "left",
|
|
33689
|
-
onPointerDown:
|
|
33723
|
+
onPointerDown: function onPointerDown() {
|
|
33724
|
+
return onLeftClick();
|
|
33725
|
+
}
|
|
33690
33726
|
}), React.createElement(QuantityInput, {
|
|
33691
33727
|
type: "text",
|
|
33692
33728
|
value: inputQty,
|
|
33693
33729
|
onChange: handleQuantityChange,
|
|
33694
33730
|
onBlur: handleBlur
|
|
33695
33731
|
}), React.createElement(StyledArrow, {
|
|
33696
|
-
size:
|
|
33732
|
+
size: 24,
|
|
33697
33733
|
className: "arrow-selector",
|
|
33698
33734
|
direction: "right",
|
|
33699
|
-
onPointerDown:
|
|
33735
|
+
onPointerDown: function onPointerDown() {
|
|
33736
|
+
return onRightClick();
|
|
33737
|
+
}
|
|
33700
33738
|
}), React.createElement(SelectArrow, {
|
|
33701
|
-
size:
|
|
33739
|
+
size: 24,
|
|
33702
33740
|
className: "arrow-selector",
|
|
33703
33741
|
direction: "right",
|
|
33704
|
-
onPointerDown:
|
|
33705
|
-
|
|
33742
|
+
onPointerDown: function onPointerDown() {
|
|
33743
|
+
return onRightClick(outerQty);
|
|
33744
|
+
},
|
|
33745
|
+
scale: 0.7
|
|
33706
33746
|
})));
|
|
33707
33747
|
};
|
|
33708
|
-
var PremiumLabel = /*#__PURE__*/styled.span.withConfig({
|
|
33709
|
-
displayName: "TradingItemRow__PremiumLabel",
|
|
33710
|
-
componentId: "sc-mja0b5-0"
|
|
33711
|
-
})(["background-color:", ";color:", ";font-weight:bold;padding:2px 5px;border-radius:5px;margin-right:5px;margin-bottom:5px;display:inline-block;"], function (_ref2) {
|
|
33712
|
-
var backgroundColor = _ref2.backgroundColor;
|
|
33713
|
-
return backgroundColor;
|
|
33714
|
-
}, function (_ref3) {
|
|
33715
|
-
var textColor = _ref3.textColor;
|
|
33716
|
-
return textColor;
|
|
33717
|
-
});
|
|
33718
33748
|
var StyledArrow = /*#__PURE__*/styled(SelectArrow).withConfig({
|
|
33719
33749
|
displayName: "TradingItemRow__StyledArrow",
|
|
33720
|
-
componentId: "sc-mja0b5-
|
|
33721
|
-
})(["margin:
|
|
33750
|
+
componentId: "sc-mja0b5-0"
|
|
33751
|
+
})(["margin:0 1.5rem;"]);
|
|
33722
33752
|
var ItemWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
33723
33753
|
displayName: "TradingItemRow__ItemWrapper",
|
|
33724
|
-
componentId: "sc-mja0b5-
|
|
33725
|
-
})(["width:100%;
|
|
33754
|
+
componentId: "sc-mja0b5-1"
|
|
33755
|
+
})(["width:100%;display:flex;justify-content:space-between;margin-bottom:0.5rem;padding:0.25rem;&:hover{background-color:", ";}"], uiColors.darkGray);
|
|
33726
33756
|
var ItemNameContainer = /*#__PURE__*/styled.div.withConfig({
|
|
33727
33757
|
displayName: "TradingItemRow__ItemNameContainer",
|
|
33728
|
-
componentId: "sc-mja0b5-
|
|
33729
|
-
})(["flex:60%;"]);
|
|
33758
|
+
componentId: "sc-mja0b5-2"
|
|
33759
|
+
})(["flex:60%;display:flex;align-items:center;"]);
|
|
33730
33760
|
var ItemIconContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
33731
33761
|
displayName: "TradingItemRow__ItemIconContainer",
|
|
33732
|
-
componentId: "sc-mja0b5-
|
|
33733
|
-
})(["display:flex;justify-content:flex-start;align-items:center;flex:0 0
|
|
33762
|
+
componentId: "sc-mja0b5-3"
|
|
33763
|
+
})(["display:flex;justify-content:flex-start;align-items:center;flex:0 0 40px;"]);
|
|
33734
33764
|
var SpriteContainer$3 = /*#__PURE__*/styled.div.withConfig({
|
|
33735
33765
|
displayName: "TradingItemRow__SpriteContainer",
|
|
33736
|
-
componentId: "sc-mja0b5-
|
|
33737
|
-
})(["position:relative;top:-0.5rem;left:0
|
|
33766
|
+
componentId: "sc-mja0b5-4"
|
|
33767
|
+
})(["position:relative;top:-0.5rem;left:0;"]);
|
|
33738
33768
|
var NameValue = /*#__PURE__*/styled.div.withConfig({
|
|
33739
33769
|
displayName: "TradingItemRow__NameValue",
|
|
33740
|
-
componentId: "sc-mja0b5-
|
|
33741
|
-
})(["p{font-size:0.
|
|
33770
|
+
componentId: "sc-mja0b5-5"
|
|
33771
|
+
})(["p{font-size:0.6rem;margin:0;line-height:1.2;}"]);
|
|
33742
33772
|
var QuantityContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
33743
33773
|
displayName: "TradingItemRow__QuantityContainer",
|
|
33744
|
-
componentId: "sc-mja0b5-
|
|
33745
|
-
})(["
|
|
33774
|
+
componentId: "sc-mja0b5-6"
|
|
33775
|
+
})(["display:flex;min-width:90px;width:40%;justify-content:flex-end;align-items:center;flex:30%;gap:2px;position:relative;"]);
|
|
33746
33776
|
var QuantityInput = /*#__PURE__*/styled.input.withConfig({
|
|
33747
33777
|
displayName: "TradingItemRow__QuantityInput",
|
|
33748
|
-
componentId: "sc-mja0b5-
|
|
33749
|
-
})(["width:
|
|
33778
|
+
componentId: "sc-mja0b5-7"
|
|
33779
|
+
})(["width:30px;text-align:center;background-color:", ";color:white;border:none;padding:1px;font-size:", ";position:relative;right:4px;"], uiColors.darkGray, uiFonts.size.small);
|
|
33750
33780
|
|
|
33751
|
-
var
|
|
33752
|
-
var
|
|
33753
|
-
onClose = _ref.onClose,
|
|
33781
|
+
var useTradingGold = function useTradingGold(_ref) {
|
|
33782
|
+
var characterAvailableGold = _ref.characterAvailableGold,
|
|
33754
33783
|
type = _ref.type,
|
|
33755
|
-
|
|
33756
|
-
atlasIMG = _ref.atlasIMG,
|
|
33757
|
-
characterAvailableGold = _ref.characterAvailableGold,
|
|
33758
|
-
onConfirm = _ref.onConfirm,
|
|
33759
|
-
equipmentSet = _ref.equipmentSet,
|
|
33760
|
-
scale = _ref.scale;
|
|
33784
|
+
traderItems = _ref.traderItems;
|
|
33761
33785
|
var _useState = useState(0),
|
|
33762
33786
|
sum = _useState[0],
|
|
33763
33787
|
setSum = _useState[1];
|
|
33764
33788
|
var _useState2 = useState(new Map()),
|
|
33765
33789
|
qtyMap = _useState2[0],
|
|
33766
33790
|
setQtyMap = _useState2[1];
|
|
33767
|
-
var onQuantityChange = function onQuantityChange(item, selectedQty) {
|
|
33768
|
-
setQtyMap(new Map(qtyMap.set(item.key, selectedQty)));
|
|
33769
|
-
var newSum = 0;
|
|
33770
|
-
traderItems.forEach(function (item) {
|
|
33771
|
-
var qty = qtyMap.get(item.key);
|
|
33772
|
-
if (qty) newSum += qty * item.price;
|
|
33773
|
-
setSum(newSum);
|
|
33774
|
-
});
|
|
33775
|
-
};
|
|
33776
33791
|
var isBuy = function isBuy() {
|
|
33777
|
-
return type
|
|
33792
|
+
return type === 'buy';
|
|
33778
33793
|
};
|
|
33779
33794
|
var hasGoldForSale = function hasGoldForSale() {
|
|
33780
|
-
|
|
33781
|
-
return !(sum > characterAvailableGold);
|
|
33782
|
-
}
|
|
33783
|
-
return true;
|
|
33795
|
+
return isBuy() ? !(sum > characterAvailableGold) : true;
|
|
33784
33796
|
};
|
|
33785
33797
|
var getFinalGold = function getFinalGold() {
|
|
33786
|
-
|
|
33787
|
-
return characterAvailableGold - sum;
|
|
33788
|
-
} else {
|
|
33789
|
-
return characterAvailableGold + sum;
|
|
33790
|
-
}
|
|
33798
|
+
return isBuy() ? characterAvailableGold - sum : characterAvailableGold + sum;
|
|
33791
33799
|
};
|
|
33792
|
-
var
|
|
33793
|
-
return word[0].toUpperCase() + word.substring(1);
|
|
33794
|
-
};
|
|
33795
|
-
var onConfirmClick = function onConfirmClick() {
|
|
33800
|
+
var getTradeItems = function getTradeItems() {
|
|
33796
33801
|
var items = [];
|
|
33797
33802
|
traderItems.forEach(function (item) {
|
|
33798
33803
|
var qty = qtyMap.get(item.key);
|
|
33799
33804
|
if (qty) {
|
|
33800
|
-
items.push(
|
|
33805
|
+
items.push(_extends({}, item, {
|
|
33801
33806
|
qty: qty
|
|
33802
33807
|
}));
|
|
33803
33808
|
}
|
|
33804
33809
|
});
|
|
33805
|
-
|
|
33810
|
+
return items;
|
|
33811
|
+
};
|
|
33812
|
+
var updateQuantity = function updateQuantity(item, selectedQty) {
|
|
33813
|
+
setQtyMap(new Map(qtyMap.set(item.key, selectedQty)));
|
|
33814
|
+
var newSum = 0;
|
|
33815
|
+
qtyMap.forEach(function (qty, key) {
|
|
33816
|
+
var item = traderItems.find(function (i) {
|
|
33817
|
+
return i.key === key;
|
|
33818
|
+
});
|
|
33819
|
+
if (item) newSum += qty * item.price;
|
|
33820
|
+
});
|
|
33821
|
+
setSum(newSum);
|
|
33806
33822
|
};
|
|
33823
|
+
return {
|
|
33824
|
+
sum: sum,
|
|
33825
|
+
qtyMap: qtyMap,
|
|
33826
|
+
isBuy: isBuy,
|
|
33827
|
+
hasGoldForSale: hasGoldForSale,
|
|
33828
|
+
getFinalGold: getFinalGold,
|
|
33829
|
+
getTradeItems: getTradeItems,
|
|
33830
|
+
updateQuantity: updateQuantity
|
|
33831
|
+
};
|
|
33832
|
+
};
|
|
33833
|
+
|
|
33834
|
+
var TradingMenu = function TradingMenu(_ref) {
|
|
33835
|
+
var traderItems = _ref.traderItems,
|
|
33836
|
+
onClose = _ref.onClose,
|
|
33837
|
+
type = _ref.type,
|
|
33838
|
+
atlasJSON = _ref.atlasJSON,
|
|
33839
|
+
atlasIMG = _ref.atlasIMG,
|
|
33840
|
+
characterAvailableGold = _ref.characterAvailableGold,
|
|
33841
|
+
onConfirm = _ref.onConfirm,
|
|
33842
|
+
equipmentSet = _ref.equipmentSet,
|
|
33843
|
+
scale = _ref.scale;
|
|
33844
|
+
var _useTradingGold = useTradingGold({
|
|
33845
|
+
characterAvailableGold: characterAvailableGold,
|
|
33846
|
+
type: type,
|
|
33847
|
+
traderItems: traderItems
|
|
33848
|
+
}),
|
|
33849
|
+
sum = _useTradingGold.sum,
|
|
33850
|
+
qtyMap = _useTradingGold.qtyMap,
|
|
33851
|
+
isBuy = _useTradingGold.isBuy,
|
|
33852
|
+
hasGoldForSale = _useTradingGold.hasGoldForSale,
|
|
33853
|
+
getFinalGold = _useTradingGold.getFinalGold,
|
|
33854
|
+
getTradeItems = _useTradingGold.getTradeItems,
|
|
33855
|
+
updateQuantity = _useTradingGold.updateQuantity;
|
|
33807
33856
|
return React.createElement(DraggableContainer, {
|
|
33808
33857
|
type: RPGUIContainerTypes.Framed,
|
|
33809
|
-
onCloseButton:
|
|
33810
|
-
|
|
33811
|
-
},
|
|
33812
|
-
width: "600px",
|
|
33858
|
+
onCloseButton: onClose,
|
|
33859
|
+
width: "500px",
|
|
33813
33860
|
cancelDrag: "#TraderContainer",
|
|
33814
33861
|
scale: scale
|
|
33815
|
-
}, React.createElement(React.
|
|
33816
|
-
style: {
|
|
33817
|
-
width: '100%'
|
|
33818
|
-
}
|
|
33819
|
-
}, React.createElement(Title$b, null, Capitalize(type), " Menu"), React.createElement("hr", {
|
|
33862
|
+
}, React.createElement(Container$y, null, React.createElement(Title$b, null, type.charAt(0).toUpperCase() + type.slice(1), " Menu"), React.createElement("hr", {
|
|
33820
33863
|
className: "golden"
|
|
33821
|
-
})
|
|
33864
|
+
}), React.createElement(ScrollWrapper, {
|
|
33822
33865
|
id: "TraderContainer"
|
|
33823
33866
|
}, traderItems.map(function (tradeItem, index) {
|
|
33824
33867
|
var _qtyMap$get;
|
|
33825
|
-
return React.createElement(
|
|
33826
|
-
key: tradeItem.key + "_" + index
|
|
33827
|
-
}, React.createElement(TradingItemRow, {
|
|
33868
|
+
return React.createElement(TradingItemRow, {
|
|
33869
|
+
key: tradeItem.key + "_" + index,
|
|
33828
33870
|
atlasIMG: atlasIMG,
|
|
33829
33871
|
atlasJSON: atlasJSON,
|
|
33830
|
-
onQuantityChange:
|
|
33872
|
+
onQuantityChange: updateQuantity,
|
|
33831
33873
|
traderItem: tradeItem,
|
|
33832
33874
|
selectedQty: (_qtyMap$get = qtyMap.get(tradeItem.key)) != null ? _qtyMap$get : 0,
|
|
33833
33875
|
equipmentSet: equipmentSet,
|
|
33834
33876
|
scale: scale,
|
|
33835
33877
|
isBuy: isBuy()
|
|
33836
|
-
})
|
|
33837
|
-
})), React.createElement(
|
|
33878
|
+
});
|
|
33879
|
+
})), React.createElement(InfoSection, null, React.createElement(GoldInfo, null, React.createElement("p", null, "Available Gold:"), React.createElement("p", null, "$", characterAvailableGold.toFixed(2))), React.createElement(GoldInfo, null, React.createElement("p", null, "Total:"), React.createElement("p", null, "$", sum)), !hasGoldForSale() ? React.createElement(AlertText, null, "Sorry, not enough money.") : React.createElement(GoldInfo, null, React.createElement("p", null, "Final Gold:"), React.createElement("p", null, "$", getFinalGold().toFixed(2)))), React.createElement(ButtonWrapper$3, null, React.createElement(Button, {
|
|
33838
33880
|
buttonType: ButtonTypes.RPGUIButton,
|
|
33839
33881
|
disabled: !hasGoldForSale(),
|
|
33840
33882
|
onPointerDown: function onPointerDown() {
|
|
33841
|
-
return
|
|
33883
|
+
return onConfirm(getTradeItems());
|
|
33842
33884
|
}
|
|
33843
33885
|
}, "Confirm"), React.createElement(Button, {
|
|
33844
33886
|
buttonType: ButtonTypes.RPGUIButton,
|
|
33845
|
-
onPointerDown:
|
|
33846
|
-
return onClose();
|
|
33847
|
-
}
|
|
33887
|
+
onPointerDown: onClose
|
|
33848
33888
|
}, "Cancel"))));
|
|
33849
33889
|
};
|
|
33890
|
+
var Container$y = /*#__PURE__*/styled.div.withConfig({
|
|
33891
|
+
displayName: "TradingMenu__Container",
|
|
33892
|
+
componentId: "sc-1wjsz1l-0"
|
|
33893
|
+
})(["width:100%;"]);
|
|
33850
33894
|
var Title$b = /*#__PURE__*/styled.h1.withConfig({
|
|
33851
33895
|
displayName: "TradingMenu__Title",
|
|
33852
|
-
componentId: "sc-1wjsz1l-0"
|
|
33853
|
-
})(["z-index:22;font-size:0.6rem;color:yellow !important;"]);
|
|
33854
|
-
var TradingComponentScrollWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
33855
|
-
displayName: "TradingMenu__TradingComponentScrollWrapper",
|
|
33856
33896
|
componentId: "sc-1wjsz1l-1"
|
|
33857
|
-
})(["
|
|
33858
|
-
var
|
|
33859
|
-
displayName: "
|
|
33897
|
+
})(["font-size:0.7rem !important;color:yellow !important;text-align:center;"]);
|
|
33898
|
+
var ScrollWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
33899
|
+
displayName: "TradingMenu__ScrollWrapper",
|
|
33860
33900
|
componentId: "sc-1wjsz1l-2"
|
|
33861
|
-
})(["
|
|
33862
|
-
var
|
|
33863
|
-
displayName: "
|
|
33901
|
+
})(["overflow-y:scroll;height:250px;width:100%;margin-top:0.3rem;overflow-x:hidden;padding:0 0.3rem;"]);
|
|
33902
|
+
var InfoSection = /*#__PURE__*/styled.div.withConfig({
|
|
33903
|
+
displayName: "TradingMenu__InfoSection",
|
|
33864
33904
|
componentId: "sc-1wjsz1l-3"
|
|
33865
|
-
})(["margin-top:
|
|
33866
|
-
var
|
|
33867
|
-
displayName: "
|
|
33905
|
+
})(["margin-top:0.3rem;padding:0 0.5rem;"]);
|
|
33906
|
+
var GoldInfo = /*#__PURE__*/styled.div.withConfig({
|
|
33907
|
+
displayName: "TradingMenu__GoldInfo",
|
|
33868
33908
|
componentId: "sc-1wjsz1l-4"
|
|
33869
|
-
})(["
|
|
33870
|
-
var
|
|
33871
|
-
displayName: "
|
|
33909
|
+
})(["display:flex;justify-content:space-between;height:16px;width:100%;margin:0.5rem 0;p{color:yellow !important;margin:0;font-size:0.6rem;}"]);
|
|
33910
|
+
var AlertText = /*#__PURE__*/styled.p.withConfig({
|
|
33911
|
+
displayName: "TradingMenu__AlertText",
|
|
33872
33912
|
componentId: "sc-1wjsz1l-5"
|
|
33873
|
-
})(["
|
|
33913
|
+
})(["color:red !important;text-align:center;margin:0.3rem 0;font-size:0.5rem;"]);
|
|
33874
33914
|
var ButtonWrapper$3 = /*#__PURE__*/styled.div.withConfig({
|
|
33875
33915
|
displayName: "TradingMenu__ButtonWrapper",
|
|
33876
33916
|
componentId: "sc-1wjsz1l-6"
|
|
33877
|
-
})(["display:flex;justify-content:space-around;
|
|
33917
|
+
})(["display:flex;justify-content:space-around;width:100%;margin-top:0.5rem;"]);
|
|
33878
33918
|
|
|
33879
33919
|
/* eslint-disable react/require-default-props */
|
|
33880
33920
|
var Truncate = function Truncate(_ref) {
|
|
33881
33921
|
var _ref$maxLines = _ref.maxLines,
|
|
33882
33922
|
maxLines = _ref$maxLines === void 0 ? 1 : _ref$maxLines,
|
|
33883
33923
|
children = _ref.children;
|
|
33884
|
-
return React.createElement(Container$
|
|
33924
|
+
return React.createElement(Container$z, {
|
|
33885
33925
|
maxLines: maxLines
|
|
33886
33926
|
}, children);
|
|
33887
33927
|
};
|
|
33888
|
-
var Container$
|
|
33928
|
+
var Container$z = /*#__PURE__*/styled.div.withConfig({
|
|
33889
33929
|
displayName: "Truncate__Container",
|
|
33890
33930
|
componentId: "sc-6x00qb-0"
|
|
33891
33931
|
})(["display:-webkit-box;max-width:100%;max-height:100%;-webkit-line-clamp:", ";-webkit-box-orient:vertical;overflow:hidden;"], function (props) {
|
|
@@ -33993,7 +34033,7 @@ var TutorialStepper = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
33993
34033
|
};
|
|
33994
34034
|
});
|
|
33995
34035
|
}, [lessons, imageStyle]);
|
|
33996
|
-
return React.createElement(Container$
|
|
34036
|
+
return React.createElement(Container$A, null, React.createElement(Stepper, {
|
|
33997
34037
|
steps: generateLessons,
|
|
33998
34038
|
finalCTAButton: {
|
|
33999
34039
|
label: 'Close',
|
|
@@ -34010,7 +34050,7 @@ var LessonBody = /*#__PURE__*/styled.div.withConfig({
|
|
|
34010
34050
|
displayName: "TutorialStepper__LessonBody",
|
|
34011
34051
|
componentId: "sc-7tgzv2-1"
|
|
34012
34052
|
})([""]);
|
|
34013
|
-
var Container$
|
|
34053
|
+
var Container$A = /*#__PURE__*/styled.div.withConfig({
|
|
34014
34054
|
displayName: "TutorialStepper__Container",
|
|
34015
34055
|
componentId: "sc-7tgzv2-2"
|
|
34016
34056
|
})(["width:80%;max-width:600px;@media (max-width:600px){width:95%;}"]);
|