@rpg-engine/long-bow 0.3.43 → 0.3.44

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.
Files changed (115) hide show
  1. package/dist/components/Abstractions/SlotsContainer.d.ts +0 -1
  2. package/dist/components/Button.d.ts +2 -3
  3. package/dist/components/Chat/Chat.d.ts +2 -12
  4. package/dist/components/CheckButton.d.ts +2 -1
  5. package/dist/components/DraggableContainer.d.ts +0 -1
  6. package/dist/components/Equipment/EquipmentSet.d.ts +0 -8
  7. package/dist/components/Input.d.ts +0 -1
  8. package/dist/components/Item/Inventory/ItemContainer.d.ts +0 -12
  9. package/dist/components/Item/Inventory/ItemSlot.d.ts +0 -9
  10. package/dist/components/NPCDialog/NPCDialogText.d.ts +2 -4
  11. package/dist/components/RangeSlider.d.ts +0 -1
  12. package/dist/index.d.ts +0 -8
  13. package/dist/long-bow.cjs.development.js +515 -7465
  14. package/dist/long-bow.cjs.development.js.map +1 -1
  15. package/dist/long-bow.cjs.production.min.js +1 -1
  16. package/dist/long-bow.cjs.production.min.js.map +1 -1
  17. package/dist/long-bow.esm.js +520 -7461
  18. package/dist/long-bow.esm.js.map +1 -1
  19. package/dist/mocks/equipmentSet.mocks.d.ts +2 -15
  20. package/dist/mocks/skills.mocks.d.ts +121 -2
  21. package/package.json +2 -5
  22. package/src/components/Abstractions/SlotsContainer.tsx +0 -3
  23. package/src/components/Button.tsx +8 -18
  24. package/src/components/Chat/Chat.tsx +105 -106
  25. package/src/components/CheckButton.tsx +1 -1
  26. package/src/components/DraggableContainer.tsx +1 -4
  27. package/src/components/Dropdown.tsx +1 -7
  28. package/src/components/Equipment/EquipmentSet.tsx +0 -46
  29. package/src/components/Input.tsx +2 -6
  30. package/src/components/Item/Inventory/ItemContainer.tsx +6 -104
  31. package/src/components/Item/Inventory/ItemSlot.tsx +34 -234
  32. package/src/components/NPCDialog/NPCDialog.tsx +28 -4
  33. package/src/components/NPCDialog/NPCDialogText.tsx +15 -75
  34. package/src/components/RangeSlider.tsx +14 -37
  35. package/src/components/SkillsContainer.tsx +1 -1
  36. package/src/components/TimeWidget/TimeWidget.tsx +0 -1
  37. package/src/components/TradingMenu/TradingItemRow.tsx +6 -43
  38. package/src/components/TradingMenu/TradingMenu.tsx +1 -1
  39. package/src/components/TradingMenu/items.mock.ts +0 -1
  40. package/src/components/shared/SpriteFromAtlas.tsx +1 -4
  41. package/src/hooks/useOutsideAlerter.ts +2 -2
  42. package/src/index.tsx +0 -8
  43. package/src/mocks/atlas/items/items.json +314 -6086
  44. package/src/mocks/atlas/items/items.png +0 -0
  45. package/src/mocks/equipmentSet.mocks.ts +4 -49
  46. package/src/mocks/itemContainer.mocks.ts +6 -54
  47. package/src/mocks/skills.mocks.ts +2 -8
  48. package/src/stories/Chat.stories.tsx +3 -20
  49. package/src/stories/EquipmentSet.stories.tsx +0 -10
  50. package/src/stories/ItemContainer.stories.tsx +15 -84
  51. package/src/stories/RangeSlider.stories.tsx +9 -10
  52. package/dist/components/CaracterStatus/CaracterStatus.d.ts +0 -9
  53. package/dist/components/Chatdeprecated/ChatDeprecated.d.ts +0 -13
  54. package/dist/components/CircularController/CircularController.d.ts +0 -10
  55. package/dist/components/CraftBook/CraftBook.d.ts +0 -15
  56. package/dist/components/CraftBook/MockItems.d.ts +0 -2
  57. package/dist/components/DropdownSelectorContainer.d.ts +0 -13
  58. package/dist/components/Item/Inventory/ItemQuantitySelector.d.ts +0 -7
  59. package/dist/components/RadioInput/RadioButton.d.ts +0 -8
  60. package/dist/components/RadioInput/RadioInput.d.ts +0 -13
  61. package/dist/components/RadioInput/instruments.d.ts +0 -4
  62. package/dist/components/Spellbook/QuickSpells.d.ts +0 -10
  63. package/dist/components/Spellbook/Spell.d.ts +0 -11
  64. package/dist/components/Spellbook/Spellbook.d.ts +0 -15
  65. package/dist/components/Spellbook/SpellbookShortcuts.d.ts +0 -10
  66. package/dist/components/Spellbook/constants.d.ts +0 -3
  67. package/dist/components/Spellbook/mockSpells.d.ts +0 -2
  68. package/dist/components/itemSelector/ItemSelector.d.ts +0 -14
  69. package/dist/constants/uiDevices.d.ts +0 -1
  70. package/dist/stories/CaracterStatus.stories.d.ts +0 -5
  71. package/dist/stories/ChatDeprecated.stories.d.ts +0 -5
  72. package/dist/stories/CircullarController.stories.d.ts +0 -5
  73. package/dist/stories/CraftBook.stories.d.ts +0 -4
  74. package/dist/stories/DropdownSelectorContainer.stories.d.ts +0 -5
  75. package/dist/stories/ItemQuantitySelector.stories.d.ts +0 -5
  76. package/dist/stories/ItemSelector.stories.d.ts +0 -4
  77. package/dist/stories/QuickSpells.stories.d.ts +0 -5
  78. package/dist/stories/RadioInput.stories.d.ts +0 -5
  79. package/dist/stories/Spellbook.stories.d.ts +0 -5
  80. package/src/.DS_Store +0 -0
  81. package/src/components/.DS_Store +0 -0
  82. package/src/components/CaracterStatus/CaracterStatus.tsx +0 -86
  83. package/src/components/CaracterStatus/Character.png +0 -0
  84. package/src/components/Chatdeprecated/ChatDeprecated.tsx +0 -200
  85. package/src/components/CircularController/CircularController.tsx +0 -162
  86. package/src/components/CraftBook/CraftBook.tsx +0 -230
  87. package/src/components/CraftBook/MockItems.ts +0 -46
  88. package/src/components/DropdownSelectorContainer.tsx +0 -42
  89. package/src/components/Item/Inventory/ItemQuantitySelector.tsx +0 -142
  90. package/src/components/NPCDialog/.DS_Store +0 -0
  91. package/src/components/NPCDialog/img/.DS_Store +0 -0
  92. package/src/components/NPCDialog/img/press-button.gif +0 -0
  93. package/src/components/RadioInput/RadioButton.tsx +0 -98
  94. package/src/components/RadioInput/RadioInput.tsx +0 -99
  95. package/src/components/RadioInput/instruments.ts +0 -16
  96. package/src/components/Spellbook/QuickSpells.tsx +0 -120
  97. package/src/components/Spellbook/Spell.tsx +0 -201
  98. package/src/components/Spellbook/Spellbook.tsx +0 -144
  99. package/src/components/Spellbook/SpellbookShortcuts.tsx +0 -77
  100. package/src/components/Spellbook/constants.ts +0 -12
  101. package/src/components/Spellbook/mockSpells.ts +0 -60
  102. package/src/components/itemSelector/ItemSelector.tsx +0 -136
  103. package/src/constants/uiDevices.ts +0 -5
  104. package/src/mocks/.DS_Store +0 -0
  105. package/src/mocks/atlas/.DS_Store +0 -0
  106. package/src/stories/CaracterStatus.stories.tsx +0 -29
  107. package/src/stories/ChatDeprecated.stories.tsx +0 -170
  108. package/src/stories/CircullarController.stories.tsx +0 -33
  109. package/src/stories/CraftBook.stories.tsx +0 -40
  110. package/src/stories/DropdownSelectorContainer.stories.tsx +0 -41
  111. package/src/stories/ItemQuantitySelector.stories.tsx +0 -26
  112. package/src/stories/ItemSelector.stories.tsx +0 -77
  113. package/src/stories/QuickSpells.stories.tsx +0 -38
  114. package/src/stories/RadioInput.stories.tsx +0 -35
  115. package/src/stories/Spellbook.stories.tsx +0 -107
