forked from phenom/healer-man
Release Healer Man 0.1.22
This commit is contained in:
1 parent
f6f2375145
commit
7f6001723a
144 files changed
+54107
-690
No files matched your search
+26
-25
@@ -1,4 +1,4 @@
|
||||
import { lazy, Suspense, useEffect, useMemo } from "react";
|
||||
import { lazy, Suspense, useMemo } from "react";
|
||||
import { classById } from "../app/characterCatalog";
|
||||
import { useShellStore } from "../app/shellStore";
|
||||
import { useCombatStore } from "../game/combatStore";
|
||||
@@ -12,24 +12,16 @@ import { AbilityBindingsPanel } from "./AbilityBindingsPanel";
|
||||
import { SpellbookPanel } from "./SpellbookPanel";
|
||||
import { EquipmentPanel } from "./EquipmentPanel";
|
||||
import { RomSkillsPanel } from "./RomSkillsPanel";
|
||||
import { getLoadedTalentGameplayPanel, loadTalentGameplayPanel } from "./talentGameplayResources";
|
||||
import {
|
||||
getLoadedBossGuidePanel,
|
||||
getLoadedPartyManagementPanel,
|
||||
loadBossGuidePanel,
|
||||
loadPartyManagementPanel,
|
||||
} from "./gameplayResources";
|
||||
|
||||
const PartyManagementPanel = lazy(() => import("./PartyManagementPanel").then((module) => ({ default: module.PartyManagementPanel })));
|
||||
const BossGuidePanel = lazy(() => import("./BossGuidePanel").then((module) => ({ default: module.BossGuidePanel })));
|
||||
let talentGameplayPanelModule: Promise<typeof import("./TalentGameplayPanel")> | null = null;
|
||||
|
||||
function loadTalentGameplayPanel() {
|
||||
if (!talentGameplayPanelModule) {
|
||||
talentGameplayPanelModule = import("./TalentGameplayPanel").catch((error: unknown) => {
|
||||
talentGameplayPanelModule = null;
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
return talentGameplayPanelModule;
|
||||
}
|
||||
|
||||
function preloadTalentGameplayPanel() {
|
||||
void loadTalentGameplayPanel().catch(() => undefined);
|
||||
}
|
||||
const PartyManagementPanel = lazy(() => loadPartyManagementPanel().then((module) => ({ default: module.PartyManagementPanel })));
|
||||
const BossGuidePanel = lazy(() => loadBossGuidePanel().then((module) => ({ default: module.BossGuidePanel })));
|
||||
|
||||
const TalentGameplayPanel = lazy(loadTalentGameplayPanel);
|
||||
|
||||
@@ -61,10 +53,9 @@ export function GameplayPanels() {
|
||||
const presentationSettings = useShellStore((state) => state.combatPresentationSettings);
|
||||
const overlay = useGameStore((state) => state.overlay);
|
||||
const classDefinition = classById(classId);
|
||||
|
||||
useEffect(() => {
|
||||
if (overlay === "pause" && !classId.startsWith("rom-")) preloadTalentGameplayPanel();
|
||||
}, [classId, overlay]);
|
||||
const PreloadedTalentGameplayPanel = getLoadedTalentGameplayPanel();
|
||||
const PreloadedPartyManagementPanel = getLoadedPartyManagementPanel();
|
||||
const PreloadedBossGuidePanel = getLoadedBossGuidePanel();
|
||||
|
||||
const spellbookAbilities = useMemo(() => [...abilities]
|
||||
.sort((left, right) => left.unlockLevel - right.unlockLevel)
|
||||
@@ -110,15 +101,25 @@ export function GameplayPanels() {
|
||||
|
||||
return (
|
||||
<>
|
||||
{overlay === "party" ? <Suspense fallback={null}><PartyManagementPanel /></Suspense> : null}
|
||||
{overlay === "boss-guide" ? <Suspense fallback={null}><BossGuidePanel /></Suspense> : null}
|
||||
{overlay === "party"
|
||||
? PreloadedPartyManagementPanel
|
||||
? <PreloadedPartyManagementPanel />
|
||||
: <Suspense fallback={null}><PartyManagementPanel /></Suspense>
|
||||
: null}
|
||||
{overlay === "boss-guide"
|
||||
? PreloadedBossGuidePanel
|
||||
? <PreloadedBossGuidePanel />
|
||||
: <Suspense fallback={null}><BossGuidePanel /></Suspense>
|
||||
: null}
|
||||
<EquipmentPanel />
|
||||
<AbilityBindingsPanel />
|
||||
<SpellbookPanel abilities={spellbookAbilities} playerLevel={level} onActivate={castAbility} />
|
||||
{overlay === "talents"
|
||||
? classId.startsWith("rom-")
|
||||
? <RomSkillsPanel />
|
||||
: <Suspense fallback={<TalentsPanelLoading />}><TalentGameplayPanel /></Suspense>
|
||||
: PreloadedTalentGameplayPanel
|
||||
? <PreloadedTalentGameplayPanel />
|
||||
: <Suspense fallback={<TalentsPanelLoading />}><TalentGameplayPanel /></Suspense>
|
||||
: null}
|
||||
<OptionsPanel
|
||||
settings={settings}
|
||||
|
||||
Reference in new issue
Block a user