From a19ec6fc5454496ecbeb7cbda566c45050bd4fe4 Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 12 Oct 2007 15:26:19 +0000 Subject: Just trying out some thing with events, there changes/additions are likely to be temporary. --- OpenSim/Region/Environment/Scenes/SceneEvents.cs | 24 ++++++++++++++++++++++ .../Region/Environment/Scenes/SceneObjectGroup.cs | 3 +++ 2 files changed, 27 insertions(+) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs index 4f0ffc7..e62a8f8 100644 --- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs +++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs @@ -60,6 +60,14 @@ namespace OpenSim.Region.Environment.Scenes public event RemoveScript OnRemoveScript; + public delegate void SceneGroupMoved(LLUUID groupID, LLVector3 delta); + + public event SceneGroupMoved OnSceneGroupMove; + + public delegate void SceneGroupGrabed(LLUUID groupID, LLVector3 offset); + + public event SceneGroupGrabed OnSceneGroupGrab; + public void TriggerPermissionError(LLUUID user, string reason) { if (OnPermissionError != null) @@ -153,5 +161,21 @@ namespace OpenSim.Region.Environment.Scenes OnRemoveScript(localID, itemID); } } + + public void TriggerGroupMove(LLUUID groupID, LLVector3 delta) + { + if (OnSceneGroupMove != null) + { + OnSceneGroupMove(groupID, delta); + } + } + + public void TriggerGroupGrab(LLUUID groupID, LLVector3 offset) + { + if (OnSceneGroupGrab != null) + { + OnSceneGroupGrab(groupID, offset); + } + } } } \ No newline at end of file diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 5ff0d72..45db5f7 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -931,6 +931,8 @@ namespace OpenSim.Region.Environment.Scenes { AbsolutePosition = pos; ScheduleGroupForTerseUpdate(); + + m_scene.EventManager.TriggerGroupMove(this.UUID, pos); } /// @@ -1279,6 +1281,7 @@ namespace OpenSim.Region.Environment.Scenes public virtual void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient) { + m_scene.EventManager.TriggerGroupGrab(this.UUID, offsetPos); } public void DeleteGroup() -- cgit v1.1