diff --git a/Help/gzdb/features/features.html b/Help/gzdb/features/features.html
index 38b3fd67..b6ac09a4 100644
--- a/Help/gzdb/features/features.html
+++ b/Help/gzdb/features/features.html
@@ -128,6 +128,7 @@
[new] Sector Info panel shows the number of sector's sidedefs as well as light and fade colors (UDMF only):
+ [new] Sector effects are now shown on top of unselected sectors (works only if "View Selection Numbering" option is enabled).
@@ -136,7 +137,8 @@
[new] [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).
[new] [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.
-
+
+
Things mode:
diff --git a/Source/Core/General/Launcher.cs b/Source/Core/General/Launcher.cs
index 06fd6e9e..11fce143 100644
--- a/Source/Core/General/Launcher.cs
+++ b/Source/Core/General/Launcher.cs
@@ -354,11 +354,11 @@ namespace CodeImp.DoomBuilder
// Done
int retries = 0; //mxd
- while (!General.Map.Graphics.Reset()) {
- Thread.Sleep(10);
+ while(!General.Map.Graphics.CheckAvailability()) {
+ Thread.Sleep(100);
- if (retries++ > 500) {
- DialogResult result = General.ShowErrorMessage("Unable to reset D3D device." + Environment.NewLine + "Press Abort to quit, Retry to wait some more," + Environment.NewLine + "Ignore to proceed anyway (high chances of D3DException)", MessageBoxButtons.AbortRetryIgnore);
+ if (retries++ > 50) { //that's 5 seconds, right?
+ DialogResult result = General.ShowErrorMessage("Unable to reset D3D device." + Environment.NewLine + "Press Abort to quit," + Environment.NewLine + " Retry to wait some more," + Environment.NewLine + "Ignore to proceed anyway (high chances of D3DException)", MessageBoxButtons.AbortRetryIgnore);
if(result == DialogResult.Abort) {
General.Exit(true);
} else if (result == DialogResult.Retry) {
diff --git a/Source/Core/General/MapManager.cs b/Source/Core/General/MapManager.cs
index 8961a12f..7c6c80dc 100644
--- a/Source/Core/General/MapManager.cs
+++ b/Source/Core/General/MapManager.cs
@@ -502,7 +502,11 @@ namespace CodeImp.DoomBuilder {
UpdateScriptNames();
// Center map in screen
- if(General.Editing.Mode is ClassicMode) (General.Editing.Mode as ClassicMode).CenterInScreen();
+ if (General.Editing.Mode is ClassicMode) {
+ ClassicMode mode = General.Editing.Mode as ClassicMode;
+ mode.OnRedoEnd();
+ mode.CenterInScreen();
+ }
// Success
this.changed = false;
@@ -1752,6 +1756,11 @@ namespace CodeImp.DoomBuilder {
return io.GetType().Equals(t);
}
+ //mxd
+ public System.Drawing.SizeF GetTextSize(string text, float scale) {
+ return graphics.Font.GetTextSize(text, scale);
+ }
+
#endregion
}
}
\ No newline at end of file
diff --git a/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs
index 9083c254..374c2197 100644
--- a/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs
+++ b/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs
@@ -29,6 +29,7 @@ using CodeImp.DoomBuilder.Actions;
using CodeImp.DoomBuilder.Types;
using CodeImp.DoomBuilder.BuilderModes.Interface;
using CodeImp.DoomBuilder.GZBuilder.Tools;
+using CodeImp.DoomBuilder.Config;
#endregion
@@ -59,6 +60,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Labels
private Dictionary labels;
+
+ //mxd. Effects
+ private Dictionary effects;
#endregion
@@ -73,6 +77,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Constructor
public SectorsMode()
{
+ //mxd
+ effects = new Dictionary();
+ foreach (SectorEffectInfo info in General.Map.Config.SortedSectorEffects) {
+ effects.Add(info.Index, new[] { info.Index + ": " + info.Title, "E"+info.Index });
+ }
}
// Disposer
@@ -161,6 +170,32 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(requiredsize < s.Labels[i].radius) renderer.RenderText(l);
}
}
+
+ //mxd. Render effect labels
+ orderedselection = General.Map.Map.GetSelectedSectors(false);
+ foreach(Sector s in orderedselection) {
+ if (s.Effect != 0) {
+ TextLabel[] labelarray = labels[s];
+ for (int i = 0; i < s.Labels.Count; i++) {
+ TextLabel l = labelarray[i];
+ l.Color = General.Colors.InfoLine;
+
+ if (effects.ContainsKey(s.Effect)) {
+ float requiredsize = (General.Map.GetTextSize(effects[s.Effect][0], l.Scale).Width) / renderer.Scale;
+
+ if (requiredsize < s.Labels[i].radius) {
+ l.Text = effects[s.Effect][0];
+ } else {
+ l.Text = effects[s.Effect][1];
+ }
+ } else {
+ l.Text = "E"+s.Effect;
+ }
+
+ renderer.RenderText(l);
+ }
+ }
+ }
}
renderer.Finish();
@@ -1056,6 +1091,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
// Clear labels
SetupLabels();
+ base.OnRedoEnd(); //mxd
}
//mxd
diff --git a/Source/Plugins/BuilderModes/Interface/MenusForm.Designer.cs b/Source/Plugins/BuilderModes/Interface/MenusForm.Designer.cs
index ccf2a5a3..a4f7516f 100644
--- a/Source/Plugins/BuilderModes/Interface/MenusForm.Designer.cs
+++ b/Source/Plugins/BuilderModes/Interface/MenusForm.Designer.cs
@@ -82,10 +82,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
// menustrip
//
this.menustrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.linedefsmenu,
- this.sectorsmenu,
- this.thingsmenu,
- this.vertsmenu});
+ this.linedefsmenu,
+ this.sectorsmenu,
+ this.thingsmenu,
+ this.vertsmenu});
this.menustrip.Location = new System.Drawing.Point(0, 0);
this.menustrip.Name = "menustrip";
this.menustrip.Size = new System.Drawing.Size(423, 24);
@@ -95,18 +95,18 @@ namespace CodeImp.DoomBuilder.BuilderModes
// linedefsmenu
//
this.linedefsmenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.placethingsl,
- this.toolStripSeparator2,
- this.selectsinglesideditem,
- this.selectdoublesideditem,
- this.toolStripMenuItem4,
- this.fliplinedefsitem,
- this.flipsidedefsitem,
- this.toolStripMenuItem1,
- this.curvelinedefsitem,
- this.toolStripMenuItem3,
- this.splitlinedefsitem,
- this.alignLinedefsItem});
+ this.placethingsl,
+ this.toolStripSeparator2,
+ this.selectsinglesideditem,
+ this.selectdoublesideditem,
+ this.toolStripMenuItem4,
+ this.fliplinedefsitem,
+ this.flipsidedefsitem,
+ this.toolStripMenuItem1,
+ this.curvelinedefsitem,
+ this.toolStripMenuItem3,
+ this.splitlinedefsitem,
+ this.alignLinedefsItem});
this.linedefsmenu.Name = "linedefsmenu";
this.linedefsmenu.Size = new System.Drawing.Size(63, 20);
this.linedefsmenu.Text = "&Linedefs";
@@ -192,10 +192,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
// alignLinedefsItem
//
this.alignLinedefsItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.alignFloorToFrontItem,
- this.alignFloorToBackItem,
- this.alignCeilingToFrontItem,
- this.alignCeilingToBackItem});
+ this.alignFloorToFrontItem,
+ this.alignFloorToBackItem,
+ this.alignCeilingToFrontItem,
+ this.alignCeilingToBackItem});
this.alignLinedefsItem.Name = "alignLinedefsItem";
this.alignLinedefsItem.Size = new System.Drawing.Size(205, 22);
this.alignLinedefsItem.Text = "&Align Textures";
@@ -235,11 +235,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
// sectorsmenu
//
this.sectorsmenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.placethingss,
- this.toolStripSeparator1,
- this.joinsectorsitem,
- this.mergesectorsitem,
- this.toolStripMenuItem2});
+ this.placethingss,
+ this.toolStripSeparator1,
+ this.joinsectorsitem,
+ this.mergesectorsitem,
+ this.toolStripMenuItem2});
this.sectorsmenu.Name = "sectorsmenu";
this.sectorsmenu.Size = new System.Drawing.Size(57, 20);
this.sectorsmenu.Text = "&Sectors";
@@ -283,9 +283,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
// thingsmenu
//
this.thingsmenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.alignToWallItem,
- this.pointAtCursorItem,
- this.selectInSectorsItem});
+ this.alignToWallItem,
+ this.pointAtCursorItem,
+ this.selectInSectorsItem});
this.thingsmenu.Name = "thingsmenu";
this.thingsmenu.Size = new System.Drawing.Size(55, 20);
this.thingsmenu.Text = "Things";
@@ -320,7 +320,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// vertsmenu
//
this.vertsmenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.placethingsv});
+ this.placethingsv});
this.vertsmenu.Name = "vertsmenu";
this.vertsmenu.Size = new System.Drawing.Size(60, 20);
this.vertsmenu.Text = "Vertices";
@@ -345,21 +345,21 @@ namespace CodeImp.DoomBuilder.BuilderModes
// manualstrip
//
this.manualstrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.buttoncopyproperties,
- this.buttonpasteproperties,
- this.seperatorcopypaste,
- this.buttonselectionnumbers,
- this.separatorsectors1,
- this.buttonbrightnessgradient,
- this.buttonfloorgradient,
- this.buttonceilinggradient,
- this.buttonflipselectionh,
- this.buttonflipselectionv,
- this.buttoncurvelinedefs,
- this.brightnessGradientMode,
- this.buttonMarqueSelectTouching,
- this.buttonAlignThingsToWall,
- this.buttonTextureOffsetLock});
+ this.buttoncopyproperties,
+ this.buttonpasteproperties,
+ this.seperatorcopypaste,
+ this.buttonselectionnumbers,
+ this.separatorsectors1,
+ this.buttonbrightnessgradient,
+ this.buttonfloorgradient,
+ this.buttonceilinggradient,
+ this.buttonflipselectionh,
+ this.buttonflipselectionv,
+ this.buttoncurvelinedefs,
+ this.brightnessGradientMode,
+ this.buttonMarqueSelectTouching,
+ this.buttonAlignThingsToWall,
+ this.buttonTextureOffsetLock});
this.manualstrip.Location = new System.Drawing.Point(0, 49);
this.manualstrip.Name = "manualstrip";
this.manualstrip.Size = new System.Drawing.Size(423, 25);
@@ -402,7 +402,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
this.buttonselectionnumbers.ImageTransparentColor = System.Drawing.Color.Magenta;
this.buttonselectionnumbers.Name = "buttonselectionnumbers";
this.buttonselectionnumbers.Size = new System.Drawing.Size(23, 22);
- this.buttonselectionnumbers.Text = "View Selection Numbering";
+ this.buttonselectionnumbers.Text = "View Effects and Selection Numbering";
this.buttonselectionnumbers.Click += new System.EventHandler(this.buttonselectionnumbers_Click);
//
// separatorsectors1