Plumb the rest of the serverside AO

avinationmerge
Melanie Thielker 2014-09-09 20:50:41 +02:00
parent 339904bc52
commit 87a4abac50
4 changed files with 113 additions and 0 deletions

View File

@ -6037,5 +6037,10 @@ namespace OpenSim.Region.Framework.Scenes
Overrides.SetOverride(animState, animID); Overrides.SetOverride(animState, animID);
Animator.SendAnimPack(); Animator.SendAnimPack();
} }
public UUID GetAnimationOverride(string animState)
{
return Overrides.GetOverriddenAnimation(animState);
}
} }
} }

View File

@ -13545,6 +13545,102 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
presence.SetAnimationOverride(state, animID); presence.SetAnimationOverride(state, animID);
} }
public void llResetAnimationOverride(LSL_String animState)
{
ScenePresence presence = World.GetScenePresence(m_item.PermsGranter);
if (presence == null)
return;
if (m_item.PermsGranter == UUID.Zero)
{
llShout(ScriptBaseClass.DEBUG_CHANNEL, "No permission to override animations");
return;
}
if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_OVERRIDE_ANIMATIONS) == 0)
{
llShout(ScriptBaseClass.DEBUG_CHANNEL, "No permission to override animations");
return;
}
if (animState == "ALL")
{
presence.SetAnimationOverride("ALL", UUID.Zero);
return;
}
string state = String.Empty;
foreach (KeyValuePair<string, string> kvp in MovementAnimationsForLSL)
{
if (kvp.Value.ToLower() == ((string)animState).ToLower())
{
state = kvp.Key;
break;
}
}
if (state == String.Empty)
{
return;
}
presence.SetAnimationOverride(state, UUID.Zero);
}
public LSL_String llGetAnimationOverride(LSL_String animState)
{
ScenePresence presence = World.GetScenePresence(m_item.PermsGranter);
if (presence == null)
return String.Empty;
if (m_item.PermsGranter == UUID.Zero)
{
llShout(ScriptBaseClass.DEBUG_CHANNEL, "No permission to override animations");
return String.Empty;
}
if ((m_item.PermsMask & (ScriptBaseClass.PERMISSION_OVERRIDE_ANIMATIONS | ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION)) == 0)
{
llShout(ScriptBaseClass.DEBUG_CHANNEL, "No permission to override animations");
return String.Empty;
}
string state = String.Empty;
foreach (KeyValuePair<string, string> kvp in MovementAnimationsForLSL)
{
if (kvp.Value.ToLower() == ((string)animState).ToLower())
{
state = kvp.Key;
break;
}
}
if (state == String.Empty)
{
return String.Empty;
}
UUID animID = presence.GetAnimationOverride(state);
if (animID == UUID.Zero)
return animState;
foreach (KeyValuePair<string, UUID> kvp in DefaultAvatarAnimations.AnimsUUID)
{
if (kvp.Value == animID)
return MovementAnimationsForLSL[kvp.Key];
}
foreach (TaskInventoryItem item in m_host.Inventory.GetInventoryItems())
{
if (item.AssetID == animID)
return item.Name;
}
return String.Empty;
}
} }
public class NotecardCache public class NotecardCache

View File

@ -435,5 +435,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules); LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules);
LSL_List llGetPhysicsMaterial(); LSL_List llGetPhysicsMaterial();
void llSetAnimationOverride(LSL_String animState, LSL_String anim); void llSetAnimationOverride(LSL_String animState, LSL_String anim);
void llResetAnimationOverride(LSL_String anim_state);
LSL_String llGetAnimationOverride(LSL_String anim_state);
} }
} }

View File

@ -2019,5 +2019,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{ {
m_LSL_Functions.llSetAnimationOverride(animState, anim); m_LSL_Functions.llSetAnimationOverride(animState, anim);
} }
public void llResetAnimationOverride(LSL_String anim_state)
{
m_LSL_Functions.llResetAnimationOverride(anim_state);
}
public LSL_String llGetAnimationOverride(LSL_String anim_state)
{
return m_LSL_Functions.llGetAnimationOverride(anim_state);
}
} }
} }