Release Healer Man 0.1.59
This commit is contained in:
1 parent
11934a3979
commit
ab1434a3b8
44 files changed
+1242
-103
No files matched your search
+10
-6
@@ -28,7 +28,7 @@ function ShellTransition() {
|
||||
return <div className="world-transition"><span>HM</span><strong>Opening expedition</strong><small>Preparing the next screen...</small></div>;
|
||||
}
|
||||
|
||||
function RuntimeCatalogGate({ children }: { readonly children: ReactNode }) {
|
||||
function RuntimeCatalogGate({ children, preloadGameplay }: { readonly children: ReactNode; readonly preloadGameplay: boolean }) {
|
||||
const character = useShellStore((state) => (
|
||||
state.characters.find((candidate) => candidate.id === state.selectedCharacterId) ?? null
|
||||
));
|
||||
@@ -41,8 +41,10 @@ function RuntimeCatalogGate({ children }: { readonly children: ReactNode }) {
|
||||
const talentClassId = character && !character.classId.startsWith("rom-")
|
||||
? character.classId
|
||||
: null;
|
||||
const requestKey = classIds.join(":");
|
||||
const originalMediaEnabled = useShellStore((state) => state.combatPresentationSettings.originalMediaEnabled);
|
||||
const requestKey = classIds.length
|
||||
? `${classIds.join(":")}|${preloadGameplay ? `game:${originalMediaEnabled}` : "shell"}`
|
||||
: "";
|
||||
const [loadedKey, setLoadedKey] = useState("");
|
||||
const [failedKey, setFailedKey] = useState("");
|
||||
|
||||
@@ -52,15 +54,15 @@ function RuntimeCatalogGate({ children }: { readonly children: ReactNode }) {
|
||||
setFailedKey("");
|
||||
void Promise.all([
|
||||
preloadAbilityCatalogsForClasses(classIds),
|
||||
talentClassId ? preloadTalentGameplayResources(talentClassId) : Promise.resolve(),
|
||||
preloadSharedGameplayResources(originalMediaEnabled),
|
||||
preloadGameplay && talentClassId ? preloadTalentGameplayResources(talentClassId) : Promise.resolve(),
|
||||
preloadGameplay ? preloadSharedGameplayResources(originalMediaEnabled) : Promise.resolve(),
|
||||
]).then(() => {
|
||||
if (active) setLoadedKey(requestKey);
|
||||
}).catch(() => {
|
||||
if (active) setFailedKey(requestKey);
|
||||
});
|
||||
return () => { active = false; };
|
||||
}, [classIds, originalMediaEnabled, requestKey, talentClassId]);
|
||||
}, [classIds, originalMediaEnabled, preloadGameplay, requestKey, talentClassId]);
|
||||
|
||||
if (!requestKey || loadedKey === requestKey) return children;
|
||||
if (failedKey === requestKey) {
|
||||
@@ -105,5 +107,7 @@ export default function App() {
|
||||
? <PreloadedGameRuntime />
|
||||
: <Suspense fallback={<ShellTransition />}><GameRuntime /></Suspense>;
|
||||
const requiresRuntimeCatalog = !["login", "characters", "create-character"].includes(phase);
|
||||
return <><OnlineGroupCoordinator />{requiresRuntimeCatalog ? <RuntimeCatalogGate>{screen}</RuntimeCatalogGate> : screen}</>;
|
||||
return <><OnlineGroupCoordinator />{requiresRuntimeCatalog
|
||||
? <RuntimeCatalogGate preloadGameplay={phase === "game"}>{screen}</RuntimeCatalogGate>
|
||||
: screen}</>;
|
||||
}
|
||||
Reference in new issue
Block a user