More status/action messages shown in the status bar while editing.

This commit is contained in:
codeimp 2009-02-27 19:02:21 +00:00
parent 7721b0f70b
commit f295292247
12 changed files with 100 additions and 43 deletions

View file

@ -399,8 +399,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
"elegant", "glamorous", "gorgeous", "handsome", "magnificent", "unusual",
"outstanding", "mysterious", "amusing", "charming", "fantastic", "jolly" };
string word = adjectives[points.Count % adjectives.Length];
string very = (points.Count > adjectives.Length) ? "very " : "";
General.Interface.DisplayStatus(StatusType.Action, "Created a " + very + word + " drawing.");
word = (points.Count > adjectives.Length) ? "very " + word : word;
string a = ((word[0] == 'a') || (word[0] == 'e') || (word[0] == 'o')) ? "an " : "a ";
General.Interface.DisplayStatus(StatusType.Action, "Created " + a + word + " drawing.");
// Make the drawing
Tools.DrawLines(points);

View file

@ -590,7 +590,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(selected.Count > 1)
{
General.Map.UndoRedo.CreateUndo("Split " + selected.Count + " linedefs");
General.Interface.DisplayStatus("Split " + selected.Count + " linedefs.");
General.Interface.DisplayStatus(StatusType.Action, "Split " + selected.Count + " linedefs.");
}
else
{
@ -679,12 +679,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(selected.Count > 1)
{
General.Map.UndoRedo.CreateUndo("Flip " + selected.Count + " linedefs");
General.Interface.DisplayStatus("Flipped " + selected.Count + " linedefs.");
General.Interface.DisplayStatus(StatusType.Action, "Flipped " + selected.Count + " linedefs.");
}
else
{
General.Map.UndoRedo.CreateUndo("Flip linedef");
General.Interface.DisplayStatus("Flipped a linedef.");
General.Interface.DisplayStatus(StatusType.Action, "Flipped a linedef.");
}
// Flip all selected linedefs
@ -731,12 +731,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(selected.Count > 1)
{
General.Map.UndoRedo.CreateUndo("Flip " + selected.Count + " sidedefs");
General.Interface.DisplayStatus("Flipped " + selected.Count + " sidedefs.");
General.Interface.DisplayStatus(StatusType.Action, "Flipped " + selected.Count + " sidedefs.");
}
else
{
General.Map.UndoRedo.CreateUndo("Flip sidedefs");
General.Interface.DisplayStatus("Flipped sidedefs.");
General.Interface.DisplayStatus(StatusType.Action, "Flipped sidedefs.");
}
// Flip sidedefs in all selected linedefs

View file

@ -735,7 +735,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Create undo
General.Map.UndoRedo.CreateUndo("Make door (" + doortex + ")");
General.Interface.DisplayStatus("Created a " + doortex + " door.");
General.Interface.DisplayStatus(StatusType.Action, "Created a " + doortex + " door.");
// Go for all selected sectors
foreach(Sector s in orderedselection)
@ -831,12 +831,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(selected.Count > 1)
{
General.Map.UndoRedo.CreateUndo("Delete " + selected.Count + " sectors");
General.Interface.DisplayStatus("Deleted " + selected.Count + " sectors.");
General.Interface.DisplayStatus(StatusType.Action, "Deleted " + selected.Count + " sectors.");
}
else
{
General.Map.UndoRedo.CreateUndo("Delete sector");
General.Interface.DisplayStatus("Deleted sector.");
General.Interface.DisplayStatus(StatusType.Action, "Deleted sector.");
}
// Dispose selected sectors
@ -893,7 +893,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
// Make undo
General.Map.UndoRedo.CreateUndo("Join " + count + " sectors");
General.Interface.DisplayStatus("Joined " + count + " sectors.");
General.Interface.DisplayStatus(StatusType.Action, "Joined " + count + " sectors.");
// Merge
JoinMergeSectors(false);
@ -919,7 +919,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
// Make undo
General.Map.UndoRedo.CreateUndo("Merge " + count + " sectors");
General.Interface.DisplayStatus("Merged " + count + " sectors.");
General.Interface.DisplayStatus(StatusType.Action, "Merged " + count + " sectors.");
// Merge
JoinMergeSectors(true);

View file

@ -533,7 +533,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Interface.ShowEditThings(things);
}
General.Interface.DisplayStatus("Inserted a new thing.");
General.Interface.DisplayStatus(StatusType.Action, "Inserted a new thing.");
// Update things filter
General.Map.ThingsFilter.Update();
@ -584,12 +584,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(selected.Count > 1)
{
General.Map.UndoRedo.CreateUndo("Delete " + selected.Count + " things");
General.Interface.DisplayStatus("Deleted " + selected.Count + " things.");
General.Interface.DisplayStatus(StatusType.Action, "Deleted " + selected.Count + " things.");
}
else
{
General.Map.UndoRedo.CreateUndo("Delete thing");
General.Interface.DisplayStatus("Deleted thing.");
General.Interface.DisplayStatus(StatusType.Action, "Deleted a thing.");
}
// Dispose selected things

