Adding a script event, changed(CHANGED_ANIMATION)
This is sent to all root prims of all attachments of an avatar when the animation state changes. llGetAnimation() can thenbe used to find the new movement animation. This eliminates the need for fast timers in AOs0.6.5-rc1
parent
b8619386eb
commit
217b2d93ae
|
@ -38,5 +38,6 @@ namespace OpenSim.Region.Framework.Interfaces
|
|||
string GetXMLState(UUID itemID);
|
||||
|
||||
bool PostScriptEvent(UUID itemID, string name, Object[] args);
|
||||
bool PostObjectEvent(UUID itemID, string name, Object[] args);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -223,6 +223,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
string m_callbackURI;
|
||||
ulong m_rootRegionHandle;
|
||||
|
||||
private IScriptModule[] m_scriptEngines;
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
|
@ -585,6 +587,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (gm != null)
|
||||
m_grouptitle = gm.GetGroupTitle(m_uuid);
|
||||
|
||||
m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();
|
||||
|
||||
AbsolutePosition = m_controllingClient.StartPos;
|
||||
AdjustKnownSeeds();
|
||||
|
||||
|
@ -1943,9 +1947,26 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
if (m_animations.TrySetDefaultAnimation(anim, m_controllingClient.NextAnimationSequenceNumber, UUID.Zero))
|
||||
{
|
||||
if (m_scriptEngines != null)
|
||||
{
|
||||
lock (m_attachments)
|
||||
{
|
||||
foreach (SceneObjectGroup grp in m_attachments)
|
||||
{
|
||||
// 16384 is CHANGED_ANIMATION
|
||||
//
|
||||
// Send this to all attachment root prims
|
||||
//
|
||||
foreach (IScriptModule m in m_scriptEngines)
|
||||
{
|
||||
m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] {16384});
|
||||
}
|
||||
SendAnimPack();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method determines the proper movement related animation
|
||||
|
|
|
@ -222,6 +222,15 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
|
|||
return PostScriptEvent(itemID, new EventParams(name, p, new DetectParams[0]));
|
||||
}
|
||||
|
||||
public bool PostObjectEvent(UUID itemID, string name, Object[] p)
|
||||
{
|
||||
SceneObjectPart part = m_Scene.GetSceneObjectPart(itemID);
|
||||
if (part == null)
|
||||
return false;
|
||||
|
||||
return PostObjectEvent(part.LocalId, new EventParams(name, p, new DetectParams[0]));
|
||||
}
|
||||
|
||||
public DetectParams GetDetectParams(UUID itemID, int number)
|
||||
{
|
||||
uint localID = m_ScriptManager.GetLocalID(itemID);
|
||||
|
|
|
@ -268,6 +268,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
|||
public const int CHANGED_REGION_RESTART = 256;
|
||||
public const int CHANGED_REGION = 512;
|
||||
public const int CHANGED_TELEPORT = 1024;
|
||||
public const int CHANGED_ANIMATION = 16384;
|
||||
public const int TYPE_INVALID = 0;
|
||||
public const int TYPE_INTEGER = 1;
|
||||
public const int TYPE_FLOAT = 2;
|
||||
|
|
|
@ -938,6 +938,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
return PostScriptEvent(itemID, new EventParams(name, p, new DetectParams[0]));
|
||||
}
|
||||
|
||||
public bool PostObjectEvent(UUID itemID, string name, Object[] p)
|
||||
{
|
||||
SceneObjectPart part = m_Scene.GetSceneObjectPart(itemID);
|
||||
if (part == null)
|
||||
return false;
|
||||
|
||||
return PostObjectEvent(part.LocalId, new EventParams(name, p, new DetectParams[0]));
|
||||
}
|
||||
|
||||
public Assembly OnAssemblyResolve(object sender,
|
||||
ResolveEventArgs args)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue