diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index bb083fa..1fb4c1b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3897,7 +3897,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3897 | ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION | | 3897 | ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION | |
3898 | ScriptBaseClass.PERMISSION_CONTROL_CAMERA | | 3898 | ScriptBaseClass.PERMISSION_CONTROL_CAMERA | |
3899 | ScriptBaseClass.PERMISSION_TRACK_CAMERA | | 3899 | ScriptBaseClass.PERMISSION_TRACK_CAMERA | |
3900 | ScriptBaseClass.PERMISSION_ATTACH; | 3900 | ScriptBaseClass.PERMISSION_ATTACH | |
3901 | ScriptBaseClass.PERMISSION_OVERRIDE_ANIMATIONS; | ||
3901 | 3902 | ||
3902 | } | 3903 | } |
3903 | else | 3904 | else |
@@ -13486,6 +13487,49 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
13486 | m_UrlModule.HttpContentType(new UUID(id),type); | 13487 | m_UrlModule.HttpContentType(new UUID(id),type); |
13487 | } | 13488 | } |
13488 | } | 13489 | } |
13490 | |||
13491 | public void llSetAnimationOverride(LSL_String animState, LSL_String anim) | ||
13492 | { | ||
13493 | string state = String.Empty; | ||
13494 | |||
13495 | foreach (KeyValuePair<string, string> kvp in MovementAnimationsForLSL) | ||
13496 | { | ||
13497 | if (kvp.Value == animState) | ||
13498 | { | ||
13499 | state = kvp.Key; | ||
13500 | break; | ||
13501 | } | ||
13502 | } | ||
13503 | |||
13504 | if (state == String.Empty) | ||
13505 | { | ||
13506 | llShout(ScriptBaseClass.DEBUG_CHANNEL, "Invalid animation state " + animState); | ||
13507 | return; | ||
13508 | } | ||
13509 | |||
13510 | if (m_item.PermsGranter == UUID.Zero) | ||
13511 | return; | ||
13512 | |||
13513 | if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_OVERRIDE_ANIMATIONS) == 0) | ||
13514 | { | ||
13515 | llShout(ScriptBaseClass.DEBUG_CHANNEL, "No permission to override animations"); | ||
13516 | return; | ||
13517 | } | ||
13518 | |||
13519 | ScenePresence presence = World.GetScenePresence(m_item.PermsGranter); | ||
13520 | |||
13521 | if (presence == null) | ||
13522 | return; | ||
13523 | |||
13524 | UUID animID = ScriptUtils.GetAssetIdFromItemName(m_host, anim, (int)AssetType.Animation); | ||
13525 | if (animID == UUID.Zero) | ||
13526 | { | ||
13527 | llShout(ScriptBaseClass.DEBUG_CHANNEL, "Animation not found"); | ||
13528 | return; | ||
13529 | } | ||
13530 | |||
13531 | presence.SetAnimationOverride(state, animID); | ||
13532 | } | ||
13489 | } | 13533 | } |
13490 | 13534 | ||
13491 | public class NotecardCache | 13535 | public class NotecardCache |