@rpg-engine/long-bow 0.2.81 → 0.2.85

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.81",
3
+ "version": "0.2.85",
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.41",
86
+ "@rpg-engine/shared": "^0.6.40",
87
87
  "dayjs": "^1.11.2",
88
88
  "fs-extra": "^10.1.0",
89
89
  "is-mobile": "^3.1.1",
package/src/.DS_Store ADDED
Binary file
@@ -70,12 +70,8 @@ export const CraftBook: React.FC<IItemCraftSelectorProps> = ({
70
70
  return name;
71
71
  };
72
72
 
73
- const handleClick = () => {
74
- let element = document.querySelector(
75
- `input[name='test']:checked`
76
- ) as HTMLInputElement;
77
- const elementValue = element.value;
78
- setCraftItem(elementValue);
73
+ const handleClick = (value: string) => {
74
+ setCraftItem(value);
79
75
  };
80
76
 
81
77
  return (
@@ -117,9 +113,11 @@ export const CraftBook: React.FC<IItemCraftSelectorProps> = ({
117
113
  value={option.name}
118
114
  name="test"
119
115
  disabled={!option.canCraft}
116
+ checked={craftItem === option.key}
117
+ onChange={() => handleClick(option.key)}
120
118
  />
121
119
  <label
122
- onClick={handleClick}
120
+ onClick={() => handleClick(option.key)}
123
121
  style={{ display: 'flex', alignItems: 'center' }}
124
122
  onMouseEnter={() => setIsShown({ show: true, index: index })}
125
123
  onMouseLeave={() => setIsShown({ show: false, index: index })}
@@ -6,38 +6,41 @@ export const craftableItems: ICraftableItem[] = [
6
6
  name: 'Bandana',
7
7
  canCraft: true,
8
8
  texturePath: 'accessories/bandana.png',
9
- ingredients: [ {
10
- key: "leather",
11
- name: "leather",
12
- qty: 10,
13
- texturePath: "crafting-resources/leather.png",
14
- }
9
+ ingredients: [
10
+ {
11
+ key: 'leather',
12
+ name: 'leather',
13
+ qty: 10,
14
+ texturePath: 'crafting-resources/leather.png',
15
+ },
15
16
  ],
16
17
  },
17
18
  {
18
- key: 'bandana',
19
+ key: 'bandana1',
19
20
  name: 'Bandana',
20
21
  canCraft: true,
21
22
  texturePath: 'accessories/bandana.png',
22
- ingredients: [ {
23
- key: "leather",
24
- name: "leather",
25
- qty: 10,
26
- texturePath: "crafting-resources/leather.png",
27
- }
23
+ ingredients: [
24
+ {
25
+ key: 'leather',
26
+ name: 'leather',
27
+ qty: 10,
28
+ texturePath: 'crafting-resources/leather.png',
29
+ },
28
30
  ],
29
31
  },
30
32
  {
31
- key: 'bandana',
33
+ key: 'bandana2',
32
34
  name: 'Bandana',
33
35
  canCraft: true,
34
36
  texturePath: 'accessories/bandana.png',
35
- ingredients: [ {
36
- key: "leather",
37
- name: "leather",
38
- qty: 10,
39
- texturePath: "crafting-resources/leather.png",
40
- }
37
+ ingredients: [
38
+ {
39
+ key: 'leather',
40
+ name: 'leather',
41
+ qty: 10,
42
+ texturePath: 'crafting-resources/leather.png',
43
+ },
41
44
  ],
42
45
  },
43
46
  ];
Binary file
Binary file