@rpg-engine/long-bow 0.2.79 → 0.2.80

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.
@@ -1,3 +1,16 @@
1
- import { IEquipmentSet } from '@rpg-engine/shared';
2
- export declare const items: any;
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.79",
3
+ "version": "0.2.80",
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.37",
86
+ "@rpg-engine/shared": "^0.6.40",
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
- key: 'frost-double-axe',
7
- texturePath: 'axes/frost-double-axe.png',
8
- name: 'Frost Double Axe',
9
- ingredients: [
10
- {
11
- key: 'blue-sapphire',
12
- qty: 10,
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: 'frost-double-axe',
18
+ key: 'bandana',
19
+ name: 'Bandana',
19
20
  canCraft: true,
20
- texturePath: 'axes/frost-double-axe.png',
21
- name: 'Frost Double Axe',
22
- ingredients: [
23
- {
24
- key: 'blue-sapphire',
25
- texturePath: 'crafting-resources/blue-sapphire.png',
26
- qty: 10,
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: 'frost-double-axe',
32
- canCraft: false,
33
- texturePath: 'axes/frost-double-axe.png',
34
- name: 'Frost Double Axe',
35
- ingredients: [
36
- {
37
- key: 'blue-sapphire',
38
- texturePath: 'crafting-resources/blue-sapphire.png',
39
- qty: 10,
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(itemToRender, atlasJSON)}
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(itemToRender, atlasJSON)}
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
- <ErrorBoundary>
43
- <Container
44
- width={width}
45
- height={height}
46
- hasHover={grayScale}
47
- onClick={onClick}
48
- style={containerStyle}
49
- >
50
- <ImgSprite
51
- className="sprite-from-atlas-img"
52
- atlasIMG={atlasIMG}
53
- frame={spriteData.frame}
54
- scale={imgScale}
55
- grayScale={grayScale}
56
- opacity={opacity}
57
- style={imgStyle}
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