diff --git a/Help/gzdb/features/classic_modes/selection.html b/Help/gzdb/features/classic_modes/selection.html
index 1670dfd3..47305bb6 100644
--- a/Help/gzdb/features/classic_modes/selection.html
+++ b/Help/gzdb/features/classic_modes/selection.html
@@ -15,7 +15,8 @@
A Rectangular selection can now be started even when a map element is already highlighted. This means that you can now use it to select sectors, which are completely surrounded by other sectors.
Hold Shift to enable additive selection, hold Ctrl to enable subtractive selection, hold Ctrl-Shift to intersect with an existing selection.
- Hold Alt in Sectors mode to select things inside of selected sectors.
+ Hold Alt in Sectors mode to (de)select things inside of (de)selected sectors when using regular, paint and rectangular selection. This behaviour is inverted when "Syncronized Things Editing " option is enabled.
+ Hold Alt in Linedefs mode to (de)select things inside of rectangular selection marquee. This behaviour is inverted when "Syncronized Things Editing " option is enabled.
Current behaviour is indicated by the selection outline: additive selection uses the Highlight color, subtractive selection uses the inverted Highlight color.
The Rectangular selection mode in Sectors and Linedefs modes can be toggled between "Select inside" (classic behavior: only map elements which are fully inside selection will be affected) and "Select touching" (map elements which are partially inside selection will be also affected) using this button in the toolbar:
diff --git a/Help/gzdb/features/features.html b/Help/gzdb/features/features.html
index 62cc44f1..4a575659 100644
--- a/Help/gzdb/features/features.html
+++ b/Help/gzdb/features/features.html
@@ -96,14 +96,14 @@
Camera position can be synchronized between Classic and Visual modes. More info .
You can use Color Picker plugin to edit dynamic light properties and sector's fog and tint colors in Classic and Visual modes.
You can use Tag Explorer plugin to view all tags and actions used in current map.
-
You can paste only specific properties using "Paste Properties Special " action (available via keyboard shortcut, as "Edit -> Paste Properties Special..." menu item and as a button on the Edit Mode toolbar).
+ You can paste only specific properties using "Paste Properties Special " action (available via keyboard shortcut, as "Edit -> Paste Properties Special... " menu item and as a button on the Edit Mode toolbar).
You can apply randomized transformations to any map element.
Image browser shows directory structure of Folder, PK3 and PK7 resources and can filter images by texture type and size. More info .
Most controls of Edit Sector/Linedef/Thing forms now work in realtime (e.g. you can immediately see texture offset/scale/rotation changes while you are changing appropriate values). Action and Tag changes are still applied only after you press "OK" button.
-
[UDMF] All UDMF properties (except "comment") can be edited using Edit Sector/Linedef/Thing/Vertex forms user interface.
+
[UDMF] All UDMF properties can be edited using Edit Sector/Linedef/Thing/Vertex windows user interface.
Thing Edit Form has "Random angle" checkbox.
[UDMF] Sector, Linedef and Vertex info panels show additional info if a map is in UDMF format.
@@ -118,7 +118,7 @@
Thing sprites are rendered in classic modes.
You can assign custom color to any combination of linedef flags, actions and/or activation. More info .
Enhanced rectangular selection .
-
New action: "Go To Coordinates ", available in View menu and by clicking on cursor coordinates in the lower-right corner of UI.
+
New action: "Go To Coordinates ", available in the View menu and by clicking on cursor coordinates in the lower-right corner of UI.
You can use Paint selection action to select map elements easier.
Draw Rectangle mode .
Draw Ellipse mode .
@@ -157,7 +157,8 @@
Sectors mode:
[UDMF] Sector Edit Form now has "Slopes " tab.
- Things inside of selected Sectors can be moved when dragging Sectors. This toolbar button toggles this mode: . When enabled, all things inside of selected sectors will be dragged when dragging sectors. Otherwise, selected things will be dragged.
+ Things selection, dragging and deletion can be syncronized with sectors selection, dragging and deletion by enabling Sectors -> Syncronized Things Editing menu item / Syncronized Things Editing toolbar button.
+ Things can be (de)selected by holding the Alt key when (de)selecting sectors. Alt key behaviour is inverted when Syncronized Things Editing option is enabled.
Sector Tag and Effect can now be shown on top of sectors. You can use "View Tags and Effects " button to toggle this overlay.
@@ -176,6 +177,7 @@
Linedefs mode:
+ Things dragging can be syncronized with linedefs dragging by enabling Linedefs -> Syncronized Things Transform menu item / Syncronized Things Transform toolbar button.
[UDMF] New actions: "Align Ceiling Texture to Back Side ", "Align Ceiling Texture to Front Side ", "Align Floor Texture to Back Side " and "Align Floor Texture to Front Side " (available in Linedefs -> Align Textures menu).
[UDMF] "Make brightness gradient " command is available in Linedefs mode.
[UDMF] Linedef info panel: relative UDMF light values are shown like this: 16 (128 ), which means "UDMF light value " ("total surface brightness "). Total surface brightness is UDMF light value + sector brightness.
@@ -193,7 +195,6 @@
You can clone selected/highlighted things by holding "Shift" before starting to drag them.
New action: "Point Thing to cursor ". More info .
- New action: "Select Things in Selected Sectors " (Default key is Shift+T).
New action: "Align Things To Linedef ".
Z-height of a thing can be changed in absolute and relative mode in Thing Edit form.
Thing's X and Y position can be edited in Edit Thing form.
diff --git a/Help/gzdb/features/sectors_mode/drag_things.jpg b/Help/gzdb/features/sectors_mode/drag_things.jpg
deleted file mode 100644
index 64ba9445..00000000
Binary files a/Help/gzdb/features/sectors_mode/drag_things.jpg and /dev/null differ
diff --git a/Source/Core/Editing/EditMode.cs b/Source/Core/Editing/EditMode.cs
index 9e71435d..e6b12ece 100644
--- a/Source/Core/Editing/EditMode.cs
+++ b/Source/Core/Editing/EditMode.cs
@@ -17,6 +17,7 @@
#region ================== Namespaces
using System;
+using System.Collections.Generic;
using System.Globalization;
using System.Windows.Forms;
using System.Reflection;
@@ -136,7 +137,32 @@ namespace CodeImp.DoomBuilder.Editing
//mxd
public virtual void UpdateSelectionInfo()
{
- General.Interface.DisplayStatus(StatusType.Selection, string.Empty);
+ // Collect info
+ List info = new List();
+
+ if(General.Map.Map.SelectedSectorsCount > 0)
+ info.Add(General.Map.Map.SelectedSectorsCount + (General.Map.Map.SelectedSectorsCount == 1 ? " sector" : " sectors"));
+
+ if(General.Map.Map.SelectedLinedefsCount > 0)
+ info.Add(General.Map.Map.SelectedLinedefsCount + (General.Map.Map.SelectedLinedefsCount == 1 ? " linedef" : " linedefs"));
+
+ if(General.Map.Map.SelectedVerticessCount > 0)
+ info.Add(General.Map.Map.SelectedVerticessCount + (General.Map.Map.SelectedVerticessCount == 1 ? " vertex" : " vertices"));
+
+ if(General.Map.Map.SelectedThingsCount > 0)
+ info.Add(General.Map.Map.SelectedThingsCount + (General.Map.Map.SelectedThingsCount == 1 ? " thing" : " things"));
+
+ // Display results
+ string result = string.Empty;
+ if(info.Count > 0)
+ {
+ result = string.Join(", ", info.ToArray());
+ int pos = result.LastIndexOf(",", StringComparison.Ordinal);
+ if(pos != -1) result = result.Remove(pos, 1).Insert(pos, " and");
+ result += " selected.";
+ }
+
+ General.Interface.DisplayStatus(StatusType.Selection, result);
}
#endregion
diff --git a/Source/Core/General/MapManager.cs b/Source/Core/General/MapManager.cs
index f96b7b01..ad56ddfb 100644
--- a/Source/Core/General/MapManager.cs
+++ b/Source/Core/General/MapManager.cs
@@ -991,7 +991,6 @@ namespace CodeImp.DoomBuilder
try
{
string settingsfile = newfilepathname.Substring(0, newfilepathname.Length - 4) + ".dbs";
- if(File.Exists(settingsfile)) File.Delete(settingsfile);
options.WriteConfiguration(settingsfile);
}
catch(Exception e)
diff --git a/Source/Plugins/BuilderModes/ClassicModes/BaseClassicMode.cs b/Source/Plugins/BuilderModes/ClassicModes/BaseClassicMode.cs
index 3639bf3c..614a885b 100644
--- a/Source/Plugins/BuilderModes/ClassicModes/BaseClassicMode.cs
+++ b/Source/Plugins/BuilderModes/ClassicModes/BaseClassicMode.cs
@@ -215,6 +215,69 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
General.Interface.OnEditFormValuesChanged -= thingEditForm_OnValuesChanged;
}
+
+ //mxd
+ protected static void DeleteThings(ICollection things)
+ {
+ if(things.Count == 0) return;
+
+ General.Map.Map.BeginAddRemove(); //mxd
+
+ // Dispose selected things
+ foreach(Thing t in things)
+ {
+ //mxd. Do some path reconnecting shenanigans...
+ ThingTypeInfo info = General.Map.Data.GetThingInfo(t.Type);
+ string targetclass = string.Empty;
+ int targetarg = -1;
+
+ // Thing type can be changed in MAPINFO DoomEdNums block...
+ switch(info.ClassName.ToLowerInvariant())
+ {
+ case "interpolationpoint":
+ if(t.Tag != 0 && t.Args[3] != 0)
+ {
+ targetclass = "interpolationpoint";
+ targetarg = 3;
+ }
+ break;
+
+ case "patrolpoint":
+ if(t.Tag != 0 && t.Args[0] != 0)
+ {
+ targetclass = "patrolpoint";
+ targetarg = 0;
+ }
+ break;
+ }
+
+ // Try to reconnect path...
+ if(!string.IsNullOrEmpty(targetclass) && targetarg > -1)
+ {
+ General.Map.Map.EndAddRemove(); // We'll need to unlock the things array...
+
+ foreach(Thing other in General.Map.Map.Things)
+ {
+ if(other.Index == t.Index)
+ continue;
+ info = General.Map.Data.GetThingInfo(other.Type);
+ if(info.ClassName.ToLowerInvariant() == targetclass && other.Args[targetarg] == t.Tag)
+ {
+ other.Move(other.Position); //hacky way to call BeforePropsChange()...
+ other.Args[targetarg] = t.Args[targetarg];
+ break;
+ }
+ }
+
+ General.Map.Map.BeginAddRemove(); // We'll need to lock it again...
+ }
+
+ // Get rid of the thing
+ t.Dispose();
+ }
+
+ General.Map.Map.EndAddRemove(); //mxd
+ }
#endregion
@@ -328,32 +391,18 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
//mxd
- [BeginAction("thingsselectinsectors")]
- public void SelectThingsInSelectedSectors()
+ [BeginAction("syncedthingedit")]
+ public void ToggleSyncronizedThingsEdit()
{
- bool convertselection = !(this is SectorsMode);
- if(convertselection) General.Map.Map.ConvertSelection(SelectionType.Sectors);
+ BuilderPlug.Me.SyncronizeThingEdit = !BuilderPlug.Me.SyncronizeThingEdit;
+ General.Interface.DisplayStatus(StatusType.Info, (BuilderPlug.Me.SyncronizeThingEdit ?
+ "Things editing is SYNCRONIZED" :
+ "Things editing is not syncronized"));
- if(General.Map.Map.SelectedSectorsCount == 0)
- {
- General.Interface.DisplayStatus(StatusType.Warning, "This action requires a!");
- if(convertselection) General.Map.Map.ConvertSelection(SelectionType.Linedefs);
- return;
- }
-
- ICollection sectors = General.Map.Map.GetSelectedSectors(true);
- foreach(Thing t in General.Map.Map.Things)
- {
- t.DetermineSector();
- if(!t.Selected && t.Sector != null && sectors.Contains(t.Sector)) t.Selected = true;
- }
-
- // Update info
- if(convertselection) General.Map.Map.ConvertSelection(SelectionType.Linedefs);
- UpdateSelectionInfo();
-
- // Redraw screen
- General.Interface.RedrawDisplay();
+ // Update interface
+ BuilderPlug.Me.MenusForm.SyncronizeThingEditButton.Checked = BuilderPlug.Me.SyncronizeThingEdit;
+ BuilderPlug.Me.MenusForm.SyncronizeThingEditLinedefsItem.Checked = BuilderPlug.Me.SyncronizeThingEdit;
+ BuilderPlug.Me.MenusForm.SyncronizeThingEditSectorsItem.Checked = BuilderPlug.Me.SyncronizeThingEdit;
}
#endregion
diff --git a/Source/Plugins/BuilderModes/ClassicModes/DragGeometryMode.cs b/Source/Plugins/BuilderModes/ClassicModes/DragGeometryMode.cs
index a5bd6971..50860da2 100644
--- a/Source/Plugins/BuilderModes/ClassicModes/DragGeometryMode.cs
+++ b/Source/Plugins/BuilderModes/ClassicModes/DragGeometryMode.cs
@@ -60,7 +60,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
protected ICollection unselectedthings; //mxd
// List of things, which should be moved
- protected ICollection thingstodrag; //mxd
+ private ICollection thingstodrag; //mxd
//mxd. List of sectors
private List selectedsectors;
@@ -133,7 +133,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Make list of selected vertices and things
selectedverts = General.Map.Map.GetMarkedVertices(true);
selectedthings = General.Map.Map.GetSelectedThings(true); //mxd
- thingstodrag = GetThingsToDrag(); //mxd
+ thingstodrag = (BuilderPlug.Me.SyncronizeThingEdit ? selectedthings : new List()); //mxd
// Make list of non-selected vertices and things
// Non-selected vertices will be used for snapping to nearest items
@@ -210,12 +210,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
Cursor.Current = Cursors.Default;
}
- //mxd
- protected virtual ICollection GetThingsToDrag()
- {
- return selectedthings;
- }
-
// This moves the selected geometry relatively
// Returns true when geometry has actually moved
private bool MoveGeometryRelative(Vector2D offset, bool snapgrid, bool snapgridincrement, bool snapnearest, bool snapcardinal)
diff --git a/Source/Plugins/BuilderModes/ClassicModes/DragSectorsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/DragSectorsMode.cs
index 1d5e6879..93615ee2 100644
--- a/Source/Plugins/BuilderModes/ClassicModes/DragSectorsMode.cs
+++ b/Source/Plugins/BuilderModes/ClassicModes/DragSectorsMode.cs
@@ -187,25 +187,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
renderer.Finish();
}
}
-
- //mxd
- protected override ICollection GetThingsToDrag()
- {
- if (BuilderPlug.Me.DragThingsInSectorsMode)
- {
- thingstodrag = new List();
-
- foreach (Thing t in General.Map.ThingsFilter.VisibleThings)
- {
- t.DetermineSector();
- if (selectedsectors.Contains(t.Sector)) thingstodrag.Add(t);
- }
-
- return thingstodrag;
- }
-
- return base.GetThingsToDrag();
- }
#endregion
}
diff --git a/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs
index e538e9f7..89dcd642 100644
--- a/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs
+++ b/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs
@@ -333,10 +333,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Interface.AddButton(BuilderPlug.Me.MenusForm.MakeGradientBrightness);
General.Interface.AddButton(BuilderPlug.Me.MenusForm.GradientInterpolationMenu);
}
- General.Interface.AddButton(BuilderPlug.Me.MenusForm.MarqueSelectTouching); //mxd
General.Interface.AddButton(BuilderPlug.Me.MenusForm.CurveLinedefs);
+ General.Interface.AddButton(BuilderPlug.Me.MenusForm.MarqueSelectTouching); //mxd
+ General.Interface.AddButton(BuilderPlug.Me.MenusForm.SyncronizeThingEditButton); //mxd
if(General.Map.UDMF) General.Interface.AddButton(BuilderPlug.Me.MenusForm.TextureOffsetLock, ToolbarSection.Geometry); //mxd
+ //mxd. Update the tooltip
+ BuilderPlug.Me.MenusForm.SyncronizeThingEditButton.ToolTipText = "Synchronized Things Editing" + Environment.NewLine + BuilderPlug.Me.MenusForm.SyncronizeThingEditLinedefsItem.ToolTipText;
+
// Convert geometry selection to linedefs selection
General.Map.Map.ConvertSelection(SelectionType.Linedefs);
UpdateSelectionInfo(); //mxd
@@ -357,8 +361,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.MakeGradientBrightness);
General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.GradientInterpolationMenu);
}
- General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.MarqueSelectTouching); //mxd
General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.CurveLinedefs);
+ General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.MarqueSelectTouching); //mxd
+ General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.SyncronizeThingEditButton); //mxd
if(General.Map.UDMF) General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.TextureOffsetLock); //mxd
// Going to EditSelectionMode?
@@ -780,26 +785,47 @@ namespace CodeImp.DoomBuilder.BuilderModes
};
//mxd
+ bool selectthings = (marqueSelectionIncludesThings ^ BuilderPlug.Me.SyncronizeThingEdit);
switch(marqueSelectionMode)
{
case MarqueSelectionMode.SELECT:
foreach(Linedef l in General.Map.Map.Linedefs)
l.Selected = IsInSelectionRect(l, selectionOutline);
+ if(selectthings)
+ {
+ foreach(Thing t in General.Map.ThingsFilter.VisibleThings)
+ t.Selected = selectionrect.Contains(t.Position.x, t.Position.y);
+ }
break;
case MarqueSelectionMode.ADD:
foreach(Linedef l in General.Map.Map.Linedefs)
l.Selected |= IsInSelectionRect(l, selectionOutline);
+ if(selectthings)
+ {
+ foreach(Thing t in General.Map.ThingsFilter.VisibleThings)
+ t.Selected |= selectionrect.Contains(t.Position.x, t.Position.y);
+ }
break;
case MarqueSelectionMode.SUBTRACT:
foreach(Linedef l in General.Map.Map.Linedefs)
if(IsInSelectionRect(l, selectionOutline)) l.Selected = false;
+ if(selectthings)
+ {
+ foreach(Thing t in General.Map.ThingsFilter.VisibleThings)
+ if(selectionrect.Contains(t.Position.x, t.Position.y)) t.Selected = false;
+ }
break;
default:
foreach(Linedef l in General.Map.Map.Linedefs)
if(!IsInSelectionRect(l, selectionOutline)) l.Selected = false;
+ if(selectthings)
+ {
+ foreach(Thing t in General.Map.ThingsFilter.VisibleThings)
+ if(!selectionrect.Contains(t.Position.x, t.Position.y)) t.Selected = false;
+ }
break;
}
@@ -848,15 +874,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
return base.OnCopyBegin();
}
- //mxd
- public override void UpdateSelectionInfo()
- {
- if(General.Map.Map.SelectedLinedefsCount > 0)
- General.Interface.DisplayStatus(StatusType.Selection, General.Map.Map.SelectedLinedefsCount + (General.Map.Map.SelectedLinedefsCount == 1 ? " linedef" : " linedefs") + " selected.");
- else
- General.Interface.DisplayStatus(StatusType.Selection, string.Empty);
- }
-
//mxd
private void RenderComment(Linedef l)
{
diff --git a/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs
index 42b13aa7..5751554d 100644
--- a/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs
+++ b/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs
@@ -525,7 +525,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
//mxd. Also (de)select things?
- if (General.Interface.AltState)
+ if(General.Interface.AltState ^ BuilderPlug.Me.SyncronizeThingEdit)
{
foreach(Thing t in General.Map.ThingsFilter.VisibleThings)
{
@@ -649,12 +649,30 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Interface.AddButton(BuilderPlug.Me.MenusForm.MakeGradientCeilings);
General.Interface.AddButton(BuilderPlug.Me.MenusForm.SeparatorSectors3); //mxd
General.Interface.AddButton(BuilderPlug.Me.MenusForm.MarqueSelectTouching); //mxd
- General.Interface.AddButton(BuilderPlug.Me.MenusForm.DragThingsInSelectedSectors); //mxd
+ General.Interface.AddButton(BuilderPlug.Me.MenusForm.SyncronizeThingEditButton); //mxd
if(General.Map.UDMF) General.Interface.AddButton(BuilderPlug.Me.MenusForm.TextureOffsetLock, ToolbarSection.Geometry); //mxd
// Convert geometry selection to sectors only
General.Map.Map.ConvertSelection(SelectionType.Sectors);
+ //mxd. Update the tooltip
+ BuilderPlug.Me.MenusForm.SyncronizeThingEditButton.ToolTipText = "Synchronized Things Editing" + Environment.NewLine + BuilderPlug.Me.MenusForm.SyncronizeThingEditSectorsItem.ToolTipText;
+
+ //mxd. Select things as well?
+ if(BuilderPlug.Me.SyncronizeThingEdit)
+ {
+ ICollection sectors = General.Map.Map.GetSelectedSectors(true);
+ if(sectors.Count > 0)
+ {
+ foreach(Thing t in General.Map.Map.Things)
+ {
+ t.DetermineSector();
+ if(!t.Selected && t.Sector != null && sectors.Contains(t.Sector))
+ t.Selected = true;
+ }
+ }
+ }
+
// Make text labels for sectors
SetupLabels();
@@ -686,7 +704,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.MakeGradientCeilings);
General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.SeparatorSectors3); //mxd
General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.MarqueSelectTouching); //mxd
- General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.DragThingsInSelectedSectors); //mxd
+ General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.SyncronizeThingEditButton); //mxd
if(General.Map.UDMF) General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.TextureOffsetLock); //mxd
// Keep only sectors selected
@@ -804,13 +822,23 @@ namespace CodeImp.DoomBuilder.BuilderModes
renderer.Present();
//mxd. Thing selection state may've changed
- if(General.Interface.AltState) General.Interface.RedrawDisplay();
- }
- else if(BuilderPlug.Me.AutoClearSelection && General.Map.Map.SelectedSectorsCount > 0) //mxd
+ if(General.Interface.AltState ^ BuilderPlug.Me.SyncronizeThingEdit) General.Interface.RedrawDisplay();
+ }
+ else if(BuilderPlug.Me.AutoClearSelection && (General.Map.Map.SelectedSectorsCount > 0 || (BuilderPlug.Me.SyncronizeThingEdit && General.Map.Map.SelectedThingsCount > 0))) //mxd
{
- General.Map.Map.ClearSelectedLinedefs();
- General.Map.Map.ClearSelectedSectors();
- UpdateOverlaySurfaces(); //mxd
+ if(General.Map.Map.SelectedSectorsCount > 0)
+ {
+ General.Map.Map.ClearSelectedLinedefs();
+ General.Map.Map.ClearSelectedSectors();
+ UpdateOverlaySurfaces(); //mxd
+ }
+
+ //mxd
+ if(BuilderPlug.Me.SyncronizeThingEdit && General.Map.Map.SelectedThingsCount > 0)
+ {
+ General.Map.Map.ClearSelectedThings();
+ }
+
General.Interface.RedrawDisplay();
}
@@ -1156,25 +1184,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
switch(marqueSelectionMode)
{
case MarqueSelectionMode.SELECT:
- bool select;
- foreach(Sector s in General.Map.Map.Sectors)
+ foreach(Sector s in General.Map.Map.Sectors)
{
- select = IsInSelectionRect(s, selectionOutline);
-
+ bool select = IsInSelectionRect(s, selectionOutline);
if(select && !s.Selected) SelectSector(s, true, false);
else if(!select && s.Selected) SelectSector(s, false, false);
}
- if (marqueSelectionIncludesThings)
- {
- ICollection selected = General.Map.Map.GetSelectedSectors(true);
-
- foreach (Thing t in General.Map.ThingsFilter.VisibleThings)
- {
- t.DetermineSector();
- if(t.Sector == null) continue;
- t.Selected = selectionrect.Contains(t.Position.x, t.Position.y) && selected.Contains(t.Sector);
- }
- }
break;
case MarqueSelectionMode.ADD:
@@ -1183,17 +1198,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(!s.Selected && IsInSelectionRect(s, selectionOutline))
SelectSector(s, true, false);
}
- if (marqueSelectionIncludesThings)
- {
- ICollection selected = General.Map.Map.GetSelectedSectors(true);
-
- foreach (Thing t in General.Map.ThingsFilter.VisibleThings)
- {
- t.DetermineSector();
- if(t.Sector == null) continue;
- t.Selected |= selectionrect.Contains(t.Position.x, t.Position.y) && selected.Contains(t.Sector);
- }
- }
break;
case MarqueSelectionMode.SUBTRACT:
@@ -1203,11 +1207,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(IsInSelectionRect(s, selectionOutline))
SelectSector(s, false, false);
}
- if (marqueSelectionIncludesThings)
- {
- foreach (Thing t in General.Map.ThingsFilter.VisibleThings)
- if (selectionrect.Contains(t.Position.x, t.Position.y)) t.Selected = false;
- }
break;
default: //should be Intersect
@@ -1217,11 +1216,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(!IsInSelectionRect(s, selectionOutline))
SelectSector(s, false, false);
}
- if (marqueSelectionIncludesThings)
- {
- foreach(Thing t in General.Map.ThingsFilter.VisibleThings)
- if(!selectionrect.Contains(t.Position.x, t.Position.y)) t.Selected = false;
- }
break;
}
@@ -1320,20 +1314,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
base.OnRedoEnd(); //mxd
}
- //mxd
- public override void UpdateSelectionInfo()
- {
- List info = new List();
-
- if(General.Map.Map.SelectedSectorsCount > 0)
- info.Add(General.Map.Map.SelectedSectorsCount + (General.Map.Map.SelectedSectorsCount == 1 ? " sector" : " sectors"));
-
- if(General.Map.Map.SelectedThingsCount > 0)
- info.Add(General.Map.Map.SelectedThingsCount + (General.Map.Map.SelectedThingsCount == 1 ? " thing" : " things"));
-
- General.Interface.DisplayStatus(StatusType.Selection, (info.Count > 0 ? string.Join(" and ", info.ToArray()) + " selected." : string.Empty));
- }
-
//mxd
private void RenderComment(Sector s)
{
@@ -1641,29 +1621,61 @@ namespace CodeImp.DoomBuilder.BuilderModes
[BeginAction("deleteitem", BaseAction = true)]
public void DeleteItem()
{
+ //mxd. Make list of selected things
+ List selectedthings = (BuilderPlug.Me.SyncronizeThingEdit ? new List(General.Map.Map.GetSelectedThings(true)) : new List());
+
// Make list of selected sectors
- List selected = new List(General.Map.Map.GetSelectedSectors(true));
- if((selected.Count == 0) && (highlighted != null) && !highlighted.IsDisposed) selected.Add(highlighted);
+ List selectedsectors = new List(General.Map.Map.GetSelectedSectors(true));
+ if((selectedsectors.Count == 0) && (highlighted != null) && !highlighted.IsDisposed)
+ {
+ selectedsectors.Add(highlighted);
+
+ //mxd. Add things?
+ if(BuilderPlug.Me.SyncronizeThingEdit)
+ {
+ foreach(Thing t in General.Map.ThingsFilter.VisibleThings)
+ {
+ if(t.Sector == null) t.DetermineSector();
+ if(t.Sector == highlighted) selectedthings.Add(t);
+ }
+ }
+ }
+ if(selectedsectors.Count == 0 && selectedthings.Count == 0) return; //mxd
+
+ //mxd. Create undo info text
+ List info = new List();
+
+ //mxd. Create linedef info text
+ if(selectedsectors.Count > 1)
+ info.Add(selectedsectors.Count + " sectors");
+ else
+ info.Add("a sector");
+
+ //mxd. Create things info text
+ if(selectedthings.Count > 1)
+ info.Add(selectedthings.Count + " things");
+ else
+ info.Add("a thing");
+
+ //mxd. Make undo
+ string rest = string.Join(" and ", info.ToArray());
+ General.Map.UndoRedo.CreateUndo("Delete " + rest);
+ General.Interface.DisplayStatus(StatusType.Action, "Deleted " + rest + ".");
+
+ //mxd. Delete things
+ if(selectedthings.Count > 0)
+ {
+ DeleteThings(selectedthings);
+ General.Map.ThingsFilter.Update();
+ }
// Anything to do?
- if(selected.Count > 0)
+ if(selectedsectors.Count > 0)
{
- // Make undo
- if(selected.Count > 1)
- {
- General.Map.UndoRedo.CreateUndo("Delete " + selected.Count + " sectors");
- General.Interface.DisplayStatus(StatusType.Action, "Deleted " + selected.Count + " sectors.");
- }
- else
- {
- General.Map.UndoRedo.CreateUndo("Delete sector");
- General.Interface.DisplayStatus(StatusType.Action, "Deleted sector.");
- }
-
General.Map.Map.BeginAddRemove(); //mxd
// Dispose selected sectors
- foreach(Sector s in selected)
+ foreach(Sector s in selectedsectors)
{
//mxd. Get all the linedefs
List lines = new List(s.Sidedefs.Count);
@@ -1713,7 +1725,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
General.Map.Map.EndAddRemove(); //mxd
+ }
+ if(selectedthings.Count > 0 || selectedsectors.Count > 0)
+ {
// Update cache values
General.Map.IsChanged = true;
General.Map.Map.Update();
diff --git a/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs
index 8e2f8ef1..2d616053 100644
--- a/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs
+++ b/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs
@@ -740,15 +740,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
return base.OnCopyBegin();
}
- //mxd
- public override void UpdateSelectionInfo()
- {
- if(General.Map.Map.SelectedThingsCount > 0)
- General.Interface.DisplayStatus(StatusType.Selection, General.Map.Map.SelectedThingsCount + (General.Map.Map.SelectedThingsCount == 1 ? " thing" : " things") + " selected.");
- else
- General.Interface.DisplayStatus(StatusType.Selection, string.Empty);
- }
-
//mxd
private void RenderComment(Thing t)
{
@@ -1007,61 +998,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Interface.DisplayStatus(StatusType.Action, "Deleted a thing.");
}
- General.Map.Map.BeginAddRemove(); //mxd
-
- // Dispose selected things
- foreach(Thing t in selected)
- {
- //mxd. Do some path reconnecting shenanigans...
- ThingTypeInfo info = General.Map.Data.GetThingInfo(t.Type);
- string targetclass = string.Empty;
- int targetarg = -1;
-
- // Thing type can be changed in MAPINFO DoomEdNums block...
- switch (info.ClassName.ToLowerInvariant())
- {
- case "interpolationpoint":
- if(t.Tag != 0 && t.Args[3] != 0)
- {
- targetclass = "interpolationpoint";
- targetarg = 3;
- }
- break;
-
- case "patrolpoint":
- if(t.Tag != 0 && t.Args[0] != 0)
- {
- targetclass = "patrolpoint";
- targetarg = 0;
- }
- break;
- }
-
- // Try to reconnect path...
- if(!string.IsNullOrEmpty(targetclass) && targetarg > -1)
- {
- General.Map.Map.EndAddRemove(); // We'll need to unlock the things array...
-
- foreach(Thing other in General.Map.Map.Things)
- {
- if(other.Index == t.Index) continue;
- info = General.Map.Data.GetThingInfo(other.Type);
- if(info.ClassName.ToLowerInvariant() == targetclass && other.Args[targetarg] == t.Tag)
- {
- other.Move(other.Position); //hacky way to call BeforePropsChange()...
- other.Args[targetarg] = t.Args[targetarg];
- break;
- }
- }
-
- General.Map.Map.BeginAddRemove(); // We'll need to lock it again...
- }
-
- // Get rid of the thing
- t.Dispose();
- }
-
- General.Map.Map.EndAddRemove(); //mxd
+ DeleteThings(selected); //mxd
// Update cache values
General.Map.IsChanged = true;
diff --git a/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs b/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs
index 74347f49..3d5d8c41 100644
--- a/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs
+++ b/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs
@@ -693,15 +693,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
return base.OnCopyBegin();
}
-
- //mxd
- public override void UpdateSelectionInfo()
- {
- if(General.Map.Map.SelectedVerticessCount > 0)
- General.Interface.DisplayStatus(StatusType.Selection, General.Map.Map.SelectedVerticessCount + (General.Map.Map.SelectedVerticessCount == 1 ? " vertex" : " vertices") + " selected.");
- else
- General.Interface.DisplayStatus(StatusType.Selection, string.Empty);
- }
#endregion
diff --git a/Source/Plugins/BuilderModes/General/BuilderPlug.cs b/Source/Plugins/BuilderModes/General/BuilderPlug.cs
index 6f03b10a..b227eae5 100644
--- a/Source/Plugins/BuilderModes/General/BuilderPlug.cs
+++ b/Source/Plugins/BuilderModes/General/BuilderPlug.cs
@@ -128,7 +128,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
private bool marqueSelectTouching; //mxd. Select elements partially/fully inside of marque selection?
private bool syncSelection; //mxd. Sync selection between Visual and Classic modes.
private bool lockSectorTextureOffsetsWhileDragging; //mxd
- private bool dragThingsInSectorsMode; //mxd
+ private bool syncthingedit; //mxd
#endregion
@@ -188,7 +188,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
public bool MarqueSelectTouching { get { return marqueSelectTouching; } set { marqueSelectTouching = value; } } //mxd
public bool SyncSelection { get { return syncSelection; } set { syncSelection = value; } } //mxd
public bool LockSectorTextureOffsetsWhileDragging { get { return lockSectorTextureOffsetsWhileDragging; } internal set { lockSectorTextureOffsetsWhileDragging = value; } } //mxd
- public bool DragThingsInSectorsMode { get { return dragThingsInSectorsMode; } internal set { dragThingsInSectorsMode = value; } } //mxd
+ public bool SyncronizeThingEdit { get { return syncthingedit; } internal set { syncthingedit = value; } } //mxd
//mxd. "Make Door" action persistent settings
internal MakeDoorSettings MakeDoor;
@@ -214,7 +214,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
menusform = new MenusForm();
menusform.Register();
menusform.TextureOffsetLock.Checked = lockSectorTextureOffsetsWhileDragging; //mxd
- menusform.DragThingsInSelectedSectors.Checked = dragThingsInSectorsMode; //mxd
+ menusform.SyncronizeThingEditButton.Checked = syncthingedit; //mxd
+ menusform.SyncronizeThingEditSectorsItem.Checked = syncthingedit; //mxd
+ menusform.SyncronizeThingEditLinedefsItem.Checked = syncthingedit; //mxd
// Load Undo\Redo docker
undoredopanel = new UndoRedoPanel();
@@ -297,7 +299,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
lockSectorTextureOffsetsWhileDragging = General.Settings.ReadPluginSetting("locktextureoffsets", false); //mxd
viewselectionnumbers = General.Settings.ReadPluginSetting("viewselectionnumbers", true);
viewselectioneffects = General.Settings.ReadPluginSetting("viewselectioneffects", true); //mxd
- dragThingsInSectorsMode = General.Settings.ReadPluginSetting("dragthingsinsectorsmode", true); //mxd
+ syncthingedit = General.Settings.ReadPluginSetting("syncthingedit", true); //mxd
}
//mxd. Save settings, which can be changed via UI
@@ -306,7 +308,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Settings.WritePluginSetting("locktextureoffsets", lockSectorTextureOffsetsWhileDragging);
General.Settings.WritePluginSetting("viewselectionnumbers", viewselectionnumbers);
General.Settings.WritePluginSetting("viewselectioneffects", viewselectioneffects);
- General.Settings.WritePluginSetting("dragthingsinsectorsmode", dragThingsInSectorsMode);
+ General.Settings.WritePluginSetting("syncthingedit", syncthingedit);
}
//mxd. These should be reset when changing maps
diff --git a/Source/Plugins/BuilderModes/Interface/MenusForm.Designer.cs b/Source/Plugins/BuilderModes/Interface/MenusForm.Designer.cs
index 197829e7..9e994369 100644
--- a/Source/Plugins/BuilderModes/Interface/MenusForm.Designer.cs
+++ b/Source/Plugins/BuilderModes/Interface/MenusForm.Designer.cs
@@ -28,10 +28,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
///
private void InitializeComponent()
{
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MenusForm));
this.menustrip = new System.Windows.Forms.MenuStrip();
this.linedefsmenu = new System.Windows.Forms.ToolStripMenuItem();
this.placethingsl = new System.Windows.Forms.ToolStripMenuItem();
- this.selectInSectorsItem3 = new System.Windows.Forms.ToolStripMenuItem();
+ this.syncthingeditlinedefsitem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.selectsinglesideditem = new System.Windows.Forms.ToolStripMenuItem();
this.selectdoublesideditem = new System.Windows.Forms.ToolStripMenuItem();
@@ -52,7 +53,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
this.selectSimilarLinesItem = new System.Windows.Forms.ToolStripMenuItem();
this.sectorsmenu = new System.Windows.Forms.ToolStripMenuItem();
this.placethingss = new System.Windows.Forms.ToolStripMenuItem();
- this.selectInSectorsItem2 = new System.Windows.Forms.ToolStripMenuItem();
+ this.syncthingeditsectorsitem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.joinsectorsitem = new System.Windows.Forms.ToolStripMenuItem();
this.mergesectorsitem = new System.Windows.Forms.ToolStripMenuItem();
@@ -95,7 +96,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
this.gradientInterpolationMenu = new System.Windows.Forms.ToolStripComboBox();
this.separatorsectors3 = new System.Windows.Forms.ToolStripSeparator();
this.buttonMarqueSelectTouching = new System.Windows.Forms.ToolStripButton();
- this.buttonDragThingsInSelectedSectors = new System.Windows.Forms.ToolStripButton();
+ this.syncthingteditbutton = new System.Windows.Forms.ToolStripButton();
this.buttonAlignThingsToWall = new System.Windows.Forms.ToolStripButton();
this.buttonTextureOffsetLock = new System.Windows.Forms.ToolStripButton();
this.fileMenuStrip = new System.Windows.Forms.MenuStrip();
@@ -128,7 +129,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
//
this.linedefsmenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.placethingsl,
- this.selectInSectorsItem3,
+ this.syncthingeditlinedefsitem,
this.toolStripSeparator2,
this.selectsinglesideditem,
this.selectdoublesideditem,
@@ -153,36 +154,41 @@ namespace CodeImp.DoomBuilder.BuilderModes
//
this.placethingsl.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.PlaceThings;
this.placethingsl.Name = "placethingsl";
- this.placethingsl.Size = new System.Drawing.Size(245, 22);
+ this.placethingsl.Size = new System.Drawing.Size(224, 22);
this.placethingsl.Tag = "placethings";
this.placethingsl.Text = "&Place Things...";
this.placethingsl.Click += new System.EventHandler(this.InvokeTaggedAction);
//
- // selectInSectorsItem3
+ // syncthingeditlinedefsitem
//
- this.selectInSectorsItem3.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.SelectThingsInSectors;
- this.selectInSectorsItem3.Name = "selectInSectorsItem3";
- this.selectInSectorsItem3.Size = new System.Drawing.Size(245, 22);
- this.selectInSectorsItem3.Tag = "thingsselectinsectors";
- this.selectInSectorsItem3.Text = "&Select Things in Selected Sectors";
+ this.syncthingeditlinedefsitem.CheckOnClick = true;
+ this.syncthingeditlinedefsitem.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.SelectThingsInSectors;
+ this.syncthingeditlinedefsitem.Name = "syncthingeditlinedefsitem";
+ this.syncthingeditlinedefsitem.Size = new System.Drawing.Size(224, 22);
+ this.syncthingeditlinedefsitem.Tag = "syncedthingedit";
+ this.syncthingeditlinedefsitem.Text = "&Synchronized Things Editing";
+ this.syncthingeditlinedefsitem.ToolTipText = "When enabled, selected things will be dragged when dragging linedefs.\r\nRectangula" +
+ "r selection will also select things (holding Alt while selecting \r\ninverts this " +
+ "behaviour).";
+ this.syncthingeditlinedefsitem.Click += new System.EventHandler(this.InvokeTaggedAction);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
- this.toolStripSeparator2.Size = new System.Drawing.Size(242, 6);
+ this.toolStripSeparator2.Size = new System.Drawing.Size(221, 6);
//
// selectsinglesideditem
//
this.selectsinglesideditem.Name = "selectsinglesideditem";
- this.selectsinglesideditem.Size = new System.Drawing.Size(245, 22);
+ this.selectsinglesideditem.Size = new System.Drawing.Size(224, 22);
this.selectsinglesideditem.Tag = "selectsinglesided";
- this.selectsinglesideditem.Text = "Select &Single-sided only";
+ this.selectsinglesideditem.Text = "Select S&ingle-sided only";
this.selectsinglesideditem.Click += new System.EventHandler(this.InvokeTaggedAction);
//
// selectdoublesideditem
//
this.selectdoublesideditem.Name = "selectdoublesideditem";
- this.selectdoublesideditem.Size = new System.Drawing.Size(245, 22);
+ this.selectdoublesideditem.Size = new System.Drawing.Size(224, 22);
this.selectdoublesideditem.Tag = "selectdoublesided";
this.selectdoublesideditem.Text = "Select &Double-sided only";
this.selectdoublesideditem.Click += new System.EventHandler(this.InvokeTaggedAction);
@@ -190,13 +196,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
// toolStripMenuItem4
//
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
- this.toolStripMenuItem4.Size = new System.Drawing.Size(242, 6);
+ this.toolStripMenuItem4.Size = new System.Drawing.Size(221, 6);
//
// fliplinedefsitem
//
this.fliplinedefsitem.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.Flip;
this.fliplinedefsitem.Name = "fliplinedefsitem";
- this.fliplinedefsitem.Size = new System.Drawing.Size(245, 22);
+ this.fliplinedefsitem.Size = new System.Drawing.Size(224, 22);
this.fliplinedefsitem.Tag = "fliplinedefs";
this.fliplinedefsitem.Text = "&Flip Linedefs";
this.fliplinedefsitem.Click += new System.EventHandler(this.InvokeTaggedAction);
@@ -205,7 +211,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
//
this.flipsidedefsitem.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.Flip;
this.flipsidedefsitem.Name = "flipsidedefsitem";
- this.flipsidedefsitem.Size = new System.Drawing.Size(245, 22);
+ this.flipsidedefsitem.Size = new System.Drawing.Size(224, 22);
this.flipsidedefsitem.Tag = "flipsidedefs";
this.flipsidedefsitem.Text = "F&lip Sidedefs";
this.flipsidedefsitem.Click += new System.EventHandler(this.InvokeTaggedAction);
@@ -213,13 +219,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
- this.toolStripMenuItem1.Size = new System.Drawing.Size(242, 6);
+ this.toolStripMenuItem1.Size = new System.Drawing.Size(221, 6);
//
// curvelinedefsitem
//
this.curvelinedefsitem.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.CurveLines;
this.curvelinedefsitem.Name = "curvelinedefsitem";
- this.curvelinedefsitem.Size = new System.Drawing.Size(245, 22);
+ this.curvelinedefsitem.Size = new System.Drawing.Size(224, 22);
this.curvelinedefsitem.Tag = "curvelinesmode";
this.curvelinedefsitem.Text = "&Curve Linedefs...";
this.curvelinedefsitem.Click += new System.EventHandler(this.InvokeTaggedAction);
@@ -227,12 +233,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
- this.toolStripMenuItem3.Size = new System.Drawing.Size(242, 6);
+ this.toolStripMenuItem3.Size = new System.Drawing.Size(221, 6);
//
// splitlinedefsitem
//
this.splitlinedefsitem.Name = "splitlinedefsitem";
- this.splitlinedefsitem.Size = new System.Drawing.Size(245, 22);
+ this.splitlinedefsitem.Size = new System.Drawing.Size(224, 22);
this.splitlinedefsitem.Tag = "splitlinedefs";
this.splitlinedefsitem.Text = "S&plit Linedefs";
this.splitlinedefsitem.Click += new System.EventHandler(this.InvokeTaggedAction);
@@ -240,7 +246,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// updatelightfogitem
//
this.updatelightfogitem.Name = "updatelightfogitem";
- this.updatelightfogitem.Size = new System.Drawing.Size(245, 22);
+ this.updatelightfogitem.Size = new System.Drawing.Size(224, 22);
this.updatelightfogitem.Tag = "applylightfogflag";
this.updatelightfogitem.Text = "&Update \'lightfog\' flag";
this.updatelightfogitem.Click += new System.EventHandler(this.InvokeTaggedAction);
@@ -253,7 +259,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
this.alignCeilingToFrontItem,
this.alignCeilingToBackItem});
this.aligntexturesitem.Name = "aligntexturesitem";
- this.aligntexturesitem.Size = new System.Drawing.Size(245, 22);
+ this.aligntexturesitem.Size = new System.Drawing.Size(224, 22);
this.aligntexturesitem.Text = "&Align Textures";
//
// alignFloorToFrontItem
@@ -291,13 +297,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
- this.toolStripSeparator5.Size = new System.Drawing.Size(242, 6);
+ this.toolStripSeparator5.Size = new System.Drawing.Size(221, 6);
//
// selectSimilarLinesItem
//
this.selectSimilarLinesItem.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.Similar;
this.selectSimilarLinesItem.Name = "selectSimilarLinesItem";
- this.selectSimilarLinesItem.Size = new System.Drawing.Size(245, 22);
+ this.selectSimilarLinesItem.Size = new System.Drawing.Size(224, 22);
this.selectSimilarLinesItem.Tag = "selectsimilar";
this.selectSimilarLinesItem.Text = "Select Similar...";
this.selectSimilarLinesItem.Click += new System.EventHandler(this.InvokeTaggedAction);
@@ -306,7 +312,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
//
this.sectorsmenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.placethingss,
- this.selectInSectorsItem2,
+ this.syncthingeditsectorsitem,
this.toolStripSeparator1,
this.joinsectorsitem,
this.mergesectorsitem,
@@ -325,30 +331,32 @@ namespace CodeImp.DoomBuilder.BuilderModes
//
this.placethingss.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.PlaceThings;
this.placethingss.Name = "placethingss";
- this.placethingss.Size = new System.Drawing.Size(245, 22);
+ this.placethingss.Size = new System.Drawing.Size(224, 22);
this.placethingss.Tag = "placethings";
this.placethingss.Text = "&Place Things...";
this.placethingss.Click += new System.EventHandler(this.InvokeTaggedAction);
//
- // selectInSectorsItem2
+ // syncthingeditsectorsitem
//
- this.selectInSectorsItem2.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.SelectThingsInSectors;
- this.selectInSectorsItem2.Name = "selectInSectorsItem2";
- this.selectInSectorsItem2.Size = new System.Drawing.Size(245, 22);
- this.selectInSectorsItem2.Tag = "thingsselectinsectors";
- this.selectInSectorsItem2.Text = "&Select Things in Selected Sectors";
- this.selectInSectorsItem2.Click += new System.EventHandler(this.InvokeTaggedAction);
+ this.syncthingeditsectorsitem.CheckOnClick = true;
+ this.syncthingeditsectorsitem.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.SelectThingsInSectors;
+ this.syncthingeditsectorsitem.Name = "syncthingeditsectorsitem";
+ this.syncthingeditsectorsitem.Size = new System.Drawing.Size(224, 22);
+ this.syncthingeditsectorsitem.Tag = "syncedthingedit";
+ this.syncthingeditsectorsitem.Text = "&Synchronized Things Editing";
+ this.syncthingeditsectorsitem.ToolTipText = resources.GetString("syncthingeditsectorsitem.ToolTipText");
+ this.syncthingeditsectorsitem.Click += new System.EventHandler(this.InvokeTaggedAction);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
- this.toolStripSeparator1.Size = new System.Drawing.Size(242, 6);
+ this.toolStripSeparator1.Size = new System.Drawing.Size(221, 6);
//
// joinsectorsitem
//
this.joinsectorsitem.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.Join;
this.joinsectorsitem.Name = "joinsectorsitem";
- this.joinsectorsitem.Size = new System.Drawing.Size(245, 22);
+ this.joinsectorsitem.Size = new System.Drawing.Size(224, 22);
this.joinsectorsitem.Tag = "joinsectors";
this.joinsectorsitem.Text = "&Join Sectors";
this.joinsectorsitem.Click += new System.EventHandler(this.InvokeTaggedAction);
@@ -357,7 +365,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
//
this.mergesectorsitem.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.Merge;
this.mergesectorsitem.Name = "mergesectorsitem";
- this.mergesectorsitem.Size = new System.Drawing.Size(245, 22);
+ this.mergesectorsitem.Size = new System.Drawing.Size(224, 22);
this.mergesectorsitem.Tag = "mergesectors";
this.mergesectorsitem.Text = "&Merge Sectors";
this.mergesectorsitem.Click += new System.EventHandler(this.InvokeTaggedAction);
@@ -365,13 +373,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
- this.toolStripMenuItem2.Size = new System.Drawing.Size(242, 6);
+ this.toolStripMenuItem2.Size = new System.Drawing.Size(221, 6);
//
// flipsectorlinedefsitem
//
this.flipsectorlinedefsitem.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.Flip;
this.flipsectorlinedefsitem.Name = "flipsectorlinedefsitem";
- this.flipsectorlinedefsitem.Size = new System.Drawing.Size(245, 22);
+ this.flipsectorlinedefsitem.Size = new System.Drawing.Size(224, 22);
this.flipsectorlinedefsitem.Tag = "fliplinedefs";
this.flipsectorlinedefsitem.Text = "&Flip Linedefs";
this.flipsectorlinedefsitem.Click += new System.EventHandler(this.InvokeTaggedAction);
@@ -379,13 +387,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
// toolStripSeparator8
//
this.toolStripSeparator8.Name = "toolStripSeparator8";
- this.toolStripSeparator8.Size = new System.Drawing.Size(242, 6);
+ this.toolStripSeparator8.Size = new System.Drawing.Size(221, 6);
//
// makedooritem
//
this.makedooritem.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.Door;
this.makedooritem.Name = "makedooritem";
- this.makedooritem.Size = new System.Drawing.Size(245, 22);
+ this.makedooritem.Size = new System.Drawing.Size(224, 22);
this.makedooritem.Tag = "makedoor";
this.makedooritem.Text = "Make &Door";
this.makedooritem.Click += new System.EventHandler(this.InvokeTaggedAction);
@@ -393,14 +401,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
- this.toolStripSeparator4.Size = new System.Drawing.Size(242, 6);
+ this.toolStripSeparator4.Size = new System.Drawing.Size(221, 6);
this.toolStripSeparator4.Visible = false;
//
// selectSimilarSectors
//
this.selectSimilarSectors.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.Similar;
this.selectSimilarSectors.Name = "selectSimilarSectors";
- this.selectSimilarSectors.Size = new System.Drawing.Size(245, 22);
+ this.selectSimilarSectors.Size = new System.Drawing.Size(224, 22);
this.selectSimilarSectors.Tag = "selectsimilar";
this.selectSimilarSectors.Text = "Select Similar...";
this.selectSimilarSectors.Click += new System.EventHandler(this.InvokeTaggedAction);
@@ -539,7 +547,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
this.gradientInterpolationMenu,
this.separatorsectors3,
this.buttonMarqueSelectTouching,
- this.buttonDragThingsInSelectedSectors,
+ this.syncthingteditbutton,
this.buttonAlignThingsToWall,
this.buttonTextureOffsetLock});
this.manualstrip.Location = new System.Drawing.Point(0, 73);
@@ -734,18 +742,17 @@ namespace CodeImp.DoomBuilder.BuilderModes
"";
this.buttonMarqueSelectTouching.Click += new System.EventHandler(this.buttonMarqueSelectTouching_Click);
//
- // buttonDragThingsInSelectedSectors
+ // syncthingteditbutton
//
- this.buttonDragThingsInSelectedSectors.CheckOnClick = true;
- this.buttonDragThingsInSelectedSectors.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
- this.buttonDragThingsInSelectedSectors.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.MoveThingsInSectors;
- this.buttonDragThingsInSelectedSectors.ImageTransparentColor = System.Drawing.Color.Magenta;
- this.buttonDragThingsInSelectedSectors.Name = "buttonDragThingsInSelectedSectors";
- this.buttonDragThingsInSelectedSectors.Size = new System.Drawing.Size(23, 22);
- this.buttonDragThingsInSelectedSectors.Text = "Move Things in Selected Sectors";
- this.buttonDragThingsInSelectedSectors.ToolTipText = "When enabled, all things inside of selected sectors \r\nwill be dragged when draggi" +
- "ng sectors.\r\nOtherwise, selected things will be dragged.";
- this.buttonDragThingsInSelectedSectors.Click += new System.EventHandler(this.buttonDragThingsInSelectedSectors_Click);
+ this.syncthingteditbutton.CheckOnClick = true;
+ this.syncthingteditbutton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.syncthingteditbutton.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.SelectThingsInSectors;
+ this.syncthingteditbutton.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.syncthingteditbutton.Name = "syncthingteditbutton";
+ this.syncthingteditbutton.Size = new System.Drawing.Size(23, 22);
+ this.syncthingteditbutton.Tag = "syncedthingedit";
+ this.syncthingteditbutton.Text = "Synchronized Things Editing";
+ this.syncthingteditbutton.Click += new System.EventHandler(this.InvokeTaggedAction);
//
// buttonAlignThingsToWall
//
@@ -918,8 +925,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
private System.Windows.Forms.ToolStripMenuItem placethingss;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripButton buttonselectioneffects;
- private System.Windows.Forms.ToolStripMenuItem selectInSectorsItem3;
- private System.Windows.Forms.ToolStripMenuItem selectInSectorsItem2;
+ private System.Windows.Forms.ToolStripMenuItem syncthingeditlinedefsitem;
+ private System.Windows.Forms.ToolStripMenuItem syncthingeditsectorsitem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripButton buttonMakeDoor;
private System.Windows.Forms.ToolStripMenuItem makedooritem;
@@ -938,7 +945,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
private System.Windows.Forms.ToolStripMenuItem selectSimilarVertsItem;
private System.Windows.Forms.ToolStripMenuItem flipsectorlinedefsitem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
- private System.Windows.Forms.ToolStripButton buttonDragThingsInSelectedSectors;
+ private System.Windows.Forms.ToolStripButton syncthingteditbutton;
private System.Windows.Forms.ToolStripComboBox gradientInterpolationMenu;
private System.Windows.Forms.ToolStripSeparator separatorsectors2;
private System.Windows.Forms.ToolStripSeparator separatorsectors3;
diff --git a/Source/Plugins/BuilderModes/Interface/MenusForm.cs b/Source/Plugins/BuilderModes/Interface/MenusForm.cs
index 8d998019..9f8039a1 100644
--- a/Source/Plugins/BuilderModes/Interface/MenusForm.cs
+++ b/Source/Plugins/BuilderModes/Interface/MenusForm.cs
@@ -85,7 +85,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
public ToolStripButton MarqueSelectTouching { get { return buttonMarqueSelectTouching; } } //mxd
public ToolStripButton AlignThingsToWall { get { return buttonAlignThingsToWall; } } //mxd
public ToolStripButton TextureOffsetLock { get { return buttonTextureOffsetLock; } } //mxd
- public ToolStripButton DragThingsInSelectedSectors { get { return buttonDragThingsInSelectedSectors; } } //mxd
+ public ToolStripButton SyncronizeThingEditButton { get { return syncthingteditbutton; } } //mxd
+ public ToolStripMenuItem SyncronizeThingEditSectorsItem { get { return syncthingeditsectorsitem; } } //mxd
+ public ToolStripMenuItem SyncronizeThingEditLinedefsItem { get { return syncthingeditlinedefsitem; } } //mxd
public ToolStripButton MakeDoor { get { return buttonMakeDoor; } } //mxd
#endregion
@@ -268,15 +270,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Interface.FocusDisplay();
}
- //mxd
- private void buttonDragThingsInSelectedSectors_Click(object sender, EventArgs e)
- {
- BuilderPlug.Me.DragThingsInSectorsMode = buttonDragThingsInSelectedSectors.Checked;
- General.Interface.DisplayStatus(StatusType.Info, (buttonDragThingsInSelectedSectors.Checked ?
- "Drag things in selected sectors" :
- "Don't drag things in selected sectors"));
- }
-
#endregion
}
}
\ No newline at end of file
diff --git a/Source/Plugins/BuilderModes/Interface/MenusForm.resx b/Source/Plugins/BuilderModes/Interface/MenusForm.resx
index 716f69dc..6a0a34f3 100644
--- a/Source/Plugins/BuilderModes/Interface/MenusForm.resx
+++ b/Source/Plugins/BuilderModes/Interface/MenusForm.resx
@@ -123,6 +123,12 @@
17, 17
+
+ When enabled, things dragging will be synchronized to sector dragging.
+Regular, Paint and Rectangular selection will also select things
+(holding Alt while selecting inverts this behaviour).
+Deleting sectors will also delete selected things.
+
True
diff --git a/Source/Plugins/BuilderModes/Properties/Resources.Designer.cs b/Source/Plugins/BuilderModes/Properties/Resources.Designer.cs
index 0c169536..3ddbdb7d 100644
--- a/Source/Plugins/BuilderModes/Properties/Resources.Designer.cs
+++ b/Source/Plugins/BuilderModes/Properties/Resources.Designer.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:2.0.50727.5485
+// Runtime Version:2.0.50727.5466
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -263,13 +263,6 @@ namespace CodeImp.DoomBuilder.BuilderModes.Properties {
}
}
- internal static System.Drawing.Bitmap MoveThingsInSectors {
- get {
- object obj = ResourceManager.GetObject("MoveThingsInSectors", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
internal static System.Drawing.Bitmap PasteProperties {
get {
object obj = ResourceManager.GetObject("PasteProperties", resourceCulture);
diff --git a/Source/Plugins/BuilderModes/Properties/Resources.resx b/Source/Plugins/BuilderModes/Properties/Resources.resx
index 288f709a..8c955f4f 100644
--- a/Source/Plugins/BuilderModes/Properties/Resources.resx
+++ b/Source/Plugins/BuilderModes/Properties/Resources.resx
@@ -190,9 +190,6 @@
..\Resources\SelectTouching.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- ..\Resources\MoveThingsInSectors.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
..\Resources\Merge.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
diff --git a/Source/Plugins/BuilderModes/Resources/Actions.cfg b/Source/Plugins/BuilderModes/Resources/Actions.cfg
index afc8a5f7..fa6954c4 100644
--- a/Source/Plugins/BuilderModes/Resources/Actions.cfg
+++ b/Source/Plugins/BuilderModes/Resources/Actions.cfg
@@ -428,15 +428,15 @@ thinglookatcursor
}
//mxd
-thingsselectinsectors
+syncedthingedit
{
- title = "Select Things in Selected Sectors";
- category = "things";
- description = "Selects Things in Selected Sectors.";
+ title = "Synchronized Things Editing";
+ category = "sectors";
+ description = "When enabled, things selection/dragging will be synchronized to sector selection/dragging in Sectors mode. Selected things will be dragged when dragging linedefs in Linedefs mode. Deleting sectors will delete selected things in Sectors mode.";
allowkeys = true;
allowmouse = true;
allowscroll = false;
- default = 65620; //Shift-T
+ default = 65620; //Shift-T
}
makesectormode
diff --git a/Source/Plugins/BuilderModes/Resources/Hints.cfg b/Source/Plugins/BuilderModes/Resources/Hints.cfg
index b46e1ee1..3638080f 100644
--- a/Source/Plugins/BuilderModes/Resources/Hints.cfg
+++ b/Source/Plugins/BuilderModes/Resources/Hints.cfg
@@ -44,6 +44,7 @@ group multiselection
"Hold Shift to toggle additive selection"
"Hold Ctrl to enable subtractive selection"
"Hold Ctrl-Shift to intersect the new selection with already existing one"
+"Hold Alt to enable things (de)selection"
class SectorsMode
@@ -68,7 +69,7 @@ group multiselection
"Hold Shift to toggle additive selection"
"Hold Ctrl to enable subtractive selection"
"Hold Ctrl-Shift to intersect the new selection with already existing one"
-"Hold Alt to select things inside of selected sectors"
+"Hold Alt to enable things (de)selection"
class ThingsMode
@@ -78,7 +79,6 @@ group general
"Hold builder_classicedit to drag selected or highlighted things"
"Hold Shift- builder_classicedit to clone-drag selected or highlighted things"
"Hold builder_classicselect and drag to use rectangular selection"
-"Press buildermodes_thingsselectinsectors to select things in selected sectors"
"Press builder_clearselection to clear selection"
"Press builder_deleteitem to delete selected thing(s)"
"Press builder_classicedit to edit properties of current selection"
diff --git a/Source/Plugins/BuilderModes/Resources/MoveThingsInSectors.png b/Source/Plugins/BuilderModes/Resources/MoveThingsInSectors.png
deleted file mode 100644
index 397e40e9..00000000
Binary files a/Source/Plugins/BuilderModes/Resources/MoveThingsInSectors.png and /dev/null differ
diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySector.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySector.cs
index ff6c7d34..bc28d607 100644
--- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySector.cs
+++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySector.cs
@@ -753,8 +753,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Copy texture
public virtual void OnCopyTexture()
{
- if(Texture == null) return; //mxd
- string texturename = ((!General.Map.Options.UseLongTextureNames && Texture.UsedInMap) ? Texture.ShortName : GetTextureName()); //mxd
+ //mxd. When UseLongTextureNames is disabled, use texture name as stored in Sidedef, otherwise use full name.
+ string texturename = ((General.Map.Options.UseLongTextureNames && Texture != null && Texture.UsedInMap) ? Texture.FullName : GetTextureName());
BuilderPlug.Me.CopiedFlat = texturename;
if(General.Map.Config.MixTexturesFlats) BuilderPlug.Me.CopiedTexture = texturename;
mode.SetActionResult("Copied flat '" + texturename + "'.");
diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs
index d0dd7e59..739447bd 100644
--- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs
+++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs
@@ -1196,8 +1196,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Copy texture
public virtual void OnCopyTexture()
{
- if(Texture == null) return; //mxd
- string texturename = ((!General.Map.Options.UseLongTextureNames && Texture.UsedInMap) ? Texture.ShortName : GetTextureName()); //mxd
+ //mxd. When UseLongTextureNames is disabled, use texture name as stored in Sidedef, otherwise use full name.
+ string texturename = ((General.Map.Options.UseLongTextureNames && Texture != null && Texture.UsedInMap) ? Texture.FullName : GetTextureName());
BuilderPlug.Me.CopiedTexture = texturename;
if(General.Map.Config.MixTexturesFlats) BuilderPlug.Me.CopiedFlat = texturename;
mode.SetActionResult("Copied texture '" + texturename + "'.");
diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs
index 9f9a8a9c..29d1f40f 100644
--- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs
+++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs
@@ -643,6 +643,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
//mxd
public override void UpdateSelectionInfo()
{
+ // Collect info
int numWalls = 0;
int numFloors = 0;
int numCeilings = 0;
@@ -668,17 +669,17 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(numThings > 0) results.Add(numThings + (numThings > 1 ? " things" : " thing"));
if(numVerts > 0) results.Add(numVerts + (numVerts > 1 ? " vertices" : " vertex"));
- if(results.Count == 0)
+ // Display results
+ string result = string.Empty;
+ if(results.Count > 0)
{
- General.Interface.DisplayStatus(StatusType.Selection, string.Empty);
- }
- else
- {
- string result = string.Join(", ", results.ToArray());
- int pos = result.LastIndexOf(",");
+ result = string.Join(", ", results.ToArray());
+ int pos = result.LastIndexOf(",", StringComparison.Ordinal);
if(pos != -1) result = result.Remove(pos, 1).Insert(pos, " and");
- General.Interface.DisplayStatus(StatusType.Selection, result + " selected.");
+ result += " selected.";
}
+
+ General.Interface.DisplayStatus(StatusType.Selection, result);
}
//mxd