Skip to content

Commit

Permalink
Updated data for v2.1.0.60224.
Browse files Browse the repository at this point in the history
  • Loading branch information
josdemmers committed Jan 19, 2025
1 parent 0171962 commit 648a697
Show file tree
Hide file tree
Showing 77 changed files with 60,067 additions and 9,795 deletions.
3 changes: 2 additions & 1 deletion D4Companion.Constants/ItemTypeConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class ItemTypeConstants
public const string Sigil = "sigil";
public const string Temper = "temper";
public const string Rune = "rune";
public const string OccultGem = "occultgem";
public const string OccultGem = "occultgem"; // Season 7
public const string WitcherSigil = "witchersigil"; // Season 7
}
}
6 changes: 5 additions & 1 deletion D4Companion.Entities/AspectInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ namespace D4Companion.Entities
{
public class AspectInfo
{
public int IdSno { get; set; }
public string IdSno { get; set; } = string.Empty;
public string IdName { get; set; } = string.Empty;

public List<string> IdSnoList { get; set; } = new List<string>();
public List<string> IdNameList { get; set; } = new List<string>();

public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public string DescriptionClean { get; set; } = string.Empty;
Expand Down
4 changes: 3 additions & 1 deletion D4Companion.Interfaces/IAffixManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ public interface IAffixManager
double GetAffixMinimalValue(string idName);
ItemAffix GetAspect(string aspectId, string itemType);
string GetAspectDescription(string aspectId);
string GetAspectId(int aspectSno);
//string GetAspectId(int aspectSno);
string GetAspectName(string aspectId);
AspectInfo? GetAspectInfoMaxrollByIdSno(string aspectIdSno);
AspectInfo? GetAspectInfoMaxrollByIdName(string aspectIdName);
ItemAffix GetSigil(string affixId, string itemType);
string GetSigilDescription(string sigilId);
string GetSigilDungeonTier(string sigilId);
Expand Down
46 changes: 34 additions & 12 deletions D4Companion.Services/AffixManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -574,18 +574,18 @@ public string GetAspectDescription(string aspectId)
}
}

public string GetAspectId(int aspectSno)
{
var aspectInfo = _aspects.FirstOrDefault(a => a.IdSno == aspectSno);
if (aspectInfo != null)
{
return aspectInfo.IdName;
}
else
{
return string.Empty;
}
}
//public string GetAspectId(int aspectSno)
//{
// var aspectInfo = _aspects.FirstOrDefault(a => a.IdSno.Equals(aspectSno));
// if (aspectInfo != null)
// {
// return aspectInfo.IdName;
// }
// else
// {
// return string.Empty;
// }
//}

public string GetAspectName(string aspectId)
{
Expand All @@ -600,6 +600,28 @@ public string GetAspectName(string aspectId)
}
}

/// <summary>
/// Find Aspect with matching sno for aspects used by imported Maxroll builds.
/// Uses an aspect list containing all known aspects, included aspects with duplicated descriptions.
/// </summary>
/// <param name="aspectIdSno"></param>
/// <returns></returns>
public AspectInfo? GetAspectInfoMaxrollByIdSno(string aspectIdSno)
{
return _aspects.FirstOrDefault(a => a.IdSnoList.Contains(aspectIdSno));
}

/// <summary>
/// Find Aspect with matching name for aspects used by imported Maxroll builds.
/// Uses an aspect list contaning all known aspects, included aspects with duplicated descriptions.
/// </summary>
/// <param name="aspectIdName"></param>
/// <returns></returns>
public AspectInfo? GetAspectInfoMaxrollByIdName(string aspectIdName)
{
return _aspects.FirstOrDefault(a => a.IdNameList.Contains(aspectIdName));
}

