aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs49
1 files changed, 29 insertions, 20 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 09c945b..3327b1e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -358,7 +358,7 @@ namespace OpenSim.Region.Framework.Scenes
358 UUID ownerID, PrimitiveBaseShape shape, Vector3 groupPosition, 358 UUID ownerID, PrimitiveBaseShape shape, Vector3 groupPosition,
359 Quaternion rotationOffset, Vector3 offsetPosition) 359 Quaternion rotationOffset, Vector3 offsetPosition)
360 { 360 {
361 m_name = "Primitive"; 361 m_name = "Object";
362 362
363 Rezzed = DateTime.UtcNow; 363 Rezzed = DateTime.UtcNow;
364 _creationDate = (int)Utils.DateTimeToUnixTime(Rezzed); 364 _creationDate = (int)Utils.DateTimeToUnixTime(Rezzed);
@@ -697,7 +697,7 @@ namespace OpenSim.Region.Framework.Scenes
697 get { return m_offsetPosition; } 697 get { return m_offsetPosition; }
698 set 698 set
699 { 699 {
700 StoreUndoState(); 700 StoreUndoState(UndoType.STATE_PRIM_POSITION);
701 m_offsetPosition = value; 701 m_offsetPosition = value;
702 702
703 if (ParentGroup != null && !ParentGroup.IsDeleted) 703 if (ParentGroup != null && !ParentGroup.IsDeleted)
@@ -759,7 +759,7 @@ namespace OpenSim.Region.Framework.Scenes
759 759
760 set 760 set
761 { 761 {
762 StoreUndoState(); 762 StoreUndoState(UndoType.STATE_PRIM_ROTATION);
763 m_rotationOffset = value; 763 m_rotationOffset = value;
764 764
765 PhysicsActor actor = PhysActor; 765 PhysicsActor actor = PhysActor;
@@ -958,7 +958,7 @@ namespace OpenSim.Region.Framework.Scenes
958 get { return m_shape.Scale; } 958 get { return m_shape.Scale; }
959 set 959 set
960 { 960 {
961 StoreUndoState(); 961 StoreUndoState(UndoType.STATE_PRIM_SCALE);
962 if (m_shape != null) 962 if (m_shape != null)
963 { 963 {
964 m_shape.Scale = value; 964 m_shape.Scale = value;
@@ -1522,7 +1522,7 @@ namespace OpenSim.Region.Framework.Scenes
1522 { 1522 {
1523 m_redo.Clear(); 1523 m_redo.Clear();
1524 } 1524 }
1525 StoreUndoState(); 1525 StoreUndoState(UndoType.STATE_ALL);
1526 } 1526 }
1527 1527
1528 public byte ConvertScriptUintToByte(uint indata) 1528 public byte ConvertScriptUintToByte(uint indata)
@@ -1625,7 +1625,7 @@ namespace OpenSim.Region.Framework.Scenes
1625 PrimitiveBaseShape shape = PrimitiveBaseShape.Create(); 1625 PrimitiveBaseShape shape = PrimitiveBaseShape.Create();
1626 part.Shape = shape; 1626 part.Shape = shape;
1627 1627
1628 part.Name = "Primitive"; 1628 part.Name = "Object";
1629 part._ownerID = UUID.Random(); 1629 part._ownerID = UUID.Random();
1630 1630
1631 return part; 1631 return part;
@@ -2721,7 +2721,7 @@ namespace OpenSim.Region.Framework.Scenes
2721 /// <param name="scale"></param> 2721 /// <param name="scale"></param>
2722 public void Resize(Vector3 scale) 2722 public void Resize(Vector3 scale)
2723 { 2723 {
2724 StoreUndoState(); 2724 StoreUndoState(UndoType.STATE_PRIM_SCALE);
2725 m_shape.Scale = scale; 2725 m_shape.Scale = scale;
2726 2726
2727 ParentGroup.HasGroupChanged = true; 2727 ParentGroup.HasGroupChanged = true;
@@ -3504,10 +3504,9 @@ namespace OpenSim.Region.Framework.Scenes
3504 m_parentGroup.ScheduleGroupForTerseUpdate(); 3504 m_parentGroup.ScheduleGroupForTerseUpdate();
3505 //m_parentGroup.ScheduleGroupForFullUpdate(); 3505 //m_parentGroup.ScheduleGroupForFullUpdate();
3506 } 3506 }
3507 3507 public void StoreUndoState(UndoType type)
3508 public void StoreUndoState()
3509 { 3508 {
3510 if (!Undoing) 3509 if (!Undoing && (m_parentGroup == null || m_parentGroup.RootPart == null || !m_parentGroup.RootPart.Undoing))
3511 { 3510 {
3512 if (!IgnoreUndoUpdate) 3511 if (!IgnoreUndoUpdate)
3513 { 3512 {
@@ -3518,17 +3517,25 @@ namespace OpenSim.Region.Framework.Scenes
3518 if (m_undo.Count > 0) 3517 if (m_undo.Count > 0)
3519 { 3518 {
3520 UndoState last = m_undo.Peek(); 3519 UndoState last = m_undo.Peek();
3521 if (last != null) 3520
3522 {
3523 if (last.Compare(this))
3524 return;
3525 }
3526 } 3521 }
3527 3522
3528 if (m_parentGroup.GetSceneMaxUndo() > 0) 3523 if (m_parentGroup.GetSceneMaxUndo() > 0)
3529 { 3524 {
3530 UndoState nUndo = new UndoState(this); 3525 UndoState lastUndo = m_undo.Peek();
3526
3527 UndoState nUndo = new UndoState(this, type);
3531 3528
3529 if (lastUndo != null)
3530 {
3531 TimeSpan ts = DateTime.Now.Subtract(lastUndo.LastUpdated);
3532 if (ts.TotalMilliseconds < 500)
3533 {
3534 //Delete the last entry since it was less than 500 milliseconds ago
3535 nUndo.Merge(lastUndo);
3536 m_undo.Pop();
3537 }
3538 }
3532 m_undo.Push(nUndo); 3539 m_undo.Push(nUndo);
3533 } 3540 }
3534 3541
@@ -4005,11 +4012,13 @@ namespace OpenSim.Region.Framework.Scenes
4005 if (m_undo.Count > 0) 4012 if (m_undo.Count > 0)
4006 { 4013 {
4007 UndoState nUndo = null; 4014 UndoState nUndo = null;
4015 UndoState goback = m_undo.Pop();
4008 if (m_parentGroup.GetSceneMaxUndo() > 0) 4016 if (m_parentGroup.GetSceneMaxUndo() > 0)
4009 { 4017 {
4010 nUndo = new UndoState(this); 4018 nUndo = new UndoState(this, goback.Type);
4011 } 4019 }
4012 UndoState goback = m_undo.Pop(); 4020
4021
4013 if (goback != null) 4022 if (goback != null)
4014 { 4023 {
4015 goback.PlaybackState(this); 4024 goback.PlaybackState(this);
@@ -4024,13 +4033,13 @@ namespace OpenSim.Region.Framework.Scenes
4024 { 4033 {
4025 lock (m_redo) 4034 lock (m_redo)
4026 { 4035 {
4036 UndoState gofwd = m_redo.Pop();
4027 if (m_parentGroup.GetSceneMaxUndo() > 0) 4037 if (m_parentGroup.GetSceneMaxUndo() > 0)
4028 { 4038 {
4029 UndoState nUndo = new UndoState(this); 4039 UndoState nUndo = new UndoState(this, gofwd.Type);
4030 4040
4031 m_undo.Push(nUndo); 4041 m_undo.Push(nUndo);
4032 } 4042 }
4033 UndoState gofwd = m_redo.Pop();
4034 if (gofwd != null) 4043 if (gofwd != null)
4035 gofwd.PlayfwdState(this); 4044 gofwd.PlayfwdState(this);
4036 } 4045 }