From 0bb959d8fda598b0f166ba5131a493c64147a317 Mon Sep 17 00:00:00 2001 From: Mandarinka Tasty Date: Mon, 28 Nov 2016 05:05:36 +0100 Subject: [PATCH] The implementation of new flags = parameters for llGetObjectDetails - Part II Constant: integer OBJECT_TOTAL_INVENTORY_COUNT = 31 Constant: integer OBJECT_GROUP_TAG = 33 Signed-off-by: Mandarinka Tasty Signed-off-by: UbitUmarov --- .../Shared/Api/Implementation/LSL_Api.cs | 25 +++++++++++++++++++ .../Shared/Api/Runtime/LSL_Constants.cs | 2 ++ 2 files changed, 27 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index cc36ad1d9f..d90d5ddeca 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -13772,6 +13772,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api AttachmentsPrimList.Add(new LSL_Integer(Attachment.PrimCount)); ret.Add(new LSL_Integer(AttachmentsPrimList.Sum())); break; + case ScriptBaseClass.OBJECT_TOTAL_INVENTORY_COUNT: + LSL_List AttachmentsPrimsInventoryList = new LSL_List(); + foreach (SceneObjectGroup Attachment in av.GetAttachments()) + { + Attachment.ForEachPart(delegate(SceneObjectPart part) + { + AttachmentsPrimsInventoryList.Add(new LSL_Integer(part.Inventory.Count)); + }); + } + ret.Add(new LSL_Integer(AttachmentsPrimsInventoryList.Sum())); + break; + case ScriptBaseClass.OBJECT_GROUP_TAG: + ret.Add(new LSL_String(av.Grouptitle)); + break; default: // Invalid or unhandled constant. ret.Add(new LSL_Integer(ScriptBaseClass.OBJECT_UNKNOWN_DETAIL)); @@ -13953,6 +13967,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case ScriptBaseClass.OBJECT_PRIM_COUNT: ret.Add(new LSL_Integer(obj.ParentGroup.PrimCount)); break; + case ScriptBaseClass.OBJECT_TOTAL_INVENTORY_COUNT: + LSL_List ObjectPrimsInventoryList = new LSL_List(); + obj.ParentGroup.ForEachPart(delegate(SceneObjectPart part) + { + ObjectPrimsInventoryList.Add(new LSL_Integer(part.Inventory.Count)); + }); + ret.Add(ObjectPrimsInventoryList.Sum()); + break; + case ScriptBaseClass.OBJECT_GROUP_TAG: + ret.Add(new LSL_String(String.Empty)); + break; default: // Invalid or unhandled constant. ret.Add(new LSL_Integer(ScriptBaseClass.OBJECT_UNKNOWN_DETAIL)); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index a177310b1d..17173a2444 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -639,6 +639,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int OBJECT_CLICK_ACTION = 28; public const int OBJECT_OMEGA = 29; public const int OBJECT_PRIM_COUNT = 30; + public const int OBJECT_TOTAL_INVENTORY_COUNT = 31; + public const int OBJECT_GROUP_TAG = 33; // Pathfinding types public const int OPT_OTHER = -1;