@rpg-engine/long-bow 0.3.60 → 0.3.62
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/long-bow.cjs.development.js +17 -23
- 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 +17 -23
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/CraftBook/CraftBook.tsx +3 -0
- package/src/components/TradingMenu/TradingItemRow.tsx +12 -24
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpg-engine/long-bow",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.62",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@rollup/plugin-image": "^2.1.1",
|
|
86
|
-
"@rpg-engine/shared": "^0.6.
|
|
86
|
+
"@rpg-engine/shared": "^0.6.88",
|
|
87
87
|
"dayjs": "^1.11.2",
|
|
88
88
|
"font-awesome": "^4.7.0",
|
|
89
89
|
"fs-extra": "^10.1.0",
|
|
@@ -125,6 +125,9 @@ export const CraftBook: React.FC<IItemCraftSelectorProps> = ({
|
|
|
125
125
|
onPointerDown={() => {
|
|
126
126
|
handleClick(option.key);
|
|
127
127
|
}}
|
|
128
|
+
onTouchEnd={() => {
|
|
129
|
+
setIsShown({ show: true, index: index });
|
|
130
|
+
}}
|
|
128
131
|
style={{ display: 'flex', alignItems: 'center' }}
|
|
129
132
|
onMouseEnter={() => setIsShown({ show: true, index: index })}
|
|
130
133
|
onMouseLeave={() => setIsShown({ show: false, index: index })}
|
|
@@ -18,6 +18,8 @@ export interface ITradeComponentProps {
|
|
|
18
18
|
selectedQty: number;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
const outerQty = 10;
|
|
22
|
+
|
|
21
23
|
export const TradingItemRow: React.FC<ITradeComponentProps> = ({
|
|
22
24
|
atlasIMG,
|
|
23
25
|
atlasJSON,
|
|
@@ -25,29 +27,15 @@ export const TradingItemRow: React.FC<ITradeComponentProps> = ({
|
|
|
25
27
|
traderItem,
|
|
26
28
|
selectedQty,
|
|
27
29
|
}) => {
|
|
28
|
-
const onLeftClick = () => {
|
|
29
|
-
|
|
30
|
-
const newQuantity = selectedQty - 1;
|
|
31
|
-
onQuantityChange(traderItem, newQuantity);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
const onRightClick = () => {
|
|
35
|
-
if (selectedQty < (traderItem.qty ?? 999)) {
|
|
36
|
-
const newQuantity = selectedQty + 1;
|
|
37
|
-
onQuantityChange(traderItem, newQuantity);
|
|
38
|
-
}
|
|
30
|
+
const onLeftClick = (qty = 1) => {
|
|
31
|
+
onQuantityChange(traderItem, Math.max(0, selectedQty - qty));
|
|
39
32
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const onRightOutClick = () => {
|
|
47
|
-
if (selectedQty + 10 <= (traderItem.qty ?? 999)) {
|
|
48
|
-
const newQuantity = selectedQty + 10;
|
|
49
|
-
onQuantityChange(traderItem, newQuantity);
|
|
50
|
-
}
|
|
33
|
+
|
|
34
|
+
const onRightClick = (qty = 1) => {
|
|
35
|
+
onQuantityChange(
|
|
36
|
+
traderItem,
|
|
37
|
+
Math.min(traderItem.qty ?? 999, selectedQty + qty)
|
|
38
|
+
);
|
|
51
39
|
};
|
|
52
40
|
|
|
53
41
|
return (
|
|
@@ -85,7 +73,7 @@ export const TradingItemRow: React.FC<ITradeComponentProps> = ({
|
|
|
85
73
|
size={32}
|
|
86
74
|
className="arrow-selector"
|
|
87
75
|
direction="left"
|
|
88
|
-
onPointerDown={
|
|
76
|
+
onPointerDown={onLeftClick.bind(null, outerQty)}
|
|
89
77
|
/>
|
|
90
78
|
<StyledArrow
|
|
91
79
|
size={32}
|
|
@@ -108,7 +96,7 @@ export const TradingItemRow: React.FC<ITradeComponentProps> = ({
|
|
|
108
96
|
size={32}
|
|
109
97
|
className="arrow-selector"
|
|
110
98
|
direction="right"
|
|
111
|
-
onPointerDown={
|
|
99
|
+
onPointerDown={onRightClick.bind(null, outerQty)}
|
|
112
100
|
/>
|
|
113
101
|
</QuantityContainer>
|
|
114
102
|
</ItemWrapper>
|