@rpg-engine/long-bow 0.3.44 → 0.3.45

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 (103) hide show
  1. package/dist/components/Abstractions/SlotsContainer.d.ts +1 -0
  2. package/dist/components/Button.d.ts +3 -2
  3. package/dist/components/Chat/Chat.d.ts +12 -2
  4. package/dist/components/Chatdeprecated/ChatDeprecated.d.ts +13 -0
  5. package/dist/components/CheckButton.d.ts +1 -2
  6. package/dist/components/CircularController/CircularController.d.ts +10 -0
  7. package/dist/components/CraftBook/CraftBook.d.ts +15 -0
  8. package/dist/components/CraftBook/MockItems.d.ts +2 -0
  9. package/dist/components/DraggableContainer.d.ts +1 -0
  10. package/dist/components/DropdownSelectorContainer.d.ts +13 -0
  11. package/dist/components/Equipment/EquipmentSet.d.ts +8 -0
  12. package/dist/components/Input.d.ts +1 -0
  13. package/dist/components/Item/Inventory/ItemContainer.d.ts +12 -0
  14. package/dist/components/Item/Inventory/ItemQuantitySelector.d.ts +7 -0
  15. package/dist/components/Item/Inventory/ItemSlot.d.ts +9 -0
  16. package/dist/components/NPCDialog/NPCDialogText.d.ts +4 -2
  17. package/dist/components/RadioInput/RadioButton.d.ts +8 -0
  18. package/dist/components/RadioInput/RadioInput.d.ts +13 -0
  19. package/dist/components/RadioInput/instruments.d.ts +4 -0
  20. package/dist/components/RangeSlider.d.ts +1 -0
  21. package/dist/components/Spellbook/QuickSpells.d.ts +10 -0
  22. package/dist/components/Spellbook/Spell.d.ts +11 -0
  23. package/dist/components/Spellbook/Spellbook.d.ts +15 -0
  24. package/dist/components/Spellbook/SpellbookShortcuts.d.ts +10 -0
  25. package/dist/components/Spellbook/constants.d.ts +3 -0
  26. package/dist/components/Spellbook/mockSpells.d.ts +2 -0
  27. package/dist/components/itemSelector/ItemSelector.d.ts +14 -0
  28. package/dist/constants/uiDevices.d.ts +1 -0
  29. package/dist/index.d.ts +8 -0
  30. package/dist/long-bow.cjs.development.js +7464 -515
  31. package/dist/long-bow.cjs.development.js.map +1 -1
  32. package/dist/long-bow.cjs.production.min.js +1 -1
  33. package/dist/long-bow.cjs.production.min.js.map +1 -1
  34. package/dist/long-bow.esm.js +7458 -518
  35. package/dist/long-bow.esm.js.map +1 -1
  36. package/dist/mocks/equipmentSet.mocks.d.ts +15 -2
  37. package/dist/mocks/skills.mocks.d.ts +2 -121
  38. package/dist/stories/ChatDeprecated.stories.d.ts +5 -0
  39. package/dist/stories/CircullarController.stories.d.ts +5 -0
  40. package/dist/stories/CraftBook.stories.d.ts +4 -0
  41. package/dist/stories/DropdownSelectorContainer.stories.d.ts +5 -0
  42. package/dist/stories/ItemQuantitySelector.stories.d.ts +5 -0
  43. package/dist/stories/ItemSelector.stories.d.ts +4 -0
  44. package/dist/stories/QuickSpells.stories.d.ts +5 -0
  45. package/dist/stories/RadioInput.stories.d.ts +5 -0
  46. package/dist/stories/Spellbook.stories.d.ts +5 -0
  47. package/package.json +4 -1
  48. package/src/components/Abstractions/SlotsContainer.tsx +3 -0
  49. package/src/components/Button.tsx +18 -8
  50. package/src/components/Chat/Chat.tsx +105 -105
  51. package/src/components/Chatdeprecated/ChatDeprecated.tsx +200 -0
  52. package/src/components/CheckButton.tsx +1 -1
  53. package/src/components/CircularController/CircularController.tsx +162 -0
  54. package/src/components/CraftBook/CraftBook.tsx +230 -0
  55. package/src/components/CraftBook/MockItems.ts +46 -0
  56. package/src/components/DraggableContainer.tsx +4 -1
  57. package/src/components/Dropdown.tsx +7 -1
  58. package/src/components/DropdownSelectorContainer.tsx +42 -0
  59. package/src/components/Equipment/EquipmentSet.tsx +46 -0
  60. package/src/components/Input.tsx +6 -2
  61. package/src/components/Item/Inventory/ItemContainer.tsx +104 -6
  62. package/src/components/Item/Inventory/ItemQuantitySelector.tsx +142 -0
  63. package/src/components/Item/Inventory/ItemSlot.tsx +234 -34
  64. package/src/components/NPCDialog/NPCDialog.tsx +4 -28
  65. package/src/components/NPCDialog/NPCDialogText.tsx +75 -15
  66. package/src/components/NPCDialog/img/press-button.gif +0 -0
  67. package/src/components/RadioInput/RadioButton.tsx +98 -0
  68. package/src/components/RadioInput/RadioInput.tsx +99 -0
  69. package/src/components/RadioInput/instruments.ts +16 -0
  70. package/src/components/RangeSlider.tsx +37 -14
  71. package/src/components/SkillsContainer.tsx +1 -1
  72. package/src/components/Spellbook/QuickSpells.tsx +120 -0
  73. package/src/components/Spellbook/Spell.tsx +201 -0
  74. package/src/components/Spellbook/Spellbook.tsx +144 -0
  75. package/src/components/Spellbook/SpellbookShortcuts.tsx +77 -0
  76. package/src/components/Spellbook/constants.ts +12 -0
  77. package/src/components/Spellbook/mockSpells.ts +60 -0
  78. package/src/components/TimeWidget/TimeWidget.tsx +1 -0
  79. package/src/components/TradingMenu/TradingItemRow.tsx +43 -6
  80. package/src/components/TradingMenu/TradingMenu.tsx +1 -1
  81. package/src/components/itemSelector/ItemSelector.tsx +136 -0
  82. package/src/components/shared/SpriteFromAtlas.tsx +4 -1
  83. package/src/constants/uiDevices.ts +5 -0
  84. package/src/hooks/useOutsideAlerter.ts +2 -2
  85. package/src/index.tsx +8 -0
  86. package/src/mocks/atlas/items/items.json +6086 -314
  87. package/src/mocks/atlas/items/items.png +0 -0
  88. package/src/mocks/equipmentSet.mocks.ts +49 -4
  89. package/src/mocks/itemContainer.mocks.ts +54 -6
  90. package/src/mocks/skills.mocks.ts +8 -2
  91. package/src/stories/Chat.stories.tsx +20 -3
  92. package/src/stories/ChatDeprecated.stories.tsx +170 -0
  93. package/src/stories/CircullarController.stories.tsx +33 -0
  94. package/src/stories/CraftBook.stories.tsx +40 -0
  95. package/src/stories/DropdownSelectorContainer.stories.tsx +41 -0
  96. package/src/stories/EquipmentSet.stories.tsx +10 -0
  97. package/src/stories/ItemContainer.stories.tsx +84 -15
  98. package/src/stories/ItemQuantitySelector.stories.tsx +26 -0
  99. package/src/stories/ItemSelector.stories.tsx +77 -0
  100. package/src/stories/QuickSpells.stories.tsx +38 -0
  101. package/src/stories/RadioInput.stories.tsx +35 -0
  102. package/src/stories/RangeSlider.stories.tsx +10 -9
  103. package/src/stories/Spellbook.stories.tsx +107 -0
