From 159a0ad6096f4cb8301218f969db30d40e20d2d8 Mon Sep 17 00:00:00 2001 From: D4VID Date: Sat, 1 Mar 2025 19:52:38 +0100 Subject: [PATCH] Outline start end end pegs --- .../src/client/tool/CriticalPathAnalyzerTool.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CriticalPathAnalyzer/CriticalPathAnalyzer/src/client/tool/CriticalPathAnalyzerTool.cs b/CriticalPathAnalyzer/CriticalPathAnalyzer/src/client/tool/CriticalPathAnalyzerTool.cs index 6d73037..795df3f 100644 --- a/CriticalPathAnalyzer/CriticalPathAnalyzer/src/client/tool/CriticalPathAnalyzerTool.cs +++ b/CriticalPathAnalyzer/CriticalPathAnalyzer/src/client/tool/CriticalPathAnalyzerTool.cs @@ -1,9 +1,11 @@ using System; using CriticalPathAnalyzer.Shared.Packets.C2S; using CriticalPathAnalyzer.Shared.Packets.S2C; +using JimmysUnityUtilities; using LogicAPI.Data; using LogicLog; using LogicWorld.Interfaces; +using LogicWorld.Outlines; using LogicWorld.Physics; using LogicWorld.Players; @@ -19,14 +21,19 @@ namespace CriticalPathAnalyzer.Client.Tool { private static Guid _currentRequestGuid = Guid.NewGuid(); private static AnalyzePathResponse _response; + private static readonly OutlineData StartOutline = new OutlineData(new Color24(0x00ff00)); + private static readonly OutlineData EndOutline = new OutlineData(new Color24(0xff0000)); + public static void Init(ILogicLogger logger) { _logger = logger; } public static void Clear() { + PathHighLighter.RemoveHighLighting(); + Outliner.RemoveOutline(_startPegAddress); + Outliner.RemoveOutline(_endPegAddress); _startPegAddress = PegAddress.Empty; _endPegAddress = PegAddress.Empty; - PathHighLighter.RemoveHighLighting(); } private static PegAddress RayCastPeg() { @@ -57,6 +64,8 @@ namespace CriticalPathAnalyzer.Client.Tool { _logger.Info("Analyze Path Start"); PegAddress pegAddress = RayCastPeg(); if (!pegAddress.IsEmpty()) { + Outliner.RemoveOutline(_startPegAddress); + Outliner.Outline(pegAddress, StartOutline); _startPegAddress = pegAddress; if (!_startPegAddress.IsEmpty() && !_endPegAddress.IsEmpty()) { CalculateCriticalPath(); @@ -68,6 +77,8 @@ namespace CriticalPathAnalyzer.Client.Tool { _logger.Info("Analyze Path End"); PegAddress pegAddress = RayCastPeg(); if (!pegAddress.IsEmpty()) { + Outliner.RemoveOutline(_endPegAddress); + Outliner.Outline(pegAddress, EndOutline); _endPegAddress = pegAddress; if (!_startPegAddress.IsEmpty() && !_endPegAddress.IsEmpty()) { CalculateCriticalPath();