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 committed by spherallic
parent 5fe6c91ffc
commit 747f268af2
12 changed files with 30 additions and 23 deletions

View file

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

View file

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

View file

@ -10,7 +10,7 @@ using System.Threading;
namespace CodeImp.DoomBuilder.BuilderModes namespace CodeImp.DoomBuilder.BuilderModes
{ {
[ErrorChecker("Check Polyobjects", true, 100)] [ErrorChecker("Check polyobjects", true, 100)]
public class CheckPolyobjects : ErrorChecker public class CheckPolyobjects : ErrorChecker
{ {
#region ================== Constants #region ================== Constants
@ -124,7 +124,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Check if Mirror Polyobject Number exists // Check if Mirror Polyobject Number exists
foreach(Linedef linedef in linesbytype.Value) 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.")); 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 namespace CodeImp.DoomBuilder.BuilderModes
{ {
[FindReplace("Sector Ceiling Flat", BrowseButton = true)] [FindReplace("Sector Flat (Ceiling)", BrowseButton = true)]
internal class FindSectorCeilingFlat : FindSectorFlat internal class FindSectorCeilingFlat : FindSectorFlat
{ {
#region ================== Methods #region ================== Methods

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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