Binary file
@@ -1,12 +1,29 @@
1
1
  import {
2
2
  IEquipmentSet,
3
+ IItem,
4
+ ItemRarities,
3
5
  // IItem,
4
6
  ItemSlotType,
5
7
  ItemSubType,
6
- ItemType,
8
+ ItemType
7
9
  } from '@rpg-engine/shared';
8
10
 
9
- export const items: any = {
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 = {
10
27
  leftHand: {
11
28
  _id: '0',
12
29
  type: ItemType.Weapon,
@@ -38,6 +55,9 @@ export const items: any = {
38
55
  isStackable: false,
39
56
  createdAt: '2022-06-04T03:18:09.335Z',
40
57
  updatedAt: '2022-06-04T18:16:49.056Z',
58
+ isTwoHanded: false,
59
+ hasUseWith: false,
60
+ rarity: ItemRarities.Common
41
61
  },
42
62
  head: {
43
63
  _id: '1',
@@ -68,6 +88,9 @@ export const items: any = {
68
88
  isStackable: false,
69
89
  createdAt: '2022-06-04T03:18:09.335Z',
70
90
  updatedAt: '2022-06-04T18:16:49.056Z',
91
+ isTwoHanded: false,
92
+ hasUseWith: false,
93
+ rarity: ItemRarities.Common
71
94
  },
72
95
  armor: {
73
96
  _id: '2',
@@ -99,6 +122,9 @@ export const items: any = {
99
122
  fullDescription: 'Recover your life',
100
123
  createdAt: '2022-06-04T03:18:09.335Z',
101
124
  updatedAt: '2022-06-04T18:16:49.056Z',
125
+ isTwoHanded: false,
126
+ hasUseWith: false,
127
+ rarity: ItemRarities.Common
102
128
  },
103
129
  legs: {
104
130
  _id: '3',
@@ -130,6 +156,9 @@ export const items: any = {
130
156
  fullDescription: 'Leather legs',
131
157
  createdAt: '2022-06-04T03:18:09.335Z',
132
158
  updatedAt: '2022-06-04T18:16:49.056Z',
159
+ isTwoHanded: false,
160
+ hasUseWith: false,
161
+ rarity: ItemRarities.Common
133
162
  },
134
163
  boot: {
135
164
  _id: '4',
@@ -160,6 +189,9 @@ export const items: any = {
160
189
  fullDescription: 'Key to open things',
161
190
  createdAt: '2022-06-04T03:18:09.335Z',
162
191
  updatedAt: '2022-06-04T18:16:49.056Z',
192
+ isTwoHanded: false,
193
+ hasUseWith: false,
194
+ rarity: ItemRarities.Common
163
195
  },
164
196
  neck: {
165
197
  _id: '5',
@@ -191,6 +223,9 @@ export const items: any = {
191
223
  fullDescription: 'Somes shard, some crafts.',
192
224
  createdAt: '2022-06-04T03:18:09.335Z',
193
225
  updatedAt: '2022-06-04T18:16:49.056Z',
226
+ isTwoHanded: false,
227
+ hasUseWith: false,
228
+ rarity: ItemRarities.Common
194
229
  },
195
230
  ring: {
196
231
  _id: '6',
@@ -222,6 +257,9 @@ export const items: any = {
222
257
  fullDescription: 'Use this axe to chop wood and stuffs.',
223
258
  createdAt: '2022-06-04T03:18:09.335Z',
224
259
  updatedAt: '2022-06-04T18:16:49.056Z',
260
+ isTwoHanded: false,
261
+ hasUseWith: false,
262
+ rarity: ItemRarities.Common
225
263
  },
226
264
  accessory: {
227
265
  _id: '392acek4j7c8e80d2fs60404',
@@ -241,7 +279,7 @@ export const items: any = {
241
279
  isItemContainer: true,
242
280
  isSolid: false,
243
281
  key: 'stone',
244
- texturePath: 'ranged-weapons/stone-qty-1.png',
282
+ texturePath: 'ranged-weapons/stone-qty-5.png',
245
283
  textureKey: 'stone',
246
284
  name: 'stone',
247
285
  generateContainerSlots: 10,
@@ -256,6 +294,7 @@ export const items: any = {
256
294
  fullDescription: 'You see a stone. It is used with slingshot',
257
295
  createdAt: '2022-06-04T03:18:09.335Z',
258
296
  updatedAt: '2022-06-04T18:16:49.056Z',
297
+ rarity: ItemRarities.Common
259
298
  },
260
299
  inventory: {
261
300
  _id: '8',
@@ -273,7 +312,7 @@ export const items: any = {
273
312
  isSolid: false,
274
313
  key: 'backpack',
275
314
  texturePath: 'containers/backpack.png',
276
- textureKey: 'backpack',
315
+ textureKey: 'containers/backpack.png',
277
316
  name: 'backpack',
278
317
  description: 'Open the gates, but use the key!',
279
318
  attack: 7,
@@ -298,6 +337,9 @@ export const items: any = {
298
337
  updatedAt: '2022-06-19T06:09:57.971Z',
299
338
  isEmpty: true,
300
339
  },
340
+ isTwoHanded: false,
341
+ hasUseWith: false,
342
+ rarity: ItemRarities.Common
301
343
  },
302
344
  rightHand: {
303
345
  _id: '629acef1c7c8e8002ff60736',
@@ -330,6 +372,9 @@ export const items: any = {
330
372
  isStackable: false,
331
373
  createdAt: '2022-06-04T03:18:09.335Z',
332
374
  updatedAt: '2022-06-04T18:16:49.056Z',
375
+ isTwoHanded: false,
376
+ hasUseWith: false,
377
+ rarity: ItemRarities.Common
333
378
  },
334
379
  };
335
380
 
@@ -1,9 +1,8 @@
1
1
  import {
2
2
  IItem,
3
- IItemContainer,
4
- ItemSlotType,
3
+ IItemContainer, ItemRarities, ItemSlotType,
5
4
  ItemSubType,
6
- ItemType,
5
+ ItemType
7
6
  } from '@rpg-engine/shared';
8
7
 
9
8
  export const items: IItem[] = [
@@ -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.Legendary
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.Epic
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.Uncommon
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.Rare
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,9 +245,10 @@ 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
- _id: '392acek4j7c8e80d2ff60404',
251
+ _id: '392acek4j7c8e80d2fs60404',
246
252
  hasUseWith: false,
247
253
  type: ItemType.Accessory,
248
254
  subType: ItemSubType.Ranged,
@@ -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',
@@ -455,7 +467,7 @@ export const items: IItem[] = [
455
467
  isEquipable: true,
456
468
  isStackable: true,
457
469
  maxStackSize: 100,
458
- stackQty: 3.75,
470
+ stackQty: 203.23,
459
471
  isUsable: false,
460
472
  isStorable: true,
461
473
  isTwoHanded: false,
@@ -478,7 +490,43 @@ 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
  },
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
+ }
482
530
  ];
483
531
 
484
532
  export const itemContainerMock: IItemContainer = {
@@ -501,7 +549,7 @@ export const itemContainerMock: IItemContainer = {
501
549
  11: items[11],
502
550
  12: items[12],
503
551
  13: items[13],
504
- // 14: items[14],
552
+ 14: items[14],
505
553
  //remaining slots are considered null by default
506
554
  },
507
555
  allowedItemTypes: [],
@@ -1,4 +1,4 @@
1
- import { SkillType } from '@rpg-engine/shared';
1
+ import { ISkill, SkillType } from '@rpg-engine/shared';
2
2
 
3
3
  export const skillMock = {
4
4
  _id: '62aebda8785a9f0089a4f757',
@@ -110,6 +110,12 @@ 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
+ },
113
119
  level: 2,
114
120
  xpGainRate: 100,
115
121
  experience: 31,
@@ -119,4 +125,4 @@ export const skillMock = {
119
125
  createdAt: '2022-06-19T06:09:44.661Z',
120
126
  updatedAt: '2022-06-19T06:09:44.661Z',
121
127
  __v: 0,
122
- };
128
+ } as ISkill;
@@ -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 '../../src/components/Chat/Chat';
5
- import { RPGUIRoot } from '../../src/components/RPGUIRoot';
4
+ import { Chat } from '../components/Chat/Chat';
5
+ import { RPGUIRoot } from '../components/RPGUIRoot';
6
6
 
7
7
  const meta: Meta = {
8
8
  title: 'Chat',
@@ -152,6 +152,20 @@ 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
+ },
155
169
  ];
156
170
 
157
171
  const Template: Story<IChatMessage> = args => (
@@ -160,8 +174,11 @@ const Template: Story<IChatMessage> = args => (
160
174
  onSendChatMessage={msg => console.log(msg)}
161
175
  chatMessages={chatMessagesMock}
162
176
  opacity={0.5}
163
- height={'200px'}
177
+ styles={{
178
+ height: '200px',
179
+ }}
164
180
  onCloseButton={() => console.log('closing chat...')}
181
+ sendMessage={true}
165
182
  {...args}
166
183
  />
167
184
  </RPGUIRoot>
@@ -0,0 +1,170 @@
1
+ import { ChatMessageType, IChatMessage } from '@rpg-engine/shared';
2
+ import { Meta, Story } from '@storybook/react';
3
+ import React from 'react';
4
+ import { ChatDeprecated } from '../components/Chatdeprecated/ChatDeprecated';
5
+ import { RPGUIRoot } from '../components/RPGUIRoot';
6
+
7
+ const meta: Meta = {
8
+ title: 'ChatDeprecated',
9
+ component: ChatDeprecated,
10
+ };
11
+
12
+ export default meta;
13
+
14
+ const chatMessagesMock = [
15
+ {
16
+ _id: 'test-id-1',
17
+ message: 'test message',
18
+ emitter: {
19
+ _id: 'someid',
20
+ name: 'Guilherme',
21
+ },
22
+ type: ChatMessageType.Global,
23
+ x: 128,
24
+ y: 128,
25
+ scene: 'MainScene',
26
+ createdAt: '2020-08-20T16:00:00.000Z',
27
+ updatedAt: '2020-08-20T16:00:00.000Z',
28
+ },
29
+ {
30
+ _id: 'test-id-1',
31
+ message: 'test message',
32
+ emitter: {
33
+ _id: 'someid',
34
+ name: 'Guilherme',
35
+ },
36
+ type: ChatMessageType.Global,
37
+ x: 128,
38
+ y: 128,
39
+ scene: 'MainScene',
40
+ createdAt: '2020-08-20T16:00:00.000Z',
41
+ updatedAt: '2020-08-20T16:00:00.000Z',
42
+ },
43
+ {
44
+ _id: 'test-id-2',
45
+ message: 'Good morning!',
46
+ emitter: {
47
+ _id: 'someid',
48
+ name: 'Guilherme',
49
+ },
50
+ type: ChatMessageType.Global,
51
+ x: 128,
52
+ y: 128,
53
+ scene: 'MainScene',
54
+ createdAt: '2020-08-20T16:00:00.000Z',
55
+ updatedAt: '2020-08-20T16:00:00.000Z',
56
+ },
57
+ {
58
+ _id: 'test-id-3',
59
+ message: 'How are you doing?',
60
+ emitter: {
61
+ _id: 'someid',
62
+ name: 'Guilherme',
63
+ },
64
+ type: ChatMessageType.Global,
65
+ x: 128,
66
+ y: 128,
67
+ scene: 'MainScene',
68
+ createdAt: '2020-08-20T16:00:00.000Z',
69
+ updatedAt: '2020-08-20T16:00:00.000Z',
70
+ },
71
+ {
72
+ _id: 'test-id-4',
73
+ message: 'Hey hey hey!!!',
74
+ emitter: {
75
+ _id: 'someid',
76
+ name: 'Guilherme',
77
+ },
78
+ type: ChatMessageType.Global,
79
+ x: 128,
80
+ y: 128,
81
+ scene: 'MainScene',
82
+ createdAt: '2020-08-20T16:00:00.000Z',
83
+ updatedAt: '2020-08-20T16:00:00.000Z',
84
+ },
85
+ {
86
+ _id: 'test-id-5',
87
+ message: 'BITCONNEEEEEEEEECT!',
88
+ emitter: {
89
+ _id: 'someid',
90
+ name: 'Guilherme',
91
+ },
92
+ type: ChatMessageType.Global,
93
+ x: 128,
94
+ y: 128,
95
+ scene: 'MainScene',
96
+ createdAt: '2020-08-20T16:00:00.000Z',
97
+ updatedAt: '2020-08-20T16:00:00.000Z',
98
+ },
99
+ {
100
+ _id: 'test-id-6',
101
+ message: 'BITCONNEEEEEEEEECT!',
102
+ emitter: {
103
+ _id: 'someid',
104
+ name: 'Guilherme',
105
+ },
106
+ type: ChatMessageType.Global,
107
+ x: 128,
108
+ y: 128,
109
+ scene: 'MainScene',
110
+ createdAt: '2020-08-20T16:00:00.000Z',
111
+ updatedAt: '2020-08-20T16:00:00.000Z',
112
+ },
113
+ {
114
+ _id: 'test-id-7',
115
+ message: 'BITCONNEEEEEEEEECT!',
116
+ emitter: {
117
+ _id: 'someid',
118
+ name: 'Guilherme',
119
+ },
120
+ type: ChatMessageType.Global,
121
+ x: 128,
122
+ y: 128,
123
+ scene: 'MainScene',
124
+ createdAt: '2020-08-20T16:00:00.000Z',
125
+ updatedAt: '2020-08-20T16:00:00.000Z',
126
+ },
127
+ {
128
+ _id: 'test-id-8',
129
+ message: 'BITCONNEEEEEEEEECT!',
130
+ emitter: {
131
+ _id: 'someid',
132
+ name: 'Guilherme',
133
+ },
134
+ type: ChatMessageType.Global,
135
+ x: 128,
136
+ y: 128,
137
+ scene: 'MainScene',
138
+ createdAt: '2020-08-20T16:00:00.000Z',
139
+ updatedAt: '2020-08-20T16:00:00.000Z',
140
+ },
141
+ {
142
+ _id: 'test-id-9',
143
+ message: 'BITCONNEEEEEEEEECT!',
144
+ emitter: {
145
+ _id: 'someid',
146
+ name: 'Guilherme',
147
+ },
148
+ type: ChatMessageType.Global,
149
+ x: 128,
150
+ y: 128,
151
+ scene: 'MainScene',
152
+ createdAt: '2020-08-20T16:00:00.000Z',
153
+ updatedAt: '2020-08-20T16:00:00.000Z',
154
+ },
155
+ ];
156
+
157
+ const Template: Story<IChatMessage> = args => (
158
+ <RPGUIRoot>
159
+ <ChatDeprecated
160
+ onSendChatMessage={msg => console.log(msg)}
161
+ chatMessages={chatMessagesMock}
162
+ opacity={0.5}
163
+ height={'200px'}
164
+ onCloseButton={() => console.log('closing chat...')}
165
+ {...args}
166
+ />
167
+ </RPGUIRoot>
168
+ );
169
+
170
+ export const Default = Template.bind({});
@@ -0,0 +1,33 @@
1
+ import { Meta, Story } from '@storybook/react';
2
+ import React from 'react';
3
+ import { RPGUIRoot } from '..';
4
+ import {
5
+ CircularController,
6
+ CircularControllerProps,
7
+ } from '../components/CircularController/CircularController';
8
+ import { SPELL_SHORTCUTS_STORAGE_KEY } from '../components/Spellbook/constants';
9
+
10
+ const meta: Meta = {
11
+ title: 'Circular Controller',
12
+ component: CircularController,
13
+ };
14
+
15
+ export default meta;
16
+
17
+ const Template: Story<CircularControllerProps> = args => (
18
+ <RPGUIRoot>
19
+ <CircularController {...args} />
20
+ </RPGUIRoot>
21
+ );
22
+
23
+ export const Default = Template.bind({});
24
+
25
+ Default.args = {
26
+ spells: JSON.parse(
27
+ localStorage.getItem(SPELL_SHORTCUTS_STORAGE_KEY) as string
28
+ ),
29
+ onSpellClick: key => console.log(key),
30
+ onActionClick: () => console.log('action'),
31
+ onCancelClick: () => console.log('cancel attack'),
32
+ mana: 100,
33
+ };
@@ -0,0 +1,40 @@
1
+ import { Meta, Story } from '@storybook/react';
2
+ import React from 'react';
3
+ import { RPGUIRoot } from '..';
4
+ import { CraftBook } from '../components/CraftBook/CraftBook';
5
+ import { craftableItems } from '../components/CraftBook/MockItems';
6
+ import atlasJSON from '../mocks/atlas/items/items.json';
7
+ import atlasIMG from '../mocks/atlas/items/items.png';
8
+
9
+ const meta: Meta = {
10
+ title: 'Craft Book',
11
+ component: CraftBook,
12
+ };
13
+
14
+ export default meta;
15
+
16
+ const Template: Story = args => (
17
+ <RPGUIRoot>
18
+ <CraftBook
19
+ atlasIMG={atlasIMG}
20
+ atlasJSON={atlasJSON}
21
+ onSelect={onSelect}
22
+ onClose={() => console.log('closing Equipment Set Container')}
23
+ craftablesItems={craftableItems}
24
+ onCraftItem={onCraftItem}
25
+ {...args}
26
+ />
27
+ </RPGUIRoot>
28
+ );
29
+
30
+ export const Default = Template.bind({});
31
+
32
+ const onCraftItem = (value: string | undefined) => {
33
+ console.log('Craft', value);
34
+ };
35
+
36
+ const onSelect = (value: string) => {
37
+ console.log('Story package', value);
38
+ };
39
+
40
+ Default.args = {};
@@ -0,0 +1,41 @@
1
+ import { Meta, Story } from '@storybook/react';
2
+ import React from 'react';
3
+ import { RPGUIRoot } from '..';
4
+ import {
5
+ DropdownSelectorContainer,
6
+ IDropdownSelectorContainer,
7
+ } from '../components/DropdownSelectorContainer';
8
+
9
+ const meta: Meta = {
10
+ title: 'DropdownSelectorContainer',
11
+ component: DropdownSelectorContainer,
12
+ };
13
+
14
+ export default meta;
15
+
16
+ const Template: Story<IDropdownSelectorContainer> = args => (
17
+ <RPGUIRoot>
18
+ <DropdownSelectorContainer {...args} details="There are server details" />
19
+ </RPGUIRoot>
20
+ );
21
+
22
+ export const Default = Template.bind({});
23
+
24
+ Default.args = {
25
+ title: 'Choose a server',
26
+ onChange: () => {},
27
+ options: [
28
+ {
29
+ id: 'europe-germany',
30
+ name: 'Europe (Germany)',
31
+ },
32
+ {
33
+ id: 'europe-uk',
34
+ name: 'Europe (UK)',
35
+ },
36
+ {
37
+ id: 'america-us',
38
+ name: 'America',
39
+ },
40
+ ],
41
+ };