mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-18 22:41:46 +00:00
Fixed a bug where selected lines were deselected when trying to find/replace
Replacing can now be made undone
This commit is contained in:
parent
e62146f464
commit
f145eebada
2 changed files with 15 additions and 4 deletions
|
@ -89,10 +89,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// Select linedefs by sectors
|
||||
foreach(Linedef ld in General.Map.Map.Linedefs)
|
||||
{
|
||||
bool front, back;
|
||||
if(ld.Front != null) front = ld.Front.Sector.Selected; else front = false;
|
||||
if(ld.Back != null) back = ld.Back.Sector.Selected; else back = false;
|
||||
ld.Selected = front | back;
|
||||
if (ld.Selected == false)
|
||||
{
|
||||
bool front, back;
|
||||
if (ld.Front != null) front = ld.Front.Sector.Selected; else front = false;
|
||||
if (ld.Back != null) back = ld.Back.Sector.Selected; else back = false;
|
||||
ld.Selected = front | back;
|
||||
}
|
||||
}
|
||||
|
||||
// Show toolbox window
|
||||
|
|
|
@ -169,8 +169,16 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// Perform the search / replace and show the results
|
||||
if(doreplace.Checked)
|
||||
{
|
||||
int ticket = General.Map.UndoRedo.CreateUndo("Replace " + searchtypes.SelectedItem);
|
||||
|
||||
resultslist.Items.AddRange(finder.Find(findinput.Text, withinselection.Checked, replaceinput.Text, false));
|
||||
resultscount.Text = resultslist.Items.Count + " items found and replaced.";
|
||||
|
||||
// Withdraw the undo step if nothing was replaced
|
||||
if (resultslist.Items.Count <= 0)
|
||||
{
|
||||
General.Map.UndoRedo.WithdrawUndo(ticket);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue