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