diff options
author | Teravus Ovares | 2008-04-28 01:48:21 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-04-28 01:48:21 +0000 |
commit | 1fb54b074c243bab1964b4a568d672e87d18655f (patch) | |
tree | 1a9a113d09b94a10e5113e1b2e613039029d52a7 /OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |
parent | * Added String(FileExtension) property to ITerrainLoader to allow us to deter... (diff) | |
download | opensim-SC_OLD-1fb54b074c243bab1964b4a568d672e87d18655f.zip opensim-SC_OLD-1fb54b074c243bab1964b4a568d672e87d18655f.tar.gz opensim-SC_OLD-1fb54b074c243bab1964b4a568d672e87d18655f.tar.bz2 opensim-SC_OLD-1fb54b074c243bab1964b4a568d672e87d18655f.tar.xz |
* Added basic 3-5 level undo on prim position/rotation/scale.
* In the future this should be a config option... and, hopefully this tides the builders over for a little while.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index ba318a8..4711701 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -378,6 +378,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
378 | part.RegionHandle = m_regionHandle; | 378 | part.RegionHandle = m_regionHandle; |
379 | 379 | ||
380 | part.TrimPermissions(); | 380 | part.TrimPermissions(); |
381 | part.StoreUndoState(); | ||
381 | } | 382 | } |
382 | break; | 383 | break; |
383 | case XmlNodeType.EndElement: | 384 | case XmlNodeType.EndElement: |
@@ -436,6 +437,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
436 | { | 437 | { |
437 | SceneObjectPart Part = SceneObjectPart.FromXml(reader); | 438 | SceneObjectPart Part = SceneObjectPart.FromXml(reader); |
438 | AddPart(Part); | 439 | AddPart(Part); |
440 | Part.StoreUndoState(); | ||
439 | } | 441 | } |
440 | else | 442 | else |
441 | { | 443 | { |
@@ -703,6 +705,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
703 | m_rootPart.ApplyPhysics(m_rootPart.ObjectFlags, m_scene.m_physicalPrim); | 705 | m_rootPart.ApplyPhysics(m_rootPart.ObjectFlags, m_scene.m_physicalPrim); |
704 | AttachToBackup(); | 706 | AttachToBackup(); |
705 | m_rootPart.ScheduleFullUpdate(); | 707 | m_rootPart.ScheduleFullUpdate(); |
708 | m_rootPart.ClearUndoState(); | ||
709 | |||
706 | } | 710 | } |
707 | public void DetachToInventoryPrep() | 711 | public void DetachToInventoryPrep() |
708 | { | 712 | { |
@@ -731,6 +735,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
731 | private void SetPartAsNonRoot(SceneObjectPart part) | 735 | private void SetPartAsNonRoot(SceneObjectPart part) |
732 | { | 736 | { |
733 | part.ParentID = m_rootPart.LocalId; | 737 | part.ParentID = m_rootPart.LocalId; |
738 | part.ClearUndoState(); | ||
734 | } | 739 | } |
735 | 740 | ||
736 | /// <summary> | 741 | /// <summary> |
@@ -783,6 +788,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
783 | try | 788 | try |
784 | { | 789 | { |
785 | m_parts.Add(part.UUID, part); | 790 | m_parts.Add(part.UUID, part); |
791 | |||
786 | } | 792 | } |
787 | catch (Exception e) | 793 | catch (Exception e) |
788 | { | 794 | { |
@@ -803,6 +809,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
803 | if (part.UUID != m_rootPart.UUID) | 809 | if (part.UUID != m_rootPart.UUID) |
804 | { | 810 | { |
805 | part.ParentID = m_rootPart.LocalId; | 811 | part.ParentID = m_rootPart.LocalId; |
812 | |||
806 | } | 813 | } |
807 | } | 814 | } |
808 | } | 815 | } |
@@ -815,10 +822,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
815 | foreach (SceneObjectPart part in m_parts.Values) | 822 | foreach (SceneObjectPart part in m_parts.Values) |
816 | { | 823 | { |
817 | part.UUID = LLUUID.Random(); | 824 | part.UUID = LLUUID.Random(); |
825 | |||
818 | } | 826 | } |
819 | } | 827 | } |
820 | } | 828 | } |
821 | 829 | // helper provided for parts. | |
830 | public int GetSceneMaxUndo() | ||
831 | { | ||
832 | if (m_scene != null) | ||
833 | return m_scene.MaxUndoCount; | ||
834 | return 5; | ||
835 | } | ||
822 | public void ResetChildPrimPhysicsPositions() | 836 | public void ResetChildPrimPhysicsPositions() |
823 | { | 837 | { |
824 | AbsolutePosition = AbsolutePosition; | 838 | AbsolutePosition = AbsolutePosition; |
@@ -845,12 +859,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
845 | { | 859 | { |
846 | SceneObjectPart part = GetChildPart(localId); | 860 | SceneObjectPart part = GetChildPart(localId); |
847 | OnGrabPart(part, offsetPos, remoteClient); | 861 | OnGrabPart(part, offsetPos, remoteClient); |
862 | |||
848 | } | 863 | } |
849 | } | 864 | } |
850 | 865 | ||
851 | public virtual void OnGrabPart(SceneObjectPart part, LLVector3 offsetPos, IClientAPI remoteClient) | 866 | public virtual void OnGrabPart(SceneObjectPart part, LLVector3 offsetPos, IClientAPI remoteClient) |
852 | { | 867 | { |
868 | part.StoreUndoState(); | ||
853 | part.OnGrab(offsetPos, remoteClient); | 869 | part.OnGrab(offsetPos, remoteClient); |
870 | |||
854 | } | 871 | } |
855 | 872 | ||
856 | public virtual void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient) | 873 | public virtual void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient) |
@@ -1382,8 +1399,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1382 | { | 1399 | { |
1383 | m_parts.Add(newPart.UUID, newPart); | 1400 | m_parts.Add(newPart.UUID, newPart); |
1384 | } | 1401 | } |
1385 | 1402 | ||
1386 | SetPartAsNonRoot(newPart); | 1403 | SetPartAsNonRoot(newPart); |
1404 | |||
1387 | } | 1405 | } |
1388 | 1406 | ||
1389 | /// <summary> | 1407 | /// <summary> |
@@ -1758,6 +1776,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1758 | { | 1776 | { |
1759 | LinkNonRootPart(part, oldGroupPosition, oldRootRotation); | 1777 | LinkNonRootPart(part, oldGroupPosition, oldRootRotation); |
1760 | } | 1778 | } |
1779 | part.ClearUndoState(); | ||
1761 | } | 1780 | } |
1762 | 1781 | ||
1763 | DetachFromBackup(objectGroup); | 1782 | DetachFromBackup(objectGroup); |
@@ -1781,7 +1800,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1781 | public void DelinkFromGroup(uint partID) | 1800 | public void DelinkFromGroup(uint partID) |
1782 | { | 1801 | { |
1783 | SceneObjectPart linkPart = GetChildPart(partID); | 1802 | SceneObjectPart linkPart = GetChildPart(partID); |
1784 | 1803 | linkPart.ClearUndoState(); | |
1785 | if (null != linkPart) | 1804 | if (null != linkPart) |
1786 | { | 1805 | { |
1787 | // m_log.DebugFormat( | 1806 | // m_log.DebugFormat( |