View file

@ -510,12 +510,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Split the line with this vertex
if(snaptonearest && (l != null))
{
General.Interface.DisplayStatus("Split a linedef.");
General.Interface.DisplayStatus(StatusType.Action, "Split a linedef.");
l.Split(v);
}
else
{
General.Interface.DisplayStatus("Inserted a vertex.");
General.Interface.DisplayStatus(StatusType.Action, "Inserted a vertex.");
}
// Update
@ -540,12 +540,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(selected.Count > 1)
{
General.Map.UndoRedo.CreateUndo("Delete " + selected.Count + " vertices");
General.Interface.DisplayStatus("Deleted " + selected.Count + " vertices.");
General.Interface.DisplayStatus(StatusType.Action, "Deleted " + selected.Count + " vertices.");
}
else
{
General.Map.UndoRedo.CreateUndo("Delete vertex");
General.Interface.DisplayStatus("Deleted a vertex.");
General.Interface.DisplayStatus(StatusType.Action, "Deleted a vertex.");
}
// Go for all vertices that need to be removed

View file

@ -159,17 +159,26 @@ namespace CodeImp.DoomBuilder.BuilderModes
string newtexture = BuilderPlug.Me.CopiedFlat;
if(newtexture != oldtexture)
{
General.Map.UndoRedo.CreateUndo("Flood-fill flats with " + newtexture);
mode.Renderer.SetCrosshairBusy(true);
General.Interface.RedrawDisplay();
// Get the texture
ImageData newtextureimage = General.Map.Data.GetFlatImage(newtexture);
if(newtextureimage != null)
{
bool fillceilings = (this is VisualCeiling);
if(fillceilings)
{
General.Map.UndoRedo.CreateUndo("Flood-fill ceilings with " + newtexture);
General.Interface.DisplayStatus(StatusType.Action, "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.Renderer.SetCrosshairBusy(true);
General.Interface.RedrawDisplay();
// Do the fill
Tools.FloodfillFlats(this.Sector.Sector, fillceilings, oldtexturelong, newtextureimage, true);
@ -200,6 +209,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
public virtual void OnCopyProperties()
{
BuilderPlug.Me.CopiedSectorProps = new SectorProperties(Sector.Sector);
General.Interface.DisplayStatus(StatusType.Action, "Copied sector properties.");
}
// Paste properties
@ -208,6 +218,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(BuilderPlug.Me.CopiedSectorProps != null)
{
General.Map.UndoRedo.CreateUndo("Paste sector properties");
General.Interface.DisplayStatus(StatusType.Action, "Pasted sector properties.");
BuilderPlug.Me.CopiedSectorProps.Apply(Sector.Sector);
UpdateSectorGeometry(true);
mode.ShowTargetInfo();
@ -234,6 +245,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() + ".");
}
public virtual void OnPasteTexture() { }
@ -276,6 +288,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Change brightness
General.Map.UndoRedo.CreateUndo("Change sector brightness", UndoGroup.SectorBrightnessChange, Sector.Sector.Index);
Sector.Sector.Brightness = General.Clamp(Sector.Sector.Brightness + amount, 0, 255);
General.Interface.DisplayStatus(StatusType.Action, "Changed sector brightness to " + Sector.Sector.Brightness + ".");
// Rebuild sector
UpdateSectorGeometry(false);

View file

@ -124,6 +124,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
// Make it now
General.Map.UndoRedo.CreateUndo("Create middle texture");
General.Interface.DisplayStatus(StatusType.Action, "Created middle texture.");
General.Settings.FindDefaultDrawSettings();
Sidedef.SetTextureMid(General.Settings.DefaultTexture);
@ -147,6 +148,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
// Remove texture
General.Map.UndoRedo.CreateUndo("Delete texture");
General.Interface.DisplayStatus(StatusType.Action, "Deleted a texture.");
SetTexture("-");
// Update
@ -192,6 +194,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
public virtual void OnResetTextureOffset()
{
General.Map.UndoRedo.CreateUndo("Reset texture offsets");
General.Interface.DisplayStatus(StatusType.Action, "Texture offsets reset.");
// Apply offsets
Sidedef.OffsetX = 0;
@ -213,12 +216,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
// Remove flag
General.Map.UndoRedo.CreateUndo("Remove upper-unpegged setting");
General.Interface.DisplayStatus(StatusType.Action, "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.");
this.Sidedef.Line.Flags[General.Map.Config.UpperUnpeggedFlag] = true;
}
@ -238,12 +243,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
// Remove flag
General.Map.UndoRedo.CreateUndo("Remove lower-unpegged setting");
General.Interface.DisplayStatus(StatusType.Action, "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.");
this.Sidedef.Line.Flags[General.Map.Config.LowerUnpeggedFlag] = true;
}
@ -266,6 +273,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(newtexture != oldtexture)
{
General.Map.UndoRedo.CreateUndo("Flood-fill textures with " + newtexture);
General.Interface.DisplayStatus(StatusType.Action, "Flood-filled textures with " + newtexture + ".");
mode.Renderer.SetCrosshairBusy(true);
General.Interface.RedrawDisplay();
@ -305,6 +313,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
public virtual void OnTextureAlign(bool alignx, bool aligny)
{
General.Map.UndoRedo.CreateUndo("Auto-align textures");
General.Interface.DisplayStatus(StatusType.Action, "Auto-aligned textures.");
// Make sure the texture is loaded (we need the texture size)
if(!base.Texture.IsImageLoaded) base.Texture.LoadImage();
@ -350,6 +359,7 @@ 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 + ".");
SetTexture(BuilderPlug.Me.CopiedTexture);
}
}
@ -360,6 +370,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Map.UndoRedo.CreateUndo("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 + ".");
// Update sidedef geometry
VisualSidedefParts parts = Sector.GetSidedefParts(Sidedef);
@ -374,18 +385,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() + ".");
}
// 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 + ".");
}
// Copy properties
public virtual void OnCopyProperties()
{
BuilderPlug.Me.CopiedSidedefProps = new SidedefProperties(Sidedef);
General.Interface.DisplayStatus(StatusType.Action, "Copied sidedef properties.");
}
// Paste properties
@ -394,6 +408,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(BuilderPlug.Me.CopiedSidedefProps != null)
{
General.Map.UndoRedo.CreateUndo("Paste sidedef properties");
General.Interface.DisplayStatus(StatusType.Action, "Pasted sidedef properties.");
BuilderPlug.Me.CopiedSidedefProps.Apply(Sidedef);
// Update sectors on both sides
@ -520,6 +535,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Change brightness
General.Map.UndoRedo.CreateUndo("Change sector brightness", UndoGroup.SectorBrightnessChange, Sector.Sector.Index);
Sector.Sector.Brightness = General.Clamp(Sector.Sector.Brightness + amount, 0, 255);
General.Interface.DisplayStatus(StatusType.Action, "Changed sector brightness to " + Sector.Sector.Brightness + ".");
// Rebuild sector
Sector.Rebuild();
@ -549,6 +565,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
Sidedef.OffsetX -= horizontal;
Sidedef.OffsetY -= vertical;
General.Interface.DisplayStatus(StatusType.Action, "Changed texture offsets to " + Sidedef.OffsetX + ", " + Sidedef.OffsetY + ".");
// Update sidedef geometry
VisualSidedefParts parts = Sector.GetSidedefParts(Sidedef);
if(parts.lower != null) parts.lower.Setup();

View file

@ -361,6 +361,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
public virtual void OnCopyProperties()
{
BuilderPlug.Me.CopiedThingProps = new ThingProperties(Thing);
General.Interface.DisplayStatus(StatusType.Action, "Copied thing properties.");
}
// Paste properties
@ -369,6 +370,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(BuilderPlug.Me.CopiedThingProps != null)
{
General.Map.UndoRedo.CreateUndo("Paste thing properties");
General.Interface.DisplayStatus(StatusType.Action, "Pasted thing properties.");
BuilderPlug.Me.CopiedThingProps.Apply(Thing);
Thing.UpdateConfiguration();
this.Rebuild();
@ -402,6 +404,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
Thing.Move(Thing.Position + new Vector3D(0.0f, 0.0f, (float)amount));
General.Interface.DisplayStatus(StatusType.Action, "Changed thing height to " + Thing.Position.z + ".");
this.Setup();
}
}

