v1.0.0.13: User-placed map notes with Title/Description; custom icon; notes on minimap
Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
||||
using Mappy.Classes;
|
||||
using Mappy.Data;
|
||||
|
||||
namespace Mappy.MapRenderer;
|
||||
|
||||
public partial class MapRenderer
|
||||
{
|
||||
private unsafe void DrawMapNotes()
|
||||
{
|
||||
var agent = AgentMap.Instance();
|
||||
var territoryId = agent->SelectedTerritoryId;
|
||||
var mapId = agent->SelectedMapId;
|
||||
|
||||
foreach (var note in System.MapNoteConfig.Notes.Where(n => n.Territory == territoryId && n.Map == mapId).ToList()) {
|
||||
var pos = new Vector2(note.X, note.Y) * Scale * DrawHelpers.GetMapScaleFactor() + DrawHelpers.GetCombinedOffsetVector() * Scale;
|
||||
|
||||
DrawHelpers.DrawMapMarker(new MarkerInfo
|
||||
{
|
||||
Position = pos,
|
||||
Offset = DrawPosition,
|
||||
Scale = Scale,
|
||||
IconId = DrawHelpers.MapNoteIconId,
|
||||
PrimaryText = () => note.Title ?? "",
|
||||
SecondaryText = () => string.IsNullOrWhiteSpace(note.Description)
|
||||
? note.GetTerritoryType().PlaceNameZone.Value.Name.ExtractText()
|
||||
: $"{note.Description}\n{note.GetTerritoryType().PlaceNameZone.Value.Name.ExtractText()}",
|
||||
OnLeftClicked = () => note.Focus(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user