From 1adeb8ad7781beecbf1f23817eb9047e57f12027 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Fri, 19 Jun 2009 12:21:20 +0000 Subject: From: Chris Yeoh This patch ensures that the touch positions are set during touch_end events (currently only working for touch_start and touch events). --- OpenSim/Region/Framework/Scenes/EventManager.cs | 6 +++--- OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index cb15434..08ec1aa 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -93,7 +93,7 @@ namespace OpenSim.Region.Framework.Scenes public event OnShutdownDelegate OnShutdown; public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs); - public delegate void ObjectDeGrabDelegate(uint localID, uint originalID, IClientAPI remoteClient); + public delegate void ObjectDeGrabDelegate(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs); public delegate void ScriptResetDelegate(uint localID, UUID itemID); public delegate void OnPermissionErrorDelegate(UUID user, string reason); @@ -582,12 +582,12 @@ namespace OpenSim.Region.Framework.Scenes } } - public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient) + public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) { handlerObjectDeGrab = OnObjectDeGrab; if (handlerObjectDeGrab != null) { - handlerObjectDeGrab(localID, originalID, remoteClient); + handlerObjectDeGrab(localID, originalID, remoteClient, surfaceArgs); } } diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index e0de029..9251aa6 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -269,10 +269,14 @@ namespace OpenSim.Region.Framework.Scenes } } - public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient) + public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List surfaceArgs) { List EntityList = GetEntities(); + SurfaceTouchEventArgs surfaceArg = null; + if (surfaceArgs != null && surfaceArgs.Count > 0) + surfaceArg = surfaceArgs[0]; + foreach (EntityBase ent in EntityList) { if (ent is SceneObjectGroup) @@ -288,9 +292,9 @@ namespace OpenSim.Region.Framework.Scenes // If the touched prim handles touches, deliver it // If not, deliver to root prim if ((part.ScriptEvents & scriptEvents.touch_end) != 0) - EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient); + EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient, surfaceArg); else - EventManager.TriggerObjectDeGrab(obj.RootPart.LocalId, part.LocalId, remoteClient); + EventManager.TriggerObjectDeGrab(obj.RootPart.LocalId, part.LocalId, remoteClient, surfaceArg); return; } -- cgit v1.1