Skip to content

Commit

Permalink
Prismatic subclass drawer fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
robojumper committed Jun 6, 2024
1 parent 4a53e4c commit 1262f54
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
6 changes: 6 additions & 0 deletions config/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,12 @@
"PullFromPostmasterGeneralError": "Unable to pull all items from Postmaster.",
"PullFromPostmasterPopupTitle": "Pull from Postmaster",
"NoSpace": "You're out of space in the vault and any other characters.",
"Prismatic": {
"Aspect": "Prismatic Aspect",
"Grenade": "Prismatic Grenade",
"Melee": "Prismatic Melee",
"Super": "Super Ability"
},
"Random": "Random",
"Randomize": "Randomize Loadout",
"RandomizeNew": "Create Random",
Expand Down
18 changes: 17 additions & 1 deletion src/app/loadout/mod-utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { t } from 'app/i18next-t';
import { PluggableInventoryItemDefinition } from 'app/inventory/item-types';
import { isPluggableItem } from 'app/inventory/store/sockets';
import { armor2PlugCategoryHashesByName } from 'app/search/d2-known-values';
Expand Down Expand Up @@ -95,7 +96,22 @@ export function createGetModRenderKey() {
* e.g. "General Armor Mod", "Helmet Armor Mod", "Nightmare Mod"
*/
export function groupModsByModType(plugs: PluggableInventoryItemDefinition[]) {
return Object.groupBy(plugs, (plugDef) => plugDef.itemTypeDisplayName);
const plugHeader = (plug: PluggableInventoryItemDefinition) => {
// Annoyingly some Prismatic plugs' itemTypeDisplayNames include the damage type and light/dark,
// so map them to a common header here
if (plug.plug.plugCategoryIdentifier.endsWith('.prism.aspects')) {
return t('Loadouts.Prismatic.Aspect');
} else if (plug.plug.plugCategoryIdentifier.endsWith('.prism.supers')) {
return t('Loadouts.Prismatic.Super');
} else if (plug.plug.plugCategoryIdentifier.endsWith('.prism.grenades')) {
return t('Loadouts.Prismatic.Grenade');
} else if (plug.plug.plugCategoryIdentifier.endsWith('.prism.melee')) {
return t('Loadouts.Prismatic.Melee');
} else {
return plug.itemTypeDisplayName;
}
};
return Object.groupBy(plugs, plugHeader);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/app/utils/socket-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,14 @@ export const aspectSocketCategoryHashes: SocketCategoryHashes[] = [
SocketCategoryHashes.Aspects_Abilities_Ikora,
SocketCategoryHashes.Aspects_Abilities_Neomuna,
SocketCategoryHashes.Aspects_Abilities_Stranger,
SocketCategoryHashes.Aspects_Abilities,
];

export const fragmentSocketCategoryHashes: SocketCategoryHashes[] = [
SocketCategoryHashes.Fragments_Abilities_Ikora,
SocketCategoryHashes.Fragments_Abilities_Stranger,
SocketCategoryHashes.Fragments_Abilities_Neomuna,
SocketCategoryHashes.Fragments_Abilities,
];

export const subclassAbilitySocketCategoryHashes: SocketCategoryHashes[] = [
Expand Down
6 changes: 6 additions & 0 deletions src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,12 @@
"OpenInOptimizer": "Optimize Armor",
"PickArmor": "Pick Armor",
"PickMods": "Add armor mods",
"Prismatic": {
"Aspect": "Prismatic Aspect",
"Grenade": "Prismatic Grenade",
"Melee": "Prismatic Melee",
"Super": "Super Ability"
},
"PullFromPostmaster": "Collect Postmaster",
"PullFromPostmasterError": "Unable to pull from Postmaster: {{error}}.",
"PullFromPostmasterGeneralError": "Unable to pull all items from Postmaster.",
Expand Down

0 comments on commit 1262f54

Please sign in to comment.