ps99-api 2.3.3 → 2.4.0
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/.idea/node-ps99-api.iml +1 -0
- package/README.md +1 -1
- package/dist/responses/collection/achievement.d.ts +2 -0
- package/dist/responses/collection/guild-battle.d.ts +2 -4
- package/dist/responses/collection/rank.d.ts +1 -0
- package/dist/responses/collection/seed.d.ts +1 -0
- package/dist/responses/exists.d.ts +2 -0
- package/example-web/react2/src/components/AchievementsComponent.tsx +23 -30
- package/example-web/react2/src/components/BoostsComponent.tsx +6 -13
- package/example-web/react2/src/components/BoothsComponent.tsx +52 -20
- package/example-web/react2/src/components/BoxesComponent.tsx +17 -24
- package/example-web/react2/src/components/BuffsComponent.tsx +35 -13
- package/example-web/react2/src/components/CharmsComponent.tsx +25 -30
- package/example-web/react2/src/components/CurrencyComponent.tsx +37 -44
- package/example-web/react2/src/components/DynamicCollectionConfigData.tsx +23 -4
- package/example-web/react2/src/components/EggsComponent.tsx +39 -44
- package/example-web/react2/src/components/EnchantsComponent.tsx +43 -34
- package/example-web/react2/src/components/FishingRodsComponent.tsx +23 -30
- package/example-web/react2/src/components/Footer.tsx +80 -16
- package/example-web/react2/src/components/FruitsComponent.tsx +18 -25
- package/example-web/react2/src/components/GenericFetchComponent.tsx +31 -21
- package/example-web/react2/src/components/GuildBattlesComponent.tsx +86 -65
- package/example-web/react2/src/components/HomePage.tsx +3 -1
- package/example-web/react2/src/components/HoverboardsComponent.tsx +100 -36
- package/example-web/react2/src/components/LootboxesComponent.tsx +8 -15
- package/example-web/react2/src/components/MasteryComponent.tsx +17 -24
- package/example-web/react2/src/components/MerchantsComponent.tsx +16 -23
- package/example-web/react2/src/components/MiscItemsComponent.tsx +32 -25
- package/example-web/react2/src/components/PetsComponent.tsx +74 -44
- package/example-web/react2/src/components/PotionsComponent.tsx +37 -36
- package/example-web/react2/src/components/RandomEventsComponent.tsx +30 -35
- package/example-web/react2/src/components/RanksComponent.tsx +58 -67
- package/example-web/react2/src/components/RarityComponent.tsx +7 -14
- package/example-web/react2/src/components/RebirthsComponent.tsx +20 -26
- package/example-web/react2/src/components/SecretRoomsComponent.tsx +6 -13
- package/example-web/react2/src/components/SeedsComponent.tsx +15 -22
- package/example-web/react2/src/components/ShovelsComponent.tsx +9 -16
- package/example-web/react2/src/components/SprinklersComponent.tsx +11 -18
- package/example-web/react2/src/components/UltimatesComponent.tsx +17 -24
- package/example-web/react2/src/components/UpgradesComponent.tsx +49 -54
- package/example-web/react2/src/components/WateringCansComponent.tsx +15 -19
- package/example-web/react2/src/components/WorldsComponent.tsx +16 -23
- package/example-web/react2/src/components/XPPotionsComponent.tsx +12 -19
- package/example-web/react2/src/components/ZoneFlagsComponent.tsx +15 -22
- package/example-web/react2/src/components/ZonesComponent.tsx +69 -69
- package/package.json +1 -1
- package/src/responses/collection/achievement.ts +2 -0
- package/src/responses/collection/guild-battle.ts +2 -4
- package/src/responses/collection/rank.ts +1 -0
- package/src/responses/collection/seed.ts +1 -0
- package/src/responses/exists.ts +2 -0
package/.idea/node-ps99-api.iml
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
6
6
|
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
7
7
|
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
+
<excludeFolder url="file://$MODULE_DIR$/dist" />
|
|
8
9
|
</content>
|
|
9
10
|
<orderEntry type="inheritedJdk" />
|
|
10
11
|
<orderEntry type="sourceFolder" forTests="false" />
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# ps99-api
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/js/ps99-api)
|
|
4
|
-

