From 97b207240ee79abfec08d2dfaa9385211eb305c8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 23 Aug 2011 22:05:22 +0100 Subject: rename AttachmentsModule.ShowDetachInUserInventory() to DetachSingleAttachmentToInv() for consistency and to reflect it's actual behaviour --- .../Avatar/Attachments/AttachmentsModule.cs | 11 +++++------ .../Attachments/Tests/AttachmentsModuleTests.cs | 2 +- .../Framework/Interfaces/IAttachmentsModule.cs | 22 +++++++--------------- .../Shared/Api/Implementation/LSL_Api.cs | 2 +- 4 files changed, 14 insertions(+), 23 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 90092ce..a854c11 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -80,7 +80,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachmentsFromInventory; client.OnObjectAttach += AttachObject; client.OnObjectDetach += DetachObject; - client.OnDetachAttachmentIntoInv += ShowDetachInUserInventory; + client.OnDetachAttachmentIntoInv += DetachSingleAttachmentToInv; } public void UnsubscribeFromClientEvents(IClientAPI client) @@ -89,7 +89,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachmentsFromInventory; client.OnObjectAttach -= AttachObject; client.OnObjectDetach -= DetachObject; - client.OnDetachAttachmentIntoInv -= ShowDetachInUserInventory; + client.OnDetachAttachmentIntoInv -= DetachSingleAttachmentToInv; } /// @@ -269,7 +269,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments if (updateInventoryStatus) { if (att == null) - ShowDetachInUserInventory(itemID, sp.ControllingClient); + DetachSingleAttachmentToInv(itemID, sp.ControllingClient); else ShowAttachInUserInventory(att, sp, itemID, AttachmentPt); } @@ -417,12 +417,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments SceneObjectGroup group = m_scene.GetGroupByPrim(objectLocalID); if (group != null) { - //group.DetachToGround(); - ShowDetachInUserInventory(group.GetFromItemID(), remoteClient); + DetachSingleAttachmentToInv(group.GetFromItemID(), remoteClient); } } - public void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient) + public void DetachSingleAttachmentToInv(UUID itemID, IClientAPI remoteClient) { ScenePresence presence; if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index 6f242e5..6695a9d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs @@ -130,7 +130,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests m_attMod.RezSingleAttachmentFromInventory( presence.ControllingClient, attItemId, (uint)AttachmentPoint.Chest); - m_attMod.ShowDetachInUserInventory(attItemId, presence.ControllingClient); + m_attMod.DetachSingleAttachmentToInv(attItemId, presence.ControllingClient); // Check status on scene presence Assert.That(presence.HasAttachments(), Is.False); diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index e012885..0c82411 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.Framework.Interfaces IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent); /// - /// Attach an object to an avatar. + /// Attach an object to an avatar /// /// /// @@ -110,11 +110,11 @@ namespace OpenSim.Region.Framework.Interfaces void DetachSingleAttachmentToGround(UUID itemID, IClientAPI remoteClient); /// - /// Update the user inventory to show a detach. + /// Detach the given item so that it remains in the user's inventory. /// /// /param> /// - void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient); + void DetachSingleAttachmentToInv(UUID itemID, IClientAPI remoteClient); /// /// Update the position of an attachment. @@ -126,18 +126,10 @@ namespace OpenSim.Region.Framework.Interfaces /// /// Update the user inventory with a changed attachment /// - /// - /// A - /// - /// - /// A - /// - /// - /// A - /// - /// - /// A - /// + /// + /// + /// + /// void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 24be7d4..ffa0e24 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3031,7 +3031,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; if (attachmentsModule != null) - attachmentsModule.ShowDetachInUserInventory(itemID, presence.ControllingClient); + attachmentsModule.DetachSingleAttachmentToInv(itemID, presence.ControllingClient); } public void llTakeCamera(string avatar) -- cgit v1.1