diff --git a/D4Companion.Services/OverlayHandler.cs b/D4Companion.Services/OverlayHandler.cs index 54d4f29b..3c05201d 100644 --- a/D4Companion.Services/OverlayHandler.cs +++ b/D4Companion.Services/OverlayHandler.cs @@ -231,8 +231,9 @@ private void DrawGraphicsAffixes(object? sender, DrawGraphicsEventArgs e, bool i var itemAffix = _currentTooltip.ItemAffixes.FirstOrDefault(affix => affix.Item1 == i); if (itemAffix != null) { - // Overwrite affix colors for unique items var affixColor = itemAffix.Item2.Color; + + // Overwrite affix colors for unique items if (_settingsManager.Settings.IsUniqueDetectionEnabled && !_currentTooltip.ItemAspectLocation.IsEmpty && _currentTooltip.IsUniqueItem && !string.IsNullOrEmpty(_currentTooltip.ItemAspect.Id)) @@ -303,11 +304,11 @@ private void DrawGraphicsAffixesMulti(object? sender, DrawGraphicsEventArgs e, b for (int i = 0; i < _currentTooltip.ItemAffixesBuildList.Count; i++) { - DrawGraphicsAffixesMulti(sender, e, itemPowerLimitCheckOk, _currentTooltip.ItemAffixesBuildList[i], 5 - (i * 20)); + DrawGraphicsAffixesMulti(sender, e, itemPowerLimitCheckOk, _currentTooltip.ItemAffixesBuildList[i], _currentTooltip.ItemAspectBuildList[i], 5 - (i * 20)); } } - private void DrawGraphicsAffixesMulti(object? sender, DrawGraphicsEventArgs e, bool itemPowerLimitCheckOk, List> itemAffixes, int offset) + private void DrawGraphicsAffixesMulti(object? sender, DrawGraphicsEventArgs e, bool itemPowerLimitCheckOk, List> itemAffixes, ItemAffix itemAspect, int offset) { if (_currentTooltip.ItemAffixLocations.Any()) { @@ -328,7 +329,15 @@ private void DrawGraphicsAffixesMulti(object? sender, DrawGraphicsEventArgs e, b var itemAffix = itemAffixes.FirstOrDefault(affix => affix.Item1 == i); if (itemAffix != null) { - var affixColor = itemAffix.Item2.Color; + var affixColor = itemAffix.Item2.Color; + + // Overwrite affix colors for unique items + if (_settingsManager.Settings.IsUniqueDetectionEnabled && + !_currentTooltip.ItemAspectLocation.IsEmpty && _currentTooltip.IsUniqueItem && + !string.IsNullOrEmpty(_currentTooltip.ItemAspect.Id)) + { + affixColor = itemAspect.Color == Colors.Red ? itemAffix.Item2.Color : itemAspect.Color; + } // Hide all unwanted affixes. if (!affixColor.ToString().Equals(Colors.Red.ToString())) diff --git a/D4Companion.Services/ScreenProcessHandler.cs b/D4Companion.Services/ScreenProcessHandler.cs index 43339d0e..7c370326 100644 --- a/D4Companion.Services/ScreenProcessHandler.cs +++ b/D4Companion.Services/ScreenProcessHandler.cs @@ -1580,13 +1580,13 @@ private void SetMultiBuildMode(List> buildAffixes, ItemAff // Affixes System.Windows.Media.Color color = Colors.Red; - bool isAnyType = false; - bool isGreater = false; - bool isImplicit = false; - bool isTempered = false; foreach (var currentItemAffix in _currentTooltip.ItemAffixes) { color = Colors.Red; + bool isAnyType = false; + bool isGreater = false; + bool isImplicit = false; + bool isTempered = false; if (currentItemAffix.Item2.Type.Equals(ItemTypeConstants.Sigil)) { var affix = preset.ItemSigils.FirstOrDefault(a => a.Id.Equals(currentItemAffix.Item2.Id) && a.Type.Equals(currentItemAffix.Item2.Type));