@rpg-engine/long-bow 0.2.74 → 0.2.76

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.74",
3
+ "version": "0.2.76",
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.27",
86
+ "@rpg-engine/shared": "^0.6.37",
87
87
  "dayjs": "^1.11.2",
88
88
  "fs-extra": "^10.1.0",
89
89
  "is-mobile": "^3.1.1",
@@ -1,4 +1,4 @@
1
- import { ITradeResponseItem } from '@rpg-engine/shared';
1
+ import { ITradeResponseItem, getItemTextureKeyPath } from '@rpg-engine/shared';
2
2
  import capitalize from 'lodash/capitalize';
3
3
  import React from 'react';
4
4
  import styled from 'styled-components';
@@ -45,7 +45,14 @@ export const TradingItemRow: React.FC<ITradeComponentProps> = ({
45
45
  <SpriteFromAtlas
46
46
  atlasIMG={atlasIMG}
47
47
  atlasJSON={atlasJSON}
48
- spriteKey={traderItem.texturePath}
48
+ spriteKey={getItemTextureKeyPath(
49
+ {
50
+ key: traderItem.key,
51
+ stackQty: traderItem.qty || 1,
52
+ texturePath: traderItem.texturePath,
53
+ },
54
+ atlasJSON
55
+ )}
49
56
  imgScale={2.5}
50
57
  />
51
58
  </SpriteContainer>
@@ -35,6 +35,8 @@ export const SpriteFromAtlas: React.FC<IProps> = ({
35
35
 
36
36
  const spriteData = atlasJSON.frames[spriteKey];
37
37
 
38
+ if (!spriteData) throw new Error(`Sprite ${spriteKey} not found in atlas!`);
39
+
38
40
  return (
39
41
  <ErrorBoundary>
40
42
  <Container