From 25709f5530ad7b7d744fc8de135514bdccbe29ef Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Wed, 8 Feb 2023 20:41:45 +0100 Subject: [PATCH] Promote VFX markers to proper traps --- Pal.Client/LocalState.cs | 2 +- Pal.Client/Marker.cs | 6 ++++-- Pal.Client/Pal.Client.csproj | 2 +- Pal.Client/Plugin.cs | 10 +--------- Pal.Client/Rendering/MarkerConfig.cs | 1 - Pal.Client/Rendering/SimpleRenderer.cs | 1 - Pal.Client/Windows/ConfigWindow.cs | 5 ----- Pal.Common/Protos/palace.proto | 2 +- 8 files changed, 8 insertions(+), 21 deletions(-) diff --git a/Pal.Client/LocalState.cs b/Pal.Client/LocalState.cs index 87e4858..dc88369 100644 --- a/Pal.Client/LocalState.cs +++ b/Pal.Client/LocalState.cs @@ -62,7 +62,7 @@ namespace Pal.Client localState = new LocalState(territoryType) { - Markers = new ConcurrentBag(save.Markers.Where(o => o.Type != Marker.EType.Debug)), + Markers = new ConcurrentBag(save.Markers.Where(o => o.Type == Marker.EType.Trap || o.Type == Marker.EType.Hoard)), }; version = save.Version; } diff --git a/Pal.Client/Marker.cs b/Pal.Client/Marker.cs index 9afa89c..f7afbc6 100644 --- a/Pal.Client/Marker.cs +++ b/Pal.Client/Marker.cs @@ -88,7 +88,7 @@ namespace Pal.Client } - public bool IsPermanent() => Type == EType.Trap || Type == EType.Hoard || Type == EType.Debug; + public bool IsPermanent() => Type == EType.Trap || Type == EType.Hoard; public enum EType { @@ -97,7 +97,9 @@ namespace Pal.Client #region Permanent Markers Trap = ObjectType.Trap, Hoard = ObjectType.Hoard, - Debug = ObjectType.Debug, + + [Obsolete] + Debug = 3, #endregion # region Markers that only show up if they're currently visible diff --git a/Pal.Client/Pal.Client.csproj b/Pal.Client/Pal.Client.csproj index f95eaa9..934af7f 100644 --- a/Pal.Client/Pal.Client.csproj +++ b/Pal.Client/Pal.Client.csproj @@ -3,7 +3,7 @@ net7.0-windows 11.0 - 2.8 + 2.9 enable diff --git a/Pal.Client/Plugin.cs b/Pal.Client/Plugin.cs index d133938..fc7a114 100644 --- a/Pal.Client/Plugin.cs +++ b/Pal.Client/Plugin.cs @@ -167,10 +167,6 @@ namespace Pal.Client DebugNearest(m => m.Type == Marker.EType.Hoard); break; - case "dnear": - DebugNearest(m => m.Type == Marker.EType.Debug); - break; - default: Service.Chat.PrintError($"[Palace Pal] Unknown sub-command '{arguments}' for '{command}'."); break; @@ -402,10 +398,6 @@ namespace Pal.Client { CreateRenderElement(marker, elements, DetermineColor(marker, visibleMarkers)); } - else if (marker.Type == Marker.EType.Debug && Service.Configuration.BetaKey == "VFX") - { - CreateRenderElement(marker, elements, DetermineColor(marker, visibleMarkers)); - } } } @@ -626,7 +618,7 @@ namespace Pal.Client { var obj = Service.ObjectTable.FirstOrDefault(x => x.Address == address); if (obj != null && obj.Position.Length() > 0.1) - result.Add(new Marker(Marker.EType.Debug, obj.Position) { Seen = true }); + result.Add(new Marker(Marker.EType.Trap, obj.Position) { Seen = true }); } return result; diff --git a/Pal.Client/Rendering/MarkerConfig.cs b/Pal.Client/Rendering/MarkerConfig.cs index 77ac161..6b465f1 100644 --- a/Pal.Client/Rendering/MarkerConfig.cs +++ b/Pal.Client/Rendering/MarkerConfig.cs @@ -10,7 +10,6 @@ namespace Pal.Client.Rendering { Marker.EType.Trap, new MarkerConfig { Radius = 1.7f } }, { Marker.EType.Hoard, new MarkerConfig { Radius = 1.7f, OffsetY = -0.03f } }, { Marker.EType.SilverCoffer, new MarkerConfig { Radius = 1f } }, - { Marker.EType.Debug, new MarkerConfig { Radius = 1.7f, OffsetY = 0.1f } }, }; public float OffsetY { get; set; } = 0; diff --git a/Pal.Client/Rendering/SimpleRenderer.cs b/Pal.Client/Rendering/SimpleRenderer.cs index 08f5657..b204ea5 100644 --- a/Pal.Client/Rendering/SimpleRenderer.cs +++ b/Pal.Client/Rendering/SimpleRenderer.cs @@ -126,7 +126,6 @@ namespace Pal.Client.Rendering goto case Marker.EType.Trap; case Marker.EType.Trap: - case Marker.EType.Debug: var playerPos = Service.ClientState.LocalPlayer?.Position; if (playerPos == null) return; diff --git a/Pal.Client/Windows/ConfigWindow.cs b/Pal.Client/Windows/ConfigWindow.cs index d3a84f0..65c310b 100644 --- a/Pal.Client/Windows/ConfigWindow.cs +++ b/Pal.Client/Windows/ConfigWindow.cs @@ -336,11 +336,6 @@ namespace Pal.Client.Windows int silverCoffers = plugin.EphemeralMarkers.Count(x => x.Type == Marker.EType.SilverCoffer); ImGui.Text($"{silverCoffers} silver coffer{(silverCoffers == 1 ? "" : "s")} visible on current floor"); } - if (Service.Configuration.BetaKey == "VFX") - { - int debugMarkers = currentFloor.Markers.Count(x => x.Type == Marker.EType.Debug); - ImGui.Text($"{debugMarkers} debug marker{(debugMarkers == 1 ? "" : "s")}"); - } ImGui.Text($"Pomander of Sight: {plugin.PomanderOfSight}"); ImGui.Text($"Pomander of Intuition: {plugin.PomanderOfIntuition}"); diff --git a/Pal.Common/Protos/palace.proto b/Pal.Common/Protos/palace.proto index 65a7353..e77c207 100644 --- a/Pal.Common/Protos/palace.proto +++ b/Pal.Common/Protos/palace.proto @@ -68,5 +68,5 @@ enum ObjectType { // Objects only really used for debugging, may not return any objects at any point in time. // Semi-Permanent: Not saved locally, but saved on the server. - OBJECT_TYPE_DEBUG = 3; + reserved 3; }