From d293e1cff416bf2a86c162a5e232c0b82c139a8b Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Wed, 17 Jul 2024 00:05:55 -0700 Subject: [PATCH] Hide empty memento sockets? --- .../__snapshots__/d2-stores.test.ts.snap | 18 +++++++++--------- src/app/utils/socket-utils.ts | 7 +++++-- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/app/inventory/__snapshots__/d2-stores.test.ts.snap b/src/app/inventory/__snapshots__/d2-stores.test.ts.snap index a543008bd3..5c0544e7e1 100644 --- a/src/app/inventory/__snapshots__/d2-stores.test.ts.snap +++ b/src/app/inventory/__snapshots__/d2-stores.test.ts.snap @@ -27643,7 +27643,7 @@ exports[`process stores generates a correct Weapons CSV export 1`] = ` "Owner": "Vault", "Perks 0": "High-Impact Frame*", "Perks 1": "Arrowhead Brake*", - "Perks 10": "Empty Memento Socket*", + "Perks 10": undefined, "Perks 11": undefined, "Perks 12": undefined, "Perks 13": undefined, @@ -28325,7 +28325,7 @@ exports[`process stores generates a correct Weapons CSV export 1`] = ` "Owner": "Vault", "Perks 0": "Lightweight Frame*", "Perks 1": "Chambered Compensator*", - "Perks 10": "Empty Memento Socket*", + "Perks 10": undefined, "Perks 11": undefined, "Perks 12": undefined, "Perks 13": undefined, @@ -28697,7 +28697,7 @@ exports[`process stores generates a correct Weapons CSV export 1`] = ` "Owner": "Vault", "Perks 0": "Precision Frame*", "Perks 1": "Fluted Barrel*", - "Perks 10": "Empty Memento Socket*", + "Perks 10": undefined, "Perks 11": undefined, "Perks 12": undefined, "Perks 13": undefined, @@ -28883,7 +28883,7 @@ exports[`process stores generates a correct Weapons CSV export 1`] = ` "Owner": "Vault", "Perks 0": "Precision Frame*", "Perks 1": "Extended Barrel*", - "Perks 10": "Empty Memento Socket*", + "Perks 10": undefined, "Perks 11": undefined, "Perks 12": undefined, "Perks 13": undefined, @@ -30371,7 +30371,7 @@ exports[`process stores generates a correct Weapons CSV export 1`] = ` "Owner": "Vault", "Perks 0": "Lightweight Frame*", "Perks 1": "Arrowhead Brake*", - "Perks 10": "Empty Memento Socket*", + "Perks 10": undefined, "Perks 11": undefined, "Perks 12": undefined, "Perks 13": undefined, @@ -30495,7 +30495,7 @@ exports[`process stores generates a correct Weapons CSV export 1`] = ` "Owner": "Vault", "Perks 0": "Precision Frame*", "Perks 1": "Full Bore*", - "Perks 10": "Empty Memento Socket*", + "Perks 10": undefined, "Perks 11": undefined, "Perks 12": undefined, "Perks 13": undefined, @@ -30557,7 +30557,7 @@ exports[`process stores generates a correct Weapons CSV export 1`] = ` "Owner": "Vault", "Perks 0": "High-Impact Frame*", "Perks 1": "Corkscrew Rifling*", - "Perks 10": "Empty Memento Socket*", + "Perks 10": undefined, "Perks 11": undefined, "Perks 12": undefined, "Perks 13": undefined, @@ -30619,7 +30619,7 @@ exports[`process stores generates a correct Weapons CSV export 1`] = ` "Owner": "Vault", "Perks 0": "High-Impact Frame*", "Perks 1": "Chambered Compensator*", - "Perks 10": "Empty Memento Socket*", + "Perks 10": undefined, "Perks 11": undefined, "Perks 12": undefined, "Perks 13": undefined, @@ -30805,7 +30805,7 @@ exports[`process stores generates a correct Weapons CSV export 1`] = ` "Owner": "Vault", "Perks 0": "Adaptive Frame*", "Perks 1": "Extended Barrel*", - "Perks 10": "Empty Memento Socket*", + "Perks 10": undefined, "Perks 11": undefined, "Perks 12": undefined, "Perks 13": undefined, diff --git a/src/app/utils/socket-utils.ts b/src/app/utils/socket-utils.ts index bb8dc639b7..4951de0ed3 100644 --- a/src/app/utils/socket-utils.ts +++ b/src/app/utils/socket-utils.ts @@ -13,6 +13,7 @@ import { armor2PlugCategoryHashes, } from 'app/search/d2-known-values'; import { DestinySocketCategoryStyle, TierType } from 'bungie-api-ts/destiny2'; +import { emptyPlugHashes } from 'data/d2/empty-plug-hashes'; import { BucketHashes, ItemCategoryHashes, @@ -297,8 +298,10 @@ function filterSocketCategories( */ export function isSocketEmpty(socket: DimSocket) { return ( - socket.plugged?.plugDef.hash === socket.emptyPlugItemHash && - socket.plugged?.plugDef.plug.plugCategoryHash !== PlugCategoryHashes.V400EmptyExoticMasterwork + socket.plugged && + (socket.plugged.plugDef.hash === socket.emptyPlugItemHash || + emptyPlugHashes.has(socket.plugged?.plugDef.hash)) && + socket.plugged.plugDef.plug.plugCategoryHash !== PlugCategoryHashes.V400EmptyExoticMasterwork ); }