diff options
author | UbitUmarov | 2016-08-27 16:38:29 +0100 |
---|---|---|
committer | UbitUmarov | 2016-08-27 16:38:29 +0100 |
commit | b2386b8d0dd2c8579b59476abcf120efd68ac6ce (patch) | |
tree | 3d6e83eff966cbc1ac764c85278de4094095d8ba /OpenSim/Region/ScriptEngine/Shared/Api | |
parent | watchdog timeouts: replace a silly List copy i added doing it a better way (diff) | |
download | opensim-SC_OLD-b2386b8d0dd2c8579b59476abcf120efd68ac6ce.zip opensim-SC_OLD-b2386b8d0dd2c8579b59476abcf120efd68ac6ce.tar.gz opensim-SC_OLD-b2386b8d0dd2c8579b59476abcf120efd68ac6ce.tar.bz2 opensim-SC_OLD-b2386b8d0dd2c8579b59476abcf120efd68ac6ce.tar.xz |
llCollisionSound(,value) back to disable all sounds. new osCollisionSound(..). allows defualt sounds with volume
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
4 files changed, 46 insertions, 9 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index f45676e..c046a0c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -5108,18 +5108,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5108 | { | 5108 | { |
5109 | m_host.CollisionSoundVolume = (float)impact_volume; | 5109 | m_host.CollisionSoundVolume = (float)impact_volume; |
5110 | m_host.CollisionSound = m_host.invalidCollisionSoundUUID; | 5110 | m_host.CollisionSound = m_host.invalidCollisionSoundUUID; |
5111 | if(impact_volume == 0.0) | 5111 | m_host.CollisionSoundType = -1; // disable all sounds |
5112 | m_host.CollisionSoundType = -1; // disable all sounds | ||
5113 | else if(impact_volume == 1.0f) | ||
5114 | m_host.CollisionSoundType = 0; // full return to default sounds | ||
5115 | else | ||
5116 | m_host.CollisionSoundType = 2; // default sounds with volume | ||
5117 | return; | 5112 | return; |
5118 | } | 5113 | } |
5114 | |||
5119 | // TODO: Parameter check logic required. | 5115 | // TODO: Parameter check logic required. |
5120 | m_host.CollisionSound = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, impact_sound, AssetType.Sound); | 5116 | UUID soundId = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, impact_sound, AssetType.Sound); |
5121 | m_host.CollisionSoundVolume = (float)impact_volume; | 5117 | if(soundId != UUID.Zero) |
5122 | m_host.CollisionSoundType = 1; | 5118 | { |
5119 | m_host.CollisionSound = soundId; | ||
5120 | m_host.CollisionSoundVolume = (float)impact_volume; | ||
5121 | m_host.CollisionSoundType = 1; | ||
5122 | } | ||
5123 | else | ||
5124 | m_host.CollisionSoundType = -1; | ||
5123 | } | 5125 | } |
5124 | 5126 | ||
5125 | public LSL_String llGetAnimation(string id) | 5127 | public LSL_String llGetAnimation(string id) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index e525a2e..32405d7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -45,6 +45,7 @@ using OpenSim.Framework; | |||
45 | using OpenSim.Framework.Console; | 45 | using OpenSim.Framework.Console; |
46 | using OpenSim.Region.Framework.Interfaces; | 46 | using OpenSim.Region.Framework.Interfaces; |
47 | using OpenSim.Region.Framework.Scenes; | 47 | using OpenSim.Region.Framework.Scenes; |
48 | using OpenSim.Region.Framework.Scenes.Scripting; | ||
48 | using OpenSim.Region.ScriptEngine.Shared; | 49 | using OpenSim.Region.ScriptEngine.Shared; |
49 | using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; | 50 | using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; |
50 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; | 51 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; |
@@ -4250,5 +4251,33 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4250 | return m_UrlModule.RequestSecureURL(m_ScriptEngine.ScriptModule, m_host, m_item.ItemID, opts).ToString(); | 4251 | return m_UrlModule.RequestSecureURL(m_ScriptEngine.ScriptModule, m_host, m_item.ItemID, opts).ToString(); |
4251 | return UUID.Zero.ToString(); | 4252 | return UUID.Zero.ToString(); |
4252 | } | 4253 | } |
4254 | |||
4255 | public void osCollisionSound(string impact_sound, double impact_volume) | ||
4256 | { | ||
4257 | m_host.AddScriptLPS(1); | ||
4258 | |||
4259 | if(impact_sound == "") | ||
4260 | { | ||
4261 | m_host.CollisionSoundVolume = (float)impact_volume; | ||
4262 | m_host.CollisionSound = m_host.invalidCollisionSoundUUID; | ||
4263 | if(impact_volume == 0.0) | ||
4264 | m_host.CollisionSoundType = -1; // disable all sounds | ||
4265 | else if(impact_volume == 1.0f) | ||
4266 | m_host.CollisionSoundType = 0; // full return to default sounds | ||
4267 | else | ||
4268 | m_host.CollisionSoundType = 2; // default sounds with volume | ||
4269 | return; | ||
4270 | } | ||
4271 | // TODO: Parameter check logic required. | ||
4272 | UUID soundId = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, impact_sound, AssetType.Sound); | ||
4273 | if(soundId != UUID.Zero) | ||
4274 | { | ||
4275 | m_host.CollisionSound = soundId; | ||
4276 | m_host.CollisionSoundVolume = (float)impact_volume; | ||
4277 | m_host.CollisionSoundType = 1; | ||
4278 | } | ||
4279 | else | ||
4280 | m_host.CollisionSoundType = -1; | ||
4281 | } | ||
4253 | } | 4282 | } |
4254 | } | 4283 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index c99679e..8851e5f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -476,5 +476,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
476 | 476 | ||
477 | LSL_String osRequestURL(LSL_List options); | 477 | LSL_String osRequestURL(LSL_List options); |
478 | LSL_String osRequestSecureURL(LSL_List options); | 478 | LSL_String osRequestSecureURL(LSL_List options); |
479 | void osCollisionSound(string impact_sound, double impact_volume); | ||
479 | } | 480 | } |
480 | } | 481 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 35eee59..9ef6996 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -1089,5 +1089,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
1089 | { | 1089 | { |
1090 | return m_OSSL_Functions.osRequestSecureURL(options); | 1090 | return m_OSSL_Functions.osRequestSecureURL(options); |
1091 | } | 1091 | } |
1092 | |||
1093 | public void osCollisionSound(string impact_sound, double impact_volume) | ||
1094 | { | ||
1095 | osCollisionSound(impact_sound, impact_volume); | ||
1096 | } | ||
1092 | } | 1097 | } |
1093 | } | 1098 | } |