@rpg-engine/long-bow 0.4.6 → 0.4.8
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/ConfirmModal.d.ts +8 -0
- package/dist/components/DraggableContainer.d.ts +1 -0
- package/dist/components/Item/Inventory/ItemSlot.d.ts +7 -7
- package/dist/components/Marketplace/BuyPanel.d.ts +22 -0
- package/dist/components/Marketplace/ManagmentPanel.d.ts +18 -0
- package/dist/components/Marketplace/Marketplace.d.ts +22 -9
- package/dist/components/Marketplace/MarketplaceRows.d.ts +3 -1
- package/dist/components/Marketplace/{__mocks__ → filters}/index.d.ts +1 -3
- package/dist/components/Pager.d.ts +9 -0
- package/dist/components/SkillProgressBar.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +552 -147
- 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 +552 -147
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/ConfirmModal.tsx +87 -0
- package/src/components/DraggableContainer.tsx +3 -0
- package/src/components/Dropdown.tsx +14 -6
- package/src/components/Item/Inventory/ItemSlot.tsx +31 -16
- package/src/components/Marketplace/BuyPanel.tsx +296 -0
- package/src/components/Marketplace/ManagmentPanel.tsx +247 -0
- package/src/components/Marketplace/Marketplace.tsx +74 -100
- package/src/components/Marketplace/MarketplaceRows.tsx +82 -92
- package/src/components/Marketplace/{__mocks__ → filters}/index.tsx +13 -11
- package/src/components/Pager.tsx +94 -0
- package/src/components/SkillProgressBar.tsx +69 -4
- package/src/components/SkillsContainer.tsx +1 -0
- package/src/components/Spellbook/Spell.tsx +0 -1
- package/src/components/Spellbook/Spellbook.tsx +1 -17
- package/src/components/Spellbook/mockSpells.ts +68 -68
- package/src/components/shared/Ellipsis.tsx +10 -2
- package/src/mocks/skills.mocks.ts +2 -0
- package/src/stories/Marketplace.stories.tsx +22 -11
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import { ItemRarities,
|
|
1
|
+
import { ItemRarities, ItemSubType } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { IOptionsProps } from '../../Dropdown';
|
|
4
4
|
|
|
5
5
|
export enum OrderByType {
|
|
6
6
|
Name = 'Name',
|
|
7
|
-
Rarity = 'Rarity',
|
|
8
7
|
Price = 'Price',
|
|
9
|
-
DateAdded = 'Date Added',
|
|
10
8
|
}
|
|
11
9
|
|
|
12
|
-
export const itemTypeOptions: IOptionsProps[] =
|
|
13
|
-
|
|
10
|
+
export const itemTypeOptions: IOptionsProps[] = [
|
|
11
|
+
'Type',
|
|
12
|
+
...Object.keys(ItemSubType),
|
|
13
|
+
]
|
|
14
|
+
.filter(type => type !== 'DeadBody')
|
|
15
|
+
.map((itemType, index) => ({
|
|
14
16
|
id: index + 1,
|
|
15
17
|
value: itemType,
|
|
16
18
|
option: itemType,
|
|
17
|
-
})
|
|
18
|
-
);
|
|
19
|
+
}));
|
|
19
20
|
|
|
20
|
-
export const itemRarityOptions: IOptionsProps[] =
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
export const itemRarityOptions: IOptionsProps[] = [
|
|
22
|
+
'Rarity',
|
|
23
|
+
...Object.values(ItemRarities),
|
|
24
|
+
].map((itemRarity, index) => ({
|
|
23
25
|
id: index + 1,
|
|
24
26
|
value: itemRarity,
|
|
25
27
|
option: itemRarity,
|
|
@@ -30,7 +32,7 @@ export const orderByOptions: IOptionsProps[] = Object.values(
|
|
|
30
32
|
).flatMap((orderBy, index) => [
|
|
31
33
|
{
|
|
32
34
|
id: index * 2 + 1,
|
|
33
|
-
value: orderBy,
|
|
35
|
+
value: orderBy.toLowerCase(),
|
|
34
36
|
option: (
|
|
35
37
|
<>
|
|
36
38
|
{orderBy}{' '}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { uiColors } from '../constants/uiColors';
|
|
4
|
+
import { uiFonts } from '../constants/uiFonts';
|
|
5
|
+
|
|
6
|
+
interface PagerProps {
|
|
7
|
+
totalItems: number;
|
|
8
|
+
currentPage: number;
|
|
9
|
+
itemsPerPage: number;
|
|
10
|
+
onPageChange: (page: number) => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const Pager: React.FC<PagerProps> = ({
|
|
14
|
+
totalItems,
|
|
15
|
+
currentPage,
|
|
16
|
+
itemsPerPage,
|
|
17
|
+
onPageChange,
|
|
18
|
+
}) => {
|
|
19
|
+
const totalPages = Math.ceil(totalItems / itemsPerPage);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Container>
|
|
23
|
+
<p>Total items: {totalItems}</p>
|
|
24
|
+
<PagerContainer>
|
|
25
|
+
<button
|
|
26
|
+
disabled={currentPage === 1}
|
|
27
|
+
onPointerDown={() => onPageChange(Math.max(currentPage - 1, 1))}
|
|
28
|
+
>
|
|
29
|
+
{'<'}
|
|
30
|
+
</button>
|
|
31
|
+
|
|
32
|
+
<div className="rpgui-container framed-grey">{currentPage}</div>
|
|
33
|
+
|
|
34
|
+
<button
|
|
35
|
+
disabled={currentPage === totalPages}
|
|
36
|
+
onPointerDown={() =>
|
|
37
|
+
onPageChange(Math.min(currentPage + 1, totalPages))
|
|
38
|
+
}
|
|
39
|
+
>
|
|
40
|
+
{'>'}
|
|
41
|
+
</button>
|
|
42
|
+
</PagerContainer>
|
|
43
|
+
</Container>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const Container = styled.div`
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
align-items: center;
|
|
51
|
+
|
|
52
|
+
p {
|
|
53
|
+
margin: 0;
|
|
54
|
+
font-size: ${uiFonts.size.xsmall};
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
57
|
+
|
|
58
|
+
const PagerContainer = styled.div`
|
|
59
|
+
display: flex;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
align-items: center;
|
|
62
|
+
gap: 5px;
|
|
63
|
+
|
|
64
|
+
p {
|
|
65
|
+
margin: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
div {
|
|
69
|
+
color: white;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
button {
|
|
73
|
+
width: 40px;
|
|
74
|
+
height: 40px;
|
|
75
|
+
background-color: ${uiColors.darkGray};
|
|
76
|
+
border: none;
|
|
77
|
+
border-radius: 5px;
|
|
78
|
+
color: white;
|
|
79
|
+
|
|
80
|
+
:hover {
|
|
81
|
+
background-color: ${uiColors.lightGray};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:disabled {
|
|
85
|
+
opacity: 0.5;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&.active {
|
|
89
|
+
background-color: ${uiColors.orange};
|
|
90
|
+
font-weight: bold;
|
|
91
|
+
color: black;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
`;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { getSPForLevel } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
+
import { uiColors } from '../constants/uiColors';
|
|
4
5
|
import { ErrorBoundary } from './Item/Inventory/ErrorBoundary';
|
|
5
|
-
import { SpriteFromAtlas } from './shared/SpriteFromAtlas';
|
|
6
6
|
import { SimpleProgressBar } from './SimpleProgressBar';
|
|
7
|
+
import { SpriteFromAtlas } from './shared/SpriteFromAtlas';
|
|
7
8
|
|
|
8
9
|
export interface ISkillProgressBarProps {
|
|
9
10
|
skillName: string;
|
|
@@ -15,6 +16,7 @@ export interface ISkillProgressBarProps {
|
|
|
15
16
|
showSkillPoints?: boolean;
|
|
16
17
|
atlasJSON: any;
|
|
17
18
|
atlasIMG: any;
|
|
19
|
+
buffAndDebuff?: number;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
|
|
@@ -27,6 +29,7 @@ export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
|
|
|
27
29
|
showSkillPoints = true,
|
|
28
30
|
atlasIMG,
|
|
29
31
|
atlasJSON,
|
|
32
|
+
buffAndDebuff,
|
|
30
33
|
}) => {
|
|
31
34
|
if (!skillPointsToNextLevel) {
|
|
32
35
|
skillPointsToNextLevel = getSPForLevel(level + 1);
|
|
@@ -36,12 +39,55 @@ export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
|
|
|
36
39
|
|
|
37
40
|
const ratio = (skillPoints / nextLevelSPWillbe) * 100;
|
|
38
41
|
|
|
42
|
+
const skillsBuffsCalc = () => {
|
|
43
|
+
if (buffAndDebuff) {
|
|
44
|
+
return 1 + buffAndDebuff / 100;
|
|
45
|
+
}
|
|
46
|
+
return;
|
|
47
|
+
};
|
|
48
|
+
|
|
39
49
|
return (
|
|
40
50
|
<>
|
|
41
51
|
<ProgressTitle>
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
{buffAndDebuff !== undefined && (
|
|
53
|
+
<>
|
|
54
|
+
{buffAndDebuff > 0 ? (
|
|
55
|
+
<BuffAndDebuffContainer>
|
|
56
|
+
<TitleNameContainer>
|
|
57
|
+
<TitleNameBuff>{skillName}</TitleNameBuff>
|
|
58
|
+
<TitleNameBuff>
|
|
59
|
+
lv {level} ({skillsBuffsCalc()})
|
|
60
|
+
</TitleNameBuff>
|
|
61
|
+
</TitleNameContainer>
|
|
62
|
+
<TitleNameBuffContainer>
|
|
63
|
+
<TitleNameBuff>(+{buffAndDebuff}%)</TitleNameBuff>
|
|
64
|
+
</TitleNameBuffContainer>
|
|
65
|
+
</BuffAndDebuffContainer>
|
|
66
|
+
) : buffAndDebuff < 0 ? (
|
|
67
|
+
<>
|
|
68
|
+
<TitleNameContainer>
|
|
69
|
+
<TitleNameDebuff>{skillName}</TitleNameDebuff>
|
|
70
|
+
<TitleNameDebuff>
|
|
71
|
+
lv {level} ({skillsBuffsCalc()})
|
|
72
|
+
</TitleNameDebuff>
|
|
73
|
+
</TitleNameContainer>
|
|
74
|
+
<div>
|
|
75
|
+
<TitleNameDebuff>({buffAndDebuff}%)</TitleNameDebuff>
|
|
76
|
+
</div>
|
|
77
|
+
</>
|
|
78
|
+
) : (
|
|
79
|
+
<TitleName>{skillName}</TitleName>
|
|
80
|
+
)}
|
|
81
|
+
</>
|
|
82
|
+
)}
|
|
83
|
+
{!buffAndDebuff && (
|
|
84
|
+
<TitleNameContainer>
|
|
85
|
+
<TitleName>{skillName}</TitleName>
|
|
86
|
+
<ValueDisplay>lv {level}</ValueDisplay>
|
|
87
|
+
</TitleNameContainer>
|
|
88
|
+
)}
|
|
44
89
|
</ProgressTitle>
|
|
90
|
+
|
|
45
91
|
<ProgressBody>
|
|
46
92
|
<ProgressIconContainer>
|
|
47
93
|
{atlasIMG && atlasJSON ? (
|
|
@@ -108,6 +154,16 @@ const TitleName = styled.span`
|
|
|
108
154
|
margin-left: 5px;
|
|
109
155
|
`;
|
|
110
156
|
|
|
157
|
+
const TitleNameBuff = styled.span`
|
|
158
|
+
margin-left: 5px;
|
|
159
|
+
color: ${uiColors.lightGreen} !important;
|
|
160
|
+
`;
|
|
161
|
+
|
|
162
|
+
const TitleNameDebuff = styled.span`
|
|
163
|
+
margin-left: 5px;
|
|
164
|
+
color: ${uiColors.red} !important;
|
|
165
|
+
`;
|
|
166
|
+
|
|
111
167
|
const ValueDisplay = styled.span``;
|
|
112
168
|
|
|
113
169
|
const ProgressIconContainer = styled.div`
|
|
@@ -125,9 +181,18 @@ const ProgressBody = styled.div`
|
|
|
125
181
|
const ProgressTitle = styled.div`
|
|
126
182
|
width: 100%;
|
|
127
183
|
display: flex;
|
|
128
|
-
flex-direction:
|
|
184
|
+
flex-direction: column;
|
|
129
185
|
justify-content: space-between;
|
|
130
186
|
span {
|
|
131
187
|
font-size: 0.6rem;
|
|
132
188
|
}
|
|
133
189
|
`;
|
|
190
|
+
|
|
191
|
+
const BuffAndDebuffContainer = styled.div``;
|
|
192
|
+
|
|
193
|
+
const TitleNameBuffContainer = styled.div``;
|
|
194
|
+
|
|
195
|
+
const TitleNameContainer = styled.div`
|
|
196
|
+
display: flex;
|
|
197
|
+
justify-content: space-between;
|
|
198
|
+
`;
|
|
@@ -38,7 +38,6 @@ export const Spell: React.FC<ISpellProps> = ({
|
|
|
38
38
|
return (
|
|
39
39
|
<SpellInfoWrapper spell={spell}>
|
|
40
40
|
<Container
|
|
41
|
-
disabled={disabled || (activeCooldown ?? 0) > 0}
|
|
42
41
|
onPointerUp={onPointerUp?.bind(null, spellKey)}
|
|
43
42
|
isSettingShortcut={isSettingShortcut && !disabled}
|
|
44
43
|
className="spell"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IShortcut, ISpell } from '@rpg-engine/shared';
|
|
2
|
-
import React, { Fragment,
|
|
2
|
+
import React, { Fragment, useMemo, useState } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { uiFonts } from '../../constants/uiFonts';
|
|
5
5
|
import { DraggableContainer } from '../DraggableContainer';
|
|
@@ -44,20 +44,6 @@ export const Spellbook: React.FC<ISpellbookProps> = ({
|
|
|
44
44
|
const [search, setSearch] = useState('');
|
|
45
45
|
const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);
|
|
46
46
|
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
const handleEscapeClose = (e: KeyboardEvent) => {
|
|
49
|
-
if (e.key === 'Escape') {
|
|
50
|
-
onClose?.();
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
document.addEventListener('keydown', handleEscapeClose);
|
|
55
|
-
|
|
56
|
-
return () => {
|
|
57
|
-
document.removeEventListener('keydown', handleEscapeClose);
|
|
58
|
-
};
|
|
59
|
-
}, [onClose]);
|
|
60
|
-
|
|
61
47
|
const spellsToDisplay = useMemo(() => {
|
|
62
48
|
return spells
|
|
63
49
|
.sort((a, b) => {
|
|
@@ -137,7 +123,6 @@ export const Spellbook: React.FC<ISpellbookProps> = ({
|
|
|
137
123
|
const Title = styled.h1`
|
|
138
124
|
font-size: ${uiFonts.size.large} !important;
|
|
139
125
|
margin-bottom: 0 !important;
|
|
140
|
-
|
|
141
126
|
`;
|
|
142
127
|
|
|
143
128
|
const Container = styled.div`
|
|
@@ -146,7 +131,6 @@ const Container = styled.div`
|
|
|
146
131
|
color: white;
|
|
147
132
|
display: flex;
|
|
148
133
|
flex-direction: column;
|
|
149
|
-
|
|
150
134
|
`;
|
|
151
135
|
|
|
152
136
|
const SpellList = styled.div`
|
|
@@ -3,9 +3,9 @@ import { AnimationEffectKeys, ISpell, SpellCastingType, SpellsBlueprint } from '
|
|
|
3
3
|
|
|
4
4
|
export const mockSpells: ISpell[] = [
|
|
5
5
|
{
|
|
6
|
-
key: SpellsBlueprint.ArrowCreationSpell,
|
|
6
|
+
key: SpellsBlueprint.ArrowCreationSpell + '1' as SpellsBlueprint,
|
|
7
7
|
name: 'Arrow Creation Spell',
|
|
8
|
-
description: 'A spell that creates arrow in your inventory.',
|
|
8
|
+
description: 'A spell that creates arrow in your inventory.1',
|
|
9
9
|
magicWords: 'iquar elandi',
|
|
10
10
|
manaCost: 10,
|
|
11
11
|
minMagicLevelRequired: 3,
|
|
@@ -16,70 +16,70 @@ export const mockSpells: ISpell[] = [
|
|
|
16
16
|
castingAnimationKey: AnimationEffectKeys.SkillLevelUp,
|
|
17
17
|
targetHitAnimationKey: AnimationEffectKeys.Rooted,
|
|
18
18
|
projectileAnimationKey: AnimationEffectKeys.Energy,
|
|
19
|
-
usableEffect: () => {}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
19
|
+
usableEffect: () => { }
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
key: SpellsBlueprint.ArrowCreationSpell + '2' as SpellsBlueprint,
|
|
23
|
+
name: 'Arrow Creation Spell',
|
|
24
|
+
description: 'A spell that creates arrow in your inventory.2',
|
|
25
|
+
magicWords: 'iquar elandi',
|
|
26
|
+
manaCost: 10,
|
|
27
|
+
minMagicLevelRequired: 3,
|
|
28
|
+
castingType: SpellCastingType.RangedCasting,
|
|
29
|
+
minLevelRequired: 1,
|
|
30
|
+
cooldown: 20,
|
|
31
|
+
maxDistanceGrid: 2,
|
|
32
|
+
castingAnimationKey: AnimationEffectKeys.SkillLevelUp,
|
|
33
|
+
targetHitAnimationKey: AnimationEffectKeys.Rooted,
|
|
34
|
+
projectileAnimationKey: AnimationEffectKeys.Energy,
|
|
35
|
+
usableEffect: () => { }
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
key: SpellsBlueprint.ArrowCreationSpell + '3' as SpellsBlueprint,
|
|
39
|
+
name: 'Arrow Creation Spell',
|
|
40
|
+
description: 'A spell that creates arrow in your inventory.3',
|
|
41
|
+
magicWords: 'iquar elandi',
|
|
42
|
+
manaCost: 10,
|
|
43
|
+
minMagicLevelRequired: 3,
|
|
44
|
+
castingType: SpellCastingType.RangedCasting,
|
|
45
|
+
minLevelRequired: 1,
|
|
46
|
+
cooldown: 20,
|
|
47
|
+
maxDistanceGrid: 2,
|
|
48
|
+
castingAnimationKey: AnimationEffectKeys.SkillLevelUp,
|
|
49
|
+
targetHitAnimationKey: AnimationEffectKeys.Rooted,
|
|
50
|
+
projectileAnimationKey: AnimationEffectKeys.Energy,
|
|
51
|
+
usableEffect: () => { }
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
key: SpellsBlueprint.ArrowCreationSpell + '4' as SpellsBlueprint,
|
|
55
|
+
name: 'Arrow Creation Spell',
|
|
56
|
+
description: 'A spell that creates arrow in your inventory.4',
|
|
57
|
+
magicWords: 'iquar elandi',
|
|
58
|
+
manaCost: 10,
|
|
59
|
+
minMagicLevelRequired: 3,
|
|
60
|
+
castingType: SpellCastingType.RangedCasting,
|
|
61
|
+
minLevelRequired: 1,
|
|
62
|
+
cooldown: 20,
|
|
63
|
+
maxDistanceGrid: 2,
|
|
64
|
+
castingAnimationKey: AnimationEffectKeys.SkillLevelUp,
|
|
65
|
+
targetHitAnimationKey: AnimationEffectKeys.Rooted,
|
|
66
|
+
projectileAnimationKey: AnimationEffectKeys.Energy,
|
|
67
|
+
usableEffect: () => { }
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: SpellsBlueprint.ArrowCreationSpell + '5' as SpellsBlueprint,
|
|
71
|
+
name: 'Arrow Creation Spell',
|
|
72
|
+
description: 'A spell that creates arrow in your inventory.5',
|
|
73
|
+
magicWords: 'iquar elandi',
|
|
74
|
+
manaCost: 10,
|
|
75
|
+
minMagicLevelRequired: 3,
|
|
76
|
+
castingType: SpellCastingType.RangedCasting,
|
|
77
|
+
minLevelRequired: 1,
|
|
78
|
+
cooldown: 20,
|
|
79
|
+
maxDistanceGrid: 2,
|
|
80
|
+
castingAnimationKey: AnimationEffectKeys.SkillLevelUp,
|
|
81
|
+
targetHitAnimationKey: AnimationEffectKeys.Rooted,
|
|
82
|
+
projectileAnimationKey: AnimationEffectKeys.Energy,
|
|
83
|
+
usableEffect: () => { }
|
|
84
|
+
},
|
|
85
85
|
];
|
|
@@ -18,7 +18,7 @@ export const Ellipsis = ({
|
|
|
18
18
|
}: IProps) => {
|
|
19
19
|
return (
|
|
20
20
|
<Container maxWidth={maxWidth} fontSize={fontSize} center={center}>
|
|
21
|
-
<
|
|
21
|
+
<span className={`ellipsis-${maxLines}-lines`}>{children}</span>
|
|
22
22
|
</Container>
|
|
23
23
|
);
|
|
24
24
|
};
|
|
@@ -29,8 +29,12 @@ interface IContainerProps {
|
|
|
29
29
|
center?: boolean;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
const Container = styled.
|
|
32
|
+
const Container = styled.span<IContainerProps>`
|
|
33
|
+
display: block;
|
|
34
|
+
margin: 0;
|
|
35
|
+
|
|
33
36
|
.ellipsis-1-lines {
|
|
37
|
+
display: block;
|
|
34
38
|
white-space: nowrap;
|
|
35
39
|
text-overflow: ellipsis;
|
|
36
40
|
overflow: hidden;
|
|
@@ -39,7 +43,9 @@ const Container = styled.div<IContainerProps>`
|
|
|
39
43
|
|
|
40
44
|
${props => props.center && `margin: 0 auto;`}
|
|
41
45
|
}
|
|
46
|
+
|
|
42
47
|
.ellipsis-2-lines {
|
|
48
|
+
display: block;
|
|
43
49
|
display: -webkit-box;
|
|
44
50
|
max-width: ${props => props.maxWidth}px;
|
|
45
51
|
|
|
@@ -52,7 +58,9 @@ const Container = styled.div<IContainerProps>`
|
|
|
52
58
|
overflow: hidden;
|
|
53
59
|
font-size: ${props => props.fontSize};
|
|
54
60
|
}
|
|
61
|
+
|
|
55
62
|
.ellipsis-3-lines {
|
|
63
|
+
display: block;
|
|
56
64
|
display: -webkit-box;
|
|
57
65
|
max-width: ${props => props.maxWidth}px;
|
|
58
66
|
|
|
@@ -13,12 +13,14 @@ export const skillMock = {
|
|
|
13
13
|
level: 1,
|
|
14
14
|
skillPoints: 22,
|
|
15
15
|
skillPointsToNextLevel: 80,
|
|
16
|
+
buffAndDebuff: -10
|
|
16
17
|
},
|
|
17
18
|
magicResistance: {
|
|
18
19
|
type: SkillType.BasicAttributes,
|
|
19
20
|
level: 1,
|
|
20
21
|
skillPoints: 13,
|
|
21
22
|
skillPointsToNextLevel: 80,
|
|
23
|
+
buffAndDebuff: 10,
|
|
22
24
|
},
|
|
23
25
|
strength: {
|
|
24
26
|
type: SkillType.BasicAttributes,
|
|
@@ -2,11 +2,6 @@ import { Meta, Story } from '@storybook/react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { RPGUIRoot } from '..';
|
|
4
4
|
import { Marketplace } from '../components/Marketplace/Marketplace';
|
|
5
|
-
import {
|
|
6
|
-
itemRarityOptions,
|
|
7
|
-
itemTypeOptions,
|
|
8
|
-
orderByOptions,
|
|
9
|
-
} from '../components/Marketplace/__mocks__';
|
|
10
5
|
import atlasJSON from '../mocks/atlas/items/items.json';
|
|
11
6
|
import atlasIMG from '../mocks/atlas/items/items.png';
|
|
12
7
|
import { equipmentSetMock } from '../mocks/equipmentSet.mocks';
|
|
@@ -25,16 +20,32 @@ const Template: Story = () => (
|
|
|
25
20
|
onChangeOrder={value => console.log(value)}
|
|
26
21
|
onChangeRarity={value => console.log(value)}
|
|
27
22
|
onChangeType={value => console.log(value)}
|
|
28
|
-
onChangeNameInput={event => console.log(event
|
|
23
|
+
onChangeNameInput={event => console.log(event)}
|
|
24
|
+
onChangePriceInput={value => console.log(value)}
|
|
25
|
+
onChangeMainLevelInput={value => console.log(value)}
|
|
26
|
+
onChangeSecondaryLevelInput={value => console.log(value)}
|
|
29
27
|
atlasIMG={atlasIMG}
|
|
30
28
|
atlasJSON={atlasJSON}
|
|
31
29
|
onClose={() => console.log('close')}
|
|
32
|
-
items={items
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
items={items.map(item => ({
|
|
31
|
+
item,
|
|
32
|
+
price: Math.round(Math.random() * 1000),
|
|
33
|
+
_id: Math.random().toString(),
|
|
34
|
+
owner: Math.random().toString(),
|
|
35
|
+
}))}
|
|
36
36
|
equipmentSet={equipmentSetMock}
|
|
37
|
-
|
|
37
|
+
onMarketPlaceItemBuy={tradeId => console.log(tradeId)}
|
|
38
|
+
availableGold={0}
|
|
39
|
+
selectedItemToSell={null}
|
|
40
|
+
onSelectedItemToSellRemove={() => console.log('click')}
|
|
41
|
+
onYourPanelToggle={() => console.log('toggle')}
|
|
42
|
+
onAddItemToMarketplace={() => console.log('add')}
|
|
43
|
+
characterId="1"
|
|
44
|
+
onMoneyWithdraw={() => console.log('withdraw')}
|
|
45
|
+
totalItems={100}
|
|
46
|
+
currentPage={1}
|
|
47
|
+
itemsPerPage={30}
|
|
48
|
+
onPageChange={page => console.log(page)}
|
|
38
49
|
/>
|
|
39
50
|
</RPGUIRoot>
|
|
40
51
|
);
|