@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/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.26",
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
+
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