diff options
author | UbitUmarov | 2012-04-20 18:51:32 +0100 |
---|---|---|
committer | UbitUmarov | 2012-04-20 18:51:32 +0100 |
commit | 3b56c4445390461ea6cdef7bc9ad8f8b26fc97c1 (patch) | |
tree | 2ec58b80052a22550c1ddbc2527f9f20fd0e6914 /OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |
parent | ubitODE: - Change triangles used in terrain height estimation (diff) | |
download | opensim-SC-3b56c4445390461ea6cdef7bc9ad8f8b26fc97c1.zip opensim-SC-3b56c4445390461ea6cdef7bc9ad8f8b26fc97c1.tar.gz opensim-SC-3b56c4445390461ea6cdef7bc9ad8f8b26fc97c1.tar.bz2 opensim-SC-3b56c4445390461ea6cdef7bc9ad8f8b26fc97c1.tar.xz |
changed seletion code. SOP now knows about parts selection. UI actions are sent to SOP and this reports to SOG. Group is selected if any part is selected.sop.isSelect get() is only used in SOG. Will need to be improved for better performance on largelinksets. *UNTESTED* NEEDS CHECKING for side efects
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 66 |
1 files changed, 51 insertions, 15 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 35ac908..3ef1e29 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -129,27 +129,47 @@ namespace OpenSim.Region.Framework.Scenes | |||
129 | /// <param name="remoteClient"></param> | 129 | /// <param name="remoteClient"></param> |
130 | public void SelectPrim(uint primLocalID, IClientAPI remoteClient) | 130 | public void SelectPrim(uint primLocalID, IClientAPI remoteClient) |
131 | { | 131 | { |
132 | /* | ||
133 | SceneObjectPart part = GetSceneObjectPart(primLocalID); | ||
134 | |||
135 | if (null == part) | ||
136 | return; | ||
137 | |||
138 | if (part.IsRoot) | ||
139 | { | ||
140 | SceneObjectGroup sog = part.ParentGroup; | ||
141 | sog.SendPropertiesToClient(remoteClient); | ||
142 | |||
143 | // A prim is only tainted if it's allowed to be edited by the person clicking it. | ||
144 | if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId) | ||
145 | || Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId)) | ||
146 | { | ||
147 | sog.IsSelected = true; | ||
148 | EventManager.TriggerParcelPrimCountTainted(); | ||
149 | } | ||
150 | } | ||
151 | else | ||
152 | { | ||
153 | part.SendPropertiesToClient(remoteClient); | ||
154 | } | ||
155 | */ | ||
132 | SceneObjectPart part = GetSceneObjectPart(primLocalID); | 156 | SceneObjectPart part = GetSceneObjectPart(primLocalID); |
133 | 157 | ||
134 | if (null == part) | 158 | if (null == part) |
135 | return; | 159 | return; |
136 | 160 | ||
137 | if (part.IsRoot) | 161 | SceneObjectGroup sog = part.ParentGroup; |
138 | { | 162 | if (sog == null) |
139 | SceneObjectGroup sog = part.ParentGroup; | 163 | return; |
140 | sog.SendPropertiesToClient(remoteClient); | ||
141 | 164 | ||
142 | // A prim is only tainted if it's allowed to be edited by the person clicking it. | 165 | part.SendPropertiesToClient(remoteClient); |
143 | if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId) | 166 | |
144 | || Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId)) | 167 | // A prim is only tainted if it's allowed to be edited by the person clicking it. |
145 | { | 168 | if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId) |
146 | sog.IsSelected = true; | 169 | || Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId)) |
147 | EventManager.TriggerParcelPrimCountTainted(); | ||
148 | } | ||
149 | } | ||
150 | else | ||
151 | { | 170 | { |
152 | part.SendPropertiesToClient(remoteClient); | 171 | part.IsSelected = true; |
172 | EventManager.TriggerParcelPrimCountTainted(); | ||
153 | } | 173 | } |
154 | } | 174 | } |
155 | 175 | ||
@@ -202,7 +222,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
202 | SceneObjectPart part = GetSceneObjectPart(primLocalID); | 222 | SceneObjectPart part = GetSceneObjectPart(primLocalID); |
203 | if (part == null) | 223 | if (part == null) |
204 | return; | 224 | return; |
205 | 225 | /* | |
206 | // A deselect packet contains all the local prims being deselected. However, since selection is still | 226 | // A deselect packet contains all the local prims being deselected. However, since selection is still |
207 | // group based we only want the root prim to trigger a full update - otherwise on objects with many prims | 227 | // group based we only want the root prim to trigger a full update - otherwise on objects with many prims |
208 | // we end up sending many duplicate ObjectUpdates | 228 | // we end up sending many duplicate ObjectUpdates |
@@ -237,6 +257,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
237 | part.UUID, remoteClient.AgentId)) | 257 | part.UUID, remoteClient.AgentId)) |
238 | EventManager.TriggerParcelPrimCountTainted(); | 258 | EventManager.TriggerParcelPrimCountTainted(); |
239 | } | 259 | } |
260 | */ | ||
261 | |||
262 | bool oldgprSelect = part.ParentGroup.IsSelected; | ||
263 | |||
264 | // This is wrong, wrong, wrong. Selection should not be | ||
265 | // handled by group, but by prim. Legacy cruft. | ||
266 | // TODO: Make selection flagging per prim! | ||
267 | // | ||
268 | if (Permissions.CanEditObject(part.ParentGroup.UUID, remoteClient.AgentId) | ||
269 | || Permissions.CanMoveObject(part.ParentGroup.UUID, remoteClient.AgentId)) | ||
270 | { | ||
271 | part.IsSelected = false; | ||
272 | if (!part.ParentGroup.IsAttachment && oldgprSelect != part.ParentGroup.IsSelected) | ||
273 | EventManager.TriggerParcelPrimCountTainted(); | ||
274 | } | ||
275 | |||
240 | } | 276 | } |
241 | 277 | ||
242 | public virtual void ProcessMoneyTransferRequest(UUID source, UUID destination, int amount, | 278 | public virtual void ProcessMoneyTransferRequest(UUID source, UUID destination, int amount, |