Skip to content

Commit 695612d

Browse files
authored
Fix: limit ornament icon-swapping behavior to armor (#11665)
* Fix: limit ornament icon-swapping behavior to armor * Use new i18n keys for ornament explanation Retain the old keys * Revise so that ornaments can still be toggled off for weapons instead of only armor, with hover behavior restricted to armor * Update behavior so setting off = no hover behavior
1 parent 3fade6c commit 695612d

File tree

6 files changed

+27
-10
lines changed

6 files changed

+27
-10
lines changed

config/i18n.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,8 @@
12591259
"MaxParallelCores": "Maximum cores for parallel tasks",
12601260
"MaxParallelCoresExplanation": "Controls how many CPU cores DIM can use for intensive tasks like Loadout Optimizer and Loadout Analyzer. Higher values may improve performance but use more system resources.",
12611261
"OrnamentDisplay": "Show Ornaments on item tiles",
1262+
"OrnamentDisplayExplanationDisabled": "Items will never display their ornaments",
1263+
"OrnamentDisplayExplanationEnabled": "Hovering or long-pressing armor will hide its ornament",
12621264
"OrnamentDisplayExplanationHide": "Hovering or long-pressing an item will hide its ornament",
12631265
"OrnamentDisplayExplanationShow": "Hovering or long-pressing an item will show its ornament",
12641266
"ResetToDefault": "Reset",

src/app/inventory/ItemIcon.m.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ $commonBg: #366f42;
9797
content-visibility 0.2s allow-discrete;
9898
}
9999

100-
:global(.item):hover & {
101-
opacity: var(--ornament-display-opacity, 1);
102-
content-visibility: var(--ornament-display-visibility, auto);
100+
:global(.item):hover &.isArmor {
101+
opacity: 1;
102+
content-visibility: auto;
103103
}
104104
}
105105

@@ -114,9 +114,9 @@ $commonBg: #366f42;
114114
content-visibility 0.2s allow-discrete;
115115
}
116116

117-
:global(.item):hover & {
118-
opacity: calc(1 - var(--ornament-display-opacity, 1));
119-
content-visibility: var(--ornament-display-visibility-inverse, hidden);
117+
:global(.item):hover &.isArmor {
118+
opacity: 0;
119+
content-visibility: hidden;
120120
}
121121
}
122122

src/app/inventory/ItemIcon.m.scss.d.ts

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/inventory/ItemIcon.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,18 @@ export default function ItemIcon({ item, className }: { item: DimItem; className
180180
{foreground && (
181181
<div
182182
style={bungieBackgroundStyle(foreground)}
183-
className={clsx({ [styles.hasAltIcon]: Boolean(altIcon) })}
183+
className={clsx({
184+
[styles.hasAltIcon]: Boolean(altIcon),
185+
[styles.isArmor]: item.bucket.inArmor,
186+
})}
187+
/>
188+
)}
189+
{altIcon && (
190+
<div
191+
style={bungieBackgroundStyle(altIcon)}
192+
className={clsx({ [styles.altIcon]: true, [styles.isArmor]: item.bucket.inArmor })}
184193
/>
185194
)}
186-
{altIcon && <div style={bungieBackgroundStyle(altIcon)} className={styles.altIcon} />}
187195
{masterworkGlow && (
188196
<div style={bungieBackgroundStyle(masterworkGlow)} className={styles.adjustOpacity} />
189197
)}

src/app/settings/SettingsPage.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ const themeOptions = mapToOptions({
6060
vexnet: 'Vex Network',
6161
});
6262

63+
// Old ornament setting; keeping these strings from being culled
64+
// t('Settings.OrnamentDisplayExplanationHide')
65+
// t('Settings.OrnamentDisplayExplanationShow')
66+
6367
export default function SettingsPage() {
6468
usePageTitle(t('Settings.Settings'));
6569
const dispatch = useThunkDispatch();
@@ -526,8 +530,8 @@ export default function SettingsPage() {
526530
/>
527531
<div className={styles.fineprint}>
528532
{settings.ornamentDisplay === OrnamentDisplay.All
529-
? t('Settings.OrnamentDisplayExplanationHide')
530-
: t('Settings.OrnamentDisplayExplanationShow')}
533+
? t('Settings.OrnamentDisplayExplanationEnabled')
534+
: t('Settings.OrnamentDisplayExplanationDisabled')}
531535
</div>
532536
</div>
533537

src/locale/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,8 @@
12421242
"MaxParallelCores": "Maximum cores for parallel tasks",
12431243
"MaxParallelCoresExplanation": "Controls how many CPU cores DIM can use for intensive tasks like Loadout Optimizer and Loadout Analyzer. Higher values may improve performance but use more system resources.",
12441244
"OrnamentDisplay": "Show Ornaments on item tiles",
1245+
"OrnamentDisplayExplanationDisabled": "Items will never display their ornaments",
1246+
"OrnamentDisplayExplanationEnabled": "Hovering or long-pressing armor will hide its ornament",
12451247
"OrnamentDisplayExplanationHide": "Hovering or long-pressing an item will hide its ornament",
12461248
"OrnamentDisplayExplanationShow": "Hovering or long-pressing an item will show its ornament",
12471249
"ResetToDefault": "Reset",

0 commit comments

Comments
 (0)