Fixed, "Check Polyobjects" error check: an error is no longer added when "Mirror Polyobject Number" of "Polyobj_Startline" is 0.

Fixed, "Find and Replace" mode: "Find and Replace" window no longer closes when no results are found and Replace mode is enabled.
Changed, "Find and Replace" mode: renamed some search modes for better grouping.
This commit is contained in:
MaxED 2016-03-24 09:25:54 +00:00
parent cc9d118f5b
commit 5fd79cd7a2
12 changed files with 30 additions and 23 deletions

View file

@ -45,7 +45,7 @@ namespace CodeImp.DoomBuilder.Editing
#region ================== Variables
// Attributes
private EditModeAttribute attributes;
protected EditModeAttribute attributes; //mxd. private -> protected
// Disposing
protected bool isdisposed;

View file

@ -46,6 +46,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
#region ================== Properties
internal bool Volatile { get { return attributes.Volatile; } set { attributes.Volatile = value; } } //mxd
#endregion
#region ================== Constructor / Disposer
@ -89,7 +91,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
// Show toolbox window
BuilderPlug.Me.FindReplaceForm.Show((Form)General.Interface);
BuilderPlug.Me.FindReplaceForm.Show((Form)General.Interface, this);
}
// Disenagaging

View file

@ -10,7 +10,7 @@ using System.Threading;
namespace CodeImp.DoomBuilder.BuilderModes
{
[ErrorChecker("Check Polyobjects", true, 100)]
[ErrorChecker("Check polyobjects", true, 100)]
public class CheckPolyobjects : ErrorChecker
{
#region ================== Constants
@ -124,7 +124,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Check if Mirror Polyobject Number exists
foreach(Linedef linedef in linesbytype.Value)
{
if(!startspots.ContainsKey(linedef.Args[1]))
// The value of 0 can mean either "No mirror polyobj" or "Polyobj 0" here...
if(linedef.Args[1] > 0 && !startspots.ContainsKey(linedef.Args[1]))
SubmitResult(new ResultInvalidPolyobjectLines(new List<Linedef> { linedef }, "\"" + Polyobj_StartLine + "\" action have non-existing Mirror Polyobject Number assigned (" + linedef.Args[1] + "). It won't function correctly ingame."));
}
}

View file

@ -10,7 +10,7 @@ using CodeImp.DoomBuilder.Map;
namespace CodeImp.DoomBuilder.BuilderModes
{
[FindReplace("Sector Ceiling Flat", BrowseButton = true)]
[FindReplace("Sector Flat (Ceiling)", BrowseButton = true)]
internal class FindSectorCeilingFlat : FindSectorFlat
{
#region ================== Methods

View file

@ -8,7 +8,7 @@ using CodeImp.DoomBuilder.Map;
namespace CodeImp.DoomBuilder.BuilderModes.FindReplace
{
[FindReplace("Sector Ceiling Height", BrowseButton = false)]
[FindReplace("Sector Height (Ceiling)", BrowseButton = false)]
internal class FindSectorCeilingHeight : BaseFindSector
{
#region ================== Methods

View file

@ -10,7 +10,7 @@ using CodeImp.DoomBuilder.Map;
namespace CodeImp.DoomBuilder.BuilderModes
{
[FindReplace("Sector Floor Flat", BrowseButton = true)]
[FindReplace("Sector Flat (Floor)", BrowseButton = true)]
internal class FindSectorFloorFlat : FindSectorFlat
{
#region ================== Methods

View file

@ -8,7 +8,7 @@ using CodeImp.DoomBuilder.Map;
namespace CodeImp.DoomBuilder.BuilderModes.FindReplace
{
[FindReplace("Sector Floor Height", BrowseButton = false)]
[FindReplace("Sector Height (Floor)", BrowseButton = false)]
internal class FindSectorFloorHeight : BaseFindSector
{
#region ================== Methods

View file

@ -11,7 +11,7 @@ using CodeImp.DoomBuilder.Map;
namespace CodeImp.DoomBuilder.BuilderModes
{
[FindReplace("Sidedef Lower Texture", BrowseButton = true)]
[FindReplace("Sidedef Texture (Lower)", BrowseButton = true)]
internal class FindSidedefLowerTexture : BaseFindSidedef
{
#region ================== Properties

View file

@ -11,7 +11,7 @@ using CodeImp.DoomBuilder.Map;
namespace CodeImp.DoomBuilder.BuilderModes
{
[FindReplace("Sidedef Middle Texture", BrowseButton = true)]
[FindReplace("Sidedef Texture (Middle)", BrowseButton = true)]
internal class FindSidedefMiddleTexture : BaseFindSidedef
{
#region ================== Properties

View file

@ -11,7 +11,7 @@ using CodeImp.DoomBuilder.Map;
namespace CodeImp.DoomBuilder.BuilderModes
{
[FindReplace("Sidedef Upper Texture", BrowseButton = true)]
[FindReplace("Sidedef Texture (Upper)", BrowseButton = true)]
internal class FindSidedefUpperTexture : BaseFindSidedef
{
#region ================== Properties

View file

@ -72,6 +72,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
this.searchtypes.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.searchtypes.FormattingEnabled = true;
this.searchtypes.Location = new System.Drawing.Point(109, 12);
this.searchtypes.MaxDropDownItems = 40;
this.searchtypes.Name = "searchtypes";
this.searchtypes.Size = new System.Drawing.Size(156, 21);
this.searchtypes.Sorted = true;

View file

@ -36,12 +36,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
#region ================== Variables
private FindReplaceMode mode; //mxd
private FindReplaceType newfinder;
private FindReplaceType finder;
private List<FindReplaceType> findtypeslist;
bool controlpressed;
bool shiftpressed;
bool suppressevents;
private bool controlpressed;
private bool shiftpressed;
private bool suppressevents;
#endregion
@ -169,7 +170,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Withdraw the undo step if nothing was replaced
if(resultslist.Items.Count < 1)
{
mode.Volatile = false; //mxd. Otherwice UndoManager.PerformUndo will cancel the mode...
General.Map.UndoRedo.WithdrawUndo();
mode.Volatile = true; //mxd
}
}
else
{
@ -345,14 +350,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
#region ================== Methods
// This shows the window
public void Show(Form owner)
public void Show(Form owner, FindReplaceMode mode)
{
// First time showing?
//if((this.Location.X == 0) && (this.Location.Y == 0))
{
// Position at left-top of owner
this.Location = new Point(owner.Location.X + 20, owner.Location.Y + 90);
}
//mxd
this.mode = mode;
// Position at left-top of owner
this.Location = new Point(owner.Location.X + 20, owner.Location.Y + 90);
// Re-fill the search types list
searchtypes.Items.Clear();
@ -373,8 +377,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
// Select first if none was selected
if(searchtypes.SelectedIndex < 0)
searchtypes.SelectedIndex = 0;
if(searchtypes.SelectedIndex < 0) searchtypes.SelectedIndex = 0;
// Close results part
resultspanel.Visible = false;