@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/long-bow",
3
- "version": "0.2.25",
3
+ "version": "0.2.27",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -23,7 +23,6 @@ export class ErrorBoundary extends Component<Props, State> {
23
23
 
24
24
  public componentDidCatch(error: Error, errorInfo: ErrorInfo) {
25
25
  console.error('Uncaught error:', error, errorInfo);
26
- console.log('quelquer cois');
27
26
  }
28
27
 
29
28
  public render() {
@@ -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) {
@@ -7,7 +7,6 @@ interface IProps {
7
7
  }
8
8
 
9
9
  export const Ellipsis = ({ children, maxLines }: IProps) => {
10
- console.log('Ellipsis Component 2');
11
10
  return (
12
11
  <Container>
13
12
  <div className={`ellipsis-${maxLines}-lines`}>{children}</div>
@@ -1,21 +1,25 @@
1
1
  import { IItem } from "@rpg-engine/shared";
2
2
 
3
3
  export const getItemTextureKeyPath = (itemToRender: IItem, atlasJSON: any) => {
4
- const stackQty = itemToRender?.stackQty ?? 0;
5
- let itemTexturePath = itemToRender.texturePath;
4
+
5
+ const stackQty = itemToRender?.stackQty ?? 0;
6
+ const itemTexturePath = itemToRender.texturePath;
6
7
 
7
- if (itemToRender.isStackable && stackQty > 1) {
8
- const txtExtension: string = itemToRender.texturePath.split('.')[1];
9
- const txtDir: string = itemToRender.texturePath.split('/')[0];
10
- const idx = stackQty >= 5 ? '5' : stackQty;
11
- const newTexturePath = `${txtDir}/${itemToRender.textureKey}-qty-${idx}.${txtExtension}`;
12
- const spriteData = atlasJSON.frames[newTexturePath];
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
- if (spriteData !== undefined) {
15
- itemTexturePath = newTexturePath;
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-qty-1.png',
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-qty-1.png',
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-qty-1.png',
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-qty-1.png',
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-qty-1.png',
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-qty-1.png',
442
+ texturePath: 'others/gold-coin.png',
443
443
  textureKey: 'gold-coin',
444
444
  name: 'gold-coin',
445
445
  generateContainerSlots: 10,