@rpg-engine/long-bow 0.8.6 → 0.8.7

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.8.6",
3
+ "version": "0.8.7",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -84,7 +84,7 @@
84
84
  "dependencies": {
85
85
  "@capacitor/core": "^6.1.0",
86
86
  "@rollup/plugin-image": "^2.1.1",
87
- "@rpg-engine/shared": "^0.9.78",
87
+ "@rpg-engine/shared": "^0.9.89",
88
88
  "dayjs": "^1.11.2",
89
89
  "font-awesome": "^4.7.0",
90
90
  "fs-extra": "^10.1.0",
@@ -60,6 +60,7 @@ export const ItemSlotRenderer: React.FC<IProps> = ({
60
60
  )}
61
61
  imgScale={3}
62
62
  imgClassname="sprite-from-atlas-img--item"
63
+ tintColor={item.tintColor}
63
64
  />
64
65
  {renderStackInfo(item)}
65
66
  {renderGems(item)}
@@ -10,6 +10,7 @@ interface IProps {
10
10
  height?: number;
11
11
  grayScale?: boolean;
12
12
  opacity?: number;
13
+ tintColor?: string;
13
14
  onPointerDown?: () => void;
14
15
  containerStyle?: any;
15
16
  imgStyle?: any;
@@ -31,6 +32,7 @@ export const SpriteFromAtlas: React.FC<IProps> = ({
31
32
  containerStyle,
32
33
  grayScale = false,
33
34
  opacity = 1,
35
+ tintColor,
34
36
  imgClassname,
35
37
  centered,
36
38
  borderRadius,
@@ -67,6 +69,7 @@ export const SpriteFromAtlas: React.FC<IProps> = ({
67
69
  style={imgStyle}
68
70
  centered={centered}
69
71
  borderRadius={borderRadius}
72
+ tintColor={tintColor}
70
73
  />
71
74
  </Container>
72
75
  );
@@ -85,6 +88,7 @@ interface IImgSpriteProps {
85
88
  opacity: number;
86
89
  centered?: boolean;
87
90
  borderRadius?: string;
91
+ tintColor?: string;
88
92
  }
89
93
 
90
94
  interface IContainerProps {
@@ -113,7 +117,16 @@ const ImgSprite = styled.div<IImgSpriteProps>`
113
117
  position: relative;
114
118
  top: ${props => (props.centered ? '0' : '8px')};
115
119
  left: ${props => (props.centered ? '0' : '8px')};
116
- filter: ${props => (props.grayScale ? 'grayscale(100%)' : 'none')};
120
+ filter: ${props => {
121
+ const filters = [];
122
+ if (props.grayScale) filters.push('grayscale(100%)');
123
+ if (props.tintColor)
124
+ filters.push(
125
+ `brightness(0.8) contrast(1.2) sepia(100%) hue-rotate(${
126
+ props.tintColor === '#FFD700' ? '40deg' : '210deg'
127
+ }) saturate(400%)`
128
+ );
129
+ return filters.length ? filters.join(' ') : 'none';
130
+ }};
117
131
  opacity: ${props => props.opacity};
118
- border-radius: ${props => (props.borderRadius ? props.borderRadius : '0')};
119
132
  `;
@@ -322,6 +322,7 @@ export const items: IItem[] = [
322
322
  createdAt: '2022-06-04T03:18:09.335Z',
323
323
  updatedAt: '2022-06-04T18:16:49.056Z',
324
324
  rarity: ItemRarities.Common,
325
+ tintColor: '#FFD700',
325
326
  },
326
327
  {
327
328
  _id: '392acek4j7c8e80d2fs60404',