From f2390f7c72c70912da8c5d4626064996d42811bc Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 9 Sep 2014 03:01:05 +0200 Subject: Plumb llSetAnimationOverride --- .../Shared/Api/Implementation/LSL_Api.cs | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index b569194..085dfc8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -13475,6 +13475,49 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_UrlModule.HttpContentType(new UUID(id),type); } } + + public void llSetAnimationOverride(LSL_String animState, LSL_String anim) + { + string state = String.Empty; + + foreach (KeyValuePair kvp in MovementAnimationsForLSL) + { + if (kvp.Value == animState) + { + state = kvp.Key; + break; + } + } + + if (state == String.Empty) + { + llShout(ScriptBaseClass.DEBUG_CHANNEL, "Invalid animation state " + animState); + return; + } + + if (m_item.PermsGranter == UUID.Zero) + return; + + if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_OVERRIDE_ANIMATIONS) == 0) + { + llShout(ScriptBaseClass.DEBUG_CHANNEL, "No permission to override animations"); + return; + } + + ScenePresence presence = World.GetScenePresence(m_item.PermsGranter); + + if (presence == null) + return; + + UUID animID = ScriptUtils.GetAssetIdFromItemName(m_host, anim, (int)AssetType.Animation); + if (animID == UUID.Zero) + { + llShout(ScriptBaseClass.DEBUG_CHANNEL, "Animation not found"); + return; + } + + presence.SetAnimationOverride(state, animID); + } } public class NotecardCache -- cgit v1.1 From e775e1a31751aa2264e0687cea6ba3a2c3d74ae0 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 9 Sep 2014 03:03:27 +0200 Subject: make PERMISSION_OVERRIDE_ANIMATIONS implicit for attachments --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 085dfc8..f4809a7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3886,7 +3886,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION | ScriptBaseClass.PERMISSION_CONTROL_CAMERA | ScriptBaseClass.PERMISSION_TRACK_CAMERA | - ScriptBaseClass.PERMISSION_ATTACH; + ScriptBaseClass.PERMISSION_ATTACH | + ScriptBaseClass.PERMISSION_OVERRIDE_ANIMATIONS; } else -- cgit v1.1