View file

@ -34,6 +34,7 @@ using CodeImp.DoomBuilder.Editing;
using CodeImp.DoomBuilder.IO;
using CodeImp.DoomBuilder.Rendering;
using CodeImp.DoomBuilder.VisualModes;
using CodeImp.DoomBuilder.Windows;
#endregion
@ -137,6 +138,7 @@ 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.");
SetTexture(BuilderPlug.Me.CopiedFlat);
this.Setup();
}
@ -147,6 +149,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
General.Map.UndoRedo.CreateUndo("Change ceiling height", UndoGroup.CeilingHeightChange, this.Sector.Sector.Index);
this.Sector.Sector.CeilHeight += amount;
General.Interface.DisplayStatus(StatusType.Action, "Changed ceiling height to " + Sector.Sector.CeilHeight + ".");
}
// This performs a fast test in object picking

View file

@ -34,6 +34,7 @@ using CodeImp.DoomBuilder.Editing;
using CodeImp.DoomBuilder.IO;
using CodeImp.DoomBuilder.Rendering;
using CodeImp.DoomBuilder.VisualModes;
using CodeImp.DoomBuilder.Windows;
#endregion
@ -124,6 +125,7 @@ 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.");
SetTexture(BuilderPlug.Me.CopiedFlat);
this.Setup();
}
@ -134,6 +136,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
General.Map.UndoRedo.CreateUndo("Change floor height", UndoGroup.FloorHeightChange, this.Sector.Sector.Index);
this.Sector.Sector.FloorHeight += amount;
General.Interface.DisplayStatus(StatusType.Action, "Changed floor height to " + Sector.Sector.FloorHeight + ".");
}
// This performs a fast test in object picking

