@ Fixed some bugs in the Floor/Ceiling align modes and the GZDoom Visual Mode

This commit is contained in:
codeimp 2011-12-17 16:47:16 +00:00
parent da1f4a76ce
commit f2d41931f4
5 changed files with 69 additions and 55 deletions

View file

@ -64,6 +64,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
public override string XOffsetName { get { return "xpanningceiling"; } }
public override string YOffsetName { get { return "ypanningceiling"; } }
public override string RotationName { get { return "rotationceiling"; } }
public override string UndoDescription { get { return "Ceiling Alignment"; } }
#endregion

View file

@ -126,6 +126,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
public abstract string XOffsetName { get; }
public abstract string YOffsetName { get; }
public abstract string RotationName { get; }
public abstract string UndoDescription { get; }
#endregion
@ -613,7 +614,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
if(selection.Count == 0)
{
General.Interface.MessageBeep(MessageBeepType.Default);
General.Interface.DisplayStatus(StatusType.Info, "A selected sector is required for this action.");
General.Interface.DisplayStatus(StatusType.Action, "A selected sector is required for this action.");
General.Editing.CancelMode();
return;
}
@ -625,7 +626,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
(texture.Width <= 0) || (texture.Height <= 0) || !texture.IsImageLoaded)
{
General.Interface.MessageBeep(MessageBeepType.Default);
General.Interface.DisplayStatus(StatusType.Info, "The selected sector must have a loaded texture to align.");
General.Interface.DisplayStatus(StatusType.Action, "The selected sector must have a loaded texture to align.");
General.Editing.CancelMode();
return;
}
@ -688,12 +689,16 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
{
base.OnAccept();
if(!modealreadyswitching)
{
modealreadyswitching = true;
// Restore original values
RestoreSectors();
General.Map.Map.Update();
// Make undo
General.Map.UndoRedo.CreateUndo("Flat Alignment");
General.Map.UndoRedo.CreateUndo(UndoDescription);
// Resume normal undo/redo recording
General.Map.UndoRedo.IgnorePropChanges = false;
@ -708,9 +713,9 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
// Done
General.Map.IsChanged = true;
selection = null;
sectorinfo = null;
if(!modealreadyswitching)
{
// Return to previous stable mode
General.Editing.ChangeMode(General.Editing.PreviousStableMode.Name);
}
@ -720,6 +725,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
public override void OnCancel()
{
base.OnCancel();
modealreadyswitching = true;
// Restore original values
RestoreSectors();
@ -865,6 +871,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
// This redraws the display
public override void OnRedrawDisplay()
{
if(sectorinfo != null)
UpdateRectangleComponents();
renderer.RedrawSurface();
@ -886,6 +893,8 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
}
// Render overlay
if(sectorinfo != null)
{
if(renderer.StartOverlay(true))
{
// Rectangle
@ -920,6 +929,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
renderer.Finish();
}
}
renderer.Present();
}

View file

@ -64,6 +64,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
public override string XOffsetName { get { return "xpanningfloor"; } }
public override string YOffsetName { get { return "ypanningfloor"; } }
public override string RotationName { get { return "rotationfloor"; } }
public override string UndoDescription { get { return "Floor Alignment"; } }
#endregion

View file

@ -169,6 +169,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
float oldy = Sector.Sector.Fields.GetValue("ypanningceiling", 0.0f);
Sector.Sector.Fields["xpanningceiling"] = new UniValue(UniversalType.Float, oldx + (float)xy.X);
Sector.Sector.Fields["ypanningceiling"] = new UniValue(UniversalType.Float, oldy + (float)xy.Y);
Sector.Sector.UpdateNeeded = true;
}
// Paste texture

View file

@ -168,6 +168,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
float oldy = Sector.Sector.Fields.GetValue("ypanningfloor", 0.0f);
Sector.Sector.Fields["xpanningfloor"] = new UniValue(UniversalType.Float, oldx + (float)xy.X);
Sector.Sector.Fields["ypanningfloor"] = new UniValue(UniversalType.Float, oldy + (float)xy.Y);
Sector.Sector.UpdateNeeded = true;
}
// Paste texture