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

bulletsim
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.OnRezMultipleAttachmentsFromInv += RezMultipleAttachmentsFromInventory;
client.OnObjectAttach += AttachObject; client.OnObjectAttach += AttachObject;
client.OnObjectDetach += DetachObject; client.OnObjectDetach += DetachObject;
client.OnDetachAttachmentIntoInv += ShowDetachInUserInventory; client.OnDetachAttachmentIntoInv += DetachSingleAttachmentToInv;
} }
public void UnsubscribeFromClientEvents(IClientAPI client) public void UnsubscribeFromClientEvents(IClientAPI client)
@ -89,7 +89,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachmentsFromInventory; client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachmentsFromInventory;
client.OnObjectAttach -= AttachObject; client.OnObjectAttach -= AttachObject;
client.OnObjectDetach -= DetachObject; client.OnObjectDetach -= DetachObject;
client.OnDetachAttachmentIntoInv -= ShowDetachInUserInventory; client.OnDetachAttachmentIntoInv -= DetachSingleAttachmentToInv;
} }
/// <summary> /// <summary>
@ -269,7 +269,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
if (updateInventoryStatus) if (updateInventoryStatus)
{ {
if (att == null) if (att == null)
ShowDetachInUserInventory(itemID, sp.ControllingClient); DetachSingleAttachmentToInv(itemID, sp.ControllingClient);
else else
ShowAttachInUserInventory(att, sp, itemID, AttachmentPt); ShowAttachInUserInventory(att, sp, itemID, AttachmentPt);
} }
@ -417,12 +417,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
SceneObjectGroup group = m_scene.GetGroupByPrim(objectLocalID); SceneObjectGroup group = m_scene.GetGroupByPrim(objectLocalID);
if (group != null) if (group != null)
{ {
//group.DetachToGround(); DetachSingleAttachmentToInv(group.GetFromItemID(), remoteClient);
ShowDetachInUserInventory(group.GetFromItemID(), remoteClient);
} }
} }
public void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient) public void DetachSingleAttachmentToInv(UUID itemID, IClientAPI remoteClient)
{ {
ScenePresence presence; ScenePresence presence;
if (m_scene.TryGetScenePresence(remoteClient.AgentId, out 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( m_attMod.RezSingleAttachmentFromInventory(
presence.ControllingClient, attItemId, (uint)AttachmentPoint.Chest); presence.ControllingClient, attItemId, (uint)AttachmentPoint.Chest);
m_attMod.ShowDetachInUserInventory(attItemId, presence.ControllingClient); m_attMod.DetachSingleAttachmentToInv(attItemId, presence.ControllingClient);
// Check status on scene presence // Check status on scene presence
Assert.That(presence.HasAttachments(), Is.False); Assert.That(presence.HasAttachments(), Is.False);

View File

@ -47,7 +47,7 @@ namespace OpenSim.Region.Framework.Interfaces
IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent); IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent);
/// <summary> /// <summary>
/// Attach an object to an avatar. /// Attach an object to an avatar
/// </summary> /// </summary>
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
/// <param name="grp"></param> /// <param name="grp"></param>
@ -110,11 +110,11 @@ namespace OpenSim.Region.Framework.Interfaces
void DetachSingleAttachmentToGround(UUID itemID, IClientAPI remoteClient); void DetachSingleAttachmentToGround(UUID itemID, IClientAPI remoteClient);
/// <summary> /// <summary>
/// Update the user inventory to show a detach. /// Detach the given item so that it remains in the user's inventory.
/// </summary> /// </summary>
/// <param name="itemID">/param> /// <param name="itemID">/param>
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient); void DetachSingleAttachmentToInv(UUID itemID, IClientAPI remoteClient);
/// <summary> /// <summary>
/// Update the position of an attachment. /// Update the position of an attachment.
@ -126,18 +126,10 @@ namespace OpenSim.Region.Framework.Interfaces
/// <summary> /// <summary>
/// Update the user inventory with a changed attachment /// Update the user inventory with a changed attachment
/// </summary> /// </summary>
/// <param name="remoteClient"> /// <param name="remoteClient"></param>
/// A <see cref="IClientAPI"/> /// <param name="grp"></param>
/// </param> /// <param name="itemID"></param>
/// <param name="grp"> /// <param name="agentID"></param>
/// A <see cref="SceneObjectGroup"/>
/// </param>
/// <param name="itemID">
/// A <see cref="UUID"/>
/// </param>
/// <param name="agentID">
/// A <see cref="UUID"/>
/// </param>
void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID); void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID);
} }
} }

View File

@ -3031,7 +3031,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule;
if (attachmentsModule != null) if (attachmentsModule != null)
attachmentsModule.ShowDetachInUserInventory(itemID, presence.ControllingClient); attachmentsModule.DetachSingleAttachmentToInv(itemID, presence.ControllingClient);
} }
public void llTakeCamera(string avatar) public void llTakeCamera(string avatar)