public ItemAffix GetSigil(string affixId, string itemType)
{
var affixDefault = new ItemAffix
Expand Down
34 changes: 14 additions & 20 deletions D4Companion.Services/BuildsManagerMaxroll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -459,19 +459,13 @@ public void CreatePresetFromMaxrollBuild(MaxrollBuild maxrollBuild, string profi
foreach (var aspectSnoFA in aspects)
{
int aspectSno = aspectSnoFA;
string aspectId = _affixManager.GetAspectId(aspectSno);

if (string.IsNullOrWhiteSpace(aspectId))
if (_maxrollMappingsAspects.TryGetValue(aspectSno, out int aspectSnoMapped))
{
// Check if there is a known mapping available
if (_maxrollMappingsAspects.TryGetValue(aspectSno, out int aspectSnoMapped))
{
aspectSno = aspectSnoMapped;
aspectId = _affixManager.GetAspectId(aspectSno);
}
aspectSno = aspectSnoMapped;
}

if (string.IsNullOrWhiteSpace(aspectId))
AspectInfo? aspectInfo = _affixManager.GetAspectInfoMaxrollByIdSno(aspectSno.ToString());
if (aspectInfo == null)
{
_logger.LogWarning($"{MethodBase.GetCurrentMethod()?.Name}: Unknown aspect sno: {aspectSno}");
_eventAggregator.GetEvent<WarningOccurredEvent>().Publish(new WarningOccurredEventParams
Expand All @@ -481,16 +475,16 @@ public void CreatePresetFromMaxrollBuild(MaxrollBuild maxrollBuild, string profi
}
else
{
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectId, Type = Constants.ItemTypeConstants.Helm, Color = _settingsManager.Settings.DefaultColorAspects });
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectId, Type = Constants.ItemTypeConstants.Chest, Color = _settingsManager.Settings.DefaultColorAspects });
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectId, Type = Constants.ItemTypeConstants.Gloves, Color = _settingsManager.Settings.DefaultColorAspects });
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectId, Type = Constants.ItemTypeConstants.Pants, Color = _settingsManager.Settings.DefaultColorAspects });
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectId, Type = Constants.ItemTypeConstants.Boots, Color = _settingsManager.Settings.DefaultColorAspects });
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectId, Type = Constants.ItemTypeConstants.Amulet, Color = _settingsManager.Settings.DefaultColorAspects });
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectId, Type = Constants.ItemTypeConstants.Ring, Color = _settingsManager.Settings.DefaultColorAspects });
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectId, Type = Constants.ItemTypeConstants.Weapon, Color = _settingsManager.Settings.DefaultColorAspects });
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectId, Type = Constants.ItemTypeConstants.Ranged, Color = _settingsManager.Settings.DefaultColorAspects });
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectId, Type = Constants.ItemTypeConstants.Offhand, Color = _settingsManager.Settings.DefaultColorAspects });
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectInfo.IdName, Type = Constants.ItemTypeConstants.Helm, Color = _settingsManager.Settings.DefaultColorAspects });
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectInfo.IdName, Type = Constants.ItemTypeConstants.Chest, Color = _settingsManager.Settings.DefaultColorAspects });
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectInfo.IdName, Type = Constants.ItemTypeConstants.Gloves, Color = _settingsManager.Settings.DefaultColorAspects });
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectInfo.IdName, Type = Constants.ItemTypeConstants.Pants, Color = _settingsManager.Settings.DefaultColorAspects });
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectInfo.IdName, Type = Constants.ItemTypeConstants.Boots, Color = _settingsManager.Settings.DefaultColorAspects });
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectInfo.IdName, Type = Constants.ItemTypeConstants.Amulet, Color = _settingsManager.Settings.DefaultColorAspects });
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectInfo.IdName, Type = Constants.ItemTypeConstants.Ring, Color = _settingsManager.Settings.DefaultColorAspects });
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectInfo.IdName, Type = Constants.ItemTypeConstants.Weapon, Color = _settingsManager.Settings.DefaultColorAspects });
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectInfo.IdName, Type = Constants.ItemTypeConstants.Ranged, Color = _settingsManager.Settings.DefaultColorAspects });
affixPreset.ItemAspects.Add(new ItemAffix { Id = aspectInfo.IdName, Type = Constants.ItemTypeConstants.Offhand, Color = _settingsManager.Settings.DefaultColorAspects });
}
}

Expand Down
3 changes: 2 additions & 1 deletion D4Companion.Services/ScreenProcessHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ private void ProcessScreen(Bitmap? currentScreen)
}

// Skip ignored item types - Seasonal
if (_currentTooltip.ItemType.Equals(ItemTypeConstants.OccultGem))
if (_currentTooltip.ItemType.Equals(ItemTypeConstants.OccultGem) ||
_currentTooltip.ItemType.Equals(ItemTypeConstants.WitcherSigil))
{
_currentTooltip.ItemAffixLocations.Clear();
}
Expand Down
Loading

0 comments on commit 648a697

Please sign in to comment.