diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 1ba9395..14306fb 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -77,7 +77,7 @@ export default async function RootLayout({
-
diff --git a/src/components/monsterBar/peak.tsx b/src/components/monsterBar/peak.tsx index 3ba3058..9a7846e 100644 --- a/src/components/monsterBar/peak.tsx +++ b/src/components/monsterBar/peak.tsx @@ -141,14 +141,16 @@ export default function PeakBar() { excludeSet={[]} selectedCustomSet={peak_config.event_id.toString()} placeholder={transI18n("selectPEAKEvent")} - setSelectedCustomSet={(id) => + setSelectedCustomSet={(id) => { + const peakEvent = mapPeak?.[id]; + const defaultFloor = peakEvent ? [...(peakEvent.PreLevel || []), peakEvent.BossLevel].filter(Boolean)[0]?.ID || 0 : 0; setPeakConfig({ ...peak_config, event_id: Number(id), - challenge_id: 0, + challenge_id: defaultFloor, buff_id: 0, - }) - } + }); + }} /> {/* Settings */} diff --git a/src/components/monsterBar/pf.tsx b/src/components/monsterBar/pf.tsx index 490074b..dee92a0 100644 --- a/src/components/monsterBar/pf.tsx +++ b/src/components/monsterBar/pf.tsx @@ -94,15 +94,34 @@ export default function PfBar() { newBattleConfig.monsters = [] newBattleConfig.stage_id = 0 + let currentSide = pf_config.floor_side; + if (currentSide === "first_half" || currentSide === "firstHalf" || !currentSide) currentSide = "firstNode"; + if (currentSide === "second_half" || currentSide === "secondHalf") currentSide = "secondNode"; + let targetEventList: PFEvent[] = [] - if (pf_config.floor_side === "firstNode" && challengeSelected.EventList1.length > 0) { + if (currentSide === "firstNode" && challengeSelected.EventList1?.length > 0) { targetEventList = challengeSelected.EventList1 - } else if (pf_config.floor_side === "secondNode" && challengeSelected.EventList2.length > 0) { + } else if (currentSide === "secondNode" && challengeSelected.EventList2?.length > 0) { targetEventList = challengeSelected.EventList2 - } else if (pf_config.floor_side === "thirdNode" && eventSelected?.Tierce && eventSelected.Tierce.EventList.length > 0) { + } else if (currentSide === "thirdNode" && eventSelected?.Tierce && eventSelected.Tierce.EventList?.length > 0) { targetEventList = eventSelected.Tierce.EventList } + // Fallback to first available node if currentSide is invalid or has no events + if (targetEventList.length === 0) { + if (challengeSelected.EventList1?.length) { + targetEventList = challengeSelected.EventList1; + currentSide = "firstNode"; + } else if (challengeSelected.EventList2?.length) { + targetEventList = challengeSelected.EventList2; + currentSide = "secondNode"; + } else if (eventSelected?.Tierce?.EventList?.length) { + targetEventList = eventSelected.Tierce.EventList; + currentSide = "thirdNode"; + } + } + newBattleConfig.floor_side = currentSide; + if (targetEventList.length > 0) { newBattleConfig.stage_id = targetEventList[0].ID @@ -158,6 +177,7 @@ export default function PfBar() { ...pf_config, event_id: Number(id), challenge_id: mapPF[Number(id)]?.Level.slice(-1)[0]?.ID || 0, + floor_side: "firstNode", buff_id: 0 })} /> diff --git a/src/components/quickView/index.tsx b/src/components/quickView/index.tsx index 9965720..6a6459e 100644 --- a/src/components/quickView/index.tsx +++ b/src/components/quickView/index.tsx @@ -5,7 +5,7 @@ import { useTranslations } from "next-intl"; import { useMemo } from "react"; import { calcAffixBonus, calcBaseStatRaw, calcBonusStatRaw, calcMainAffixBonus, calcMainAffixBonusRaw, calcPromotion, calcSubAffixBonusRaw, getLocaleName, replaceByParam } from "@/helper"; import { mappingStats } from "@/constant/constant"; -import RelicShowcase from "../showcaseCard/relicShowcase"; +import QuickViewRelic from "./quickViewRelic"; import useLocaleStore from "@/stores/localeStore"; import useDetailDataStore from "@/stores/detailDataStore"; import useCurrentDataStore from "@/stores/currentDataStore"; @@ -491,7 +491,7 @@ export default function QuickView() { {relicStats?.map((relic, index) => { if (!relic || !avatarSelected) return null return ( - + ) })} diff --git a/src/components/quickView/quickViewRelic.tsx b/src/components/quickView/quickViewRelic.tsx new file mode 100644 index 0000000..d237ccb --- /dev/null +++ b/src/components/quickView/quickViewRelic.tsx @@ -0,0 +1,93 @@ +"use client" +import NextImage from "next/image" +import { AvatarDetail, RelicShowcaseType } from "@/types"; + +export default function QuickViewRelic({ + relic, + avatarInfo, +}: { + relic: RelicShowcaseType; + avatarInfo: AvatarDetail; +}) { + return ( +
+ {/* Relic Figure Icon */} +
+ +
+ + {/* Main Affix - Clean Display */} +
+
+ {relic?.mainAffix?.detail?.icon ? ( + + ) : null} + + {relic?.mainAffix?.valueAffix + (relic?.mainAffix?.detail?.unit || "")} + +
+ + +{relic?.mainAffix?.level} + +
+ + {/* Sub Affixes Grid - Clean Flat Typography */} +
+ {relic?.subAffix?.map((subAffix, index) => { + if (!subAffix) return null + const isOptimalStat = avatarInfo?.Relics?.SubAffixPropertyList?.includes(subAffix?.property) + + return ( +
+
+ {subAffix?.detail?.icon ? ( + + ) : null} + + +{subAffix?.valueAffix + (subAffix?.detail?.unit || "")} + +
+ + {isOptimalStat && subAffix?.count ? ( + + ({subAffix?.count}) + + ) : null} +
+ ) + })} +
+
+ ) +} diff --git a/src/components/showcaseCard/index.tsx b/src/components/showcaseCard/index.tsx index 04bb24e..4e1978e 100644 --- a/src/components/showcaseCard/index.tsx +++ b/src/components/showcaseCard/index.tsx @@ -718,7 +718,7 @@ export default function ShowCaseInfo() { const sizeClass = isBigMemory ? "w-12 h-12 mx-1" : isBig ? "w-12 h-12 mx-1" : isMedium ? "w-10 h-10" : "w-8 h-8"; - const imageSize = isBigMemory ? "w-10" : isBig ? "w-10" : isMedium ? "w-8" : "w-6"; + const imageSize = isBigMemory ? "w-10 h-10" : isBig ? "w-10 h-10" : isMedium ? "w-8 h-8" : "w-6 h-6"; const bgColor = isBigMemory ? "bg-[#2a1a39]/80" @@ -741,7 +741,7 @@ export default function ShowCaseInfo() {
{(isBig || isBigMemory) && ( diff --git a/src/components/showcaseCard/relicShowcase.tsx b/src/components/showcaseCard/relicShowcase.tsx index 2475f13..a78c949 100644 --- a/src/components/showcaseCard/relicShowcase.tsx +++ b/src/components/showcaseCard/relicShowcase.tsx @@ -1,5 +1,5 @@ - "use client" + import NextImage from "next/image" import { AvatarDetail, RelicShowcaseType } from "@/types"; @@ -11,84 +11,95 @@ export default function RelicShowcase({ avatarInfo: AvatarDetail; }) { return ( -
- {/* Relic Figure Icon */} -
+
+ {/* Subtle glow overlay */} +
+ +
+
+ +
+ ✦✦✦✦✦ +
- {/* Main Affix - Clean Display */} -
-
- {relic?.mainAffix?.detail?.icon ? ( - - ) : null} - - {relic?.mainAffix?.valueAffix + (relic?.mainAffix?.detail?.unit || "")} - +
+
+
+
- + + {relic?.mainAffix?.valueAffix + (relic?.mainAffix?.detail?.unit || "")} + + +{relic?.mainAffix?.level}
- {/* Sub Affixes Grid - Clean Flat Typography */} -
+
+ +
{relic?.subAffix?.map((subAffix, index) => { if (!subAffix) return null - const isOptimalStat = avatarInfo?.Relics?.SubAffixPropertyList?.includes(subAffix?.property) - return ( -
-
+
+
{subAffix?.detail?.icon ? ( - ) : null} - + ) : ( +
+ ? +
+ )} + +{subAffix?.valueAffix + (subAffix?.detail?.unit || "")} + { + (avatarInfo?.Relics?.SubAffixPropertyList?.findIndex((item) => item === subAffix?.property) !== -1) && ( + + {subAffix?.count} + + )}
- - {isOptimalStat && subAffix?.count ? ( - - ({subAffix?.count}) - - ) : null}
) })}
) -} \ No newline at end of file +}