Binary file
@@ -1,29 +1,12 @@
1
1
  import {
2
2
  IEquipmentSet,
3
- IItem,
4
- ItemRarities,
5
3
  // IItem,
6
4
  ItemSlotType,
7
5
  ItemSubType,
8
- ItemType
6
+ ItemType,
9
7
  } from '@rpg-engine/shared';
10
8
 
11
- interface IEquipmentSetItems {
12
- leftHand: IItem
13
- head: IItem
14
- armor: IItem
15
- legs: IItem
16
- boot: IItem
17
- neck: IItem
18
- ring: IItem
19
- accessory: IItem
20
- inventory: IItem
21
- rightHand: IItem
22
-
23
-
24
- }
25
-
26
- export const items: IEquipmentSetItems = {
9
+ export const items: any = {
27
10
  leftHand: {
28
11
  _id: '0',
29
12
  type: ItemType.Weapon,
@@ -55,9 +38,6 @@ export const items: IEquipmentSetItems = {
55
38
  isStackable: false,
56
39
  createdAt: '2022-06-04T03:18:09.335Z',
57
40
  updatedAt: '2022-06-04T18:16:49.056Z',
58
- isTwoHanded: false,
59
- hasUseWith: false,
60
- rarity: ItemRarities.Common
61
41
  },
62
42
  head: {
63
43
  _id: '1',
@@ -88,9 +68,6 @@ export const items: IEquipmentSetItems = {
88
68
  isStackable: false,
89
69
  createdAt: '2022-06-04T03:18:09.335Z',
90
70
  updatedAt: '2022-06-04T18:16:49.056Z',
91
- isTwoHanded: false,
92
- hasUseWith: false,
93
- rarity: ItemRarities.Common
94
71
  },
95
72
  armor: {
96
73
  _id: '2',
@@ -122,9 +99,6 @@ export const items: IEquipmentSetItems = {
122
99
  fullDescription: 'Recover your life',
123
100
  createdAt: '2022-06-04T03:18:09.335Z',
124
101
  updatedAt: '2022-06-04T18:16:49.056Z',
125
- isTwoHanded: false,
126
- hasUseWith: false,
127
- rarity: ItemRarities.Common
128
102
  },
129
103
  legs: {
130
104
  _id: '3',
@@ -156,9 +130,6 @@ export const items: IEquipmentSetItems = {
156
130
  fullDescription: 'Leather legs',
157
131
  createdAt: '2022-06-04T03:18:09.335Z',
158
132
  updatedAt: '2022-06-04T18:16:49.056Z',
159
- isTwoHanded: false,
160
- hasUseWith: false,
161
- rarity: ItemRarities.Common
162
133
  },
163
134
  boot: {
164
135
  _id: '4',
@@ -189,9 +160,6 @@ export const items: IEquipmentSetItems = {
189
160
  fullDescription: 'Key to open things',
190
161
  createdAt: '2022-06-04T03:18:09.335Z',
191
162
  updatedAt: '2022-06-04T18:16:49.056Z',
192
- isTwoHanded: false,
193
- hasUseWith: false,
194
- rarity: ItemRarities.Common
195
163
  },
196
164
  neck: {
197
165
  _id: '5',
@@ -223,9 +191,6 @@ export const items: IEquipmentSetItems = {
223
191
  fullDescription: 'Somes shard, some crafts.',
224
192
  createdAt: '2022-06-04T03:18:09.335Z',
225
193
  updatedAt: '2022-06-04T18:16:49.056Z',
226
- isTwoHanded: false,
227
- hasUseWith: false,
228
- rarity: ItemRarities.Common
229
194
  },
230
195
  ring: {
231
196
  _id: '6',
@@ -257,9 +222,6 @@ export const items: IEquipmentSetItems = {
257
222
  fullDescription: 'Use this axe to chop wood and stuffs.',
258
223
  createdAt: '2022-06-04T03:18:09.335Z',
259
224
  updatedAt: '2022-06-04T18:16:49.056Z',
260
- isTwoHanded: false,
261
- hasUseWith: false,
262
- rarity: ItemRarities.Common
263
225
  },
264
226
  accessory: {
265
227
  _id: '392acek4j7c8e80d2fs60404',
@@ -279,7 +241,7 @@ export const items: IEquipmentSetItems = {
279
241
  isItemContainer: true,
280
242
  isSolid: false,
281
243
  key: 'stone',
282
- texturePath: 'ranged-weapons/stone-qty-5.png',
244
+ texturePath: 'ranged-weapons/stone-qty-1.png',
283
245
  textureKey: 'stone',
284
246
  name: 'stone',
285
247
  generateContainerSlots: 10,
@@ -294,7 +256,6 @@ export const items: IEquipmentSetItems = {
294
256
  fullDescription: 'You see a stone. It is used with slingshot',
295
257
  createdAt: '2022-06-04T03:18:09.335Z',
296
258
  updatedAt: '2022-06-04T18:16:49.056Z',
297
- rarity: ItemRarities.Common
298
259
  },
299
260
  inventory: {
300
261
  _id: '8',
@@ -312,7 +273,7 @@ export const items: IEquipmentSetItems = {
312
273
  isSolid: false,
313
274
  key: 'backpack',
314
275
  texturePath: 'containers/backpack.png',
315
- textureKey: 'containers/backpack.png',
276
+ textureKey: 'backpack',
316
277
  name: 'backpack',
317
278
  description: 'Open the gates, but use the key!',
318
279
  attack: 7,
@@ -337,9 +298,6 @@ export const items: IEquipmentSetItems = {
337
298
  updatedAt: '2022-06-19T06:09:57.971Z',
338
299
  isEmpty: true,
339
300
  },
340
- isTwoHanded: false,
341
- hasUseWith: false,
342
- rarity: ItemRarities.Common
343
301
  },
344
302
  rightHand: {
345
303
  _id: '629acef1c7c8e8002ff60736',
@@ -372,9 +330,6 @@ export const items: IEquipmentSetItems = {
372
330
  isStackable: false,
373
331
  createdAt: '2022-06-04T03:18:09.335Z',
374
332
  updatedAt: '2022-06-04T18:16:49.056Z',
375
- isTwoHanded: false,
376
- hasUseWith: false,
377
- rarity: ItemRarities.Common
378
333
  },
379
334
  };
380
335
 
@@ -1,8 +1,9 @@
1
1
  import {
2
2
  IItem,
3
- IItemContainer, ItemRarities, ItemSlotType,
3
+ IItemContainer,
4
+ ItemSlotType,
4
5
  ItemSubType,
5
- ItemType
6
+ ItemType,
6
7
  } from '@rpg-engine/shared';
7
8
 
8
9
  export const items: IItem[] = [
@@ -39,7 +40,6 @@ export const items: IItem[] = [
39
40
  isStackable: false,
40
41
  createdAt: '2022-06-04T03:18:09.335Z',
41
42
  updatedAt: '2022-06-04T18:16:49.056Z',
42
- rarity: ItemRarities.Legendary
43
43
  },
44
44
  {
45
45
  _id: '629acef1c7c8e8002ff73564',
@@ -72,7 +72,6 @@ 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.Epic
76
75
  },
77
76
  {
78
77
  _id: '629acef1c7c8e8002ff60723',
@@ -106,7 +105,6 @@ export const items: IItem[] = [
106
105
  fullDescription: 'Recover your life',
107
106
  createdAt: '2022-06-04T03:18:09.335Z',
108
107
  updatedAt: '2022-06-04T18:16:49.056Z',
109
- rarity: ItemRarities.Uncommon
110
108
  },
111
109
  {
112
110
  _id: '629acek4j7c8e8002ff60034',
@@ -140,7 +138,6 @@ export const items: IItem[] = [
140
138
  fullDescription: 'Recover your mana',
141
139
  createdAt: '2022-06-04T03:18:09.335Z',
142
140
  updatedAt: '2022-06-04T18:16:49.056Z',
143
- rarity: ItemRarities.Rare
144
141
  },
145
142
  {
146
143
  _id: '629acek4j7c8e8002fg60034',
@@ -174,7 +171,6 @@ export const items: IItem[] = [
174
171
  fullDescription: 'Key to open things',
175
172
  createdAt: '2022-06-04T03:18:09.335Z',
176
173
  updatedAt: '2022-06-04T18:16:49.056Z',
177
- rarity: ItemRarities.Common
178
174
  },
179
175
  {
180
176
  _id: '392acek4j7c8e8002ff60403',
@@ -208,7 +204,6 @@ export const items: IItem[] = [
208
204
  fullDescription: 'Somes shard, some crafts.',
209
205
  createdAt: '2022-06-04T03:18:09.335Z',
210
206
  updatedAt: '2022-06-04T18:16:49.056Z',
211
- rarity: ItemRarities.Common
212
207
  },
213
208
  {
214
209
  _id: '392acek4j7c8e8002ff60404',
@@ -245,10 +240,9 @@ export const items: IItem[] = [
245
240
  'You see a bag. It has made using leather and it has 10 total slots.',
246
241
  createdAt: '2022-06-04T03:18:09.335Z',
247
242
  updatedAt: '2022-06-04T18:16:49.056Z',
248
- rarity: ItemRarities.Common
249
243
  },
250
244
  {
251
- _id: '392acek4j7c8e80d2fs60404',
245
+ _id: '392acek4j7c8e80d2ff60404',
252
246
  hasUseWith: false,
253
247
  type: ItemType.Accessory,
254
248
  subType: ItemSubType.Ranged,
@@ -280,7 +274,6 @@ export const items: IItem[] = [
280
274
  fullDescription: 'You see a stone. It is used with slingshot',
281
275
  createdAt: '2022-06-04T03:18:09.335Z',
282
276
  updatedAt: '2022-06-04T18:16:49.056Z',
283
- rarity: ItemRarities.Common
284
277
  },
285
278
  {
286
279
  _id: '392acek4j7c8e80d2fs60404',
@@ -315,7 +308,6 @@ export const items: IItem[] = [
315
308
  fullDescription: 'You see a stone. It is used with slingshot',
316
309
  createdAt: '2022-06-04T03:18:09.335Z',
317
310
  updatedAt: '2022-06-04T18:16:49.056Z',
318
- rarity: ItemRarities.Common
319
311
  },
320
312
  {
321
313
  _id: '392acek4j7c8e80d2fs60404',
@@ -350,7 +342,6 @@ export const items: IItem[] = [
350
342
  fullDescription: 'You see a stone. It is used with slingshot',
351
343
  createdAt: '2022-06-04T03:18:09.335Z',
352
344
  updatedAt: '2022-06-04T18:16:49.056Z',
353
- rarity: ItemRarities.Common
354
345
  },
355
346
  {
356
347
  _id: '392acek4j7c8e80d2fs60404',
@@ -385,7 +376,6 @@ export const items: IItem[] = [
385
376
  fullDescription: 'You see a stone. It is used with slingshot',
386
377
  createdAt: '2022-06-04T03:18:09.335Z',
387
378
  updatedAt: '2022-06-04T18:16:49.056Z',
388
- rarity: ItemRarities.Common
389
379
  },
390
380
  {
391
381
  _id: '392acek4j7c8e80d2fs60404',
@@ -420,7 +410,6 @@ export const items: IItem[] = [
420
410
  fullDescription: 'You see a stone. It is used with slingshot',
421
411
  createdAt: '2022-06-04T03:18:09.335Z',
422
412
  updatedAt: '2022-06-04T18:16:49.056Z',
423
- rarity: ItemRarities.Common
424
413
  },
425
414
  {
426
415
  _id: '392acek4j7c8e80d2fs60404',
@@ -455,7 +444,6 @@ export const items: IItem[] = [
455
444
  fullDescription: 'You see a stone. It is used with slingshot',
456
445
  createdAt: '2022-06-04T03:18:09.335Z',
457
446
  updatedAt: '2022-06-04T18:16:49.056Z',
458
- rarity: ItemRarities.Common
459
447
  },
460
448
  {
461
449
  _id: '392acek4j7c8e80d2fs60404',
@@ -467,7 +455,7 @@ export const items: IItem[] = [
467
455
  isEquipable: true,
468
456
  isStackable: true,
469
457
  maxStackSize: 100,
470
- stackQty: 203.23,
458
+ stackQty: 3.75,
471
459
  isUsable: false,
472
460
  isStorable: true,
473
461
  isTwoHanded: false,
@@ -490,43 +478,7 @@ export const items: IItem[] = [
490
478
  fullDescription: 'You see a stone. It is used with slingshot',
491
479
  createdAt: '2022-06-04T03:18:09.335Z',
492
480
  updatedAt: '2022-06-04T18:16:49.056Z',
493
- rarity: ItemRarities.Common
494
481
  },
495
- {
496
- _id: '392acek4j7casd0d2fs60404',
497
- hasUseWith: false,
498
- type: ItemType.Other,
499
- subType: ItemSubType.Other,
500
- textureAtlas: 'items',
501
- allowedEquipSlotType: [],
502
- isEquipable: true,
503
- isStackable: true,
504
- maxStackSize: 100,
505
- stackQty: 345,
506
- isUsable: false,
507
- isStorable: true,
508
- isTwoHanded: false,
509
- layer: 1,
510
- isItemContainer: true,
511
- isSolid: false,
512
- key: 'gold-coin',
513
- texturePath: 'others/gold-coin.png',
514
- textureKey: 'gold-coin',
515
- name: 'gold-coin',
516
- generateContainerSlots: 10,
517
- description: 'You see a coin.',
518
- attack: 7,
519
- defense: 3,
520
- weight: 13,
521
- tiledId: 67,
522
- x: 320,
523
- y: 144,
524
- scene: 'MainScene',
525
- fullDescription: 'You see a stone. It is used with slingshot',
526
- createdAt: '2022-06-04T03:18:09.335Z',
527
- updatedAt: '2022-06-04T18:16:49.056Z',
528
- rarity: ItemRarities.Common
529
- }
530
482
  ];
531
483
 
532
484
  export const itemContainerMock: IItemContainer = {
@@ -549,7 +501,7 @@ export const itemContainerMock: IItemContainer = {
549
501
  11: items[11],
550
502
  12: items[12],
551
503
  13: items[13],
552
- 14: items[14],
504
+ // 14: items[14],
553
505
  //remaining slots are considered null by default
554
506
  },
555
507
  allowedItemTypes: [],
@@ -1,4 +1,4 @@
1
- import { ISkill, SkillType } from '@rpg-engine/shared';
1
+ import { SkillType } from '@rpg-engine/shared';
2
2
 
3
3
  export const skillMock = {
4
4
  _id: '62aebda8785a9f0089a4f757',
@@ -110,12 +110,6 @@ export const skillMock = {
110
110
  skillPoints: 2,
111
111
  skillPointsToNextLevel: 80,
112
112
  },
113
- blacksmithing: {
114
- type: SkillType.Crafting,
115
- level: 1,
116
- skillPoints: 2,
117
- skillPointsToNextLevel: 80,
118
- },
119
113
  level: 2,
120
114
  xpGainRate: 100,
121
115
  experience: 31,
@@ -125,4 +119,4 @@ export const skillMock = {
125
119
  createdAt: '2022-06-19T06:09:44.661Z',
126
120
  updatedAt: '2022-06-19T06:09:44.661Z',
127
121
  __v: 0,
128
- } as ISkill;
122
+ };
@@ -1,8 +1,8 @@
1
1
  import { ChatMessageType, IChatMessage } from '@rpg-engine/shared';
2
2
  import { Meta, Story } from '@storybook/react';
3
3
  import React from 'react';
4
- import { Chat } from '../components/Chat/Chat';
5
- import { RPGUIRoot } from '../components/RPGUIRoot';
4
+ import { Chat } from '../../src/components/Chat/Chat';
5
+ import { RPGUIRoot } from '../../src/components/RPGUIRoot';
6
6
 
7
7
  const meta: Meta = {
8
8
  title: 'Chat',
@@ -152,20 +152,6 @@ const chatMessagesMock = [
152
152
  createdAt: '2020-08-20T16:00:00.000Z',
153
153
  updatedAt: '2020-08-20T16:00:00.000Z',
154
154
  },
155
- {
156
- _id: 'test-id-9',
157
- message: '22222EEECT!',
158
- emitter: {
159
- _id: 'someid',
160
- name: 'Guilherme',
161
- },
162
- type: ChatMessageType.Global,
163
- x: 128,
164
- y: 128,
165
- scene: 'MainScene',
166
- createdAt: '2020-08-20T16:00:00.000Z',
167
- updatedAt: '2020-08-20T16:00:00.000Z',
168
- },
169
155
  ];
170
156
 
171
157
  const Template: Story<IChatMessage> = args => (
@@ -174,11 +160,8 @@ const Template: Story<IChatMessage> = args => (
174
160
  onSendChatMessage={msg => console.log(msg)}
175
161
  chatMessages={chatMessagesMock}
176
162
  opacity={0.5}
177
- styles={{
178
- height: '200px',
179
- }}
163
+ height={'200px'}
180
164
  onCloseButton={() => console.log('closing chat...')}
181
- sendMessage={true}
182
165
  {...args}
183
166
  />
184
167
  </RPGUIRoot>
@@ -9,7 +9,6 @@ import { RPGUIRoot } from '../../src/components/RPGUIRoot';
9
9
  import { equipmentSetMock } from '../../src/mocks/equipmentSet.mocks';
10
10
  import atlasJSON from '../mocks/atlas/items/items.json';
11
11
  import atlasIMG from '../mocks/atlas/items/items.png';
12
- import { IPosition } from '../types/eventTypes';
13
12
 
14
13
  const meta: Meta = {
15
14
  title: 'Equipment Set',
@@ -37,10 +36,6 @@ const onSelected = (payload: string) => {
37
36
  console.log('dispatch', payload);
38
37
  };
39
38
 
40
- const onItemOutsideDrop = (item: IItem, position: IPosition) => {
41
- console.log('dropped outside', item, position);
42
- };
43
-
44
39
  const Template: Story<IEquipmentSetProps> = args => (
45
40
  <RPGUIRoot>
46
41
  <EquipmentSet
@@ -50,14 +45,9 @@ const Template: Story<IEquipmentSetProps> = args => (
50
45
  onMouseOver={onMouseOver}
51
46
  onSelected={onSelected}
52
47
  onItemClick={onItemClick}
53
- onItemDragEnd={_quantity => {}}
54
- onItemDragStart={item => console.log('drag start: ', item._id)}
55
- onItemPlaceDrop={item => console.log('dropped to: ', item?._id)}
56
- checkIfItemCanBeMoved={() => false}
57
48
  type={ItemContainerType.Equipment}
58
49
  atlasIMG={atlasIMG}
59
50
  atlasJSON={atlasJSON}
60
- onItemOutsideDrop={onItemOutsideDrop}
61
51
  />
62
52
  </RPGUIRoot>
63
53
  );
@@ -1,6 +1,6 @@
1
1
  import { IItem, ItemContainerType, ItemType } from '@rpg-engine/shared';
2
2
  import { Meta, Story } from '@storybook/react';
3
- import React, { useState } from 'react';
3
+ import React from 'react';
4
4
  import {
5
5
  IItemContainerProps,
6
6
  ItemContainer,
@@ -37,88 +37,19 @@ const onItemClick = (
37
37
  console.log(item, ItemType, itemContainerType, 'was clicked!');
38
38
  };
39
39
 
40
- // THIS IS ONLY LONG-BOW EXAMPLE FOR DRAG AND DROP
41
- let dragItem: IItem | null = null;
42
- let dropItem: IItem | null = null;
43
- let allowedToDrop = false;
44
- let dragSlot = -1;
45
- let dropSlot = -1;
46
-
47
- const Template: Story<IItemContainerProps> = () => {
48
- const [itemContainer, setItemContainer] = useState(itemContainerMock);
49
-
50
- return (
51
- <RPGUIRoot>
52
- <ItemContainer
53
- itemContainer={itemContainer}
54
- onClose={() => console.log('closing item container')}
55
- onMouseOver={onMouseOver}
56
- onSelected={onSelected}
57
- onItemClick={onItemClick}
58
- checkIfItemCanBeMoved={() => allowedToDrop}
59
- onItemDragEnd={quantity => {
60
- // THIS IS ONLY LONG-BOW EXAMPLE FOR DRAG AND DROP
61
-
62
- if (quantity === 0) {
63
- setItemContainer({ ...itemContainer });
64
- } else if (allowedToDrop && dropSlot !== -1) {
65
- const newContainer = { ...itemContainer };
66
-
67
- if (quantity && dragItem && dragItem.stackQty) {
68
- newContainer.slots[dropSlot] = {
69
- ...dragItem,
70
- stackQty: quantity + (dropItem?.stackQty || 0),
71
- };
72
-
73
- if (dragItem.stackQty - quantity === 0)
74
- newContainer.slots[dragSlot] = null;
75
- else
76
- newContainer.slots[dragSlot] = {
77
- ...dragItem,
78
- stackQty: dragItem.stackQty - quantity,
79
- };
80
- } else {
81
- newContainer.slots[dropSlot] = dragItem;
82
- newContainer.slots[dragSlot] = null;
83
- }
84
- setTimeout(() => {
85
- setItemContainer(newContainer);
86
- }, 100);
87
- }
88
-
89
- allowedToDrop = false;
90
- dropSlot = -1;
91
- dropItem = null;
92
- dragItem = null;
93
- }}
94
- onItemDragStart={(item, slotIndex) => {
95
- dragItem = item;
96
- dragSlot = slotIndex;
97
- }}
98
- onItemPlaceDrop={(item, slotIndex) => {
99
- // THIS IS ONLY LONG-BOW EXAMPLE FOR DRAG AND DROP
100
-
101
- if (
102
- !item ||
103
- (dragItem?.key === item?.key && dragSlot !== slotIndex)
104
- ) {
105
- console.log('allow');
106
- allowedToDrop = true;
107
- dropSlot = slotIndex;
108
- dropItem = item ? item : null;
109
- } else {
110
- allowedToDrop = false;
111
- dropSlot = -1;
112
- dropItem = null;
113
- }
114
- }}
115
- onOutsideDrop={(item, pos) => console.log('drop', item, pos)}
116
- type={ItemContainerType.Inventory}
117
- atlasIMG={atlasIMG}
118
- atlasJSON={atlasJSON}
119
- />
120
- </RPGUIRoot>
121
- );
122
- };
40
+ const Template: Story<IItemContainerProps> = () => (
41
+ <RPGUIRoot>
42
+ <ItemContainer
43
+ itemContainer={itemContainerMock}
44
+ onClose={() => console.log('closing item container')}
45
+ onMouseOver={onMouseOver}
46
+ onSelected={onSelected}
47
+ onItemClick={onItemClick}
48
+ type={ItemContainerType.Inventory}
49
+ atlasIMG={atlasIMG}
50
+ atlasJSON={atlasJSON}
51
+ />
52
+ </RPGUIRoot>
53
+ );
123
54
 
124
55
  export const Default = Template.bind({});
@@ -1,5 +1,5 @@
1
1
  import { Meta, Story } from '@storybook/react';
2
- import React, { useState } from 'react';
2
+ import React from 'react';
3
3
  import {
4
4
  IRangeSliderProps,
5
5
  RangeSlider,
@@ -43,15 +43,11 @@ const meta: Meta = {
43
43
 
44
44
  export default meta;
45
45
 
46
- const Template: Story<IRangeSliderProps> = args => {
47
- const [value, setValue] = useState(50);
48
-
49
- return (
50
- <RPGUIRoot>
51
- <RangeSlider {...args} value={value} onChange={setValue} />
52
- </RPGUIRoot>
53
- );
54
- };
46
+ const Template: Story<IRangeSliderProps> = args => (
47
+ <RPGUIRoot>
48
+ <RangeSlider {...args} />
49
+ </RPGUIRoot>
50
+ );
55
51
 
56
52
  // By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
57
53
  // https://storybook.js.org/docs/react/workflows/unit-testing
@@ -61,4 +57,7 @@ Default.args = {
61
57
  type: RangeSliderType.Slider,
62
58
  valueMin: 0,
63
59
  valueMax: 100,
60
+ onChange: n => {
61
+ console.log('onChange', n);
62
+ },
64
63
  };
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- export interface ICharacterStatusProps {
3
- healthValue: number;
4
- healthMaxValue: number;
5
- manaValue: number;
6
- manaMaxValue: number;
7
- charName: string;
8
- }
9
- export declare const CharacterStatus: React.FC<ICharacterStatusProps>;
@@ -1,13 +0,0 @@
1
- import { IChatMessage } from '@rpg-engine/shared';
2
- import React from 'react';
3
- export interface IChatDeprecatedProps {
4
- chatMessages: IChatMessage[];
5
- onSendChatMessage: (message: string) => void;
6
- onCloseButton: () => void;
7
- onFocus?: () => void;
8
- onBlur?: () => void;
9
- opacity?: number;
10
- width?: string;
11
- height?: string;
12
- }
13
- export declare const ChatDeprecated: React.FC<IChatDeprecatedProps>;
@@ -1,10 +0,0 @@
1
- import { IRawSpell } from '@rpg-engine/shared';
2
- import React from 'react';
3
- export declare type CircularControllerProps = {
4
- onActionClick: () => void;
5
- onCancelClick: () => void;
6
- onSpellClick: (spellKey: string) => void;
7
- mana: number;
8
- spells: IRawSpell[];
9
- };
10
- export declare const CircularController: React.FC<CircularControllerProps>;
@@ -1,15 +0,0 @@
1
- import { ICraftableItem } from '@rpg-engine/shared';
2
- import React from 'react';
3
- export interface IItemCraftSelectorProps {
4
- atlasJSON: any;
5
- atlasIMG: any;
6
- onClose: () => void;
7
- onSelect: (value: string) => void;
8
- onCraftItem: (value: string | undefined) => void;
9
- craftablesItems: ICraftableItem[];
10
- }
11
- export interface ShowMessage {
12
- show: boolean;
13
- index: number;
14
- }
15
- export declare const CraftBook: React.FC<IItemCraftSelectorProps>;
@@ -1,2 +0,0 @@
1
- import { ICraftableItem } from '@rpg-engine/shared';
2
- export declare const craftableItems: ICraftableItem[];
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- interface IDropdownSelectorOption {
3
- id: string;
4
- name: string;
5
- }
6
- export interface IDropdownSelectorContainer {
7
- onChange: (id: string) => void;
8
- options: IDropdownSelectorOption[];
9
- details?: string;
10
- title: string;
11
- }
12
- export declare const DropdownSelectorContainer: React.FC<IDropdownSelectorContainer>;
13
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- export interface IItemQuantitySelectorProps {
3
- quantity: number;
4
- onConfirm: (quantity: number) => void;
5
- onClose: () => void;
6
- }
7
- export declare const ItemQuantitySelector: React.FC<IItemQuantitySelectorProps>;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- export interface IRadioProps {
3
- title: string;
4
- subtitle: string;
5
- instrument: string | null;
6
- setInstrument: (value: string) => void;
7
- }
8
- export declare const RadioButton: React.FC<IRadioProps>;
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- export interface IRadioItems {
3
- title: string;
4
- subtitle: string;
5
- }
6
- export interface IRadioInput {
7
- title: string;
8
- subtitle: string;
9
- onSelect: (a: string) => void;
10
- onCancel: () => void;
11
- items: IRadioItems[];
12
- }
13
- export declare const RadioInput: React.FC<IRadioInput>;
@@ -1,4 +0,0 @@
1
- export declare const Itools: {
2
- title: string;
3
- subtitle: string;
4
- }[];