diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/EventManager.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index ac5f433..052a05e 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -550,6 +550,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
550 | /// </remarks> | 550 | /// </remarks> |
551 | public event ScriptControlEvent OnScriptControlEvent; | 551 | public event ScriptControlEvent OnScriptControlEvent; |
552 | 552 | ||
553 | public delegate void ScriptMovingStartEvent(uint localID); | ||
554 | |||
555 | /// <summary> | ||
556 | /// TODO: Should be triggered when a physics object starts moving. | ||
557 | /// </summary> | ||
558 | public event ScriptMovingStartEvent OnScriptMovingStartEvent; | ||
559 | |||
560 | public delegate void ScriptMovingEndEvent(uint localID); | ||
561 | |||
562 | /// <summary> | ||
563 | /// TODO: Should be triggered when a physics object stops moving. | ||
564 | /// </summary> | ||
565 | public event ScriptMovingEndEvent OnScriptMovingEndEvent; | ||
566 | |||
553 | public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos); | 567 | public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos); |
554 | 568 | ||
555 | /// <summary> | 569 | /// <summary> |
@@ -2238,6 +2252,48 @@ namespace OpenSim.Region.Framework.Scenes | |||
2238 | } | 2252 | } |
2239 | } | 2253 | } |
2240 | 2254 | ||
2255 | public void TriggerMovingStartEvent(uint localID) | ||
2256 | { | ||
2257 | ScriptMovingStartEvent handlerScriptMovingStartEvent = OnScriptMovingStartEvent; | ||
2258 | if (handlerScriptMovingStartEvent != null) | ||
2259 | { | ||
2260 | foreach (ScriptMovingStartEvent d in handlerScriptMovingStartEvent.GetInvocationList()) | ||
2261 | { | ||
2262 | try | ||
2263 | { | ||
2264 | d(localID); | ||
2265 | } | ||
2266 | catch (Exception e) | ||
2267 | { | ||
2268 | m_log.ErrorFormat( | ||
2269 | "[EVENT MANAGER]: Delegate for TriggerMovingStartEvent failed - continuing. {0} {1}", | ||
2270 | e.Message, e.StackTrace); | ||
2271 | } | ||
2272 | } | ||
2273 | } | ||
2274 | } | ||
2275 | |||
2276 | public void TriggerMovingEndEvent(uint localID) | ||
2277 | { | ||
2278 | ScriptMovingEndEvent handlerScriptMovingEndEvent = OnScriptMovingEndEvent; | ||
2279 | if (handlerScriptMovingEndEvent != null) | ||
2280 | { | ||
2281 | foreach (ScriptMovingEndEvent d in handlerScriptMovingEndEvent.GetInvocationList()) | ||
2282 | { | ||
2283 | try | ||
2284 | { | ||
2285 | d(localID); | ||
2286 | } | ||
2287 | catch (Exception e) | ||
2288 | { | ||
2289 | m_log.ErrorFormat( | ||
2290 | "[EVENT MANAGER]: Delegate for TriggerMovingEndEvent failed - continuing. {0} {1}", | ||
2291 | e.Message, e.StackTrace); | ||
2292 | } | ||
2293 | } | ||
2294 | } | ||
2295 | } | ||
2296 | |||
2241 | public void TriggerRequestChangeWaterHeight(float height) | 2297 | public void TriggerRequestChangeWaterHeight(float height) |
2242 | { | 2298 | { |
2243 | if (height < 0) | 2299 | if (height < 0) |