Skip to content

Commit

Permalink
Improvements for the multi build mode
Browse files Browse the repository at this point in the history
  • Loading branch information
josdemmers committed Feb 8, 2025
1 parent 4e7a8c9 commit c7e8767
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
17 changes: 13 additions & 4 deletions D4Companion.Services/OverlayHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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<Tuple<int, ItemAffix>> itemAffixes, int offset)
private void DrawGraphicsAffixesMulti(object? sender, DrawGraphicsEventArgs e, bool itemPowerLimitCheckOk, List<Tuple<int, ItemAffix>> itemAffixes, ItemAffix itemAspect, int offset)
{
if (_currentTooltip.ItemAffixLocations.Any())
{
Expand All @@ -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()))
Expand Down
8 changes: 4 additions & 4 deletions D4Companion.Services/ScreenProcessHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1580,13 +1580,13 @@ private void SetMultiBuildMode(List<Tuple<int, ItemAffix>> 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));
Expand Down

0 comments on commit c7e8767

Please sign in to comment.