From 93ab8b3ca8c4aa121751e40806c4aacebffa8cce Mon Sep 17 00:00:00 2001 From: Madpeter <57852827+Madpeterz@users.noreply.github.com> Date: Wed, 9 Apr 2025 15:11:21 +0100 Subject: [PATCH] adds GetCurrentParcelSize --- SecondBotEvents/Commands/ParcelCommands.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/SecondBotEvents/Commands/ParcelCommands.cs b/SecondBotEvents/Commands/ParcelCommands.cs index 96e09e4..e393fb3 100644 --- a/SecondBotEvents/Commands/ParcelCommands.cs +++ b/SecondBotEvents/Commands/ParcelCommands.cs @@ -66,6 +66,24 @@ namespace SecondBotEvents.Commands return BasicReply(JsonConvert.SerializeObject(reply)); } + [About("Requests the current parcel size")] + [ReturnHints("width,height as a csv")] + [ReturnHintsFailure("Error not in a sim")] + [ReturnHintsFailure("Parcel data not ready")] + public object GetCurrentParcelSize() + { + KeyValuePair tests = SetupCurrentParcel(); + if (tests.Key == false) + { + return Failure(tests.Value); + } + Vector3 start = targetparcel.AABBMin; + Vector3 end = targetparcel.AABBMax; + Vector3 dif = end - start; + return BasicReply(dif.X.ToString() + "," + dif.Y.ToString()); + } + + [About("requests the parcel layout as a SVG\n call UpdateListOfParcels first to update list before calling")] [ReturnHints("json encoded svg")] public object GetSimParcelLayers()