View file

@ -60,8 +60,8 @@ namespace CodeImp.DoomBuilder.Windows
private const int WARNING_FLASH_INTERVAL = 100;
private const int WARNING_RESET_DELAY = 4000;
private const int INFO_RESET_DELAY = 4000;
private const int ACTION_FLASH_COUNT = 1;
private const int ACTION_FLASH_INTERVAL = 100;
private const int ACTION_FLASH_COUNT = 3;
private const int ACTION_FLASH_INTERVAL = 50;
private const int ACTION_RESET_DELAY = 4000;
private readonly Image[,] STATUS_IMAGES = new Image[2, 4]
@ -551,9 +551,12 @@ namespace CodeImp.DoomBuilder.Windows
public void DisplayStatus(StatusInfo newstatus)
{
// Stop timers
statusresetter.Stop();
statusflasher.Stop();
statusflashicon = false;
if(!newstatus.displayed)
{
statusresetter.Stop();
statusflasher.Stop();
statusflashicon = false;
}
// Determine what to do specifically for this status type
switch(newstatus.type)
@ -569,33 +572,43 @@ namespace CodeImp.DoomBuilder.Windows
// Shows information without flashing the icon.
case StatusType.Info:
statusresetter.Interval = INFO_RESET_DELAY;
statusresetter.Start();
if(!newstatus.displayed)
{
statusresetter.Interval = INFO_RESET_DELAY;
statusresetter.Start();
}
break;
// Shows action information and flashes up the status icon once.
case StatusType.Action:
statusflashicon = true;
statusflasher.Interval = ACTION_FLASH_INTERVAL;
statusflashcount = ACTION_FLASH_COUNT;
statusflasher.Start();
statusresetter.Interval = ACTION_RESET_DELAY;
statusresetter.Start();
if(!newstatus.displayed)
{
statusflashicon = true;
statusflasher.Interval = ACTION_FLASH_INTERVAL;
statusflashcount = ACTION_FLASH_COUNT;
statusflasher.Start();
statusresetter.Interval = ACTION_RESET_DELAY;
statusresetter.Start();
}
break;
// Shows a warning, makes a warning sound and flashes a warning icon.
case StatusType.Warning:
MessageBeep(MessageBeepType.Warning);
statusflasher.Interval = WARNING_FLASH_INTERVAL;
statusflashcount = WARNING_FLASH_COUNT;
statusflasher.Start();
statusresetter.Interval = WARNING_RESET_DELAY;
statusresetter.Start();
if(!newstatus.displayed)
{
MessageBeep(MessageBeepType.Warning);
statusflasher.Interval = WARNING_FLASH_INTERVAL;
statusflashcount = WARNING_FLASH_COUNT;
statusflasher.Start();
statusresetter.Interval = WARNING_RESET_DELAY;
statusresetter.Start();
}
break;
}
// Update status description
status = newstatus;
status.displayed = true;
if(statuslabel.Text != status.message)
statuslabel.Text = status.message;

View file

@ -42,11 +42,13 @@ namespace CodeImp.DoomBuilder.Windows
{
public StatusType type;
public string message;
internal bool displayed;
internal StatusInfo(StatusType type, string message)
{
this.type = type;
this.message = message;
this.displayed = false;
}
}