Skip to content

Commit

Permalink
Implement @robojumper's suggestion for how to ID subclass abilities
Browse files Browse the repository at this point in the history
  • Loading branch information
bhollis committed Oct 28, 2023
1 parent f3c6593 commit b9b3e1c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/app/loadout/ingame/InGameLoadoutDetailsSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { streamDeckSelectionSelector } from 'app/stream-deck/selectors';
import { streamDeckSelectLoadout } from 'app/stream-deck/stream-deck';
import { isKillTrackerSocket } from 'app/utils/item-utils';
import { getSocketsByCategoryHashes, socketContainsIntrinsicPlug } from 'app/utils/socket-utils';
import { ItemCategoryHashes, SocketCategoryHashes } from 'data/d2/generated-enums';
import { SocketCategoryHashes } from 'data/d2/generated-enums';
import _ from 'lodash';
import React from 'react';
import { useSelector } from 'react-redux';
Expand Down Expand Up @@ -124,8 +124,6 @@ export function InGameLoadoutDetails({
);
}

const majorSubclassPlugSuffixes = ['.trinkets', '.totems', '.fragments', '.aspects', '.supers'];

// Note that the item has already had socket overrides applied by useItemsFromInGameLoadout
function InGameLoadoutItemDetail({
resolvedItem: { item, loadoutItem },
Expand All @@ -147,16 +145,19 @@ function InGameLoadoutItemDetail({
SocketCategoryHashes.ArmorCosmetics,
SocketCategoryHashes.WeaponCosmetics,
]);

const subclassAbilitySockets = getSocketsByCategoryHashes(item.sockets, [
SocketCategoryHashes.Abilities_Abilities,
SocketCategoryHashes.Abilities_Abilities_Ikora,
]);

const [smallSockets, bigSockets] = _.partition(
validSockets,
(s) =>
// Shaders and ornaments should be small
cosmeticSockets.includes(s) ||
// subclass mods that aren't super/aspect/fragment should be small (Grenade, jump, etc)
(s.plugged!.plugDef.itemCategoryHashes?.includes(ItemCategoryHashes.SubclassMods) &&
!majorSubclassPlugSuffixes.some((ps) =>
s.plugged!.plugDef.plug.plugCategoryIdentifier.endsWith(ps)
))
subclassAbilitySockets.includes(s)
);
return (
<React.Fragment key={item.id}>
Expand Down

0 comments on commit b9b3e1c

Please sign in to comment.