mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
Thank you kindly, Snowdrop/Snowcrash for a patch that:
This patch makes the worn attachments accessible to MRM scripting
This commit is contained in:
@@ -26,15 +26,22 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
using log4net;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
{
|
||||
class SPAvatar : System.MarshalByRefObject, IAvatar
|
||||
{
|
||||
private readonly Scene m_rootScene;
|
||||
private readonly UUID m_ID;
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public SPAvatar(Scene scene, UUID ID)
|
||||
{
|
||||
@@ -63,5 +70,26 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
get { return GetSP().AbsolutePosition; }
|
||||
set { GetSP().TeleportWithMomentum(value); }
|
||||
}
|
||||
|
||||
#region IAvatar implementation
|
||||
public IAvatarAttachment[] Attachments
|
||||
{
|
||||
get {
|
||||
List<IAvatarAttachment> attachments = new List<IAvatarAttachment>();
|
||||
|
||||
Hashtable internalAttachments = GetSP().Appearance.GetAttachments();
|
||||
if(internalAttachments != null)
|
||||
{
|
||||
foreach(DictionaryEntry element in internalAttachments)
|
||||
{
|
||||
Hashtable attachInfo = (Hashtable)element.Value;
|
||||
attachments.Add(new SPAvatarAttachment(m_rootScene, this, (int)element.Key, new UUID((string)attachInfo["item"]), new UUID((string)attachInfo["asset"])));
|
||||
}
|
||||
}
|
||||
|
||||
return attachments.ToArray();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user