@rpg-engine/long-bow 0.3.76 → 0.3.78
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 -13
- 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 -13
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/CraftBook/MockItems.ts +3 -172
- package/src/components/Item/Cards/ItemInfo.tsx +9 -5
- package/src/components/Item/Cards/ItemInfoDisplay.tsx +5 -0
- package/src/components/Item/Cards/MobileItemTooltip.tsx +38 -9
- package/src/mocks/itemContainer.mocks.ts +1 -1
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.78",
|
|
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.95",
|
|
87
87
|
"dayjs": "^1.11.2",
|
|
88
88
|
"font-awesome": "^4.7.0",
|
|
89
89
|
"fs-extra": "^10.1.0",
|
|
@@ -37,175 +37,10 @@ export const craftableItems: ICraftableItem[] = [
|
|
|
37
37
|
texturePath: 'crafting-resources/leather.png',
|
|
38
38
|
},
|
|
39
39
|
],
|
|
40
|
-
}, {
|
|
41
|
-
key: 'bandana',
|
|
42
|
-
name: 'Bandana',
|
|
43
|
-
canCraft: true,
|
|
44
|
-
texturePath: 'accessories/bandana.png',
|
|
45
|
-
ingredients: [
|
|
46
|
-
{
|
|
47
|
-
key: 'leather',
|
|
48
|
-
name: 'leather',
|
|
49
|
-
qty: 10,
|
|
50
|
-
texturePath: 'crafting-resources/leather.png',
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
key: 'bandana1',
|
|
56
|
-
name: 'Bandana',
|
|
57
|
-
canCraft: true,
|
|
58
|
-
texturePath: 'accessories/bandana.png',
|
|
59
|
-
ingredients: [
|
|
60
|
-
{
|
|
61
|
-
key: 'leather',
|
|
62
|
-
name: 'leather',
|
|
63
|
-
qty: 10,
|
|
64
|
-
texturePath: 'crafting-resources/leather.png',
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
40
|
},
|
|
68
41
|
{
|
|
69
|
-
|
|
70
|
-
name: 'Bandana',
|
|
71
|
-
canCraft: true,
|
|
72
|
-
texturePath: 'accessories/bandana.png',
|
|
73
|
-
ingredients: [
|
|
74
|
-
{
|
|
75
|
-
key: 'leather',
|
|
76
|
-
name: 'leather',
|
|
77
|
-
qty: 10,
|
|
78
|
-
texturePath: 'crafting-resources/leather.png',
|
|
79
|
-
},
|
|
80
|
-
],
|
|
81
|
-
}, {
|
|
82
|
-
key: 'bandana',
|
|
83
|
-
name: 'Bandana',
|
|
84
|
-
canCraft: true,
|
|
85
|
-
texturePath: 'accessories/bandana.png',
|
|
86
|
-
ingredients: [
|
|
87
|
-
{
|
|
88
|
-
key: 'leather',
|
|
89
|
-
name: 'leather',
|
|
90
|
-
qty: 10,
|
|
91
|
-
texturePath: 'crafting-resources/leather.png',
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
key: 'bandana1',
|
|
97
|
-
name: 'Bandana',
|
|
98
|
-
canCraft: true,
|
|
99
|
-
texturePath: 'accessories/bandana.png',
|
|
100
|
-
ingredients: [
|
|
101
|
-
{
|
|
102
|
-
key: 'leather',
|
|
103
|
-
name: 'leather',
|
|
104
|
-
qty: 10,
|
|
105
|
-
texturePath: 'crafting-resources/leather.png',
|
|
106
|
-
},
|
|
107
|
-
],
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
key: 'bandana2',
|
|
111
|
-
name: 'Bandana',
|
|
112
|
-
canCraft: true,
|
|
113
|
-
texturePath: 'accessories/bandana.png',
|
|
114
|
-
ingredients: [
|
|
115
|
-
{
|
|
116
|
-
key: 'leather',
|
|
117
|
-
name: 'leather',
|
|
118
|
-
qty: 10,
|
|
119
|
-
texturePath: 'crafting-resources/leather.png',
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
}, {
|
|
123
|
-
key: 'bandana',
|
|
124
|
-
name: 'Bandana',
|
|
125
|
-
canCraft: true,
|
|
126
|
-
texturePath: 'accessories/bandana.png',
|
|
127
|
-
ingredients: [
|
|
128
|
-
{
|
|
129
|
-
key: 'leather',
|
|
130
|
-
name: 'leather',
|
|
131
|
-
qty: 10,
|
|
132
|
-
texturePath: 'crafting-resources/leather.png',
|
|
133
|
-
},
|
|
134
|
-
],
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
key: 'bandana1',
|
|
138
|
-
name: 'Bandana',
|
|
139
|
-
canCraft: true,
|
|
140
|
-
texturePath: 'accessories/bandana.png',
|
|
141
|
-
ingredients: [
|
|
142
|
-
{
|
|
143
|
-
key: 'leather',
|
|
144
|
-
name: 'leather',
|
|
145
|
-
qty: 10,
|
|
146
|
-
texturePath: 'crafting-resources/leather.png',
|
|
147
|
-
},
|
|
148
|
-
],
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
key: 'bandana2',
|
|
152
|
-
name: 'Bandana',
|
|
153
|
-
canCraft: true,
|
|
154
|
-
texturePath: 'accessories/bandana.png',
|
|
155
|
-
ingredients: [
|
|
156
|
-
{
|
|
157
|
-
key: 'leather',
|
|
158
|
-
name: 'leather',
|
|
159
|
-
qty: 10,
|
|
160
|
-
texturePath: 'crafting-resources/leather.png',
|
|
161
|
-
},
|
|
162
|
-
],
|
|
163
|
-
}, {
|
|
164
|
-
key: 'bandana',
|
|
165
|
-
name: 'Bandana',
|
|
166
|
-
canCraft: true,
|
|
167
|
-
texturePath: 'accessories/bandana.png',
|
|
168
|
-
ingredients: [
|
|
169
|
-
{
|
|
170
|
-
key: 'leather',
|
|
171
|
-
name: 'leather',
|
|
172
|
-
qty: 10,
|
|
173
|
-
texturePath: 'crafting-resources/leather.png',
|
|
174
|
-
},
|
|
175
|
-
],
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
key: 'bandana1',
|
|
179
|
-
name: 'Bandana',
|
|
180
|
-
canCraft: true,
|
|
181
|
-
texturePath: 'accessories/bandana.png',
|
|
182
|
-
ingredients: [
|
|
183
|
-
{
|
|
184
|
-
key: 'leather',
|
|
185
|
-
name: 'leather',
|
|
186
|
-
qty: 10,
|
|
187
|
-
texturePath: 'crafting-resources/leather.png',
|
|
188
|
-
},
|
|
189
|
-
],
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
key: 'bandana2',
|
|
193
|
-
name: 'Bandana',
|
|
194
|
-
canCraft: true,
|
|
195
|
-
texturePath: 'accessories/bandana.png',
|
|
196
|
-
ingredients: [
|
|
197
|
-
{
|
|
198
|
-
key: 'leather',
|
|
199
|
-
name: 'leather',
|
|
200
|
-
qty: 10,
|
|
201
|
-
texturePath: 'crafting-resources/leather.png',
|
|
202
|
-
},
|
|
203
|
-
],
|
|
204
|
-
}, {
|
|
205
|
-
key: 'bandana',
|
|
206
|
-
name: 'Bandana',
|
|
42
|
+
...items[0],
|
|
207
43
|
canCraft: true,
|
|
208
|
-
texturePath: 'accessories/bandana.png',
|
|
209
44
|
ingredients: [
|
|
210
45
|
{
|
|
211
46
|
key: 'leather',
|
|
@@ -216,10 +51,8 @@ export const craftableItems: ICraftableItem[] = [
|
|
|
216
51
|
],
|
|
217
52
|
},
|
|
218
53
|
{
|
|
219
|
-
|
|
220
|
-
name: 'Bandana',
|
|
54
|
+
...items[1],
|
|
221
55
|
canCraft: true,
|
|
222
|
-
texturePath: 'accessories/bandana.png',
|
|
223
56
|
ingredients: [
|
|
224
57
|
{
|
|
225
58
|
key: 'leather',
|
|
@@ -230,10 +63,8 @@ export const craftableItems: ICraftableItem[] = [
|
|
|
230
63
|
],
|
|
231
64
|
},
|
|
232
65
|
{
|
|
233
|
-
|
|
234
|
-
name: 'Bandana',
|
|
66
|
+
...items[2],
|
|
235
67
|
canCraft: true,
|
|
236
|
-
texturePath: 'accessories/bandana.png',
|
|
237
68
|
ingredients: [
|
|
238
69
|
{
|
|
239
70
|
key: 'leather',
|
|
@@ -156,9 +156,14 @@ const Container = styled.div<{ item: IItem }>`
|
|
|
156
156
|
background-color: #222;
|
|
157
157
|
border-radius: 5px;
|
|
158
158
|
padding: 0.5rem;
|
|
159
|
-
width: max-content;
|
|
160
159
|
font-size: ${uiFonts.size.small};
|
|
161
160
|
border: 3px solid ${({ item }) => rarityColor(item) ?? uiColors.lightGray};
|
|
161
|
+
height: max-content;
|
|
162
|
+
width: 15rem;
|
|
163
|
+
|
|
164
|
+
@media (max-width: 580px) {
|
|
165
|
+
width: 80vw;
|
|
166
|
+
}
|
|
162
167
|
`;
|
|
163
168
|
|
|
164
169
|
const Title = styled.div`
|
|
@@ -186,6 +191,7 @@ const Type = styled.div`
|
|
|
186
191
|
|
|
187
192
|
const Statistic = styled.div`
|
|
188
193
|
margin-bottom: 0.4rem;
|
|
194
|
+
width: max-content;
|
|
189
195
|
|
|
190
196
|
.label {
|
|
191
197
|
display: inline-block;
|
|
@@ -214,8 +220,6 @@ const Description = styled.div`
|
|
|
214
220
|
font-size: ${uiFonts.size.small};
|
|
215
221
|
color: ${uiColors.lightGray};
|
|
216
222
|
font-style: italic;
|
|
217
|
-
width: max-content;
|
|
218
|
-
max-width: 20rem;
|
|
219
223
|
`;
|
|
220
224
|
|
|
221
225
|
const Header = styled.div`
|
|
@@ -229,9 +233,9 @@ const AllowedSlots = styled.div`
|
|
|
229
233
|
display: flex;
|
|
230
234
|
align-items: center;
|
|
231
235
|
justify-content: center;
|
|
232
|
-
flex-wrap: wrap;
|
|
233
236
|
gap: 0.5rem;
|
|
234
|
-
margin-left:
|
|
237
|
+
margin-left: auto;
|
|
238
|
+
align-self: flex-start;
|
|
235
239
|
`;
|
|
236
240
|
|
|
237
241
|
const StackInfo = styled.div`
|
|
@@ -109,6 +109,11 @@ const Flex = styled.div<{ $isMobile?: boolean }>`
|
|
|
109
109
|
display: flex;
|
|
110
110
|
gap: 0.5rem;
|
|
111
111
|
flex-direction: ${({ $isMobile }) => ($isMobile ? 'row-reverse' : 'row')};
|
|
112
|
+
|
|
113
|
+
@media (max-width: 580px) {
|
|
114
|
+
flex-direction: column-reverse;
|
|
115
|
+
align-items: center;
|
|
116
|
+
}
|
|
112
117
|
`;
|
|
113
118
|
|
|
114
119
|
const Equipped = styled.div`
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IEquipmentSet, IItem } from '@rpg-engine/shared';
|
|
2
2
|
import React, { useEffect, useRef } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
import { uiColors } from '../../../constants/uiColors';
|
|
5
4
|
import { ItemInfoDisplay } from './ItemInfoDisplay';
|
|
6
5
|
|
|
7
6
|
interface IListMenuOption {
|
|
@@ -43,7 +42,7 @@ export const MobileItemTooltip: React.FC<MobileItemTooltipProps> = ({
|
|
|
43
42
|
const y = (-rect.y * 100) / (scale * 100);
|
|
44
43
|
|
|
45
44
|
current.style.transform = `translate(${x}px, ${y}px)`;
|
|
46
|
-
current.style.opacity = '
|
|
45
|
+
current.style.opacity = '0.92';
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
return;
|
|
@@ -52,9 +51,10 @@ export const MobileItemTooltip: React.FC<MobileItemTooltipProps> = ({
|
|
|
52
51
|
return (
|
|
53
52
|
<Container
|
|
54
53
|
ref={ref}
|
|
55
|
-
onTouchEnd={
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
onTouchEnd={() => {
|
|
55
|
+
setTimeout(() => {
|
|
56
|
+
closeTooltip();
|
|
57
|
+
}, 10);
|
|
58
58
|
}}
|
|
59
59
|
scale={scale}
|
|
60
60
|
>
|
|
@@ -67,7 +67,15 @@ export const MobileItemTooltip: React.FC<MobileItemTooltipProps> = ({
|
|
|
67
67
|
/>
|
|
68
68
|
<OptionsContainer>
|
|
69
69
|
{options?.map(option => (
|
|
70
|
-
<Option
|
|
70
|
+
<Option
|
|
71
|
+
key={option.id}
|
|
72
|
+
onTouchEnd={() => {
|
|
73
|
+
setTimeout(() => {
|
|
74
|
+
onSelected?.(option.id);
|
|
75
|
+
closeTooltip();
|
|
76
|
+
}, 10);
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
71
79
|
{option.text}
|
|
72
80
|
</Option>
|
|
73
81
|
))}
|
|
@@ -88,18 +96,39 @@ const Container = styled.div<{ scale: number }>`
|
|
|
88
96
|
display: flex;
|
|
89
97
|
justify-content: center;
|
|
90
98
|
align-items: center;
|
|
99
|
+
gap: 0.5rem;
|
|
100
|
+
|
|
101
|
+
@media (max-width: 580px) {
|
|
102
|
+
flex-direction: column;
|
|
103
|
+
}
|
|
91
104
|
`;
|
|
92
105
|
|
|
93
106
|
const OptionsContainer = styled.div`
|
|
94
107
|
display: flex;
|
|
95
108
|
flex-direction: column;
|
|
96
|
-
|
|
97
|
-
|
|
109
|
+
gap: 0.5rem;
|
|
110
|
+
flex-wrap: wrap;
|
|
111
|
+
|
|
112
|
+
@media (max-width: 580px) {
|
|
113
|
+
flex-direction: row;
|
|
114
|
+
justify-content: center;
|
|
115
|
+
}
|
|
98
116
|
`;
|
|
99
117
|
|
|
100
118
|
const Option = styled.button`
|
|
101
119
|
padding: 1rem;
|
|
102
|
-
background-color:
|
|
120
|
+
background-color: #333;
|
|
121
|
+
color: white;
|
|
103
122
|
border: none;
|
|
104
123
|
border-radius: 3px;
|
|
124
|
+
width: 8rem;
|
|
125
|
+
transition: background-color 0.2s;
|
|
126
|
+
|
|
127
|
+
&:hover {
|
|
128
|
+
background-color: #555;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@media (max-width: 580px) {
|
|
132
|
+
padding: 1rem 0.5rem;
|
|
133
|
+
}
|
|
105
134
|
`;
|
|
@@ -25,7 +25,7 @@ export const items: IItem[] = [
|
|
|
25
25
|
key: 'short-sword-66',
|
|
26
26
|
texturePath: 'swords/short-sword.png',
|
|
27
27
|
textureKey: 'short-sword',
|
|
28
|
-
name: '
|
|
28
|
+
name: "Carpenter's Axe",
|
|
29
29
|
description:
|
|
30
30
|
'You see a short sword. It is a single-handed sword with a handle that just features a grip.',
|
|
31
31
|
attack: 5,
|