@rpg-engine/long-bow 0.2.93 → 0.2.95
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 +8 -7
- 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 +8 -7
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/components/Item/Inventory/ItemSlot.tsx +8 -12
- package/src/components/NPCDialog/.DS_Store +0 -0
- package/src/components/NPCDialog/img/.DS_Store +0 -0
- package/src/hooks/useOutsideAlerter.ts +2 -2
- package/src/mocks/.DS_Store +0 -0
- package/src/mocks/atlas/.DS_Store +0 -0
- package/src/mocks/itemContainer.mocks.ts +37 -3
package/package.json
CHANGED
package/src/.DS_Store
ADDED
|
Binary file
|
|
@@ -122,23 +122,18 @@ export const ItemSlot: React.FC<IProps> = observer(
|
|
|
122
122
|
}, [dropPosition]);
|
|
123
123
|
|
|
124
124
|
const getStackInfo = (itemId: string, stackQty: number) => {
|
|
125
|
-
// if (itemToRender?.isStackable && itemToRender?.stackQty) {
|
|
126
|
-
|
|
127
125
|
const isFractionalStackQty = stackQty % 1 !== 0;
|
|
128
126
|
const isLargerThan999 = stackQty > 999;
|
|
129
127
|
|
|
128
|
+
let qtyClassName = 'regular';
|
|
129
|
+
if (isLargerThan999) qtyClassName = 'small';
|
|
130
|
+
if (isFractionalStackQty) qtyClassName = 'xsmall';
|
|
131
|
+
|
|
130
132
|
if (stackQty > 1) {
|
|
131
133
|
return (
|
|
132
134
|
<ItemQtyContainer key={`qty-${itemId}`}>
|
|
133
135
|
<Ellipsis maxLines={1} maxWidth="48px">
|
|
134
|
-
<ItemQty
|
|
135
|
-
className={
|
|
136
|
-
isFractionalStackQty || isLargerThan999 ? 'small' : 'regular'
|
|
137
|
-
}
|
|
138
|
-
>
|
|
139
|
-
{' '}
|
|
140
|
-
{stackQty}{' '}
|
|
141
|
-
</ItemQty>
|
|
136
|
+
<ItemQty className={qtyClassName}> {stackQty} </ItemQty>
|
|
142
137
|
</Ellipsis>
|
|
143
138
|
</ItemQtyContainer>
|
|
144
139
|
);
|
|
@@ -286,8 +281,6 @@ export const ItemSlot: React.FC<IProps> = observer(
|
|
|
286
281
|
|
|
287
282
|
const isOutsideDrop =
|
|
288
283
|
classes.some(elm => {
|
|
289
|
-
//elm matches ItemContainer string
|
|
290
|
-
|
|
291
284
|
return elm.includes('rpgui-content');
|
|
292
285
|
}) || classes.length === 0;
|
|
293
286
|
|
|
@@ -425,4 +418,7 @@ const ItemQty = styled.span`
|
|
|
425
418
|
&.small {
|
|
426
419
|
font-size: ${uiFonts.size.xsmall};
|
|
427
420
|
}
|
|
421
|
+
&.xsmall {
|
|
422
|
+
font-size: ${uiFonts.size.xxsmall};
|
|
423
|
+
}
|
|
428
424
|
`;
|
|
Binary file
|
|
Binary file
|
|
@@ -16,10 +16,10 @@ export function useOutsideClick(ref: any, id: string) {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
// Bind the event listener
|
|
19
|
-
document.addEventListener('
|
|
19
|
+
document.addEventListener('pointerdown', handleClickOutside);
|
|
20
20
|
return () => {
|
|
21
21
|
// Unbind the event listener on clean up
|
|
22
|
-
document.removeEventListener('
|
|
22
|
+
document.removeEventListener('pointerdown', handleClickOutside);
|
|
23
23
|
};
|
|
24
24
|
}, [ref]);
|
|
25
25
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
IItemContainer,
|
|
4
4
|
ItemSlotType,
|
|
5
5
|
ItemSubType,
|
|
6
|
-
ItemType
|
|
6
|
+
ItemType
|
|
7
7
|
} from '@rpg-engine/shared';
|
|
8
8
|
|
|
9
9
|
export const items: IItem[] = [
|
|
@@ -455,7 +455,7 @@ export const items: IItem[] = [
|
|
|
455
455
|
isEquipable: true,
|
|
456
456
|
isStackable: true,
|
|
457
457
|
maxStackSize: 100,
|
|
458
|
-
stackQty:
|
|
458
|
+
stackQty: 203.23,
|
|
459
459
|
isUsable: false,
|
|
460
460
|
isStorable: true,
|
|
461
461
|
isTwoHanded: false,
|
|
@@ -479,6 +479,40 @@ export const items: IItem[] = [
|
|
|
479
479
|
createdAt: '2022-06-04T03:18:09.335Z',
|
|
480
480
|
updatedAt: '2022-06-04T18:16:49.056Z',
|
|
481
481
|
},
|
|
482
|
+
{
|
|
483
|
+
_id: '392acek4j7casd0d2fs60404',
|
|
484
|
+
hasUseWith: false,
|
|
485
|
+
type: ItemType.Other,
|
|
486
|
+
subType: ItemSubType.Other,
|
|
487
|
+
textureAtlas: 'items',
|
|
488
|
+
allowedEquipSlotType: [],
|
|
489
|
+
isEquipable: true,
|
|
490
|
+
isStackable: true,
|
|
491
|
+
maxStackSize: 100,
|
|
492
|
+
stackQty: 345,
|
|
493
|
+
isUsable: false,
|
|
494
|
+
isStorable: true,
|
|
495
|
+
isTwoHanded: false,
|
|
496
|
+
layer: 1,
|
|
497
|
+
isItemContainer: true,
|
|
498
|
+
isSolid: false,
|
|
499
|
+
key: 'gold-coin',
|
|
500
|
+
texturePath: 'others/gold-coin.png',
|
|
501
|
+
textureKey: 'gold-coin',
|
|
502
|
+
name: 'gold-coin',
|
|
503
|
+
generateContainerSlots: 10,
|
|
504
|
+
description: 'You see a coin.',
|
|
505
|
+
attack: 7,
|
|
506
|
+
defense: 3,
|
|
507
|
+
weight: 13,
|
|
508
|
+
tiledId: 67,
|
|
509
|
+
x: 320,
|
|
510
|
+
y: 144,
|
|
511
|
+
scene: 'MainScene',
|
|
512
|
+
fullDescription: 'You see a stone. It is used with slingshot',
|
|
513
|
+
createdAt: '2022-06-04T03:18:09.335Z',
|
|
514
|
+
updatedAt: '2022-06-04T18:16:49.056Z',
|
|
515
|
+
}
|
|
482
516
|
];
|
|
483
517
|
|
|
484
518
|
export const itemContainerMock: IItemContainer = {
|
|
@@ -501,7 +535,7 @@ export const itemContainerMock: IItemContainer = {
|
|
|
501
535
|
11: items[11],
|
|
502
536
|
12: items[12],
|
|
503
537
|
13: items[13],
|
|
504
|
-
|
|
538
|
+
14: items[14],
|
|
505
539
|
//remaining slots are considered null by default
|
|
506
540
|
},
|
|
507
541
|
allowedItemTypes: [],
|