Skip to content

Commit b20f097

Browse files
committed
Revise so that ornaments can still be toggled off for weapons instead of only armor, with hover behavior restricted to armor
1 parent 443f0fb commit b20f097

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

config/i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@
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",
1262+
"OrnamentDisplayExplanationDisabled": "Hovering or long-pressing armor will show its ornament",
12631263
"OrnamentDisplayExplanationEnabled": "Hovering or long-pressing armor will hide its ornament",
12641264
"OrnamentDisplayExplanationHide": "Hovering or long-pressing an item will hide its ornament",
12651265
"OrnamentDisplayExplanationShow": "Hovering or long-pressing an item will show its ornament",

src/app/inventory/ItemIcon.m.scss

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

100-
:global(.item):hover & {
100+
:global(.item):hover &.isArmor {
101101
opacity: var(--ornament-display-opacity, 1);
102102
content-visibility: var(--ornament-display-visibility, auto);
103103
}
@@ -114,7 +114,7 @@ $commonBg: #366f42;
114114
content-visibility 0.2s allow-discrete;
115115
}
116116

117-
:global(.item):hover & {
117+
:global(.item):hover &.isArmor {
118118
opacity: calc(1 - var(--ornament-display-opacity, 1));
119119
content-visibility: var(--ornament-display-visibility-inverse, hidden);
120120
}

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: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,7 @@ export default function ItemIcon({ item, className }: { item: DimItem; className
116116
let foreground = (item.iconDef?.foreground ?? item.icon) || '';
117117
let altIcon = '';
118118
if (item.ornamentIconDef) {
119-
if (item.bucket.inArmor) {
120-
altIcon = item.ornamentIconDef.foreground;
121-
} else {
122-
foreground = item.ornamentIconDef.foreground;
123-
}
119+
altIcon = item.ornamentIconDef.foreground;
124120
}
125121

126122
if (!animatedBackground && !altIcon) {
@@ -184,10 +180,18 @@ export default function ItemIcon({ item, className }: { item: DimItem; className
184180
{foreground && (
185181
<div
186182
style={bungieBackgroundStyle(foreground)}
187-
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 })}
188193
/>
189194
)}
190-
{altIcon && <div style={bungieBackgroundStyle(altIcon)} className={styles.altIcon} />}
191195
{masterworkGlow && (
192196
<div style={bungieBackgroundStyle(masterworkGlow)} className={styles.adjustOpacity} />
193197
)}

src/locale/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,7 @@
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",
1245+
"OrnamentDisplayExplanationDisabled": "Hovering or long-pressing armor will show its ornament",
12461246
"OrnamentDisplayExplanationEnabled": "Hovering or long-pressing armor will hide its ornament",
12471247
"OrnamentDisplayExplanationHide": "Hovering or long-pressing an item will hide its ornament",
12481248
"OrnamentDisplayExplanationShow": "Hovering or long-pressing an item will show its ornament",

0 commit comments

Comments
 (0)