542da3a71b
Made-with: Cursor
36 lines
1.3 KiB
C#
36 lines
1.3 KiB
C#
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(),
|
|
});
|
|
}
|
|
}
|
|
|
|
}
|