diff options
author | Justin Clark-Casey (justincc) | 2011-08-06 00:13:08 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-06 00:13:08 +0100 |
commit | c6c91e6599de6d4402ec0258da03cc975147da90 (patch) | |
tree | a42303f745eff34a65f3a33f94d098209c74b923 /OpenSim | |
parent | Add regression test for setting phantom status on a scene object. This is no... (diff) | |
download | opensim-SC-c6c91e6599de6d4402ec0258da03cc975147da90.zip opensim-SC-c6c91e6599de6d4402ec0258da03cc975147da90.tar.gz opensim-SC-c6c91e6599de6d4402ec0258da03cc975147da90.tar.bz2 opensim-SC-c6c91e6599de6d4402ec0258da03cc975147da90.tar.xz |
refactor: Fold most SOP.ScriptSet* methods back into script code. Simplify.
Diffstat (limited to 'OpenSim')
3 files changed, 9 insertions, 47 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index e8a1070..afc386e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2967,22 +2967,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2967 | } | 2967 | } |
2968 | } | 2968 | } |
2969 | 2969 | ||
2970 | public void ScriptSetPhantomStatus(bool Phantom) | ||
2971 | { | ||
2972 | if (m_parentGroup != null) | ||
2973 | { | ||
2974 | m_parentGroup.ScriptSetPhantomStatus(Phantom); | ||
2975 | } | ||
2976 | } | ||
2977 | |||
2978 | public void ScriptSetTemporaryStatus(bool Temporary) | ||
2979 | { | ||
2980 | if (m_parentGroup != null) | ||
2981 | { | ||
2982 | m_parentGroup.ScriptSetTemporaryStatus(Temporary); | ||
2983 | } | ||
2984 | } | ||
2985 | |||
2986 | public void ScriptSetPhysicsStatus(bool UsePhysics) | 2970 | public void ScriptSetPhysicsStatus(bool UsePhysics) |
2987 | { | 2971 | { |
2988 | if (m_parentGroup == null) | 2972 | if (m_parentGroup == null) |
@@ -2991,15 +2975,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2991 | m_parentGroup.ScriptSetPhysicsStatus(UsePhysics); | 2975 | m_parentGroup.ScriptSetPhysicsStatus(UsePhysics); |
2992 | } | 2976 | } |
2993 | 2977 | ||
2994 | public void ScriptSetVolumeDetect(bool SetVD) | ||
2995 | { | ||
2996 | |||
2997 | if (m_parentGroup != null) | ||
2998 | { | ||
2999 | m_parentGroup.ScriptSetVolumeDetect(SetVD); | ||
3000 | } | ||
3001 | } | ||
3002 | |||
3003 | /// <summary> | 2978 | /// <summary> |
3004 | /// Set sculpt and mesh data, and tell the physics engine to process the change. | 2979 | /// Set sculpt and mesh data, and tell the physics engine to process the change. |
3005 | /// </summary> | 2980 | /// </summary> |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs index a26fe33..641c34e 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs | |||
@@ -53,9 +53,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
53 | SceneObjectPart rootPart = so.RootPart; | 53 | SceneObjectPart rootPart = so.RootPart; |
54 | Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); | 54 | Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); |
55 | 55 | ||
56 | so.RootPart.ScriptSetPhantomStatus(true); | 56 | so.ScriptSetPhantomStatus(true); |
57 | 57 | ||
58 | Console.WriteLine("so.RootPart.Flags [{0}]", so.RootPart.Flags); | 58 | // Console.WriteLine("so.RootPart.Flags [{0}]", so.RootPart.Flags); |
59 | Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Phantom)); | 59 | Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Phantom)); |
60 | } | 60 | } |
61 | } | 61 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 26969a5..7c21ba9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -1204,10 +1204,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1204 | 1204 | ||
1205 | if ((status & ScriptBaseClass.STATUS_PHANTOM) == ScriptBaseClass.STATUS_PHANTOM) | 1205 | if ((status & ScriptBaseClass.STATUS_PHANTOM) == ScriptBaseClass.STATUS_PHANTOM) |
1206 | { | 1206 | { |
1207 | if (value != 0) | 1207 | if (m_host.ParentGroup != null) |
1208 | m_host.ScriptSetPhantomStatus(true); | 1208 | m_host.ParentGroup.ScriptSetPhantomStatus(value != 0); |
1209 | else | ||
1210 | m_host.ScriptSetPhantomStatus(false); | ||
1211 | } | 1209 | } |
1212 | 1210 | ||
1213 | if ((status & ScriptBaseClass.STATUS_CAST_SHADOWS) == ScriptBaseClass.STATUS_CAST_SHADOWS) | 1211 | if ((status & ScriptBaseClass.STATUS_CAST_SHADOWS) == ScriptBaseClass.STATUS_CAST_SHADOWS) |
@@ -6446,9 +6444,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6446 | if (m_host.ParentGroup != null) | 6444 | if (m_host.ParentGroup != null) |
6447 | { | 6445 | { |
6448 | if (!m_host.ParentGroup.IsDeleted) | 6446 | if (!m_host.ParentGroup.IsDeleted) |
6449 | { | 6447 | m_host.ParentGroup.ScriptSetVolumeDetect(detect != 0); |
6450 | m_host.ParentGroup.RootPart.ScriptSetVolumeDetect(detect!=0); | ||
6451 | } | ||
6452 | } | 6448 | } |
6453 | } | 6449 | } |
6454 | 6450 | ||
@@ -6456,7 +6452,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6456 | /// This is a depecated function so this just replicates the result of | 6452 | /// This is a depecated function so this just replicates the result of |
6457 | /// invoking it in SL | 6453 | /// invoking it in SL |
6458 | /// </summary> | 6454 | /// </summary> |
6459 | |||
6460 | public void llRemoteLoadScript(string target, string name, int running, int start_param) | 6455 | public void llRemoteLoadScript(string target, string name, int running, int start_param) |
6461 | { | 6456 | { |
6462 | m_host.AddScriptLPS(1); | 6457 | m_host.AddScriptLPS(1); |
@@ -7254,14 +7249,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7254 | return; | 7249 | return; |
7255 | 7250 | ||
7256 | string ph = rules.Data[idx++].ToString(); | 7251 | string ph = rules.Data[idx++].ToString(); |
7257 | bool phantom; | ||
7258 | 7252 | ||
7259 | if (ph.Equals("1")) | 7253 | if (m_host.ParentGroup != null) |
7260 | phantom = true; | 7254 | m_host.ParentGroup.ScriptSetPhantomStatus(ph.Equals("1")); |
7261 | else | ||
7262 | phantom = false; | ||
7263 | 7255 | ||
7264 | part.ScriptSetPhantomStatus(phantom); | ||
7265 | break; | 7256 | break; |
7266 | 7257 | ||
7267 | case (int)ScriptBaseClass.PRIM_PHYSICS: | 7258 | case (int)ScriptBaseClass.PRIM_PHYSICS: |
@@ -7282,14 +7273,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7282 | if (remain < 1) | 7273 | if (remain < 1) |
7283 | return; | 7274 | return; |
7284 | string temp = rules.Data[idx++].ToString(); | 7275 | string temp = rules.Data[idx++].ToString(); |
7285 | bool tempOnRez; | ||
7286 | 7276 | ||
7287 | if (temp.Equals("1")) | 7277 | if (m_host.ParentGroup != null) |
7288 | tempOnRez = true; | 7278 | m_host.ParentGroup.ScriptSetTemporaryStatus(temp.Equals("1")); |
7289 | else | ||
7290 | tempOnRez = false; | ||
7291 | 7279 | ||
7292 | part.ScriptSetTemporaryStatus(tempOnRez); | ||
7293 | break; | 7280 | break; |
7294 | 7281 | ||
7295 | case (int)ScriptBaseClass.PRIM_TEXGEN: | 7282 | case (int)ScriptBaseClass.PRIM_TEXGEN: |