@rpg-engine/long-bow 0.5.13 → 0.5.15
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/components/Chat/Chat.d.ts +3 -4
- package/dist/components/ChatRevamp/ChatRevamp.d.ts +28 -0
- package/dist/components/ChatRevamp/SearchCharacter.d.ts +14 -0
- package/dist/components/Multitab/TabBody.d.ts +2 -0
- package/dist/components/TradingMenu/TradingItemRow.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +247 -75
- 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 +249 -78
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/ChatRevamp.stories.d.ts +6 -0
- package/package.json +2 -2
- package/src/components/Chat/Chat.tsx +16 -7
- package/src/components/ChatRevamp/ChatRevamp.tsx +121 -0
- package/src/components/ChatRevamp/SearchCharacter.tsx +163 -0
- package/src/components/Item/Inventory/ItemContainer.tsx +3 -56
- package/src/components/Multitab/Tab.tsx +3 -2
- package/src/components/Multitab/TabBody.tsx +17 -3
- package/src/components/Multitab/TabsContainer.tsx +2 -2
- package/src/components/Spellbook/mockSpells.ts +10 -5
- package/src/components/TradingMenu/TradingItemRow.tsx +58 -0
- package/src/components/TradingMenu/TradingMenu.tsx +1 -0
- package/src/index.tsx +1 -0
- package/src/mocks/itemContainer.mocks.ts +35 -31
- package/src/stories/ChatRevamp.stories.tsx +248 -0
package/src/index.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './components/Button';
|
|
2
2
|
export * from './components/Character/CharacterSelection';
|
|
3
3
|
export * from './components/Chat/Chat';
|
|
4
|
+
export * from './components/ChatRevamp/ChatRevamp';
|
|
4
5
|
export * from './components/Chatdeprecated/ChatDeprecated';
|
|
5
6
|
export * from './components/CheckButton';
|
|
6
7
|
export * from './components/CircularController/CircularController';
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
ItemSlotType,
|
|
6
6
|
ItemSubType,
|
|
7
7
|
ItemType,
|
|
8
|
+
UserAccountTypes,
|
|
8
9
|
} from '@rpg-engine/shared';
|
|
9
10
|
|
|
10
11
|
export const items: IItem[] = [
|
|
@@ -42,16 +43,20 @@ export const items: IItem[] = [
|
|
|
42
43
|
createdAt: '2022-06-04T03:18:09.335Z',
|
|
43
44
|
updatedAt: '2022-06-04T18:16:49.056Z',
|
|
44
45
|
rarity: ItemRarities.Legendary,
|
|
46
|
+
canBePurchasedOnlyByPremiumPlans: [
|
|
47
|
+
UserAccountTypes.PremiumGold,
|
|
48
|
+
UserAccountTypes.PremiumUltimate,
|
|
49
|
+
],
|
|
45
50
|
minRequirements: {
|
|
46
51
|
level: 10,
|
|
47
52
|
skill: {
|
|
48
53
|
name: 'sword',
|
|
49
54
|
level: 5,
|
|
50
|
-
}
|
|
55
|
+
},
|
|
51
56
|
},
|
|
52
|
-
equippedBuffDescription:
|
|
57
|
+
equippedBuffDescription: 'Character speed +10%',
|
|
53
58
|
entityEffectChance: 50,
|
|
54
|
-
entityEffects: ['freezing']
|
|
59
|
+
entityEffects: ['freezing'],
|
|
55
60
|
},
|
|
56
61
|
{
|
|
57
62
|
_id: '629acef1c7c8e8002ff73564',
|
|
@@ -541,36 +546,36 @@ export const items: IItem[] = [
|
|
|
541
546
|
rarity: ItemRarities.Common,
|
|
542
547
|
},
|
|
543
548
|
{
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
549
|
+
type: ItemType.Consumable,
|
|
550
|
+
subType: ItemSubType.Food,
|
|
551
|
+
rarity: 'Common',
|
|
552
|
+
textureAtlas: 'items',
|
|
553
|
+
allowedEquipSlotType: [],
|
|
554
|
+
maxStackSize: 100,
|
|
555
|
+
isUsable: false,
|
|
556
|
+
isStorable: true,
|
|
557
|
+
isItemContainer: false,
|
|
558
|
+
isSolid: false,
|
|
559
|
+
requiredAmmoKeys: [],
|
|
560
|
+
isTwoHanded: false,
|
|
561
|
+
hasUseWith: false,
|
|
562
|
+
entityEffects: [],
|
|
563
|
+
entityEffectChance: 0,
|
|
564
|
+
_id: '64529049d45546003b2c6c6d',
|
|
565
|
+
key: 'apple',
|
|
566
|
+
texturePath: 'foods/apple.png',
|
|
562
567
|
textureKey: 'apple',
|
|
563
568
|
isEquipable: false,
|
|
564
569
|
isStackable: true,
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
fullDescription:
|
|
572
|
-
usableEffectDescription:
|
|
573
|
-
}
|
|
570
|
+
name: 'Apple',
|
|
571
|
+
description: 'A red apple.',
|
|
572
|
+
weight: 0.05,
|
|
573
|
+
stackQty: 16,
|
|
574
|
+
attack: 0,
|
|
575
|
+
defense: 0,
|
|
576
|
+
fullDescription: '',
|
|
577
|
+
usableEffectDescription: 'Regenerates 10 HP and Mana 5 times',
|
|
578
|
+
},
|
|
574
579
|
];
|
|
575
580
|
|
|
576
581
|
export const itemContainerMock: IItemContainer = {
|
|
@@ -595,7 +600,6 @@ export const itemContainerMock: IItemContainer = {
|
|
|
595
600
|
13: items[13],
|
|
596
601
|
14: items[14],
|
|
597
602
|
15: items[15],
|
|
598
|
-
21: items[15],
|
|
599
603
|
//remaining slots are considered null by default
|
|
600
604
|
},
|
|
601
605
|
allowedItemTypes: [],
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { ChatMessageType } from '@rpg-engine/shared';
|
|
2
|
+
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import {
|
|
5
|
+
ChatRevamp,
|
|
6
|
+
IChatRevampProps,
|
|
7
|
+
} from '../components/ChatRevamp/ChatRevamp';
|
|
8
|
+
import { RPGUIRoot } from '../components/RPGUIRoot';
|
|
9
|
+
|
|
10
|
+
const meta: Meta = {
|
|
11
|
+
title: 'ChatRevamp',
|
|
12
|
+
component: ChatRevamp,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
|
|
17
|
+
const chatMessagesMock = [
|
|
18
|
+
{
|
|
19
|
+
_id: 'test-id-1',
|
|
20
|
+
message: 'test message',
|
|
21
|
+
emitter: {
|
|
22
|
+
_id: 'someid',
|
|
23
|
+
name: 'Guilherme',
|
|
24
|
+
},
|
|
25
|
+
type: ChatMessageType.Global,
|
|
26
|
+
x: 128,
|
|
27
|
+
y: 128,
|
|
28
|
+
scene: 'MainScene',
|
|
29
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
30
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
_id: 'test-id-1',
|
|
34
|
+
message: 'test message',
|
|
35
|
+
emitter: {
|
|
36
|
+
_id: 'someid',
|
|
37
|
+
name: 'Guilherme',
|
|
38
|
+
},
|
|
39
|
+
type: ChatMessageType.Global,
|
|
40
|
+
x: 128,
|
|
41
|
+
y: 128,
|
|
42
|
+
scene: 'MainScene',
|
|
43
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
44
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
_id: 'test-id-2',
|
|
48
|
+
message: 'Good morning!',
|
|
49
|
+
emitter: {
|
|
50
|
+
_id: 'someid',
|
|
51
|
+
name: 'Guilherme',
|
|
52
|
+
},
|
|
53
|
+
type: ChatMessageType.Global,
|
|
54
|
+
x: 128,
|
|
55
|
+
y: 128,
|
|
56
|
+
scene: 'MainScene',
|
|
57
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
58
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
_id: 'test-id-3',
|
|
62
|
+
message: 'How are you doing?',
|
|
63
|
+
emitter: {
|
|
64
|
+
_id: 'someid',
|
|
65
|
+
name: 'Guilherme',
|
|
66
|
+
},
|
|
67
|
+
type: ChatMessageType.Global,
|
|
68
|
+
x: 128,
|
|
69
|
+
y: 128,
|
|
70
|
+
scene: 'MainScene',
|
|
71
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
72
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
_id: 'test-id-4',
|
|
76
|
+
message: 'Hey hey hey!!!',
|
|
77
|
+
emitter: {
|
|
78
|
+
_id: 'someid',
|
|
79
|
+
name: 'Guilherme',
|
|
80
|
+
},
|
|
81
|
+
type: ChatMessageType.Global,
|
|
82
|
+
x: 128,
|
|
83
|
+
y: 128,
|
|
84
|
+
scene: 'MainScene',
|
|
85
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
86
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
_id: 'test-id-5',
|
|
90
|
+
message: 'BITCONNEEEEEEEEECT!',
|
|
91
|
+
emitter: {
|
|
92
|
+
_id: 'someid',
|
|
93
|
+
name: 'Guilherme',
|
|
94
|
+
},
|
|
95
|
+
type: ChatMessageType.Global,
|
|
96
|
+
x: 128,
|
|
97
|
+
y: 128,
|
|
98
|
+
scene: 'MainScene',
|
|
99
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
100
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
_id: 'test-id-6',
|
|
104
|
+
message: 'BITCONNEEEEEEEEECT!',
|
|
105
|
+
emitter: {
|
|
106
|
+
_id: 'someid',
|
|
107
|
+
name: 'Guilherme',
|
|
108
|
+
},
|
|
109
|
+
type: ChatMessageType.Global,
|
|
110
|
+
x: 128,
|
|
111
|
+
y: 128,
|
|
112
|
+
scene: 'MainScene',
|
|
113
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
114
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
_id: 'test-id-7',
|
|
118
|
+
message: 'BITCONNEEEEEEEEECT!',
|
|
119
|
+
emitter: {
|
|
120
|
+
_id: 'someid',
|
|
121
|
+
name: 'Guilherme',
|
|
122
|
+
},
|
|
123
|
+
type: ChatMessageType.Global,
|
|
124
|
+
x: 128,
|
|
125
|
+
y: 128,
|
|
126
|
+
scene: 'MainScene',
|
|
127
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
128
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
_id: 'test-id-8',
|
|
132
|
+
message: 'BITCONNEEEEEEEEECT!',
|
|
133
|
+
emitter: {
|
|
134
|
+
_id: 'someid',
|
|
135
|
+
name: 'Guilherme',
|
|
136
|
+
},
|
|
137
|
+
type: ChatMessageType.Global,
|
|
138
|
+
x: 128,
|
|
139
|
+
y: 128,
|
|
140
|
+
scene: 'MainScene',
|
|
141
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
142
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
_id: 'test-id-9',
|
|
146
|
+
message: 'BITCONNEEEEEEEEECT!',
|
|
147
|
+
emitter: {
|
|
148
|
+
_id: 'someid',
|
|
149
|
+
name: 'Guilherme',
|
|
150
|
+
},
|
|
151
|
+
type: ChatMessageType.Global,
|
|
152
|
+
x: 128,
|
|
153
|
+
y: 128,
|
|
154
|
+
scene: 'MainScene',
|
|
155
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
156
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
_id: 'test-id-9',
|
|
160
|
+
message: '22222EEECT!',
|
|
161
|
+
emitter: {
|
|
162
|
+
_id: 'someid',
|
|
163
|
+
name: 'Guilherme',
|
|
164
|
+
},
|
|
165
|
+
type: ChatMessageType.Global,
|
|
166
|
+
x: 128,
|
|
167
|
+
y: 128,
|
|
168
|
+
scene: 'MainScene',
|
|
169
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
170
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
_id: 'test-id-9',
|
|
174
|
+
message: '22222EEECT!',
|
|
175
|
+
emitter: {
|
|
176
|
+
_id: 'someid',
|
|
177
|
+
name: 'Guilherme',
|
|
178
|
+
},
|
|
179
|
+
type: ChatMessageType.Global,
|
|
180
|
+
x: 128,
|
|
181
|
+
y: 128,
|
|
182
|
+
scene: 'MainScene',
|
|
183
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
184
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
_id: 'test-id-9',
|
|
188
|
+
message: '22222EEECT!',
|
|
189
|
+
emitter: {
|
|
190
|
+
_id: 'someid',
|
|
191
|
+
name: 'Guilherme',
|
|
192
|
+
},
|
|
193
|
+
type: ChatMessageType.Global,
|
|
194
|
+
x: 128,
|
|
195
|
+
y: 128,
|
|
196
|
+
scene: 'MainScene',
|
|
197
|
+
createdAt: '2020-08-20T16:00:00.000Z',
|
|
198
|
+
updatedAt: '2020-08-20T16:00:00.000Z',
|
|
199
|
+
},
|
|
200
|
+
];
|
|
201
|
+
|
|
202
|
+
const tabsMock = [
|
|
203
|
+
{ label: 'Global', id: 'global' },
|
|
204
|
+
{ label: 'Private', id: 'private' },
|
|
205
|
+
];
|
|
206
|
+
|
|
207
|
+
const recentPrivateChatCharactersMock = [
|
|
208
|
+
{ _id: 'someid', name: 'Guilherme' },
|
|
209
|
+
{ _id: 'someid2', name: 'Guilherme2' },
|
|
210
|
+
];
|
|
211
|
+
|
|
212
|
+
const Template: Story<IChatRevampProps> = args => (
|
|
213
|
+
<RPGUIRoot>
|
|
214
|
+
<ChatRevamp {...args} />
|
|
215
|
+
</RPGUIRoot>
|
|
216
|
+
);
|
|
217
|
+
|
|
218
|
+
export const Default = Template.bind({});
|
|
219
|
+
|
|
220
|
+
Default.args = {
|
|
221
|
+
onSendGlobalChatMessage: () => {},
|
|
222
|
+
onChangeCharacterName: () => {},
|
|
223
|
+
chatMessages: chatMessagesMock,
|
|
224
|
+
opacity: 0.5,
|
|
225
|
+
styles: { width: `calc(100% - 0.5rem * 2)`, height: '200px' },
|
|
226
|
+
onCloseButton: () => console.log('closing chat...'),
|
|
227
|
+
tabs: tabsMock,
|
|
228
|
+
privateChatCharacters: recentPrivateChatCharactersMock,
|
|
229
|
+
activeTab: 'global',
|
|
230
|
+
onChangeTab: () => {},
|
|
231
|
+
onSendPrivateChatMessage: () => {},
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
export const PrivateCharacters = Template.bind({});
|
|
235
|
+
|
|
236
|
+
PrivateCharacters.args = {
|
|
237
|
+
onSendGlobalChatMessage: () => {},
|
|
238
|
+
onChangeCharacterName: () => {},
|
|
239
|
+
chatMessages: chatMessagesMock,
|
|
240
|
+
opacity: 0.5,
|
|
241
|
+
styles: { width: `calc(100% - 0.5rem * 2)`, height: '200px' },
|
|
242
|
+
onCloseButton: () => {},
|
|
243
|
+
tabs: tabsMock,
|
|
244
|
+
privateChatCharacters: recentPrivateChatCharactersMock,
|
|
245
|
+
activeTab: 'private',
|
|
246
|
+
onChangeTab: () => {},
|
|
247
|
+
onSendPrivateChatMessage: () => {},
|
|
248
|
+
};
|