@rpg-engine/long-bow 0.3.0 → 0.3.1

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.3.0",
3
+ "version": "0.3.1",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -33,6 +33,7 @@ export interface IEquipmentSetProps {
33
33
  itemContainerType: ItemContainerType | null
34
34
  ) => void;
35
35
  onItemOutsideDrop?: (item: IItem, position: IPosition) => void;
36
+ dragScale?: number;
36
37
  checkIfItemCanBeMoved: () => boolean;
37
38
  checkIfItemShouldDragEnd?: () => boolean;
38
39
  onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;
@@ -57,6 +58,7 @@ export const EquipmentSet: React.FC<IEquipmentSetProps> = ({
57
58
  onItemOutsideDrop,
58
59
  checkIfItemCanBeMoved,
59
60
  checkIfItemShouldDragEnd,
61
+ dragScale,
60
62
  }) => {
61
63
  const {
62
64
  neck,
@@ -134,6 +136,7 @@ export const EquipmentSet: React.FC<IEquipmentSetProps> = ({
134
136
  onDragEnd={quantity => {
135
137
  if (onItemDragEnd) onItemDragEnd(quantity);
136
138
  }}
139
+ dragScale={dragScale}
137
140
  checkIfItemCanBeMoved={checkIfItemCanBeMoved}
138
141
  checkIfItemShouldDragEnd={checkIfItemShouldDragEnd}
139
142
  onPlaceDrop={(item, slotIndex, itemContainerType) => {
@@ -27,6 +27,7 @@ export interface IItemContainerProps {
27
27
  slotIndex: number,
28
28
  itemContainerType: ItemContainerType | null
29
29
  ) => void;
30
+ dragScale?: number;
30
31
  checkIfItemCanBeMoved: () => boolean;
31
32
  checkIfItemShouldDragEnd?: () => boolean;
32
33
  onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;
@@ -55,6 +56,7 @@ export const ItemContainer: React.FC<IItemContainerProps> = ({
55
56
  checkIfItemCanBeMoved,
56
57
  initialPosition,
57
58
  checkIfItemShouldDragEnd,
59
+ dragScale,
58
60
  }) => {
59
61
  const [quantitySelect, setQuantitySelect] = useState({
60
62
  isOpen: false,
@@ -89,6 +91,7 @@ export const ItemContainer: React.FC<IItemContainerProps> = ({
89
91
  onDragEnd={quantity => {
90
92
  if (onItemDragEnd) onItemDragEnd(quantity);
91
93
  }}
94
+ dragScale={dragScale}
92
95
  checkIfItemCanBeMoved={checkIfItemCanBeMoved}
93
96
  checkIfItemShouldDragEnd={checkIfItemShouldDragEnd}
94
97
  openQuantitySelector={(maxQuantity, callback) => {
@@ -61,6 +61,7 @@ interface IProps {
61
61
  ) => void;
62
62
  onDragEnd: (quantity?: number) => void;
63
63
  onOutsideDrop?: (item: IItem, position: IPosition) => void;
64
+ dragScale?: number;
64
65
  checkIfItemCanBeMoved: () => boolean;
65
66
  checkIfItemShouldDragEnd?: () => boolean;
66
67
  openQuantitySelector?: (maxQuantity: number, callback: () => void) => void;
@@ -94,6 +95,7 @@ export const ItemSlot: React.FC<IProps> = observer(
94
95
  checkIfItemCanBeMoved,
95
96
  openQuantitySelector,
96
97
  checkIfItemShouldDragEnd,
98
+ dragScale,
97
99
  }) => {
98
100
  const [isTooltipVisible, setTooltipVisible] = useState(false);
99
101
 
@@ -276,6 +278,7 @@ export const ItemSlot: React.FC<IProps> = observer(
276
278
  >
277
279
  <Draggable
278
280
  defaultClassName={item ? 'draggable' : 'empty-slot'}
281
+ scale={dragScale}
279
282
  onStop={(e, data) => {
280
283
  if (wasDragged && item) {
281
284
  //@ts-ignore
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  IEquipmentSet,
3
3
  IItem,
4
+ ItemRarities,
4
5
  // IItem,
5
6
  ItemSlotType,
6
7
  ItemSubType,
@@ -55,7 +56,8 @@ export const items: IEquipmentSetItems = {
55
56
  createdAt: '2022-06-04T03:18:09.335Z',
56
57
  updatedAt: '2022-06-04T18:16:49.056Z',
57
58
  isTwoHanded: false,
58
- hasUseWith: false
59
+ hasUseWith: false,
60
+ rarity: ItemRarities.Common
59
61
  },
60
62
  head: {
61
63
  _id: '1',
@@ -87,7 +89,8 @@ export const items: IEquipmentSetItems = {
87
89
  createdAt: '2022-06-04T03:18:09.335Z',
88
90
  updatedAt: '2022-06-04T18:16:49.056Z',
89
91
  isTwoHanded: false,
90
- hasUseWith: false
92
+ hasUseWith: false,
93
+ rarity: ItemRarities.Common
91
94
  },
92
95
  armor: {
93
96
  _id: '2',
@@ -120,7 +123,8 @@ export const items: IEquipmentSetItems = {
120
123
  createdAt: '2022-06-04T03:18:09.335Z',
121
124
  updatedAt: '2022-06-04T18:16:49.056Z',
122
125
  isTwoHanded: false,
123
- hasUseWith: false
126
+ hasUseWith: false,
127
+ rarity: ItemRarities.Common
124
128
  },
125
129
  legs: {
126
130
  _id: '3',
@@ -153,7 +157,8 @@ export const items: IEquipmentSetItems = {
153
157
  createdAt: '2022-06-04T03:18:09.335Z',
154
158
  updatedAt: '2022-06-04T18:16:49.056Z',
155
159
  isTwoHanded: false,
156
- hasUseWith: false
160
+ hasUseWith: false,
161
+ rarity: ItemRarities.Common
157
162
  },
158
163
  boot: {
159
164
  _id: '4',
@@ -185,7 +190,8 @@ export const items: IEquipmentSetItems = {
185
190
  createdAt: '2022-06-04T03:18:09.335Z',
186
191
  updatedAt: '2022-06-04T18:16:49.056Z',
187
192
  isTwoHanded: false,
188
- hasUseWith: false
193
+ hasUseWith: false,
194
+ rarity: ItemRarities.Common
189
195
  },
190
196
  neck: {
191
197
  _id: '5',
@@ -218,7 +224,8 @@ export const items: IEquipmentSetItems = {
218
224
  createdAt: '2022-06-04T03:18:09.335Z',
219
225
  updatedAt: '2022-06-04T18:16:49.056Z',
220
226
  isTwoHanded: false,
221
- hasUseWith: false
227
+ hasUseWith: false,
228
+ rarity: ItemRarities.Common
222
229
  },
223
230
  ring: {
224
231
  _id: '6',
@@ -251,7 +258,8 @@ export const items: IEquipmentSetItems = {
251
258
  createdAt: '2022-06-04T03:18:09.335Z',
252
259
  updatedAt: '2022-06-04T18:16:49.056Z',
253
260
  isTwoHanded: false,
254
- hasUseWith: false
261
+ hasUseWith: false,
262
+ rarity: ItemRarities.Common
255
263
  },
256
264
  accessory: {
257
265
  _id: '392acek4j7c8e80d2fs60404',
@@ -286,6 +294,7 @@ export const items: IEquipmentSetItems = {
286
294
  fullDescription: 'You see a stone. It is used with slingshot',
287
295
  createdAt: '2022-06-04T03:18:09.335Z',
288
296
  updatedAt: '2022-06-04T18:16:49.056Z',
297
+ rarity: ItemRarities.Common
289
298
  },
290
299
  inventory: {
291
300
  _id: '8',
@@ -329,7 +338,8 @@ export const items: IEquipmentSetItems = {
329
338
  isEmpty: true,
330
339
  },
331
340
  isTwoHanded: false,
332
- hasUseWith: false
341
+ hasUseWith: false,
342
+ rarity: ItemRarities.Common
333
343
  },
334
344
  rightHand: {
335
345
  _id: '629acef1c7c8e8002ff60736',
@@ -363,7 +373,8 @@ export const items: IEquipmentSetItems = {
363
373
  createdAt: '2022-06-04T03:18:09.335Z',
364
374
  updatedAt: '2022-06-04T18:16:49.056Z',
365
375
  isTwoHanded: false,
366
- hasUseWith: false
376
+ hasUseWith: false,
377
+ rarity: ItemRarities.Common
367
378
  },
368
379
  };
369
380
 
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  IItem,
3
- IItemContainer,
4
- ItemSlotType,
3
+ IItemContainer, ItemRarities, ItemSlotType,
5
4
  ItemSubType,
6
5
  ItemType
7
6
  } from '@rpg-engine/shared';
@@ -40,6 +39,7 @@ export const items: IItem[] = [
40
39
  isStackable: false,
41
40
  createdAt: '2022-06-04T03:18:09.335Z',
42
41
  updatedAt: '2022-06-04T18:16:49.056Z',
42
+ rarity: ItemRarities.Common
43
43
  },
44
44
  {
45
45
  _id: '629acef1c7c8e8002ff73564',
@@ -72,6 +72,7 @@ export const items: IItem[] = [
72
72
  isStackable: false,
73
73
  createdAt: '2022-06-04T03:18:09.335Z',
74
74
  updatedAt: '2022-06-04T18:16:49.056Z',
75
+ rarity: ItemRarities.Common
75
76
  },
76
77
  {
77
78
  _id: '629acef1c7c8e8002ff60723',
@@ -105,6 +106,7 @@ export const items: IItem[] = [
105
106
  fullDescription: 'Recover your life',
106
107
  createdAt: '2022-06-04T03:18:09.335Z',
107
108
  updatedAt: '2022-06-04T18:16:49.056Z',
109
+ rarity: ItemRarities.Common
108
110
  },
109
111
  {
110
112
  _id: '629acek4j7c8e8002ff60034',
@@ -138,6 +140,7 @@ export const items: IItem[] = [
138
140
  fullDescription: 'Recover your mana',
139
141
  createdAt: '2022-06-04T03:18:09.335Z',
140
142
  updatedAt: '2022-06-04T18:16:49.056Z',
143
+ rarity: ItemRarities.Common
141
144
  },
142
145
  {
143
146
  _id: '629acek4j7c8e8002fg60034',
@@ -171,6 +174,7 @@ export const items: IItem[] = [
171
174
  fullDescription: 'Key to open things',
172
175
  createdAt: '2022-06-04T03:18:09.335Z',
173
176
  updatedAt: '2022-06-04T18:16:49.056Z',
177
+ rarity: ItemRarities.Common
174
178
  },
175
179
  {
176
180
  _id: '392acek4j7c8e8002ff60403',
@@ -204,6 +208,7 @@ export const items: IItem[] = [
204
208
  fullDescription: 'Somes shard, some crafts.',
205
209
  createdAt: '2022-06-04T03:18:09.335Z',
206
210
  updatedAt: '2022-06-04T18:16:49.056Z',
211
+ rarity: ItemRarities.Common
207
212
  },
208
213
  {
209
214
  _id: '392acek4j7c8e8002ff60404',
@@ -240,6 +245,7 @@ export const items: IItem[] = [
240
245
  'You see a bag. It has made using leather and it has 10 total slots.',
241
246
  createdAt: '2022-06-04T03:18:09.335Z',
242
247
  updatedAt: '2022-06-04T18:16:49.056Z',
248
+ rarity: ItemRarities.Common
243
249
  },
244
250
  {
245
251
  _id: '392acek4j7c8e80d2fs60404',
@@ -274,6 +280,7 @@ export const items: IItem[] = [
274
280
  fullDescription: 'You see a stone. It is used with slingshot',
275
281
  createdAt: '2022-06-04T03:18:09.335Z',
276
282
  updatedAt: '2022-06-04T18:16:49.056Z',
283
+ rarity: ItemRarities.Common
277
284
  },
278
285
  {
279
286
  _id: '392acek4j7c8e80d2fs60404',
@@ -308,6 +315,7 @@ export const items: IItem[] = [
308
315
  fullDescription: 'You see a stone. It is used with slingshot',
309
316
  createdAt: '2022-06-04T03:18:09.335Z',
310
317
  updatedAt: '2022-06-04T18:16:49.056Z',
318
+ rarity: ItemRarities.Common
311
319
  },
312
320
  {
313
321
  _id: '392acek4j7c8e80d2fs60404',
@@ -342,6 +350,7 @@ export const items: IItem[] = [
342
350
  fullDescription: 'You see a stone. It is used with slingshot',
343
351
  createdAt: '2022-06-04T03:18:09.335Z',
344
352
  updatedAt: '2022-06-04T18:16:49.056Z',
353
+ rarity: ItemRarities.Common
345
354
  },
346
355
  {
347
356
  _id: '392acek4j7c8e80d2fs60404',
@@ -376,6 +385,7 @@ export const items: IItem[] = [
376
385
  fullDescription: 'You see a stone. It is used with slingshot',
377
386
  createdAt: '2022-06-04T03:18:09.335Z',
378
387
  updatedAt: '2022-06-04T18:16:49.056Z',
388
+ rarity: ItemRarities.Common
379
389
  },
380
390
  {
381
391
  _id: '392acek4j7c8e80d2fs60404',
@@ -410,6 +420,7 @@ export const items: IItem[] = [
410
420
  fullDescription: 'You see a stone. It is used with slingshot',
411
421
  createdAt: '2022-06-04T03:18:09.335Z',
412
422
  updatedAt: '2022-06-04T18:16:49.056Z',
423
+ rarity: ItemRarities.Common
413
424
  },
414
425
  {
415
426
  _id: '392acek4j7c8e80d2fs60404',
@@ -444,6 +455,7 @@ export const items: IItem[] = [
444
455
  fullDescription: 'You see a stone. It is used with slingshot',
445
456
  createdAt: '2022-06-04T03:18:09.335Z',
446
457
  updatedAt: '2022-06-04T18:16:49.056Z',
458
+ rarity: ItemRarities.Common
447
459
  },
448
460
  {
449
461
  _id: '392acek4j7c8e80d2fs60404',
@@ -478,6 +490,7 @@ export const items: IItem[] = [
478
490
  fullDescription: 'You see a stone. It is used with slingshot',
479
491
  createdAt: '2022-06-04T03:18:09.335Z',
480
492
  updatedAt: '2022-06-04T18:16:49.056Z',
493
+ rarity: ItemRarities.Common
481
494
  },
482
495
  {
483
496
  _id: '392acek4j7casd0d2fs60404',
@@ -512,6 +525,7 @@ export const items: IItem[] = [
512
525
  fullDescription: 'You see a stone. It is used with slingshot',
513
526
  createdAt: '2022-06-04T03:18:09.335Z',
514
527
  updatedAt: '2022-06-04T18:16:49.056Z',
528
+ rarity: ItemRarities.Common
515
529
  }
516
530
  ];
517
531