expose the option to save HUDs into notecard on the API
parent
873b3b0af6
commit
9bd5310fe8
|
@ -3023,7 +3023,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
/// <param name="avatar"></param>
|
/// <param name="avatar"></param>
|
||||||
/// <param name="notecard">The name of the notecard to which to save the appearance.</param>
|
/// <param name="notecard">The name of the notecard to which to save the appearance.</param>
|
||||||
/// <returns>The asset ID of the notecard saved.</returns>
|
/// <returns>The asset ID of the notecard saved.</returns>
|
||||||
public LSL_Key osNpcSaveAppearance(LSL_Key npc, string notecard)
|
|
||||||
|
public LSL_Key osNpcSaveAppearance(LSL_Key npc, LSL_String notecard)
|
||||||
|
{
|
||||||
|
return NpcSaveAppearance(npc, notecard, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LSL_Key osNpcSaveAppearance(LSL_Key npc, LSL_String notecard, LSL_Integer includeHuds)
|
||||||
|
{
|
||||||
|
return NpcSaveAppearance(npc, notecard, includeHuds == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected LSL_Key NpcSaveAppearance(LSL_Key npc, string notecard, bool NoHUds)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.High, "osNpcSaveAppearance");
|
CheckThreatLevel(ThreatLevel.High, "osNpcSaveAppearance");
|
||||||
|
|
||||||
|
@ -3031,14 +3042,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
if (npcModule != null)
|
if (npcModule != null)
|
||||||
{
|
{
|
||||||
UUID npcId;
|
if (!UUID.TryParse(npc.m_string, out UUID npcId))
|
||||||
if (!UUID.TryParse(npc.m_string, out npcId))
|
|
||||||
return new LSL_Key(UUID.Zero.ToString());
|
return new LSL_Key(UUID.Zero.ToString());
|
||||||
|
|
||||||
if (!npcModule.CheckPermissions(npcId, m_host.OwnerID))
|
if (!npcModule.CheckPermissions(npcId, m_host.OwnerID))
|
||||||
return new LSL_Key(UUID.Zero.ToString());
|
return new LSL_Key(UUID.Zero.ToString());
|
||||||
|
|
||||||
return SaveAppearanceToNotecard(npcId, notecard);
|
return SaveAppearanceToNotecard(npcId, notecard, NoHUds);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new LSL_Key(UUID.Zero.ToString());
|
return new LSL_Key(UUID.Zero.ToString());
|
||||||
|
@ -3522,32 +3532,57 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="notecard">The name of the notecard to which to save the appearance.</param>
|
/// <param name="notecard">The name of the notecard to which to save the appearance.</param>
|
||||||
/// <returns>The asset ID of the notecard saved.</returns>
|
/// <returns>The asset ID of the notecard saved.</returns>
|
||||||
public LSL_Key osOwnerSaveAppearance(string notecard)
|
public LSL_Key osOwnerSaveAppearance(LSL_String notecard)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.High, "osOwnerSaveAppearance");
|
CheckThreatLevel(ThreatLevel.High, "osOwnerSaveAppearance");
|
||||||
|
|
||||||
return SaveAppearanceToNotecard(m_host.OwnerID, notecard);
|
return SaveAppearanceToNotecard(m_host.OwnerID, notecard, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LSL_Key osAgentSaveAppearance(LSL_Key avatarKey, string notecard)
|
public LSL_Key osOwnerSaveAppearance(LSL_String notecard, LSL_Integer includeHuds)
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.High, "osOwnerSaveAppearance");
|
||||||
|
|
||||||
|
return SaveAppearanceToNotecard(m_host.OwnerID, notecard, includeHuds == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LSL_Key osAgentSaveAppearance(LSL_Key avatarKey, LSL_String notecard)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.VeryHigh, "osAgentSaveAppearance");
|
CheckThreatLevel(ThreatLevel.VeryHigh, "osAgentSaveAppearance");
|
||||||
|
|
||||||
UUID avatarId;
|
if (!UUID.TryParse(avatarKey, out UUID avatarId))
|
||||||
if (!UUID.TryParse(avatarKey, out avatarId))
|
|
||||||
return new LSL_Key(UUID.Zero.ToString());
|
return new LSL_Key(UUID.Zero.ToString());
|
||||||
|
|
||||||
return SaveAppearanceToNotecard(avatarId, notecard);
|
return SaveAppearanceToNotecard(avatarId, notecard, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LSL_Key SaveAppearanceToNotecard(ScenePresence sp, string notecard)
|
public LSL_Key osAgentSaveAppearance(LSL_Key avatarKey, LSL_String notecard, LSL_Integer includeHuds)
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.VeryHigh, "osAgentSaveAppearance");
|
||||||
|
|
||||||
|
if (!UUID.TryParse(avatarKey, out UUID avatarId))
|
||||||
|
return new LSL_Key(UUID.Zero.ToString());
|
||||||
|
|
||||||
|
return SaveAppearanceToNotecard(avatarId, notecard, includeHuds == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected LSL_Key SaveAppearanceToNotecard(UUID avatarId, string notecard, bool NoHuds)
|
||||||
|
{
|
||||||
|
ScenePresence sp = World.GetScenePresence(avatarId);
|
||||||
|
if (sp == null || sp.IsChildAgent)
|
||||||
|
return new LSL_Key(UUID.Zero.ToString());
|
||||||
|
|
||||||
|
return SaveAppearanceToNotecard(sp, notecard, NoHuds);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected LSL_Key SaveAppearanceToNotecard(ScenePresence sp, string notecard, bool NoHuds)
|
||||||
{
|
{
|
||||||
IAvatarFactoryModule appearanceModule = World.RequestModuleInterface<IAvatarFactoryModule>();
|
IAvatarFactoryModule appearanceModule = World.RequestModuleInterface<IAvatarFactoryModule>();
|
||||||
|
|
||||||
if (appearanceModule != null)
|
if (appearanceModule != null)
|
||||||
{
|
{
|
||||||
appearanceModule.SaveBakedTextures(sp.UUID);
|
appearanceModule.SaveBakedTextures(sp.UUID);
|
||||||
OSDMap appearancePacked = sp.Appearance.PackForNotecard();
|
OSDMap appearancePacked = sp.Appearance.PackForNotecard(NoHuds);
|
||||||
|
|
||||||
TaskInventoryItem item
|
TaskInventoryItem item
|
||||||
= SaveNotecard(notecard, "Avatar Appearance", Util.GetFormattedXml(appearancePacked as OSD), true);
|
= SaveNotecard(notecard, "Avatar Appearance", Util.GetFormattedXml(appearancePacked as OSD), true);
|
||||||
|
@ -3560,16 +3595,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LSL_Key SaveAppearanceToNotecard(UUID avatarId, string notecard)
|
|
||||||
{
|
|
||||||
ScenePresence sp = World.GetScenePresence(avatarId);
|
|
||||||
|
|
||||||
if (sp == null || sp.IsChildAgent)
|
|
||||||
return new LSL_Key(UUID.Zero.ToString());
|
|
||||||
|
|
||||||
return SaveAppearanceToNotecard(sp, notecard);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the gender as specified in avatar appearance for a given avatar key
|
/// Get the gender as specified in avatar appearance for a given avatar key
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -337,13 +337,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
/// <returns>TRUE if the key belongs to an npc in the scene. FALSE otherwise.</returns>
|
/// <returns>TRUE if the key belongs to an npc in the scene. FALSE otherwise.</returns>
|
||||||
LSL_Integer osIsNpc(LSL_Key npc);
|
LSL_Integer osIsNpc(LSL_Key npc);
|
||||||
|
|
||||||
key osNpcCreate(string user, string name, vector position, string notecard);
|
key osNpcCreate(string user, string name, vector position, string notecard);
|
||||||
key osNpcCreate(string user, string name, vector position, string notecard, int options);
|
key osNpcCreate(string user, string name, vector position, string notecard, int options);
|
||||||
LSL_Key osNpcSaveAppearance(key npc, string notecard);
|
LSL_Key osNpcSaveAppearance(key npc, LSL_String notecard);
|
||||||
void osNpcLoadAppearance(key npc, string notecard);
|
LSL_Key osNpcSaveAppearance(key npc, LSL_String notecard, LSL_Integer includeHuds);
|
||||||
vector osNpcGetPos(key npc);
|
void osNpcLoadAppearance(key npc, string notecard);
|
||||||
void osNpcMoveTo(key npc, vector position);
|
vector osNpcGetPos(key npc);
|
||||||
void osNpcMoveToTarget(key npc, vector target, int options);
|
void osNpcMoveTo(key npc, vector position);
|
||||||
|
void osNpcMoveToTarget(key npc, vector target, int options);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the owner of the NPC
|
/// Get the owner of the NPC
|
||||||
|
@ -352,27 +353,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// The owner of the NPC for an owned NPC. The NPC's agent id for an unowned NPC. UUID.Zero if the key is not an npc.
|
/// The owner of the NPC for an owned NPC. The NPC's agent id for an unowned NPC. UUID.Zero if the key is not an npc.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
LSL_Key osNpcGetOwner(key npc);
|
LSL_Key osNpcGetOwner(key npc);
|
||||||
|
|
||||||
rotation osNpcGetRot(key npc);
|
rotation osNpcGetRot(key npc);
|
||||||
void osNpcSetRot(LSL_Key npc, rotation rot);
|
|
||||||
void osNpcStopMoveToTarget(LSL_Key npc);
|
|
||||||
void osNpcSetProfileAbout(LSL_Key npc, string about);
|
|
||||||
void osNpcSetProfileImage(LSL_Key npc, string image);
|
|
||||||
void osNpcSay(key npc, string message);
|
|
||||||
void osNpcSay(key npc, int channel, string message);
|
|
||||||
void osNpcSayTo(LSL_Key npc, LSL_Key target, int channel, string msg);
|
|
||||||
void osNpcShout(key npc, int channel, string message);
|
|
||||||
void osNpcSit(key npc, key target, int options);
|
|
||||||
void osNpcStand(LSL_Key npc);
|
|
||||||
void osNpcRemove(key npc);
|
|
||||||
void osNpcPlayAnimation(LSL_Key npc, string animation);
|
|
||||||
void osNpcStopAnimation(LSL_Key npc, string animation);
|
|
||||||
void osNpcTouch(LSL_Key npcLSL_Key, LSL_Key object_key, LSL_Integer link_num);
|
|
||||||
void osNpcWhisper(key npc, int channel, string message);
|
|
||||||
|
|
||||||
LSL_Key osOwnerSaveAppearance(string notecard);
|
void osNpcSetRot(LSL_Key npc, rotation rot);
|
||||||
LSL_Key osAgentSaveAppearance(key agentId, string notecard);
|
void osNpcStopMoveToTarget(LSL_Key npc);
|
||||||
|
void osNpcSetProfileAbout(LSL_Key npc, string about);
|
||||||
|
void osNpcSetProfileImage(LSL_Key npc, string image);
|
||||||
|
void osNpcSay(key npc, string message);
|
||||||
|
void osNpcSay(key npc, int channel, string message);
|
||||||
|
void osNpcSayTo(LSL_Key npc, LSL_Key target, int channel, string msg);
|
||||||
|
void osNpcShout(key npc, int channel, string message);
|
||||||
|
void osNpcSit(key npc, key target, int options);
|
||||||
|
void osNpcStand(LSL_Key npc);
|
||||||
|
void osNpcRemove(key npc);
|
||||||
|
void osNpcPlayAnimation(LSL_Key npc, string animation);
|
||||||
|
void osNpcStopAnimation(LSL_Key npc, string animation);
|
||||||
|
void osNpcTouch(LSL_Key npcLSL_Key, LSL_Key object_key, LSL_Integer link_num);
|
||||||
|
void osNpcWhisper(key npc, int channel, string message);
|
||||||
|
|
||||||
|
LSL_Key osOwnerSaveAppearance(LSL_String notecard);
|
||||||
|
LSL_Key osOwnerSaveAppearance(LSL_String notecard, LSL_Integer includeHuds);
|
||||||
|
LSL_Key osAgentSaveAppearance(key agentId, LSL_String notecard);
|
||||||
|
LSL_Key osAgentSaveAppearance(key agentId, LSL_String notecard, LSL_Integer includeHuds);
|
||||||
|
|
||||||
key osGetGender(LSL_Key rawAvatarId);
|
key osGetGender(LSL_Key rawAvatarId);
|
||||||
key osGetMapTexture();
|
key osGetMapTexture();
|
||||||
|
|
|
@ -628,11 +628,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
return m_OSSL_Functions.osNpcCreate(user, name, position, cloneFrom, options);
|
return m_OSSL_Functions.osNpcCreate(user, name, position, cloneFrom, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
public key osNpcSaveAppearance(key npc, string notecard)
|
public key osNpcSaveAppearance(key npc, LSL_String notecard)
|
||||||
{
|
{
|
||||||
return m_OSSL_Functions.osNpcSaveAppearance(npc, notecard);
|
return m_OSSL_Functions.osNpcSaveAppearance(npc, notecard);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public key osNpcSaveAppearance(key npc, LSL_String notecard, LSL_Integer includeHuds)
|
||||||
|
{
|
||||||
|
return m_OSSL_Functions.osNpcSaveAppearance(npc, notecard, includeHuds);
|
||||||
|
}
|
||||||
|
|
||||||
public void osNpcLoadAppearance(key npc, string notecard)
|
public void osNpcLoadAppearance(key npc, string notecard)
|
||||||
{
|
{
|
||||||
m_OSSL_Functions.osNpcLoadAppearance(npc, notecard);
|
m_OSSL_Functions.osNpcLoadAppearance(npc, notecard);
|
||||||
|
@ -738,16 +743,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
m_OSSL_Functions.osNpcTouch(npcLSL_Key, object_key, link_num);
|
m_OSSL_Functions.osNpcTouch(npcLSL_Key, object_key, link_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LSL_Key osOwnerSaveAppearance(string notecard)
|
public LSL_Key osOwnerSaveAppearance(LSL_String notecard)
|
||||||
{
|
{
|
||||||
return m_OSSL_Functions.osOwnerSaveAppearance(notecard);
|
return m_OSSL_Functions.osOwnerSaveAppearance(notecard);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LSL_Key osAgentSaveAppearance(LSL_Key agentId, string notecard)
|
public LSL_Key osOwnerSaveAppearance(LSL_String notecard, LSL_Integer includeHuds)
|
||||||
|
{
|
||||||
|
return m_OSSL_Functions.osOwnerSaveAppearance(notecard, includeHuds);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LSL_Key osAgentSaveAppearance(LSL_Key agentId, LSL_String notecard)
|
||||||
{
|
{
|
||||||
return m_OSSL_Functions.osAgentSaveAppearance(agentId, notecard);
|
return m_OSSL_Functions.osAgentSaveAppearance(agentId, notecard);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LSL_Key osAgentSaveAppearance(LSL_Key agentId, LSL_String notecard, LSL_Integer includeHuds)
|
||||||
|
{
|
||||||
|
return m_OSSL_Functions.osAgentSaveAppearance(agentId, notecard, includeHuds);
|
||||||
|
}
|
||||||
|
|
||||||
public OSSLPrim Prim;
|
public OSSLPrim Prim;
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
|
|
Loading…
Reference in New Issue