@rpg-engine/long-bow 0.2.79 → 0.2.81
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 +14196 -8416
- 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 +14196 -8416
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/mocks/equipmentSet.mocks.d.ts +15 -2
- package/package.json +2 -2
- package/src/components/CraftBook/MockItems.ts +28 -28
- package/src/components/Item/Inventory/ItemSlot.tsx +19 -3
- package/src/components/shared/SpriteFromAtlas.tsx +17 -20
- package/src/mocks/atlas/items/items.json +6086 -314
- package/src/mocks/atlas/items/items.png +0 -0
- package/src/mocks/equipmentSet.mocks.ts +38 -4
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
import { IEquipmentSet } from '@rpg-engine/shared';
|
|
2
|
-
|
|
1
|
+
import { IEquipmentSet, IItem } from '@rpg-engine/shared';
|
|
2
|
+
interface IEquipmentSetItems {
|
|
3
|
+
leftHand: IItem;
|
|
4
|
+
head: IItem;
|
|
5
|
+
armor: IItem;
|
|
6
|
+
legs: IItem;
|
|
7
|
+
boot: IItem;
|
|
8
|
+
neck: IItem;
|
|
9
|
+
ring: IItem;
|
|
10
|
+
accessory: IItem;
|
|
11
|
+
inventory: IItem;
|
|
12
|
+
rightHand: IItem;
|
|
13
|
+
}
|
|
14
|
+
export declare const items: IEquipmentSetItems;
|
|
3
15
|
export declare const equipmentSetMock: IEquipmentSet;
|
|
16
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpg-engine/long-bow",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.81",
|
|
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.41",
|
|
87
87
|
"dayjs": "^1.11.2",
|
|
88
88
|
"fs-extra": "^10.1.0",
|
|
89
89
|
"is-mobile": "^3.1.1",
|
|
@@ -2,42 +2,42 @@ import { ICraftableItem } from '@rpg-engine/shared';
|
|
|
2
2
|
|
|
3
3
|
export const craftableItems: ICraftableItem[] = [
|
|
4
4
|
{
|
|
5
|
+
key: 'bandana',
|
|
6
|
+
name: 'Bandana',
|
|
5
7
|
canCraft: true,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
texturePath: 'crafting-resources/blue-sapphire.png',
|
|
14
|
-
},
|
|
8
|
+
texturePath: 'accessories/bandana.png',
|
|
9
|
+
ingredients: [ {
|
|
10
|
+
key: "leather",
|
|
11
|
+
name: "leather",
|
|
12
|
+
qty: 10,
|
|
13
|
+
texturePath: "crafting-resources/leather.png",
|
|
14
|
+
}
|
|
15
15
|
],
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
key: '
|
|
18
|
+
key: 'bandana',
|
|
19
|
+
name: 'Bandana',
|
|
19
20
|
canCraft: true,
|
|
20
|
-
texturePath: '
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
},
|
|
21
|
+
texturePath: 'accessories/bandana.png',
|
|
22
|
+
ingredients: [ {
|
|
23
|
+
key: "leather",
|
|
24
|
+
name: "leather",
|
|
25
|
+
qty: 10,
|
|
26
|
+
texturePath: "crafting-resources/leather.png",
|
|
27
|
+
}
|
|
28
28
|
],
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
|
-
key: '
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
ingredients: [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
key: 'bandana',
|
|
32
|
+
name: 'Bandana',
|
|
33
|
+
canCraft: true,
|
|
34
|
+
texturePath: 'accessories/bandana.png',
|
|
35
|
+
ingredients: [ {
|
|
36
|
+
key: "leather",
|
|
37
|
+
name: "leather",
|
|
38
|
+
qty: 10,
|
|
39
|
+
texturePath: "crafting-resources/leather.png",
|
|
40
|
+
}
|
|
41
41
|
],
|
|
42
42
|
},
|
|
43
43
|
];
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
IItemContainer,
|
|
5
5
|
ItemContainerType,
|
|
6
6
|
ItemSlotType,
|
|
7
|
-
ItemType
|
|
7
|
+
ItemType
|
|
8
8
|
} from '@rpg-engine/shared';
|
|
9
9
|
|
|
10
10
|
import { observer } from 'mobx-react-lite';
|
|
@@ -112,6 +112,7 @@ export const ItemSlot: React.FC<IProps> = observer(
|
|
|
112
112
|
|
|
113
113
|
const renderItem = (itemToRender: IItem | null) => {
|
|
114
114
|
const element = [];
|
|
115
|
+
|
|
115
116
|
if (itemToRender?.texturePath) {
|
|
116
117
|
element.push(
|
|
117
118
|
<ErrorBoundary key={itemToRender._id}>
|
|
@@ -119,7 +120,14 @@ export const ItemSlot: React.FC<IProps> = observer(
|
|
|
119
120
|
key={itemToRender._id}
|
|
120
121
|
atlasIMG={atlasIMG}
|
|
121
122
|
atlasJSON={atlasJSON}
|
|
122
|
-
spriteKey={getItemTextureKeyPath(
|
|
123
|
+
spriteKey={getItemTextureKeyPath(
|
|
124
|
+
{
|
|
125
|
+
key: itemToRender.texturePath,
|
|
126
|
+
texturePath: itemToRender.texturePath,
|
|
127
|
+
stackQty: itemToRender.stackQty || 1,
|
|
128
|
+
},
|
|
129
|
+
atlasJSON
|
|
130
|
+
)}
|
|
123
131
|
imgScale={3}
|
|
124
132
|
/>
|
|
125
133
|
</ErrorBoundary>
|
|
@@ -142,13 +150,21 @@ export const ItemSlot: React.FC<IProps> = observer(
|
|
|
142
150
|
itemToRender.allowedEquipSlotType?.includes(slotSpriteMask!)
|
|
143
151
|
) {
|
|
144
152
|
const element = [];
|
|
153
|
+
|
|
145
154
|
element.push(
|
|
146
155
|
<ErrorBoundary key={itemToRender._id}>
|
|
147
156
|
<SpriteFromAtlas
|
|
148
157
|
key={itemToRender._id}
|
|
149
158
|
atlasIMG={atlasIMG}
|
|
150
159
|
atlasJSON={atlasJSON}
|
|
151
|
-
spriteKey={getItemTextureKeyPath(
|
|
160
|
+
spriteKey={getItemTextureKeyPath(
|
|
161
|
+
{
|
|
162
|
+
key: itemToRender.texturePath,
|
|
163
|
+
texturePath: itemToRender.texturePath,
|
|
164
|
+
stackQty: itemToRender.stackQty || 1,
|
|
165
|
+
},
|
|
166
|
+
atlasJSON
|
|
167
|
+
)}
|
|
152
168
|
imgScale={3}
|
|
153
169
|
/>
|
|
154
170
|
</ErrorBoundary>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { GRID_HEIGHT, GRID_WIDTH } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
import { ErrorBoundary } from '../Item/Inventory/ErrorBoundary';
|
|
5
4
|
|
|
6
5
|
interface IProps {
|
|
7
6
|
atlasJSON: any;
|
|
@@ -39,25 +38,23 @@ export const SpriteFromAtlas: React.FC<IProps> = ({
|
|
|
39
38
|
if (!spriteData) throw new Error(`Sprite ${spriteKey} not found in atlas!`);
|
|
40
39
|
|
|
41
40
|
return (
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</Container>
|
|
60
|
-
</ErrorBoundary>
|
|
41
|
+
<Container
|
|
42
|
+
width={width}
|
|
43
|
+
height={height}
|
|
44
|
+
hasHover={grayScale}
|
|
45
|
+
onClick={onClick}
|
|
46
|
+
style={containerStyle}
|
|
47
|
+
>
|
|
48
|
+
<ImgSprite
|
|
49
|
+
className="sprite-from-atlas-img"
|
|
50
|
+
atlasIMG={atlasIMG}
|
|
51
|
+
frame={spriteData.frame}
|
|
52
|
+
scale={imgScale}
|
|
53
|
+
grayScale={grayScale}
|
|
54
|
+
opacity={opacity}
|
|
55
|
+
style={imgStyle}
|
|
56
|
+
/>
|
|
57
|
+
</Container>
|
|
61
58
|
);
|
|
62
59
|
};
|
|
63
60
|
|