diff --git a/Source/Core/Actions/Action.cs b/Source/Core/Actions/Action.cs index 73ce89db..a966b824 100644 --- a/Source/Core/Actions/Action.cs +++ b/Source/Core/Actions/Action.cs @@ -248,9 +248,11 @@ namespace CodeImp.DoomBuilder.Actions delegateslist = new List(begindelegates); // Invoke all the delegates + General.Actions.Current = this; General.Actions.ResetExclusiveRequest(); foreach(ActionDelegate ad in delegateslist) ad.Invoke(); General.Actions.ResetExclusiveRequest(); + General.Actions.Current = null; } } @@ -266,9 +268,11 @@ namespace CodeImp.DoomBuilder.Actions delegateslist = new List(enddelegates); // Invoke all the delegates + General.Actions.Current = this; General.Actions.ResetExclusiveRequest(); foreach(ActionDelegate ad in delegateslist) ad.Invoke(); General.Actions.ResetExclusiveRequest(); + General.Actions.Current = null; } } diff --git a/Source/Core/Actions/ActionManager.cs b/Source/Core/Actions/ActionManager.cs index b51d7709..56a2b867 100644 --- a/Source/Core/Actions/ActionManager.cs +++ b/Source/Core/Actions/ActionManager.cs @@ -54,6 +54,7 @@ namespace CodeImp.DoomBuilder.Actions // Begun actions private List activeactions; + private Action currentaction; // Exclusive invokation private bool exclusiverequested; @@ -70,6 +71,11 @@ namespace CodeImp.DoomBuilder.Actions public bool IsDisposed { get { return isdisposed; } } internal bool ExclusiveRequested { get { return exclusiverequested; } } + /// + /// Current executing action. This returns Null when no action is invoked. + /// + public Action Current { get { return currentaction; } internal set { currentaction = value; } } + #endregion #region ================== Constructor / Disposer diff --git a/Source/Plugins/BuilderModes/BuilderModes.csproj b/Source/Plugins/BuilderModes/BuilderModes.csproj index a3cf1ef4..5e7e0e1e 100644 --- a/Source/Plugins/BuilderModes/BuilderModes.csproj +++ b/Source/Plugins/BuilderModes/BuilderModes.csproj @@ -2,7 +2,7 @@ Debug AnyCPU - 9.0.30729 + 8.0.50727 2.0 {B42D5AA0-F9A6-4234-9C4B-A05B11A64851} Library @@ -275,4 +275,4 @@ - + \ No newline at end of file diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySector.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySector.cs index 7eca98b7..8bb2a79a 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySector.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySector.cs @@ -138,6 +138,7 @@ namespace CodeImp.DoomBuilder.BuilderModes public virtual void OnSelectEnd() { this.selected = !this.selected; + mode.SelectionChanged = true; } // Processing @@ -176,13 +177,13 @@ namespace CodeImp.DoomBuilder.BuilderModes if(fillceilings) { - General.Map.UndoRedo.CreateUndo("Flood-fill ceilings with " + newtexture); - General.Interface.DisplayStatus(StatusType.Action, "Flood-filled ceilings with " + newtexture + "."); + mode.CreateSingleUndo("Flood-fill ceilings with " + newtexture); + mode.SetActionResult("Flood-filled ceilings with " + newtexture + "."); } else { - General.Map.UndoRedo.CreateUndo("Flood-fill floors with " + newtexture); - General.Interface.DisplayStatus(StatusType.Action, "Flood-filled floors with " + newtexture + "."); + mode.CreateSingleUndo("Flood-fill floors with " + newtexture); + mode.SetActionResult("Flood-filled floors with " + newtexture + "."); } mode.Renderer.SetCrosshairBusy(true); @@ -218,7 +219,7 @@ namespace CodeImp.DoomBuilder.BuilderModes public virtual void OnCopyProperties() { BuilderPlug.Me.CopiedSectorProps = new SectorProperties(Sector.Sector); - General.Interface.DisplayStatus(StatusType.Action, "Copied sector properties."); + mode.SetActionResult("Copied sector properties."); } // Paste properties @@ -226,8 +227,8 @@ namespace CodeImp.DoomBuilder.BuilderModes { if(BuilderPlug.Me.CopiedSectorProps != null) { - General.Map.UndoRedo.CreateUndo("Paste sector properties"); - General.Interface.DisplayStatus(StatusType.Action, "Pasted sector properties."); + mode.CreateSingleUndo("Paste sector properties"); + mode.SetActionResult("Pasted sector properties."); BuilderPlug.Me.CopiedSectorProps.Apply(Sector.Sector); UpdateSectorGeometry(true); mode.ShowTargetInfo(); @@ -243,7 +244,7 @@ namespace CodeImp.DoomBuilder.BuilderModes string newtexture = General.Interface.BrowseFlat(General.Interface, oldtexture); if(newtexture != oldtexture) { - General.Map.UndoRedo.CreateUndo("Change flat " + newtexture); + mode.CreateSingleUndo("Change flat " + newtexture); SetTexture(newtexture); } } @@ -254,7 +255,7 @@ namespace CodeImp.DoomBuilder.BuilderModes { BuilderPlug.Me.CopiedFlat = GetTextureName(); if(General.Map.Config.MixTexturesFlats) BuilderPlug.Me.CopiedTexture = GetTextureName(); - General.Interface.DisplayStatus(StatusType.Action, "Copied flat " + GetTextureName() + "."); + mode.SetActionResult("Copied flat " + GetTextureName() + "."); } public virtual void OnPasteTexture() { } @@ -294,14 +295,14 @@ namespace CodeImp.DoomBuilder.BuilderModes // Sector brightness change public virtual void OnChangeTargetBrightness(bool up) { - General.Map.UndoRedo.CreateUndo("Change sector brightness", UndoGroup.SectorBrightnessChange, Sector.Sector.FixedIndex); + mode.CreateSingleUndo("Change sector brightness", UndoGroup.SectorBrightnessChange, Sector.Sector.FixedIndex); if(up) Sector.Sector.Brightness = General.Map.Config.BrightnessLevels.GetNextHigher(Sector.Sector.Brightness); else Sector.Sector.Brightness = General.Map.Config.BrightnessLevels.GetNextLower(Sector.Sector.Brightness); - General.Interface.DisplayStatus(StatusType.Action, "Changed sector brightness to " + Sector.Sector.Brightness + "."); + mode.SetActionResult("Changed sector brightness to " + Sector.Sector.Brightness + "."); Sector.Sector.UpdateCache(); diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs index 8708149c..759bb3aa 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs @@ -123,8 +123,8 @@ namespace CodeImp.DoomBuilder.BuilderModes if(!Sidedef.MiddleRequired() && (string.IsNullOrEmpty(Sidedef.MiddleTexture) || (Sidedef.MiddleTexture[0] == '-'))) { // Make it now - General.Map.UndoRedo.CreateUndo("Create middle texture"); - General.Interface.DisplayStatus(StatusType.Action, "Created middle texture."); + mode.CreateSingleUndo("Create middle texture"); + mode.SetActionResult("Created middle texture."); General.Settings.FindDefaultDrawSettings(); Sidedef.SetTextureMid(General.Settings.DefaultTexture); @@ -147,8 +147,8 @@ namespace CodeImp.DoomBuilder.BuilderModes public virtual void OnDelete() { // Remove texture - General.Map.UndoRedo.CreateUndo("Delete texture"); - General.Interface.DisplayStatus(StatusType.Action, "Deleted a texture."); + mode.CreateSingleUndo("Delete texture"); + mode.SetActionResult("Deleted a texture."); SetTexture("-"); // Update @@ -193,8 +193,8 @@ namespace CodeImp.DoomBuilder.BuilderModes // Reset texture offsets public virtual void OnResetTextureOffset() { - General.Map.UndoRedo.CreateUndo("Reset texture offsets"); - General.Interface.DisplayStatus(StatusType.Action, "Texture offsets reset."); + mode.CreateSingleUndo("Reset texture offsets"); + mode.SetActionResult("Texture offsets reset."); // Apply offsets Sidedef.OffsetX = 0; @@ -215,15 +215,15 @@ namespace CodeImp.DoomBuilder.BuilderModes this.Sidedef.Line.Flags[General.Map.Config.UpperUnpeggedFlag]) { // Remove flag - General.Map.UndoRedo.CreateUndo("Remove upper-unpegged setting"); - General.Interface.DisplayStatus(StatusType.Action, "Removed upper-unpegged setting."); + mode.CreateSingleUndo("Remove upper-unpegged setting"); + mode.SetActionResult("Removed upper-unpegged setting."); this.Sidedef.Line.Flags[General.Map.Config.UpperUnpeggedFlag] = false; } else { // Add flag - General.Map.UndoRedo.CreateUndo("Set upper-unpegged setting"); - General.Interface.DisplayStatus(StatusType.Action, "Set upper-unpegged setting."); + mode.CreateSingleUndo("Set upper-unpegged setting"); + mode.SetActionResult("Set upper-unpegged setting."); this.Sidedef.Line.Flags[General.Map.Config.UpperUnpeggedFlag] = true; } @@ -253,15 +253,15 @@ namespace CodeImp.DoomBuilder.BuilderModes this.Sidedef.Line.Flags[General.Map.Config.LowerUnpeggedFlag]) { // Remove flag - General.Map.UndoRedo.CreateUndo("Remove lower-unpegged setting"); - General.Interface.DisplayStatus(StatusType.Action, "Removed lower-unpegged setting."); + mode.CreateSingleUndo("Remove lower-unpegged setting"); + mode.SetActionResult("Removed lower-unpegged setting."); this.Sidedef.Line.Flags[General.Map.Config.LowerUnpeggedFlag] = false; } else { // Add flag - General.Map.UndoRedo.CreateUndo("Set lower-unpegged setting"); - General.Interface.DisplayStatus(StatusType.Action, "Set lower-unpegged setting."); + mode.CreateSingleUndo("Set lower-unpegged setting"); + mode.SetActionResult("Set lower-unpegged setting."); this.Sidedef.Line.Flags[General.Map.Config.LowerUnpeggedFlag] = true; } @@ -294,8 +294,8 @@ namespace CodeImp.DoomBuilder.BuilderModes string newtexture = BuilderPlug.Me.CopiedTexture; if(newtexture != oldtexture) { - General.Map.UndoRedo.CreateUndo("Flood-fill textures with " + newtexture); - General.Interface.DisplayStatus(StatusType.Action, "Flood-filled textures with " + newtexture + "."); + mode.CreateSingleUndo("Flood-fill textures with " + newtexture); + mode.SetActionResult("Flood-filled textures with " + newtexture + "."); mode.Renderer.SetCrosshairBusy(true); General.Interface.RedrawDisplay(); @@ -334,8 +334,8 @@ namespace CodeImp.DoomBuilder.BuilderModes // Auto-align texture X offsets public virtual void OnTextureAlign(bool alignx, bool aligny) { - General.Map.UndoRedo.CreateUndo("Auto-align textures"); - General.Interface.DisplayStatus(StatusType.Action, "Auto-aligned textures."); + mode.CreateSingleUndo("Auto-align textures"); + mode.SetActionResult("Auto-aligned textures."); // Make sure the texture is loaded (we need the texture size) if(!base.Texture.IsImageLoaded) base.Texture.LoadImage(); @@ -369,7 +369,7 @@ namespace CodeImp.DoomBuilder.BuilderModes string newtexture = General.Interface.BrowseTexture(General.Interface, oldtexture); if(newtexture != oldtexture) { - General.Map.UndoRedo.CreateUndo("Change texture " + newtexture); + mode.CreateSingleUndo("Change texture " + newtexture); SetTexture(newtexture); } } @@ -380,8 +380,8 @@ namespace CodeImp.DoomBuilder.BuilderModes { if(BuilderPlug.Me.CopiedTexture != null) { - General.Map.UndoRedo.CreateUndo("Paste texture " + BuilderPlug.Me.CopiedTexture); - General.Interface.DisplayStatus(StatusType.Action, "Pasted texture " + BuilderPlug.Me.CopiedTexture + "."); + mode.CreateSingleUndo("Paste texture " + BuilderPlug.Me.CopiedTexture); + mode.SetActionResult("Pasted texture " + BuilderPlug.Me.CopiedTexture + "."); SetTexture(BuilderPlug.Me.CopiedTexture); } } @@ -389,10 +389,10 @@ namespace CodeImp.DoomBuilder.BuilderModes // Paste texture offsets public virtual void OnPasteTextureOffsets() { - General.Map.UndoRedo.CreateUndo("Paste texture offsets"); + mode.CreateSingleUndo("Paste texture offsets"); Sidedef.OffsetX = BuilderPlug.Me.CopiedOffsets.X; Sidedef.OffsetY = BuilderPlug.Me.CopiedOffsets.Y; - General.Interface.DisplayStatus(StatusType.Action, "Pasted texture offsets " + Sidedef.OffsetX + ", " + Sidedef.OffsetY + "."); + mode.SetActionResult("Pasted texture offsets " + Sidedef.OffsetX + ", " + Sidedef.OffsetY + "."); // Update sidedef geometry VisualSidedefParts parts = Sector.GetSidedefParts(Sidedef); @@ -407,21 +407,21 @@ namespace CodeImp.DoomBuilder.BuilderModes { BuilderPlug.Me.CopiedTexture = GetTextureName(); if(General.Map.Config.MixTexturesFlats) BuilderPlug.Me.CopiedFlat = GetTextureName(); - General.Interface.DisplayStatus(StatusType.Action, "Copied texture " + GetTextureName() + "."); + mode.SetActionResult("Copied texture " + GetTextureName() + "."); } // Copy texture offsets public virtual void OnCopyTextureOffsets() { BuilderPlug.Me.CopiedOffsets = new Point(Sidedef.OffsetX, Sidedef.OffsetY); - General.Interface.DisplayStatus(StatusType.Action, "Copied texture offsets " + Sidedef.OffsetX + ", " + Sidedef.OffsetY + "."); + mode.SetActionResult("Copied texture offsets " + Sidedef.OffsetX + ", " + Sidedef.OffsetY + "."); } // Copy properties public virtual void OnCopyProperties() { BuilderPlug.Me.CopiedSidedefProps = new SidedefProperties(Sidedef); - General.Interface.DisplayStatus(StatusType.Action, "Copied sidedef properties."); + mode.SetActionResult("Copied sidedef properties."); } // Paste properties @@ -429,8 +429,8 @@ namespace CodeImp.DoomBuilder.BuilderModes { if(BuilderPlug.Me.CopiedSidedefProps != null) { - General.Map.UndoRedo.CreateUndo("Paste sidedef properties"); - General.Interface.DisplayStatus(StatusType.Action, "Pasted sidedef properties."); + mode.CreateSingleUndo("Paste sidedef properties"); + mode.SetActionResult("Pasted sidedef properties."); BuilderPlug.Me.CopiedSidedefProps.Apply(Sidedef); // Update sectors on both sides @@ -472,6 +472,7 @@ namespace CodeImp.DoomBuilder.BuilderModes { // Add/remove selection this.selected = !this.selected; + mode.SelectionChanged = true; } } @@ -509,7 +510,7 @@ namespace CodeImp.DoomBuilder.BuilderModes float deltaz = General.Map.VisualCamera.AngleZ - dragstartanglez; if((Math.Abs(deltaxy) + Math.Abs(deltaz)) > DRAG_ANGLE_TOLERANCE) { - General.Map.UndoRedo.CreateUndo("Change texture offsets"); + mode.CreateSingleUndo("Change texture offsets"); // Start drag now uvdragging = true; @@ -556,14 +557,14 @@ namespace CodeImp.DoomBuilder.BuilderModes public virtual void OnChangeTargetBrightness(bool up) { // Change brightness - General.Map.UndoRedo.CreateUndo("Change sector brightness", UndoGroup.SectorBrightnessChange, Sector.Sector.FixedIndex); + mode.CreateSingleUndo("Change sector brightness", UndoGroup.SectorBrightnessChange, Sector.Sector.FixedIndex); if(up) Sector.Sector.Brightness = General.Map.Config.BrightnessLevels.GetNextHigher(Sector.Sector.Brightness); else Sector.Sector.Brightness = General.Map.Config.BrightnessLevels.GetNextLower(Sector.Sector.Brightness); - General.Interface.DisplayStatus(StatusType.Action, "Changed sector brightness to " + Sector.Sector.Brightness + "."); + mode.SetActionResult("Changed sector brightness to " + Sector.Sector.Brightness + "."); Sector.Sector.UpdateCache(); @@ -589,13 +590,13 @@ namespace CodeImp.DoomBuilder.BuilderModes public virtual void OnChangeTextureOffset(int horizontal, int vertical) { if((General.Map.UndoRedo.NextUndo == null) || (General.Map.UndoRedo.NextUndo.TicketID != undoticket)) - undoticket = General.Map.UndoRedo.CreateUndo("Change texture offsets"); + undoticket = mode.CreateSingleUndo("Change texture offsets"); // Apply offsets Sidedef.OffsetX -= horizontal; Sidedef.OffsetY -= vertical; - General.Interface.DisplayStatus(StatusType.Action, "Changed texture offsets to " + Sidedef.OffsetX + ", " + Sidedef.OffsetY + "."); + mode.SetActionResult("Changed texture offsets to " + Sidedef.OffsetX + ", " + Sidedef.OffsetY + "."); // Update sidedef geometry VisualSidedefParts parts = Sector.GetSidedefParts(Sidedef); diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs index 9782cee6..3ded5e5e 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs @@ -73,18 +73,21 @@ namespace CodeImp.DoomBuilder.BuilderModes // on an object that was not selected. In this case the previous selection // is cleared and the targeted object is temporarely selected to perform // the action on. After the action is completed, the object is deselected. - private bool temporaryselection; + private bool singleselection; - // Actions - private int lastchangeoffsetticket; + // We keep these to determine if we need to make a new undo level + private bool selectionchanged; + private Action lastaction; + private VisualActionResult actionresult; #endregion #region ================== Properties public IRenderer3D Renderer { get { return renderer; } } - - public bool IsTemporarySelection { get { return temporaryselection; } } + + public bool IsSingleSelection { get { return singleselection; } } + public bool SelectionChanged { get { return selectionchanged; } set { selectionchanged |= value; } } #endregion @@ -118,9 +121,10 @@ namespace CodeImp.DoomBuilder.BuilderModes #region ================== Methods // This is called before an action is performed - private void PreAction(string multiundodescription) + private void PreAction(string multiundodescription, bool multiseparateundo, UndoGroup singleundogroup) { int undogrouptag = 0; + actionresult = new VisualActionResult(); PickTargetUnlocked(); @@ -128,24 +132,68 @@ namespace CodeImp.DoomBuilder.BuilderModes // current selection and make a temporary selection for the target. if(!target.picked.Selected) { - temporaryselection = true; + // Single object, no selection + singleselection = true; ClearSelection(); target.picked.Selected = true; - - if(target.picked is BaseVisualGeometrySector) - undogrouptag = (target.picked as BaseVisualGeometrySector).Sector.Sector.FixedIndex; } - - // Make an undo level - //lastundoticket = General.Map.UndoRedo.CreateUndo(multiundodescription, undogroup, undogrouptag); + else + { + // Check if we should make a new undo level + // We don't want to do this if this is the same action with the same + // selection and the action wants to group the undo levels + if((lastaction != General.Actions.Current) || selectionchanged || multiseparateundo) + { + General.Map.UndoRedo.CreateUndo(multiundodescription, UndoGroup.None, 0); + } + } } - + // This is called after an action is performed - private void PostAction(VisualActionResult result) + private void PostAction() { + if(!string.IsNullOrEmpty(actionresult.displaystatus)) + General.Interface.DisplayStatus(StatusType.Action, actionresult.displaystatus); + + lastaction = General.Actions.Current; + selectionchanged = false; + UpdateChangedObjects(); ShowTargetInfo(); } + + // This sets the result for an action + public void SetActionResult(VisualActionResult result) + { + actionresult = result; + } + + // This sets the result for an action + public void SetActionResult(string displaystatus) + { + actionresult = new VisualActionResult(); + actionresult.displaystatus = displaystatus; + } + + // This creates an undo, when only a single selection is made + // When a multi-selection is made, the undo is created by the PreAction function + public int CreateSingleUndo(string description, UndoGroup group, int grouptag) + { + if(singleselection) + return General.Map.UndoRedo.CreateUndo(description, group, grouptag); + else + return 0; + } + + // This creates an undo, when only a single selection is made + // When a multi-selection is made, the undo is created by the PreAction function + public int CreateSingleUndo(string description) + { + if(singleselection) + return General.Map.UndoRedo.CreateUndo(description); + else + return 0; + } // This creates a visual sector protected override VisualSector CreateVisualSector(Sector s) diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs index 5e3c75d2..5d97b5ea 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs @@ -379,13 +379,14 @@ namespace CodeImp.DoomBuilder.BuilderModes public virtual void OnSelectEnd() { this.selected = !this.selected; + mode.SelectionChanged = true; } // Copy properties public virtual void OnCopyProperties() { BuilderPlug.Me.CopiedThingProps = new ThingProperties(Thing); - General.Interface.DisplayStatus(StatusType.Action, "Copied thing properties."); + mode.SetActionResult("Copied thing properties."); } // Paste properties @@ -393,8 +394,8 @@ namespace CodeImp.DoomBuilder.BuilderModes { if(BuilderPlug.Me.CopiedThingProps != null) { - General.Map.UndoRedo.CreateUndo("Paste thing properties"); - General.Interface.DisplayStatus(StatusType.Action, "Pasted thing properties."); + mode.CreateSingleUndo("Paste thing properties"); + mode.SetActionResult("Pasted thing properties."); BuilderPlug.Me.CopiedThingProps.Apply(Thing); Thing.UpdateConfiguration(); this.Rebuild(); @@ -424,11 +425,11 @@ namespace CodeImp.DoomBuilder.BuilderModes if(General.Map.FormatInterface.HasThingHeight) { if((General.Map.UndoRedo.NextUndo == null) || (General.Map.UndoRedo.NextUndo.TicketID != undoticket)) - undoticket = General.Map.UndoRedo.CreateUndo("Change thing height"); + undoticket = mode.CreateSingleUndo("Change thing height"); Thing.Move(Thing.Position + new Vector3D(0.0f, 0.0f, (float)amount)); - General.Interface.DisplayStatus(StatusType.Action, "Changed thing height to " + Thing.Position.z + "."); + mode.SetActionResult("Changed thing height to " + Thing.Position.z + "."); this.Changed = true; } diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualActionResult.cs b/Source/Plugins/BuilderModes/VisualModes/VisualActionResult.cs index 39724b15..542366ce 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualActionResult.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualActionResult.cs @@ -36,8 +36,11 @@ using CodeImp.DoomBuilder.VisualModes; namespace CodeImp.DoomBuilder.BuilderModes { - internal struct VisualActionResult + public struct VisualActionResult { + /// + /// Status description to show after action hasbeen performed. Set to null to show no message. + /// public string displaystatus; } } diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs b/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs index e1f733d2..dc61feae 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs @@ -137,8 +137,8 @@ namespace CodeImp.DoomBuilder.BuilderModes { if(BuilderPlug.Me.CopiedFlat != null) { - General.Map.UndoRedo.CreateUndo("Paste ceiling " + BuilderPlug.Me.CopiedFlat); - General.Interface.DisplayStatus(StatusType.Action, "Pasted flat " + BuilderPlug.Me.CopiedFlat + " on ceiling."); + mode.CreateSingleUndo("Paste ceiling " + BuilderPlug.Me.CopiedFlat); + mode.SetActionResult("Pasted flat " + BuilderPlug.Me.CopiedFlat + " on ceiling."); SetTexture(BuilderPlug.Me.CopiedFlat); this.Setup(); } @@ -147,9 +147,9 @@ namespace CodeImp.DoomBuilder.BuilderModes // This changes the height protected override void ChangeHeight(int amount) { - General.Map.UndoRedo.CreateUndo("Change ceiling height", UndoGroup.CeilingHeightChange, this.Sector.Sector.FixedIndex); + mode.CreateSingleUndo("Change ceiling height", UndoGroup.CeilingHeightChange, this.Sector.Sector.FixedIndex); this.Sector.Sector.CeilHeight += amount; - General.Interface.DisplayStatus(StatusType.Action, "Changed ceiling height to " + Sector.Sector.CeilHeight + "."); + mode.SetActionResult("Changed ceiling height to " + Sector.Sector.CeilHeight + "."); } // This performs a fast test in object picking diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs b/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs index b8a2b194..8561dfa9 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs @@ -124,8 +124,8 @@ namespace CodeImp.DoomBuilder.BuilderModes { if(BuilderPlug.Me.CopiedFlat != null) { - General.Map.UndoRedo.CreateUndo("Paste floor " + BuilderPlug.Me.CopiedFlat); - General.Interface.DisplayStatus(StatusType.Action, "Pasted flat " + BuilderPlug.Me.CopiedFlat + " on floor."); + mode.CreateSingleUndo("Paste floor " + BuilderPlug.Me.CopiedFlat); + mode.SetActionResult("Pasted flat " + BuilderPlug.Me.CopiedFlat + " on floor."); SetTexture(BuilderPlug.Me.CopiedFlat); this.Setup(); } @@ -134,9 +134,9 @@ namespace CodeImp.DoomBuilder.BuilderModes // This changes the height protected override void ChangeHeight(int amount) { - General.Map.UndoRedo.CreateUndo("Change floor height", UndoGroup.FloorHeightChange, this.Sector.Sector.FixedIndex); + mode.CreateSingleUndo("Change floor height", UndoGroup.FloorHeightChange, this.Sector.Sector.FixedIndex); this.Sector.Sector.FloorHeight += amount; - General.Interface.DisplayStatus(StatusType.Action, "Changed floor height to " + Sector.Sector.FloorHeight + "."); + mode.SetActionResult("Changed floor height to " + Sector.Sector.FloorHeight + "."); } // This performs a fast test in object picking