* Rewired Touch to route to group/part (Still triggering EventManager as well)

afrisby
lbsa71 2007-09-20 05:22:18 +00:00
parent 4ce0c0794a
commit 3c7161d128
4 changed files with 19 additions and 26 deletions

View File

@ -516,6 +516,20 @@ namespace OpenSim.Region.Environment.Scenes
public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
{ {
EventManager.TriggerObjectGrab(localID, offsetPos, remoteClient); EventManager.TriggerObjectGrab(localID, offsetPos, remoteClient);
foreach (EntityBase ent in Entities.Values)
{
if (ent is SceneObjectGroup)
{
SceneObjectGroup obj = ent as SceneObjectGroup;
if( obj.HasChildPrim( localID ) )
{
obj.ObjectGrabHandler(localID, offsetPos, remoteClient);
return;
}
}
}
} }
} }
} }

View File

@ -133,8 +133,10 @@ namespace OpenSim.Region.Environment.Scenes
public void TriggerObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) public void TriggerObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
{ {
if (OnObjectGrab != null) if (OnObjectGrab != null)
{
OnObjectGrab(localID, offsetPos, remoteClient); OnObjectGrab(localID, offsetPos, remoteClient);
} }
}
public void TriggerRezScript(uint localID, LLUUID itemID, string script) public void TriggerRezScript(uint localID, LLUUID itemID, string script)
{ {

View File

@ -41,27 +41,6 @@ namespace SimpleApp
this.CreateTerrainTexture(); this.CreateTerrainTexture();
} }
public override void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
{
foreach (EntityBase ent in Entities.Values)
{
if (ent is SceneObjectGroup)
{
SceneObjectGroup obj = ent as SceneObjectGroup;
if( obj.HasChildPrim( localID ) )
{
obj.ObjectGrabHandler(localID, offsetPos, remoteClient);
return;
}
}
}
base.ProcessObjectGrab(localID, offsetPos, remoteClient);
}
#region IWorld Members
override public void AddNewClient(IClientAPI client, bool child) override public void AddNewClient(IClientAPI client, bool child)
{ {
SubscribeToClientEvents(client); SubscribeToClientEvents(client);
@ -79,7 +58,5 @@ namespace SimpleApp
client.SendRegionHandshake(m_regInfo); client.SendRegionHandshake(m_regInfo);
} }
#endregion
} }
} }

View File

@ -52,9 +52,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
// Hook up a test event to our test form // Hook up a test event to our test form
myScriptEngine.Log.Verbose("ScriptEngine", "Hooking up to server events"); myScriptEngine.Log.Verbose("ScriptEngine", "Hooking up to server events");
myScriptEngine.World.EventManager.OnObjectGrab += new OpenSim.Region.Environment.Scenes.EventManager.ObjectGrabDelegate(touch_start); myScriptEngine.World.EventManager.OnObjectGrab += touch_start;
myScriptEngine.World.EventManager.OnRezScript += new OpenSim.Region.Environment.Scenes.EventManager.NewRezScript(OnRezScript); myScriptEngine.World.EventManager.OnRezScript += OnRezScript;
myScriptEngine.World.EventManager.OnRemoveScript += new OpenSim.Region.Environment.Scenes.EventManager.RemoveScript(OnRemoveScript); myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript;
} }