diff options
author | Mandarinka Tasty | 2016-12-14 01:14:23 +0100 |
---|---|---|
committer | UbitUmarov | 2016-12-14 00:24:52 +0000 |
commit | ec883d0f1504e8573f763882231cb1da06bdc2a1 (patch) | |
tree | 5146fdae277ad5ce482093df5a8cbc2011d5254c /OpenSim/Region/ScriptEngine | |
parent | Remove the AllowAlternatePorts option. It wasn't implemented anyway. (diff) | |
download | opensim-SC-ec883d0f1504e8573f763882231cb1da06bdc2a1.zip opensim-SC-ec883d0f1504e8573f763882231cb1da06bdc2a1.tar.gz opensim-SC-ec883d0f1504e8573f763882231cb1da06bdc2a1.tar.bz2 opensim-SC-ec883d0f1504e8573f763882231cb1da06bdc2a1.tar.xz |
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>
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
3 files changed, 35 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index b101cf9..dd4da0a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -3018,6 +3018,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3018 | } | 3018 | } |
3019 | } | 3019 | } |
3020 | 3020 | ||
3021 | public void osNpcSetProfileImage(LSL_Key npc, string image) | ||
3022 | { | ||
3023 | CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); | ||
3024 | m_host.AddScriptLPS(1); | ||
3025 | |||
3026 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | ||
3027 | if (module != null) | ||
3028 | { | ||
3029 | UUID npcId = new UUID(npc.m_string); | ||
3030 | |||
3031 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) | ||
3032 | return; | ||
3033 | |||
3034 | UUID ImageID = new UUID(); | ||
3035 | |||
3036 | ImageID = ScriptUtils.GetAssetIdFromItemName(m_host, image, (int)AssetType.Texture); | ||
3037 | |||
3038 | if (ImageID == null || ImageID == UUID.Zero) | ||
3039 | { | ||
3040 | if (!UUID.TryParse(image, out ImageID)) | ||
3041 | return; | ||
3042 | } | ||
3043 | |||
3044 | ScenePresence sp = World.GetScenePresence(npcId); | ||
3045 | if (sp != null) | ||
3046 | ((INPC)(sp.ControllingClient)).profileImage = ImageID; | ||
3047 | } | ||
3048 | } | ||
3049 | |||
3021 | public void osNpcSay(LSL_Key npc, string message) | 3050 | public void osNpcSay(LSL_Key npc, string message) |
3022 | { | 3051 | { |
3023 | osNpcSay(npc, 0, message); | 3052 | osNpcSay(npc, 0, message); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 87b0967..cf3e6df 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -344,6 +344,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
344 | void osNpcSetRot(LSL_Key npc, rotation rot); | 344 | void osNpcSetRot(LSL_Key npc, rotation rot); |
345 | void osNpcStopMoveToTarget(LSL_Key npc); | 345 | void osNpcStopMoveToTarget(LSL_Key npc); |
346 | void osNpcSetProfileAbout(LSL_Key npc, string about); | 346 | void osNpcSetProfileAbout(LSL_Key npc, string about); |
347 | void osNpcSetProfileImage(LSL_Key npc, string image); | ||
347 | void osNpcSay(key npc, string message); | 348 | void osNpcSay(key npc, string message); |
348 | void osNpcSay(key npc, int channel, string message); | 349 | void osNpcSay(key npc, int channel, string message); |
349 | void osNpcShout(key npc, int channel, string message); | 350 | void osNpcShout(key npc, int channel, string message); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 5bc998e..2e8a76c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -642,6 +642,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
642 | m_OSSL_Functions.osNpcSetProfileAbout(npc, about); | 642 | m_OSSL_Functions.osNpcSetProfileAbout(npc, about); |
643 | } | 643 | } |
644 | 644 | ||
645 | public void osNpcSetProfileImage(LSL_Key npc, string image) | ||
646 | { | ||
647 | m_OSSL_Functions.osNpcSetProfileImage(npc, image); | ||
648 | } | ||
649 | |||
645 | public void osNpcSay(key npc, string message) | 650 | public void osNpcSay(key npc, string message) |
646 | { | 651 | { |
647 | m_OSSL_Functions.osNpcSay(npc, message); | 652 | m_OSSL_Functions.osNpcSay(npc, message); |