add vector osGetLinkColor(LSL_Integer linknum, LSL_Integer face)

This commit is contained in:
UbitUmarov
2024-05-18 22:17:10 +01:00
parent 7b731a387b
commit 270427ba2a
4 changed files with 25 additions and 1 deletions

View File

@@ -2068,7 +2068,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return GetColor(m_host, face);
}
protected static LSL_Vector GetColor(SceneObjectPart part, int face)
public LSL_Vector GetColor(SceneObjectPart part, int face)
{
Primitive.TextureEntry tex = part.Shape.Textures;
Color4 texcolor;

View File

@@ -6571,5 +6571,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
return ret.ToString();
}
public LSL_Vector osGetLinkColor(LSL_Integer link, LSL_Integer face)
{
SceneObjectPart linkedPart = link.value switch
{
ScriptBaseClass.LINK_ROOT => m_host.ParentGroup.RootPart,
ScriptBaseClass.LINK_THIS => m_host,
_ => m_host.ParentGroup.GetLinkNumPart(link.value)
};
if (linkedPart != null)
{
InitLSL();
return m_LSL_Api.GetColor(linkedPart, face.value);
}
return LSL_Vector.Zero;
}
}
}

View File

@@ -626,5 +626,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_String osAESEncryptTo(string secret, string plainText, string ivString);
LSL_String osAESDecrypt(string secret, string encryptedText);
LSL_String osAESDecryptFrom(string secret, string encryptedText, string ivString);
vector osGetLinkColor(LSL_Integer linknum, LSL_Integer face);
}
}

View File

@@ -1802,5 +1802,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osAESDecryptFrom(secret, encryptedText, ivString);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public vector osGetLinkColor(LSL_Integer link, LSL_Integer face)
{
return m_OSSL_Functions.osGetLinkColor(link, face);
}
}
}