@rpg-engine/long-bow 0.8.17 → 0.8.19
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/InformationCenter/InformationCenter.d.ts +1 -14
- package/dist/components/InformationCenter/InformationCenterTypes.d.ts +17 -0
- package/dist/components/InformationCenter/sections/bestiary/InformationCenterBestiarySection.d.ts +2 -0
- package/dist/components/InformationCenter/sections/bestiary/InformationCenterNPCDetails.d.ts +2 -0
- package/dist/long-bow.cjs.development.js +53 -21
- 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 +53 -21
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/InformationCenter/InformationCenter.tsx +109 -117
- package/src/components/InformationCenter/InformationCenterTypes.ts +18 -0
- package/src/components/InformationCenter/sections/bestiary/InformationCenterBestiarySection.tsx +6 -0
- package/src/components/InformationCenter/sections/bestiary/InformationCenterNPCDetails.tsx +232 -178
- package/src/components/shared/PaginatedContent/PaginatedContent.tsx +1 -1
- package/src/mocks/informationCenter.mocks.ts +17 -8
- package/src/stories/UI/info/InformationCenter.stories.tsx +5 -0
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ import styled from 'styled-components';
|
|
|
4
4
|
import { InternalTabs } from '../InternalTabs/InternalTabs';
|
|
5
5
|
import {
|
|
6
6
|
IInformationCenterItem,
|
|
7
|
-
|
|
7
|
+
IInformationCenterProps,
|
|
8
8
|
} from './InformationCenterTypes';
|
|
9
9
|
import { InformationCenterBestiarySection } from './sections/bestiary/InformationCenterBestiarySection';
|
|
10
10
|
import { InformationCenterFAQSection } from './sections/faq/InformationCenterFaqSection';
|
|
@@ -27,127 +27,119 @@ export interface IVideoGuide {
|
|
|
27
27
|
category: 'Combat' | 'Crafting' | 'Exploration' | 'General';
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export interface IInformationCenterProps {
|
|
31
|
-
itemsAtlasJSON: Record<string, any>;
|
|
32
|
-
itemsAtlasIMG: string;
|
|
33
|
-
entitiesAtlasJSON: Record<string, any>;
|
|
34
|
-
entitiesAtlasIMG: string;
|
|
35
|
-
faqItems?: IFaqItem[];
|
|
36
|
-
bestiaryItems?: IInformationCenterNPC[];
|
|
37
|
-
videoGuides?: IVideoGuide[];
|
|
38
|
-
items?: IInformationCenterItem[];
|
|
39
|
-
loading?: boolean;
|
|
40
|
-
error?: string;
|
|
41
|
-
initialSearchQuery?: string;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
30
|
export const InformationCenter: React.FC<IInformationCenterProps> = ({
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
31
|
+
itemsAtlasJSON,
|
|
32
|
+
itemsAtlasIMG,
|
|
33
|
+
entitiesAtlasJSON,
|
|
34
|
+
entitiesAtlasIMG,
|
|
35
|
+
iconsAtlasIMG,
|
|
36
|
+
iconsAtlasJSON,
|
|
37
|
+
faqItems = [],
|
|
38
|
+
bestiaryItems = [],
|
|
39
|
+
videoGuides = [],
|
|
40
|
+
items = [],
|
|
41
|
+
loading = false,
|
|
42
|
+
error,
|
|
43
|
+
initialSearchQuery = '',
|
|
44
|
+
}) => {
|
|
45
|
+
const [activeTab, setActiveTab] = useState('bestiary');
|
|
46
|
+
const [
|
|
47
|
+
selectedItem,
|
|
48
|
+
setSelectedItem,
|
|
49
|
+
] = useState<IInformationCenterItem | null>(null);
|
|
62
50
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
51
|
+
if (loading) {
|
|
52
|
+
return <LoadingMessage>Loading...</LoadingMessage>;
|
|
53
|
+
}
|
|
66
54
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
55
|
+
if (error) {
|
|
56
|
+
return <ErrorMessage>{error}</ErrorMessage>;
|
|
57
|
+
}
|
|
70
58
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
59
|
+
const tabs = [
|
|
60
|
+
{
|
|
61
|
+
id: 'bestiary',
|
|
62
|
+
title: 'Bestiary',
|
|
63
|
+
content: (
|
|
64
|
+
<InformationCenterBestiarySection
|
|
65
|
+
bestiaryItems={bestiaryItems}
|
|
66
|
+
itemsAtlasJSON={itemsAtlasJSON}
|
|
67
|
+
itemsAtlasIMG={itemsAtlasIMG}
|
|
68
|
+
iconsAtlasIMG={iconsAtlasIMG}
|
|
69
|
+
iconsAtlasJSON={iconsAtlasJSON}
|
|
70
|
+
entitiesAtlasJSON={entitiesAtlasJSON}
|
|
71
|
+
entitiesAtlasIMG={entitiesAtlasIMG}
|
|
72
|
+
initialSearchQuery={initialSearchQuery}
|
|
73
|
+
tabId="bestiary"
|
|
74
|
+
/>
|
|
75
|
+
),
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: 'items',
|
|
79
|
+
title: 'Items',
|
|
80
|
+
content: (
|
|
81
|
+
<InformationCenterItemsSection
|
|
82
|
+
items={items}
|
|
83
|
+
bestiaryItems={bestiaryItems}
|
|
84
|
+
itemsAtlasJSON={itemsAtlasJSON}
|
|
85
|
+
itemsAtlasIMG={itemsAtlasIMG}
|
|
86
|
+
initialSearchQuery={initialSearchQuery}
|
|
87
|
+
tabId="items"
|
|
88
|
+
/>
|
|
89
|
+
),
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: 'faq',
|
|
93
|
+
title: 'FAQ',
|
|
94
|
+
content: (
|
|
95
|
+
<InformationCenterFAQSection
|
|
96
|
+
faqItems={faqItems}
|
|
97
|
+
initialSearchQuery={initialSearchQuery}
|
|
98
|
+
tabId="faq"
|
|
99
|
+
/>
|
|
100
|
+
),
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: 'tutorials',
|
|
104
|
+
title: 'Tutorials',
|
|
105
|
+
content: (
|
|
106
|
+
<InformationCenterTutorialsSection
|
|
107
|
+
videoGuides={videoGuides}
|
|
108
|
+
initialSearchQuery={initialSearchQuery}
|
|
109
|
+
tabId="tutorials"
|
|
110
|
+
/>
|
|
111
|
+
),
|
|
112
|
+
},
|
|
113
|
+
];
|
|
124
114
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
115
|
+
return (
|
|
116
|
+
<Container>
|
|
117
|
+
<InternalTabs
|
|
118
|
+
tabs={tabs}
|
|
119
|
+
activeTextColor="#000000"
|
|
120
|
+
activeTab={activeTab}
|
|
121
|
+
onTabChange={setActiveTab}
|
|
122
|
+
activeColor="#fef08a"
|
|
123
|
+
inactiveColor="#6b7280"
|
|
124
|
+
borderColor="#f59e0b"
|
|
125
|
+
hoverColor="#fef3c7"
|
|
126
|
+
/>
|
|
127
|
+
{selectedItem && (
|
|
128
|
+
<InformationCenterItemDetails
|
|
129
|
+
item={selectedItem}
|
|
130
|
+
itemsAtlasJSON={itemsAtlasJSON}
|
|
131
|
+
itemsAtlasIMG={itemsAtlasIMG}
|
|
132
|
+
droppedBy={bestiaryItems.filter(npc =>
|
|
133
|
+
npc.loots?.some(
|
|
134
|
+
loot => loot.itemBlueprintKey === selectedItem.key
|
|
135
|
+
)
|
|
136
|
+
)}
|
|
137
|
+
onBack={() => setSelectedItem(null)}
|
|
138
|
+
/>
|
|
139
|
+
)}
|
|
140
|
+
</Container>
|
|
141
|
+
);
|
|
142
|
+
};
|
|
151
143
|
|
|
152
144
|
const Container = styled.div`
|
|
153
145
|
width: 100%;
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
NPCSubtype,
|
|
9
9
|
RangeTypes,
|
|
10
10
|
} from '@rpg-engine/shared';
|
|
11
|
+
import { IFaqItem, IVideoGuide } from './InformationCenter';
|
|
11
12
|
|
|
12
13
|
export enum MovementSpeed {
|
|
13
14
|
ExtraSlow = 1.5,
|
|
@@ -48,6 +49,7 @@ interface INPCBlueprintSpellArea {
|
|
|
48
49
|
spellKey: string;
|
|
49
50
|
probability: number;
|
|
50
51
|
power: string;
|
|
52
|
+
texturePath: string;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
export interface IInformationCenterNPC {
|
|
@@ -85,3 +87,19 @@ export interface IInformationCenterItem extends IEquippableItemBlueprint {
|
|
|
85
87
|
equippedBuff?: ICharacterPermanentBuff[];
|
|
86
88
|
equippedBuffDescription?: string;
|
|
87
89
|
}
|
|
90
|
+
|
|
91
|
+
export interface IInformationCenterProps {
|
|
92
|
+
itemsAtlasJSON: Record<string, any>;
|
|
93
|
+
itemsAtlasIMG: string;
|
|
94
|
+
entitiesAtlasJSON: Record<string, any>;
|
|
95
|
+
entitiesAtlasIMG: string;
|
|
96
|
+
iconsAtlasJSON: any;
|
|
97
|
+
iconsAtlasIMG: any;
|
|
98
|
+
faqItems?: IFaqItem[];
|
|
99
|
+
bestiaryItems?: IInformationCenterNPC[];
|
|
100
|
+
videoGuides?: IVideoGuide[];
|
|
101
|
+
items?: IInformationCenterItem[];
|
|
102
|
+
loading?: boolean;
|
|
103
|
+
error?: string;
|
|
104
|
+
initialSearchQuery?: string;
|
|
105
|
+
}
|
package/src/components/InformationCenter/sections/bestiary/InformationCenterBestiarySection.tsx
CHANGED
|
@@ -13,6 +13,8 @@ interface IBestiarySectionProps {
|
|
|
13
13
|
itemsAtlasIMG: string;
|
|
14
14
|
entitiesAtlasJSON: Record<string, any>;
|
|
15
15
|
entitiesAtlasIMG: string;
|
|
16
|
+
iconsAtlasIMG: any;
|
|
17
|
+
iconsAtlasJSON: any;
|
|
16
18
|
initialSearchQuery: string;
|
|
17
19
|
tabId: string;
|
|
18
20
|
}
|
|
@@ -21,6 +23,8 @@ export const InformationCenterBestiarySection: React.FC<IBestiarySectionProps> =
|
|
|
21
23
|
bestiaryItems,
|
|
22
24
|
itemsAtlasJSON,
|
|
23
25
|
itemsAtlasIMG,
|
|
26
|
+
iconsAtlasIMG,
|
|
27
|
+
iconsAtlasJSON,
|
|
24
28
|
entitiesAtlasJSON,
|
|
25
29
|
entitiesAtlasIMG,
|
|
26
30
|
initialSearchQuery,
|
|
@@ -143,6 +147,8 @@ export const InformationCenterBestiarySection: React.FC<IBestiarySectionProps> =
|
|
|
143
147
|
npc={selectedMonster}
|
|
144
148
|
itemsAtlasJSON={itemsAtlasJSON}
|
|
145
149
|
itemsAtlasIMG={itemsAtlasIMG}
|
|
150
|
+
iconAtlasIMG={iconsAtlasIMG}
|
|
151
|
+
iconAtlasJSON={iconsAtlasJSON}
|
|
146
152
|
entitiesAtlasJSON={entitiesAtlasJSON}
|
|
147
153
|
entitiesAtlasIMG={entitiesAtlasIMG}
|
|
148
154
|
onBack={() => setSelectedMonster(null)}
|