mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 13:55:35 +08:00
New OSSL function: osNpcSetProfileImage(LSL_Key npc, string image); This patch gives possibility to set image in created NPC's profile. You can use UUID of the texture or name of texture included in prim's inventory.
Signed-off-by: Mandarinka Tasty <mandarinka.tasty@gmail.com> Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
This commit is contained in:
committed by
UbitUmarov
parent
69776aa70c
commit
ec883d0f15
@@ -3018,6 +3018,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
}
|
||||
|
||||
public void osNpcSetProfileImage(LSL_Key npc, string image)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osNpcCreate");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
INPCModule module = World.RequestModuleInterface<INPCModule>();
|
||||
if (module != null)
|
||||
{
|
||||
UUID npcId = new UUID(npc.m_string);
|
||||
|
||||
if (!module.CheckPermissions(npcId, m_host.OwnerID))
|
||||
return;
|
||||
|
||||
UUID ImageID = new UUID();
|
||||
|
||||
ImageID = ScriptUtils.GetAssetIdFromItemName(m_host, image, (int)AssetType.Texture);
|
||||
|
||||
if (ImageID == null || ImageID == UUID.Zero)
|
||||
{
|
||||
if (!UUID.TryParse(image, out ImageID))
|
||||
return;
|
||||
}
|
||||
|
||||
ScenePresence sp = World.GetScenePresence(npcId);
|
||||
if (sp != null)
|
||||
((INPC)(sp.ControllingClient)).profileImage = ImageID;
|
||||
}
|
||||
}
|
||||
|
||||
public void osNpcSay(LSL_Key npc, string message)
|
||||
{
|
||||
osNpcSay(npc, 0, message);
|
||||
|
||||
Reference in New Issue
Block a user