diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 8289dec2e7..bff5028147 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -3023,7 +3023,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// The name of the notecard to which to save the appearance. /// The asset ID of the notecard saved. - 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"); @@ -3031,14 +3042,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (npcModule != null) { - UUID npcId; - if (!UUID.TryParse(npc.m_string, out npcId)) + if (!UUID.TryParse(npc.m_string, out UUID npcId)) return new LSL_Key(UUID.Zero.ToString()); if (!npcModule.CheckPermissions(npcId, m_host.OwnerID)) return new LSL_Key(UUID.Zero.ToString()); - return SaveAppearanceToNotecard(npcId, notecard); + return SaveAppearanceToNotecard(npcId, notecard, NoHUds); } return new LSL_Key(UUID.Zero.ToString()); @@ -3522,32 +3532,57 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// /// The name of the notecard to which to save the appearance. /// The asset ID of the notecard saved. - public LSL_Key osOwnerSaveAppearance(string notecard) + public LSL_Key osOwnerSaveAppearance(LSL_String notecard) { 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"); - UUID avatarId; - if (!UUID.TryParse(avatarKey, out avatarId)) + if (!UUID.TryParse(avatarKey, out UUID avatarId)) 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(); if (appearanceModule != null) { appearanceModule.SaveBakedTextures(sp.UUID); - OSDMap appearancePacked = sp.Appearance.PackForNotecard(); + OSDMap appearancePacked = sp.Appearance.PackForNotecard(NoHuds); TaskInventoryItem item = 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); - } - /// /// Get the gender as specified in avatar appearance for a given avatar key /// diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index e9aeda5f28..9b4a9ca12d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -337,13 +337,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces /// TRUE if the key belongs to an npc in the scene. FALSE otherwise. 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, int options); - LSL_Key osNpcSaveAppearance(key npc, string notecard); - void osNpcLoadAppearance(key npc, string notecard); - vector osNpcGetPos(key npc); - void osNpcMoveTo(key npc, vector position); - void osNpcMoveToTarget(key npc, vector target, int options); + key osNpcCreate(string user, string name, vector position, string notecard); + key osNpcCreate(string user, string name, vector position, string notecard, int options); + LSL_Key osNpcSaveAppearance(key npc, LSL_String notecard); + LSL_Key osNpcSaveAppearance(key npc, LSL_String notecard, LSL_Integer includeHuds); + void osNpcLoadAppearance(key npc, string notecard); + vector osNpcGetPos(key npc); + void osNpcMoveTo(key npc, vector position); + void osNpcMoveToTarget(key npc, vector target, int options); /// /// Get the owner of the NPC @@ -352,27 +353,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces /// /// 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. /// - LSL_Key osNpcGetOwner(key npc); + LSL_Key osNpcGetOwner(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); + rotation osNpcGetRot(key npc); - LSL_Key osOwnerSaveAppearance(string notecard); - LSL_Key osAgentSaveAppearance(key agentId, string notecard); + 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(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 osGetMapTexture(); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 399f5315c9..ba5158a2ff 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -628,11 +628,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase 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); } + 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) { 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); } - public LSL_Key osOwnerSaveAppearance(string notecard) + public LSL_Key osOwnerSaveAppearance(LSL_String 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); } + public LSL_Key osAgentSaveAppearance(LSL_Key agentId, LSL_String notecard, LSL_Integer includeHuds) + { + return m_OSSL_Functions.osAgentSaveAppearance(agentId, notecard, includeHuds); + } + public OSSLPrim Prim; [Serializable]