@rpg-engine/long-bow 0.2.25 → 0.2.27
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 +8 -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 +8 -23
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Item/Inventory/ErrorBoundary.tsx +0 -1
- package/src/components/Item/Inventory/ItemSlot.tsx +0 -19
- package/src/components/shared/Ellipsis.tsx +0 -1
- package/src/libs/ItemSlotHelper.ts +16 -12
- package/src/mocks/itemContainer.mocks.ts +6 -6
package/package.json
CHANGED
|
@@ -100,25 +100,6 @@ export const ItemSlot: React.FC<IProps> = observer(
|
|
|
100
100
|
return undefined;
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
// const getItemTextureKeyPath = (itemToRender: IItem) => {
|
|
104
|
-
// const stackQty = itemToRender?.stackQty ?? 0;
|
|
105
|
-
// let itemTexturePath = itemToRender.texturePath;
|
|
106
|
-
|
|
107
|
-
// if (stackQty > 1) {
|
|
108
|
-
// const txtExtension: string = itemToRender.texturePath.split('.')[1];
|
|
109
|
-
// const txtDir: string = itemToRender.texturePath.split('/')[0];
|
|
110
|
-
// const idx = stackQty >= 5 ? '5' : stackQty;
|
|
111
|
-
// const newTexturePath = `${txtDir}/${itemToRender.textureKey}-qty-${idx}.${txtExtension}`;
|
|
112
|
-
// const spriteData = atlasJSON.frames[newTexturePath];
|
|
113
|
-
|
|
114
|
-
// if (spriteData !== undefined) {
|
|
115
|
-
// itemTexturePath = newTexturePath;
|
|
116
|
-
// }
|
|
117
|
-
// }
|
|
118
|
-
|
|
119
|
-
// return itemTexturePath;
|
|
120
|
-
// };
|
|
121
|
-
|
|
122
103
|
const renderItem = (itemToRender: IItem | null) => {
|
|
123
104
|
const element = [];
|
|
124
105
|
if (itemToRender?.texturePath) {
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
import { IItem } from "@rpg-engine/shared";
|
|
2
2
|
|
|
3
3
|
export const getItemTextureKeyPath = (itemToRender: IItem, atlasJSON: any) => {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
|
|
5
|
+
const stackQty = itemToRender?.stackQty ?? 0;
|
|
6
|
+
const itemTexturePath = itemToRender.texturePath;
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
if (itemToRender && stackQty >= 1) {
|
|
9
|
+
const idx = stackQty >= 5 ? '5' : stackQty;
|
|
10
|
+
|
|
11
|
+
const textureBreakPath = itemTexturePath.split('.');
|
|
12
|
+
const txtPrefix: string = textureBreakPath[0];
|
|
13
|
+
const txtExtension: string = textureBreakPath[1];
|
|
14
|
+
console.log(`${txtPrefix}-qty-${idx}.${txtExtension}`);
|
|
15
|
+
const newTexturePath = `${txtPrefix}-qty-${idx}.${txtExtension}`;
|
|
16
|
+
const spriteData = atlasJSON.frames[newTexturePath];
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
18
|
+
if (spriteData !== undefined) {
|
|
19
|
+
return newTexturePath;
|
|
17
20
|
}
|
|
21
|
+
}
|
|
22
|
+
return itemTexturePath;
|
|
18
23
|
|
|
19
|
-
return itemTexturePath;
|
|
20
24
|
};
|
|
21
25
|
|
|
@@ -259,7 +259,7 @@ export const items: IItem[] = [
|
|
|
259
259
|
isItemContainer: true,
|
|
260
260
|
isSolid: false,
|
|
261
261
|
key: 'stone',
|
|
262
|
-
texturePath: 'ranged-weapons/stone
|
|
262
|
+
texturePath: 'ranged-weapons/stone.png',
|
|
263
263
|
textureKey: 'stone',
|
|
264
264
|
name: 'stone',
|
|
265
265
|
generateContainerSlots: 10,
|
|
@@ -295,7 +295,7 @@ export const items: IItem[] = [
|
|
|
295
295
|
isItemContainer: true,
|
|
296
296
|
isSolid: false,
|
|
297
297
|
key: 'stone',
|
|
298
|
-
texturePath: 'ranged-weapons/stone
|
|
298
|
+
texturePath: 'ranged-weapons/stone.png',
|
|
299
299
|
textureKey: 'stone',
|
|
300
300
|
name: 'stone',
|
|
301
301
|
generateContainerSlots: 10,
|
|
@@ -331,7 +331,7 @@ export const items: IItem[] = [
|
|
|
331
331
|
isItemContainer: true,
|
|
332
332
|
isSolid: false,
|
|
333
333
|
key: 'stone',
|
|
334
|
-
texturePath: 'ranged-weapons/stone
|
|
334
|
+
texturePath: 'ranged-weapons/stone.png',
|
|
335
335
|
textureKey: 'stone',
|
|
336
336
|
name: 'stone',
|
|
337
337
|
generateContainerSlots: 10,
|
|
@@ -367,7 +367,7 @@ export const items: IItem[] = [
|
|
|
367
367
|
isItemContainer: true,
|
|
368
368
|
isSolid: false,
|
|
369
369
|
key: 'stone',
|
|
370
|
-
texturePath: 'ranged-weapons/stone
|
|
370
|
+
texturePath: 'ranged-weapons/stone.png',
|
|
371
371
|
textureKey: 'stone',
|
|
372
372
|
name: 'stone',
|
|
373
373
|
generateContainerSlots: 10,
|
|
@@ -403,7 +403,7 @@ export const items: IItem[] = [
|
|
|
403
403
|
isItemContainer: true,
|
|
404
404
|
isSolid: false,
|
|
405
405
|
key: 'stone',
|
|
406
|
-
texturePath: 'ranged-weapons/stone
|
|
406
|
+
texturePath: 'ranged-weapons/stone.png',
|
|
407
407
|
textureKey: 'stone',
|
|
408
408
|
name: 'stone',
|
|
409
409
|
generateContainerSlots: 10,
|
|
@@ -439,7 +439,7 @@ export const items: IItem[] = [
|
|
|
439
439
|
isItemContainer: true,
|
|
440
440
|
isSolid: false,
|
|
441
441
|
key: 'gold-coin',
|
|
442
|
-
texturePath: 'others/gold-coin
|
|
442
|
+
texturePath: 'others/gold-coin.png',
|
|
443
443
|
textureKey: 'gold-coin',
|
|
444
444
|
name: 'gold-coin',
|
|
445
445
|
generateContainerSlots: 10,
|