@rpg-engine/long-bow 0.5.91 → 0.5.92
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/dist/long-bow.cjs.development.js +10 -2
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +10 -2
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CraftBook/CraftBook.tsx +13 -2
package/package.json
CHANGED
|
@@ -67,6 +67,8 @@ export const CraftBook: React.FC<IItemCraftSelectorProps> = ({
|
|
|
67
67
|
);
|
|
68
68
|
const [size, setSize] = useState<{ width: string; height: string }>();
|
|
69
69
|
|
|
70
|
+
const [isCraftingDisabled, setIsCraftingDisabled] = useState(false);
|
|
71
|
+
|
|
70
72
|
useEffect(() => {
|
|
71
73
|
const handleResize = (): void => {
|
|
72
74
|
if (
|
|
@@ -196,9 +198,18 @@ export const CraftBook: React.FC<IItemCraftSelectorProps> = ({
|
|
|
196
198
|
Cancel
|
|
197
199
|
</Button>
|
|
198
200
|
<Button
|
|
199
|
-
disabled={!craftItemKey}
|
|
201
|
+
disabled={!craftItemKey || isCraftingDisabled}
|
|
200
202
|
buttonType={ButtonTypes.RPGUIButton}
|
|
201
|
-
onPointerDown={() =>
|
|
203
|
+
onPointerDown={() => {
|
|
204
|
+
if (!craftItemKey || isCraftingDisabled) return;
|
|
205
|
+
|
|
206
|
+
onCraftItem(craftItemKey);
|
|
207
|
+
setIsCraftingDisabled(true);
|
|
208
|
+
|
|
209
|
+
setTimeout(() => {
|
|
210
|
+
setIsCraftingDisabled(false);
|
|
211
|
+
}, 2000);
|
|
212
|
+
}}
|
|
202
213
|
>
|
|
203
214
|
Craft
|
|
204
215
|
</Button>
|