Merge branch 'master' into ubitworkmaster

avinationmerge
UbitUmarov 2014-09-09 02:05:44 +01:00
commit d00aa403e0
5 changed files with 56 additions and 1 deletions

View File

@ -6004,5 +6004,9 @@ namespace OpenSim.Region.Framework.Scenes
Animator.SendAnimPackToClient(p.ControllingClient);
SendAttachmentsToAgentNF(p);
}
public void SetAnimationOverride(string animState, UUID animID)
{
}
}
}

View File

@ -3897,7 +3897,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
@ -13486,6 +13487,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<string, string> 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

View File

@ -434,5 +434,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void llSetKeyframedMotion(LSL_List frames, LSL_List options);
LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules);
LSL_List llGetPhysicsMaterial();
void llSetAnimationOverride(LSL_String animState, LSL_String anim);
}
}

View File

@ -81,6 +81,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int PERMISSION_TRACK_CAMERA = 1024;
public const int PERMISSION_CONTROL_CAMERA = 2048;
public const int PERMISSION_TELEPORT = 4096;
public const int PERMISSION_OVERRIDE_ANIMATIONS = 0x8000;
public const int AGENT_FLYING = 1;
public const int AGENT_ATTACHMENTS = 2;

View File

@ -2014,5 +2014,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
return m_LSL_Functions.llGetPhysicsMaterial();
}
public void llSetAnimationOverride(LSL_String animState, LSL_String anim)
{
m_LSL_Functions.llSetAnimationOverride(animState, anim);
}
}
}