@rpg-engine/long-bow 0.2.25 → 0.2.26
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 +7 -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 +7 -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/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
|
+
|
|
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
|
|