diff --git a/ArcdpsLogManager/Sections/LogList.cs b/ArcdpsLogManager/Sections/LogList.cs index 16a3efc7..d8e2e5f1 100644 --- a/ArcdpsLogManager/Sections/LogList.cs +++ b/ArcdpsLogManager/Sections/LogList.cs @@ -43,6 +43,7 @@ public class LogList : Panel { "CM", "Challenge Mode or Emboldened" }, { "Instabilities", "Fractals of the Mists" }, { "Scale", "Fractals of the Mists" }, + { "", "Encounter Icon" }, }; public bool ReadOnly { get; init; } @@ -139,6 +140,34 @@ private GridView ConstructLogGridView(LogDetailPanel detailPanel, Multi gridView.Columns.Add(favoritesColumn); + var encounterIconCell = new DrawableCell(); + encounterIconCell.Paint += (sender, args) => + { + if (!(args.Item is LogData log)) return; + if (log.ParsingStatus != ParsingStatus.Parsed) return; + + var rectangle = new RectangleF(new PointF(0, 0), new SizeF(PlayerIconSize, PlayerIconSize)); + + // If the log has no corrisponding icon it will not be drawn. + var wvwIcon = imageProvider.GetWvWMapIcon(log.MapId); + var encounterIcon = imageProvider.GetTinyEncounterIcon(log.Encounter); + if (encounterIcon != null) + { + args.Graphics.DrawImage(encounterIcon, rectangle); + } + if (wvwIcon != null) + { + args.Graphics.DrawImage(wvwIcon, rectangle); + } + }; + + gridView.Columns.Add(new GridColumn() + { + HeaderText = "", + DataCell = encounterIconCell, + Visible = false, + }); + gridView.Columns.Add(new GridColumn() { HeaderText = "Encounter", @@ -493,7 +522,7 @@ private ContextMenu ConstructLogGridViewContextMenu(GridView gridView) if (Abbreviations.TryGetValue(menuItem.Text, out string fullName)) { - menuItem.Text = $"{menuItem.Text} ({fullName})"; + menuItem.Text = string.IsNullOrEmpty(menuItem.Text) || string.IsNullOrWhiteSpace(menuItem.Text) ? $"{fullName}" : $"{menuItem.Text} ({fullName})"; } menuItem.CheckedChanged += (item, args) =>