v1.0.0.14: Movement Trail (Carbonite-style) - red dots show where you've been
Made-with: Cursor
This commit is contained in:
@@ -62,6 +62,8 @@ public partial class MapRenderer
|
||||
DrawMinimapFlag(contentTopLeft, TexToContent, scaleFactor, offsetX, offsetY);
|
||||
// User map notes
|
||||
DrawMinimapMapNotes(contentTopLeft, TexToContent, size, scaleFactor, offsetX, offsetY);
|
||||
// Movement trail
|
||||
DrawMinimapMovementTrail(contentTopLeft, TexToContent, size, scaleFactor, offsetX, offsetY);
|
||||
// Temporary (quest objectives, etc.)
|
||||
DrawMinimapTempMarkers(contentTopLeft, TexToContent, size, scaleFactor, offsetX, offsetY, scale);
|
||||
// Field markers (waymarks)
|
||||
@@ -729,6 +731,33 @@ public partial class MapRenderer
|
||||
}
|
||||
}
|
||||
|
||||
private unsafe void DrawMinimapMovementTrail(Vector2 contentTopLeft, Func<float, float, Vector2> texToContent, Vector2 size, float scaleFactor, float offsetX, float offsetY)
|
||||
{
|
||||
if (!System.SystemConfig.ShowMovementTrail) return;
|
||||
|
||||
var agent = AgentMap.Instance();
|
||||
var territoryId = agent->CurrentTerritoryId;
|
||||
var mapId = agent->CurrentMapId;
|
||||
var now = DateTime.UtcNow.Subtract(DateTime.UnixEpoch).TotalSeconds;
|
||||
var fadeTime = System.SystemConfig.MovementTrailFadeTimeSeconds;
|
||||
|
||||
foreach (var pt in System.MovementTrailConfig.GetVisiblePoints(territoryId, mapId).ToList()) {
|
||||
var age = now - pt.TimeStamp;
|
||||
var alpha = (float)((fadeTime - age) / fadeTime * 0.9);
|
||||
if (alpha <= 0f) continue;
|
||||
|
||||
var tx = 1024.0f + (pt.X - offsetX) * scaleFactor;
|
||||
var ty = 1024.0f + (pt.Y - offsetY) * scaleFactor;
|
||||
var contentPos = texToContent(tx, ty);
|
||||
if (!IsInMinimapBounds(contentPos, size, MinimapBoundsMargin)) continue;
|
||||
|
||||
var centerScreen = contentPos + contentTopLeft;
|
||||
var trailSize = 4f * 0.75f;
|
||||
var color = System.MovementTrailConfig.TrailColor with { W = alpha };
|
||||
ImGui.GetWindowDrawList().AddCircleFilled(centerScreen, trailSize, ImGui.GetColorU32(color));
|
||||
}
|
||||
}
|
||||
|
||||
private unsafe void DrawMinimapMapNotes(Vector2 contentTopLeft, Func<float, float, Vector2> texToContent, Vector2 size, float scaleFactor, float offsetX, float offsetY)
|
||||
{
|
||||
var agent = AgentMap.Instance();
|
||||
|
||||
Reference in New Issue
Block a user