From 9b42a44f449c23907c0e6b3d3370e66809711a36 Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Wed, 30 Oct 2024 22:37:13 -0700 Subject: [PATCH] Trim manifest tables more --- src/app/manifest/manifest-service-json.ts | 58 +++++++++++++++++++++-- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/src/app/manifest/manifest-service-json.ts b/src/app/manifest/manifest-service-json.ts index 996b735083..d883a52e26 100644 --- a/src/app/manifest/manifest-service-json.ts +++ b/src/app/manifest/manifest-service-json.ts @@ -11,11 +11,14 @@ import { dedupePromise } from 'app/utils/promises'; import { LookupTable } from 'app/utils/util-types'; import { AllDestinyManifestComponents, + DestinyCollectibleDefinition, DestinyInventoryItemDefinition, DestinyItemActionBlockDefinition, DestinyItemTalentGridBlockDefinition, DestinyItemTranslationBlockDefinition, DestinyManifestComponentName, + DestinyObjectiveDefinition, + DestinyRecordDefinition, } from 'bungie-api-ts/destiny2'; import { BucketHashes } from 'data/d2/generated-enums'; import { once } from 'es-toolkit'; @@ -52,12 +55,18 @@ const tableTrimmers: LookupTable a if (def.equippingBlock?.displayStrings?.length) { def.equippingBlock.displayStrings = emptyArray(); } - if (def.preview?.derivedItemCategories?.length) { - def.preview.derivedItemCategories = emptyArray(); + if (def.preview) { + if (def.preview.derivedItemCategories?.length) { + def.preview.derivedItemCategories = emptyArray(); + } + def.preview.screenStyle = ''; } - if (def.inventory?.bucketTypeHash !== BucketHashes.Subclass) { - // The only useful bit about talent grids is for subclass damage types - def.talentGrid = emptyObject>(); + if (def.inventory) { + if (def.inventory.bucketTypeHash !== BucketHashes.Subclass) { + // The only useful bit about talent grids is for subclass damage types + def.talentGrid = emptyObject>(); + } + def.inventory.tierTypeName = ''; } if (def.sockets) { @@ -68,8 +77,47 @@ const tableTrimmers: LookupTable a } } } + + // We never figured out anything to do with icon sequences on items + if (def.displayProperties.iconSequences) { + def.displayProperties.iconSequences = emptyArray(); + } + + // We don't use these + def.tooltipStyle = ''; + def.itemTypeAndTierDisplayName = ''; + } + + return table; + }, + DestinyObjectiveDefinition: (table: { [hash: number]: DestinyObjectiveDefinition }) => { + for (const key in table) { + const def = table[key] as Draft; + + def.stats = emptyObject(); + def.perks = emptyObject(); + // Believe it or not we don't use these + def.displayProperties.description = ''; + def.displayProperties.name = ''; + } + return table; + }, + DestinyCollectibleDefinition: (table: { [hash: number]: DestinyCollectibleDefinition }) => { + for (const key in table) { + const def = table[key] as Draft; + + def.acquisitionInfo = emptyObject(); + def.stateInfo = emptyObject(); } + return table; + }, + DestinyRecordDefinition: (table: { [hash: number]: DestinyRecordDefinition }) => { + for (const key in table) { + const def = table[key] as Draft; + def.requirements = emptyObject(); + def.expirationInfo = emptyObject(); + } return table; }, };