rename AttachmentsModule.ShowDetachInUserInventory() to DetachSingleAttachmentToInv() for consistency and to reflect it's actual behaviour

This commit is contained in:
Justin Clark-Casey (justincc)
2011-08-23 22:05:22 +01:00
parent 014cd4f8bb
commit 97b207240e
4 changed files with 14 additions and 23 deletions

View File

@@ -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;
}
/// <summary>
@@ -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))

View File

@@ -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);