Skip to content

Commit

Permalink
Replaced generic stackable mod text. (#10169)
Browse files Browse the repository at this point in the history
* requirement vs description

* jank fix but works, look for side effects

* nested ternary?

* garden bug fixed, need to fix more

* it works, need to test

* works

* not stackable -> Unstackable

* changeLog and removed comment

* reverted some changes
  • Loading branch information
grySal authored Dec 19, 2023
1 parent 590a035 commit 4777777
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
9 changes: 7 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"**/*.m.scss.d.ts": true
},
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll": "explicit"
},
"jest.jestCommandLine": "pnpm test --",
"[javascript]": {
Expand Down Expand Up @@ -64,5 +64,10 @@
"tsconfig.json": "tsconfig.*.json",
"package.json": "package-lock.json, pnpm-lock.yaml"
},
"eslint.lintTask.options": "src"
"eslint.lintTask.options": "src",
"[javascript][typescript][typescriptreact]": {
"editor.codeActionsOnSave": {
"source.organizeImports": "never"
}
}
}
4 changes: 3 additions & 1 deletion config/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,9 @@
"UnassignedModsDesc": "1 mod did not fit due to insufficient energy capacity or mod slots. Energy upgrades to the selected armor will not fix the issue.",
"UnassignedModsDesc_plural": "{{count}} mods did not fit due to insufficient energy capacity or mod slots. Energy upgrades to the selected armor will not fix the issue.",
"UpgradeCosts": "Upgrade Costs",
"UpgradeCostsDesc": "Some armor needs energy capacity upgrades to fit the requested mods. In total, these upgrades cost:"
"UpgradeCostsDesc": "Some armor needs energy capacity upgrades to fit the requested mods. In total, these upgrades cost:",
"UnstackableMod": "Unstackable",
"StackableMod": "Stackable"
},
"MissingItemsWarning": "Some of the items in this loadout are no longer in your inventory.",
"MissingItems": "Missing Items",
Expand Down
2 changes: 2 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Next
* Replaced the stackable/unstackable mod text.

=======
## 7.99.0 <span class="changelog-date">(2023-12-17)</span>

## 7.98.0 <span class="changelog-date">(2023-12-10)</span>
Expand Down
15 changes: 13 additions & 2 deletions src/app/loadout/plug-drawer/SelectablePlug.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import ClosableContainer from 'app/dim-ui/ClosableContainer';
import { TileGridTile } from 'app/dim-ui/TileGrid';
import RichDestinyText from 'app/dim-ui/destiny-symbols/RichDestinyText';
import { t } from 'app/i18next-t';
import { DefItemIcon } from 'app/inventory/ItemIcon';
import { PluggableInventoryItemDefinition } from 'app/inventory/item-types';
import { PlugStats } from 'app/item-popup/PlugTooltip';
import { getPlugDefStats, usePlugDescriptions } from 'app/utils/plug-descriptions';
import { DestinyClass } from 'bungie-api-ts/destiny2';
import unstackableModHashes from 'data/d2/unstackable-mods.json';
import React, { useCallback, useMemo } from 'react';
import styles from './SelectablePlug.m.scss';

Expand Down Expand Up @@ -74,12 +76,21 @@ function SelectablePlugDetails({

// We don't show Clarity descriptions here due to layout concerns, see #9318 / #8641
const plugDescriptions = usePlugDescriptions(plug, stats, /* forceUseBungieDescriptions */ true);

return (
<>
{plugDescriptions.perks.map((perkDesc) => (
{plugDescriptions.perks.map((perkDesc, index) => (
<React.Fragment key={perkDesc.perkHash}>
{perkDesc.description && <RichDestinyText text={perkDesc.description} />}
{perkDesc.requirement && <div className={styles.requirement}>{perkDesc.requirement}</div>}
{perkDesc.requirement && index === plugDescriptions.perks.length - 1 ? (
<div className={styles.requirement}>
{unstackableModHashes.includes(plug.hash)
? t('Loadouts.ModPlacement.UnstackableMod')
: t('Loadouts.ModPlacement.StackableMod')}
</div>
) : (
<div className={styles.requirement}>{perkDesc.requirement}</div>
)}
</React.Fragment>
))}
{stats.length > 0 && <PlugStats stats={stats} />}
Expand Down
2 changes: 2 additions & 0 deletions src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -777,9 +777,11 @@
"InvalidModsDesc": "1 mod cannot fit into any armor piece.",
"InvalidModsDesc_plural": "{{count}} mods cannot fit into any armor piece.",
"ModPlacement": "Mod Placement",
"StackableMod": "Stackable",
"UnassignedMods": "Unassigned Mods",
"UnassignedModsDesc": "1 mod did not fit due to insufficient energy capacity or mod slots. Energy upgrades to the selected armor will not fix the issue.",
"UnassignedModsDesc_plural": "{{count}} mods did not fit due to insufficient energy capacity or mod slots. Energy upgrades to the selected armor will not fix the issue.",
"UnstackableMod": "Unstackable",
"UpgradeCosts": "Upgrade Costs",
"UpgradeCostsDesc": "Some armor needs energy capacity upgrades to fit the requested mods. In total, these upgrades cost:"
},
Expand Down

0 comments on commit 4777777

Please sign in to comment.