Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion IconsBuilder/Icons/MonsterIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void Update(Entity entity, IconsBuilderSettings settings, Dictionary<stri
{
var objectMagicProperties = entity.GetComponent<ObjectMagicProperties>();

var mods = objectMagicProperties.Mods;
var mods = objectMagicProperties?.Mods;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Encountered a null reference exception here where the HasComponent check returned true, but by the time it got to Entity.GetComponent, it was false.


if (mods != null)
{
Expand Down
2 changes: 2 additions & 0 deletions MapIconsSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class MapIconsSettings : ISettings
public RangeNode<float> ZForText { get; set; } = new RangeNode<float>(-10, -50, 50);
public ToggleNode DrawOnlyOnLargeMap { get; set; } = new ToggleNode(true);
public ToggleNode DrawCachedEntities { get; set; } = new ToggleNode(true);
public ToggleNode DrawShrineNames { get; set; } = new ToggleNode(true);
public ToggleNode DrawReplacementsForGameIconsWhenOutOfRange { get; set; } = new ToggleNode(true);
public ToggleNode IgnoreFullscreenPanels { get; set; } = new ToggleNode(false);
public ToggleNode IgnoreLargePanels { get; set; } = new ToggleNode(false);
Expand All @@ -26,6 +27,7 @@ public class MapIconsSettings : ISettings
{
Content =
[
new TextNode("Metadata/Shrines/Shrine")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the Show() function checks for the entity being in AlwaysShownIngameIcons, need to add this for shrines to be shown.

],
EnableControls = true,
ItemFactory = () => new TextNode(""),
Expand Down
13 changes: 8 additions & 5 deletions MinimapIcons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,17 +268,20 @@ public override void Render()
if (!icon.Show())
continue;

var iconGridPos = icon.GridPosition();
var position = _mapCenter +
DeltaInWorldToMinimapDelta(iconGridPos - playerPos,
(playerHeight + GameController.IngameState.Data.GetTerrainHeightAt(iconGridPos)) * PoeMapExtension.WorldToGridConversion);

if (Settings.DrawShrineNames && icon.Entity.Type == EntityType.Shrine && !string.IsNullOrEmpty(icon.Entity.RenderName))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this after the Show() check but before the HasIngameIcon check so that we can add text to the existing ingame icon.

Graphics.DrawText(icon.Entity.RenderName, position.Translate(0, Settings.ZForText), FontAlign.Center);

if (icon.HasIngameIcon &&
icon is not CustomIcon &&
(!Settings.DrawReplacementsForGameIconsWhenOutOfRange || icon.Entity.IsValid) &&
!icon.Entity.Path.Contains("Metadata/Terrain/Leagues/Delve/Objects/DelveWall"))
continue;

var iconGridPos = icon.GridPosition();
var position = _mapCenter +
DeltaInWorldToMinimapDelta(iconGridPos - playerPos,
(playerHeight + GameController.IngameState.Data.GetTerrainHeightAt(iconGridPos)) * PoeMapExtension.WorldToGridConversion);

var iconValueMainTexture = icon.MainTexture;
var size = iconValueMainTexture.Size;
var halfSize = size / 2f;
Expand Down