-
Notifications
You must be signed in to change notification settings - Fork 6
Adding support for shrine name display #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: poe1
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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); | ||
|
|
@@ -26,6 +27,7 @@ public class MapIconsSettings : ISettings | |
| { | ||
| Content = | ||
| [ | ||
| new TextNode("Metadata/Shrines/Shrine") | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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(""), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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)) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
|
|
||
There was a problem hiding this comment.
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.