|
|
4
|
+
[](https://joekiller.github.io/node-ps99-api/)
|
|
5
5
|
|
|
6
6
|
Pet Simulator Public API wrapper written in Typescript.
|
|
7
7
|
|
|
@@ -26,7 +26,9 @@ export type AchievementRewardItem = {
|
|
|
26
26
|
};
|
|
27
27
|
export type AchievementRewardData = {
|
|
28
28
|
id: string;
|
|
29
|
+
/** potions: enchants, etc: tn is tier number */
|
|
29
30
|
tn?: number;
|
|
30
31
|
_am?: number;
|
|
32
|
+
/** For pets: pt=1 is golden, p2=2 is rainbow */
|
|
31
33
|
pt?: number;
|
|
32
34
|
};
|
|
@@ -18,13 +18,11 @@ export type GuildBattleItem = {
|
|
|
18
18
|
};
|
|
19
19
|
export type GuildBattleItemData = {
|
|
20
20
|
id: string;
|
|
21
|
+
/** For pets: pt=1 is golden, p2=2 is rainbow */
|
|
21
22
|
pt?: number;
|
|
22
23
|
};
|
|
23
24
|
export type GuildBattleRewards = {
|
|
24
|
-
|
|
25
|
-
Gold: GuildBattleRewardItem[];
|
|
26
|
-
Good?: GuildBattleRewardItem[];
|
|
27
|
-
Silver: GuildBattleRewardItem[];
|
|
25
|
+
[key: string]: GuildBattleRewardItem[];
|
|
28
26
|
};
|
|
29
27
|
export type GuildBattleRewardItem = {
|
|
30
28
|
_data: GuildBattleRewardItemData;
|
|
@@ -1,40 +1,33 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { CollectionConfigData } from "ps99-api";
|
|
3
|
-
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
4
3
|
import ImageComponent from "./ImageComponent";
|
|
5
4
|
|
|
6
5
|
const AchievementsComponent: React.FC<{
|
|
7
|
-
configData
|
|
6
|
+
configData: CollectionConfigData<"Achievements">;
|
|
8
7
|
}> = ({ configData }) => {
|
|
9
8
|
return (
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
configData={configData}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</li>
|
|
33
|
-
))}
|
|
34
|
-
</ul>
|
|
35
|
-
</div>
|
|
36
|
-
)}
|
|
37
|
-
/>
|
|
9
|
+
<div>
|
|
10
|
+
<h2>{configData.Name}</h2>
|
|
11
|
+
<ImageComponent src={configData.Icon} alt={configData.Name} />
|
|
12
|
+
<ul>
|
|
13
|
+
{configData.Tiers.map((tier, index) => (
|
|
14
|
+
<li key={index}>
|
|
15
|
+
<h3>{tier.Title}</h3>
|
|
16
|
+
<p>{tier.Desc.replace("{amount}", tier.Amount.toString())}</p>
|
|
17
|
+
<p>Difficulty: {tier.Difficulty.Name}</p>
|
|
18
|
+
<p>Amount: {tier.Amount}</p>
|
|
19
|
+
<ul>
|
|
20
|
+
{tier.Rewards.map((reward, rewardIndex) => (
|
|
21
|
+
<li key={rewardIndex}>
|
|
22
|
+
Reward ID: {reward.Reward._data.id} Amount:{" "}
|
|
23
|
+
{reward.Reward._data._am}
|
|
24
|
+
</li>
|
|
25
|
+
))}
|
|
26
|
+
</ul>
|
|
27
|
+
</li>
|
|
28
|
+
))}
|
|
29
|
+
</ul>
|
|
30
|
+
</div>
|
|
38
31
|
);
|
|
39
32
|
};
|
|
40
33
|
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { CollectionConfigData } from "ps99-api";
|
|
3
|
-
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
4
3
|
import ImageComponent from "./ImageComponent";
|
|
5
4
|
|
|
6
5
|
const BoostsComponent: React.FC<{
|
|
7
|
-
configData
|
|
6
|
+
configData: CollectionConfigData<"Boosts">;
|
|
8
7
|
}> = ({ configData }) => {
|
|
9
8
|
return (
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
configData={configData}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<h2>{data.DisplayName}</h2>
|
|
16
|
-
<ImageComponent src={data.Icon} alt={data.DisplayName} />
|
|
17
|
-
<p>Maximum Percent: {data.MaximumPercent}%</p>
|
|
18
|
-
</div>
|
|
19
|
-
)}
|
|
20
|
-
/>
|
|
9
|
+
<div>
|
|
10
|
+
<h2>{configData.DisplayName}</h2>
|
|
11
|
+
<ImageComponent src={configData.Icon} alt={configData.DisplayName} />
|
|
12
|
+
<p>Maximum Percent: {configData.MaximumPercent}%</p>
|
|
13
|
+
</div>
|
|
21
14
|
);
|
|
22
15
|
};
|
|
23
16
|
|
|
@@ -1,31 +1,63 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { CollectionConfigData } from "ps99-api";
|
|
3
|
-
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
4
3
|
import ImageComponent from "./ImageComponent";
|
|
5
4
|
|
|
6
5
|
const BoothsComponent: React.FC<{
|
|
7
|
-
configData
|
|
6
|
+
configData: CollectionConfigData<"Booths">;
|
|
8
7
|
}> = ({ configData }) => {
|
|
9
8
|
return (
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
9
|
+
<div
|
|
10
|
+
style={{
|
|
11
|
+
padding: "1em",
|
|
12
|
+
border: "1px solid #ccc",
|
|
13
|
+
borderRadius: "8px",
|
|
14
|
+
backgroundColor: "#f9f9f9",
|
|
15
|
+
}}
|
|
16
|
+
>
|
|
17
|
+
<h2 style={{ borderBottom: "2px solid #ccc", paddingBottom: "0.5em" }}>
|
|
18
|
+
{configData.DisplayName}
|
|
19
|
+
</h2>
|
|
20
|
+
<ImageComponent src={configData.Icon} alt={configData.DisplayName} />
|
|
21
|
+
<p>
|
|
22
|
+
<strong>Description:</strong> {configData.Desc}
|
|
23
|
+
</p>
|
|
24
|
+
<p>
|
|
25
|
+
<strong>Rarity:</strong> {configData.Rarity.DisplayName}
|
|
26
|
+
</p>
|
|
27
|
+
<p>
|
|
28
|
+
<strong>Rarity Number:</strong> {configData.Rarity.RarityNumber}
|
|
29
|
+
</p>
|
|
30
|
+
{configData.Hidden && (
|
|
31
|
+
<p>
|
|
32
|
+
<strong>Hidden:</strong> Yes
|
|
33
|
+
</p>
|
|
27
34
|
)}
|
|
28
|
-
|
|
35
|
+
{configData.Tradable && (
|
|
36
|
+
<p>
|
|
37
|
+
<strong>Tradable:</strong> Yes
|
|
38
|
+
</p>
|
|
39
|
+
)}
|
|
40
|
+
{configData.OffSale && (
|
|
41
|
+
<p>
|
|
42
|
+
<strong>Off Sale:</strong> Yes
|
|
43
|
+
</p>
|
|
44
|
+
)}
|
|
45
|
+
{configData.ProductId && (
|
|
46
|
+
<p>
|
|
47
|
+
<strong>Product ID:</strong> {configData.ProductId}
|
|
48
|
+
</p>
|
|
49
|
+
)}
|
|
50
|
+
{configData.DiamondPrice && (
|
|
51
|
+
<p>
|
|
52
|
+
<strong>Diamond Price:</strong> {configData.DiamondPrice}
|
|
53
|
+
</p>
|
|
54
|
+
)}
|
|
55
|
+
{configData.Sittable && (
|
|
56
|
+
<p>
|
|
57
|
+
<strong>Sittable:</strong> Yes
|
|
58
|
+
</p>
|
|
59
|
+
)}
|
|
60
|
+
</div>
|
|
29
61
|
);
|
|
30
62
|
};
|
|
31
63
|
|
|
@@ -1,34 +1,27 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { CollectionConfigData } from "ps99-api";
|
|
3
|
-
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
4
3
|
import ImageComponent from "./ImageComponent";
|
|
5
4
|
|
|
6
5
|
const BoxesComponent: React.FC<{
|
|
7
|
-
configData
|
|
6
|
+
configData: CollectionConfigData<"Boxes">;
|
|
8
7
|
}> = ({ configData }) => {
|
|
9
8
|
return (
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</li>
|
|
27
|
-
))}
|
|
28
|
-
</ul>
|
|
29
|
-
</div>
|
|
30
|
-
)}
|
|
31
|
-
/>
|
|
9
|
+
<div>
|
|
10
|
+
<h2>{configData.DisplayName}</h2>
|
|
11
|
+
<p>Description: {configData.Desc}</p>
|
|
12
|
+
<p>Capacity: {configData.Capacity}</p>
|
|
13
|
+
<p>Rarity: {configData.Rarity.DisplayName}</p>
|
|
14
|
+
<p>Rarity Number: {configData.Rarity.RarityNumber}</p>
|
|
15
|
+
<h3>Icons:</h3>
|
|
16
|
+
<ul>
|
|
17
|
+
{configData.Icons.map((icon, index) => (
|
|
18
|
+
<li key={index}>
|
|
19
|
+
<ImageComponent src={icon.Icon} alt={icon.Name} />
|
|
20
|
+
<span>{icon.Name}</span>
|
|
21
|
+
</li>
|
|
22
|
+
))}
|
|
23
|
+
</ul>
|
|
24
|
+
</div>
|
|
32
25
|
);
|
|
33
26
|
};
|
|
34
27
|
|
|
@@ -1,24 +1,46 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { CollectionConfigData } from "ps99-api";
|
|
3
|
-
import
|
|
3
|
+
import DynamicCollectionConfigData from "./DynamicCollectionConfigData";
|
|
4
4
|
|
|
5
5
|
const BuffsComponent: React.FC<{
|
|
6
|
-
configData
|
|
6
|
+
configData: CollectionConfigData<"Buffs">;
|
|
7
7
|
}> = ({ configData }) => {
|
|
8
8
|
return (
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
<div
|
|
10
|
+
style={{
|
|
11
|
+
padding: "1em",
|
|
12
|
+
border: "1px solid #ccc",
|
|
13
|
+
borderRadius: "8px",
|
|
14
|
+
marginBottom: "2em",
|
|
15
|
+
}}
|
|
16
|
+
>
|
|
17
|
+
<h2 style={{ borderBottom: "2px solid #ccc", paddingBottom: "0.5em" }}>
|
|
18
|
+
{configData.DisplayName}
|
|
19
|
+
</h2>
|
|
20
|
+
<p>
|
|
21
|
+
<strong>Associated Item ID:</strong> {configData.AssociatedItemID}
|
|
22
|
+
</p>
|
|
23
|
+
<p>
|
|
24
|
+
<strong>Associated Item Class:</strong> {configData.AssociatedItemClass}
|
|
25
|
+
</p>
|
|
26
|
+
<p>
|
|
27
|
+
<strong>Length:</strong> {configData.Length} seconds
|
|
28
|
+
</p>
|
|
29
|
+
{configData.IgnoreInstancePause && (
|
|
30
|
+
<p>
|
|
31
|
+
<strong>Ignore Instance Pause:</strong> Yes
|
|
32
|
+
</p>
|
|
33
|
+
)}
|
|
34
|
+
{configData.AssociatedItemClass === "Misc" && (
|
|
35
|
+
<div style={{ marginTop: "2em" }}>
|
|
36
|
+
<h3>Associated Misc Item</h3>
|
|
37
|
+
<DynamicCollectionConfigData
|
|
38
|
+
collectionName="MiscItems"
|
|
39
|
+
configName={configData.AssociatedItemID}
|
|
40
|
+
/>
|
|
19
41
|
</div>
|
|
20
42
|
)}
|
|
21
|
-
|
|
43
|
+
</div>
|
|
22
44
|
);
|
|
23
45
|
};
|
|
24
46
|
|
|
@@ -1,41 +1,36 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { CollectionConfigData } from "ps99-api";
|
|
3
|
-
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
4
3
|
import ImageComponent from "./ImageComponent";
|
|
5
4
|
|
|
6
5
|
const CharmsComponent: React.FC<{
|
|
7
|
-
configData
|
|
6
|
+
configData: CollectionConfigData<"Charms">;
|
|
8
7
|
}> = ({ configData }) => {
|
|
9
8
|
return (
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<p>Diminish Power Threshold: {data.DiminishPowerThreshold}</p>
|
|
21
|
-
)}
|
|
22
|
-
{data.Unique && <p>Unique: Yes</p>}
|
|
23
|
-
<h3>Tiers:</h3>
|
|
24
|
-
<ul>
|
|
25
|
-
{data.Tiers.map((tier, index) => (
|
|
26
|
-
<li key={index}>
|
|
27
|
-
<p>{tier.DisplayName}</p>
|
|
28
|
-
<p>Description: {tier.Desc}</p>
|
|
29
|
-
<p>Power: {tier.Power}</p>
|
|
30
|
-
<p>Rarity: {tier.Rarity.DisplayName}</p>
|
|
31
|
-
<p>Rarity Number: {tier.Rarity.RarityNumber}</p>
|
|
32
|
-
</li>
|
|
33
|
-
))}
|
|
34
|
-
</ul>
|
|
35
|
-
</div>
|
|
9
|
+
<div>
|
|
10
|
+
<h2>{configData.Tiers[0].DisplayName}</h2>
|
|
11
|
+
<ImageComponent
|
|
12
|
+
src={configData.Icon}
|
|
13
|
+
alt={configData.Tiers[0].DisplayName}
|
|
14
|
+
/>
|
|
15
|
+
<p>Base Tier: {configData.BaseTier}</p>
|
|
16
|
+
<p>Max Tier: {configData.MaxTier}</p>
|
|
17
|
+
{configData.DiminishPowerThreshold && (
|
|
18
|
+
<p>Diminish Power Threshold: {configData.DiminishPowerThreshold}</p>
|
|
36
19
|
)}
|
|
37
|
-
|
|
20
|
+
{configData.Unique && <p>Unique: Yes</p>}
|
|
21
|
+
<h3>Tiers:</h3>
|
|
22
|
+
<ul>
|
|
23
|
+
{configData.Tiers.map((tier, index) => (
|
|
24
|
+
<li key={index}>
|
|
25
|
+
<p>{tier.DisplayName}</p>
|
|
26
|
+
<p>Description: {tier.Desc}</p>
|
|
27
|
+
<p>Power: {tier.Power}</p>
|
|
28
|
+
<p>Rarity: {tier.Rarity.DisplayName}</p>
|
|
29
|
+
<p>Rarity Number: {tier.Rarity.RarityNumber}</p>
|
|
30
|
+
</li>
|
|
31
|
+
))}
|
|
32
|
+
</ul>
|
|
33
|
+
</div>
|
|
38
34
|
);
|
|
39
35
|
};
|
|
40
|
-
|
|
41
36
|
export default CharmsComponent;
|
|
@@ -1,64 +1,57 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { CollectionConfigData } from "ps99-api";
|
|
3
|
-
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
4
3
|
import ImageComponent from "./ImageComponent";
|
|
5
4
|
|
|
6
5
|
const CurrencyComponent: React.FC<{
|
|
7
|
-
configData
|
|
6
|
+
configData: CollectionConfigData<"Currency">;
|
|
8
7
|
}> = ({ configData }) => {
|
|
9
8
|
return (
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
<div>
|
|
10
|
+
<h2>{configData.DisplayName}</h2>
|
|
11
|
+
<p>Description: {configData.Desc}</p>
|
|
12
|
+
<p>Max Amount: {configData.MaxAmount}</p>
|
|
13
|
+
<p>Rarity: {configData.Rarity.DisplayName}</p>
|
|
14
|
+
<p>Rarity Number: {configData.Rarity.RarityNumber}</p>
|
|
15
|
+
{configData.Tradable && <p>Tradable: Yes</p>}
|
|
16
|
+
{configData.IsWorldCurrency && <p>World Currency: Yes</p>}
|
|
17
|
+
{configData.PermitAutoLootScaling && <p>Permit Auto Loot Scaling: Yes</p>}
|
|
18
|
+
<h3>Tiers:</h3>
|
|
19
|
+
<ul>
|
|
20
|
+
{configData.Tiers.map((tier, index) => (
|
|
21
|
+
<li key={index}>
|
|
22
|
+
<ImageComponent src={tier.orbImage} alt={tier.tierName} />
|
|
23
|
+
<p>Tier Name: {tier.tierName}</p>
|
|
24
|
+
<p>Order: {tier.Order}</p>
|
|
25
|
+
<p>Value: {tier.value}</p>
|
|
26
|
+
<ImageComponent
|
|
27
|
+
src={tier.imageOutline}
|
|
28
|
+
alt={`${tier.tierName} outline`}
|
|
29
|
+
/>
|
|
30
|
+
{tier.isBottom && <p>Is Bottom: Yes</p>}
|
|
31
|
+
<ImageComponent
|
|
32
|
+
src={tier.tinyImage}
|
|
33
|
+
alt={`${tier.tierName} tiny`}
|
|
34
|
+
/>
|
|
35
|
+
</li>
|
|
36
|
+
))}
|
|
37
|
+
</ul>
|
|
38
|
+
{configData.BagTiers && (
|
|
14
39
|
<div>
|
|
15
|
-
<
|
|
16
|
-
<p>Description: {data.Desc}</p>
|
|
17
|
-
<p>Max Amount: {data.MaxAmount}</p>
|
|
18
|
-
<p>Rarity: {data.Rarity.DisplayName}</p>
|
|
19
|
-
<p>Rarity Number: {data.Rarity.RarityNumber}</p>
|
|
20
|
-
{data.Tradable && <p>Tradable: Yes</p>}
|
|
21
|
-
{data.IsWorldCurrency && <p>World Currency: Yes</p>}
|
|
22
|
-
{data.PermitAutoLootScaling && <p>Permit Auto Loot Scaling: Yes</p>}
|
|
23
|
-
<h3>Tiers:</h3>
|
|
40
|
+
<h3>Bag Tiers:</h3>
|
|
24
41
|
<ul>
|
|
25
|
-
{
|
|
42
|
+
{configData.BagTiers.map((bagTier, index) => (
|
|
26
43
|
<li key={index}>
|
|
27
|
-
<ImageComponent src={tier.orbImage} alt={tier.tierName} />
|
|
28
|
-
<p>Tier Name: {tier.tierName}</p>
|
|
29
|
-
<p>Order: {tier.Order}</p>
|
|
30
|
-
<p>Value: {tier.value}</p>
|
|
31
44
|
<ImageComponent
|
|
32
|
-
src={
|
|
33
|
-
alt={
|
|
34
|
-
/>
|
|
35
|
-
{tier.isBottom && <p>Is Bottom: Yes</p>}
|
|
36
|
-
<ImageComponent
|
|
37
|
-
src={tier.tinyImage}
|
|
38
|
-
alt={`${tier.tierName} tiny`}
|
|
45
|
+
src={bagTier.image}
|
|
46
|
+
alt={`Bag tier ${index + 1}`}
|
|
39
47
|
/>
|
|
48
|
+
<p>Value: {bagTier.value}</p>
|
|
40
49
|
</li>
|
|
41
50
|
))}
|
|
42
51
|
</ul>
|
|
43
|
-
{data.BagTiers && (
|
|
44
|
-
<div>
|
|
45
|
-
<h3>Bag Tiers:</h3>
|
|
46
|
-
<ul>
|
|
47
|
-
{data.BagTiers.map((bagTier, index) => (
|
|
48
|
-
<li key={index}>
|
|
49
|
-
<ImageComponent
|
|
50
|
-
src={bagTier.image}
|
|
51
|
-
alt={`Bag tier ${index + 1}`}
|
|
52
|
-
/>
|
|
53
|
-
<p>Value: {bagTier.value}</p>
|
|
54
|
-
</li>
|
|
55
|
-
))}
|
|
56
|
-
</ul>
|
|
57
|
-
</div>
|
|
58
|
-
)}
|
|
59
52
|
</div>
|
|
60
53
|
)}
|
|
61
|
-
|
|
54
|
+
</div>
|
|
62
55
|
);
|
|
63
56
|
};
|
|
64
57
|
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
import React, { lazy, Suspense } from "react";
|
|
2
2
|
import { useParams } from "react-router-dom";
|
|
3
|
-
import { CollectionName } from "ps99-api";
|
|
3
|
+
import { CollectionName, CollectionConfigData } from "ps99-api";
|
|
4
|
+
import { GenericFetchComponent } from "./GenericFetchComponent";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
interface DynamicCollectionConfigDataProps {
|
|
7
|
+
collectionName?: CollectionName;
|
|
8
|
+
configName?: string;
|
|
9
|
+
render?: (configData: CollectionConfigData<any>) => React.ReactNode; // Add render prop
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const DynamicCollectionConfigData: React.FC<
|
|
13
|
+
DynamicCollectionConfigDataProps
|
|
14
|
+
> = (props) => {
|
|
15
|
+
const params = useParams<{
|
|
7
16
|
collectionName: CollectionName;
|
|
8
17
|
configName: string;
|
|
9
18
|
}>();
|
|
10
19
|
|
|
20
|
+
const collectionName = props.collectionName || params.collectionName;
|
|
21
|
+
const configName = props.configName || params.configName;
|
|
22
|
+
|
|
11
23
|
if (!collectionName || !configName) {
|
|
12
24
|
return <div>Invalid collection or config name</div>;
|
|
13
25
|
}
|
|
@@ -16,7 +28,14 @@ const DynamicCollectionConfigData: React.FC = () => {
|
|
|
16
28
|
|
|
17
29
|
return (
|
|
18
30
|
<Suspense fallback={<div>Loading...</div>}>
|
|
19
|
-
<
|
|
31
|
+
<GenericFetchComponent
|
|
32
|
+
collectionName={collectionName}
|
|
33
|
+
configName={configName}
|
|
34
|
+
render={
|
|
35
|
+
props.render ||
|
|
36
|
+
((configData) => <Component configData={configData} />)
|
|
37
|
+
} // Use render prop if provided
|
|
38
|
+
/>
|
|
20
39
|
</Suspense>
|
|
21
40
|
);
|
|
22
41
|
};
|