From c14209e362a3994ecf078fbe251968e380c1bd47 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 28 Dec 2018 14:40:51 +0000 Subject: [PATCH] add some LSL --- .../Shared/Api/Implementation/LSL_Api.cs | 32 ++++++++ .../Shared/Api/Interface/ILSL_Api.cs | 3 + .../Shared/Api/Runtime/LSL_Stub.cs | 15 ++++ bin/ScriptSyntax.xml | 73 ++++++++++++------- 4 files changed, 95 insertions(+), 28 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 4d71cc8345..c757cd088f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4224,6 +4224,38 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } + public void llStartObjectAnimation(string anim) + { + m_host.AddScriptLPS(1); + + // Do NOT try to parse UUID, animations cannot be triggered by ID + UUID animID = ScriptUtils.GetAssetIdFromItemName(m_host, anim, (int)AssetType.Animation); + if (animID == UUID.Zero) + return; + m_host.AddAnimation(animID, anim); + } + + public void llStopObjectAnimation(string anim) + { + m_host.AddScriptLPS(1); + UUID animID = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, anim, AssetType.Animation); + if (animID != UUID.Zero) + m_host.RemoveAnimation(animID); + } + + public LSL_List llGetObjectAnimationNames() + { + m_host.AddScriptLPS(1); + LSL_List ret = new LSL_List(); + + if(m_host.AnimationsNames == null || m_host.AnimationsNames.Count == 0) + return ret; + + foreach (string name in m_host.AnimationsNames.Values) + ret.Add(new LSL_String(name)); + return ret; + } + public void llPointAt(LSL_Vector pos) { m_host.AddScriptLPS(1); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index 101e69da23..8e1192cd92 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs @@ -409,6 +409,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_Float llSqrt(double f); void llStartAnimation(string anim); void llStopAnimation(string anim); + void llStartObjectAnimation(string anim); + void llStopObjectAnimation(string anim); + LSL_List llGetObjectAnimationNames(); void llStopHover(); void llStopLookAt(); void llStopMoveToTarget(); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index 07043780a5..0f10d8d228 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs @@ -1836,6 +1836,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase m_LSL_Functions.llStopAnimation(anim); } + public void llStartObjectAnimation(string anim) + { + m_LSL_Functions.llStartObjectAnimation(anim); + } + + public void llStopObjectAnimation(string anim) + { + m_LSL_Functions.llStopObjectAnimation(anim); + } + + public LSL_List llGetObjectAnimationNames() + { + return m_LSL_Functions.llGetObjectAnimationNames(); + } + public void llStopHover() { m_LSL_Functions.llStopHover(); diff --git a/bin/ScriptSyntax.xml b/bin/ScriptSyntax.xml index 60daa89c79..862a66df93 100644 --- a/bin/ScriptSyntax.xml +++ b/bin/ScriptSyntax.xml @@ -1,4 +1,4 @@ -41ccf83c-178f-6070-7960-1448d28dcdab +a0b4b514-3c14-6b98-ca98-e18a79e9792f llsd-lsl-syntax-version2 controls @@ -4063,6 +4063,11 @@ returninteger arguments + llGetObjectAnimationNames + + returnlist + arguments + llGetObjectDesc returnstring @@ -5797,6 +5802,12 @@ animtypestring + llStartObjectAnimation + + arguments + animtypestring + + llStopAnimation arguments @@ -5815,6 +5826,12 @@ arguments + llStopObjectAnimation + + arguments + animtypestring + + llStopPointAt arguments @@ -6099,35 +6116,35 @@ arguments vatypevector vbtypevector - - - osApproxEquals - - returninteger - arguments - atypefloat - btypefloat margintypefloat osApproxEquals - - returninteger - arguments - atypefloat - btypefloat - - - osApproxEquals returninteger arguments vatypevector vbtypevector + + + osApproxEquals + + returninteger + arguments + atypefloat + btypefloat margintypefloat osApproxEquals + + returninteger + arguments + atypefloat + btypefloat + + + osApproxEquals returninteger arguments @@ -6267,6 +6284,8 @@ returnstring arguments drawListtypestring + startXtypeinteger + startYtypeinteger endXtypeinteger endYtypeinteger @@ -6276,8 +6295,6 @@ returnstring arguments drawListtypestring - startXtypeinteger - startYtypeinteger endXtypeinteger endYtypeinteger @@ -6416,13 +6433,13 @@ arguments avatartypestring + targettypestring osForceOtherSit arguments avatartypestring - targettypestring osFormatString @@ -6822,6 +6839,7 @@ nametypestring positiontypevector notecardtypestring + optionstypeinteger osNpcCreate @@ -6832,7 +6850,6 @@ nametypestring positiontypevector notecardtypestring - optionstypeinteger osNpcGetOwner @@ -7415,8 +7432,6 @@ arguments srctypestring valuetypestring - starttypeinteger - counttypeinteger ignorecasetypeinteger @@ -7426,6 +7441,8 @@ arguments srctypestring valuetypestring + starttypeinteger + counttypeinteger ignorecasetypeinteger @@ -7520,6 +7537,8 @@ arguments agenttypestring + regionXtypeinteger + regionYtypeinteger positiontypevector lookattypevector @@ -7528,8 +7547,6 @@ arguments agenttypestring - regionXtypeinteger - regionYtypeinteger positiontypevector lookattypevector @@ -7547,7 +7564,8 @@ osTeleportOwner arguments - regionNametypestring + regionXtypeinteger + regionYtypeinteger positiontypevector lookattypevector @@ -7555,8 +7573,7 @@ osTeleportOwner arguments - regionXtypeinteger - regionYtypeinteger + regionNametypestring positiontypevector lookattypevector