Sectors mode: sector effects are now shown on top of unselected sectors (works only if "View Selection Numbering" option is enabled).

Updated documentation.
This commit is contained in:
MaxED 2013-09-12 15:02:08 +00:00
parent 261811cc57
commit dcc063f008
5 changed files with 98 additions and 51 deletions

View file

@ -128,6 +128,7 @@
</li> </li>
<li><span class="style1"><strong>[new]</strong></span><strong> </strong>Sector Info panel shows the number of sector's sidedefs as well as light and fade colors (UDMF only): <input class="spoilerbutton" type="button" onclick="ToggleSpoiler(this);" href="javascript:void(0);" value="Show image"/> <li><span class="style1"><strong>[new]</strong></span><strong> </strong>Sector Info panel shows the number of sector's sidedefs as well as light and fade colors (UDMF only): <input class="spoilerbutton" type="button" onclick="ToggleSpoiler(this);" href="javascript:void(0);" value="Show image"/>
<div style="display: none; margin: 0px; padding: 6px; border: 1px inset;"><img src="sectors_mode/sector_info.jpg" alt="" /></div></li> <div style="display: none; margin: 0px; padding: 6px; border: 1px inset;"><img src="sectors_mode/sector_info.jpg" alt="" /></div></li>
<li><span class="style1"><strong>[new]</strong></span> Sector effects are now shown on top of unselected sectors (works only if &quot;View Selection Numbering&quot; option is enabled).</li>
</ul> </ul>
</li> </li>
@ -136,7 +137,8 @@
<li><span class="style1"><strong>[new]</strong></span> <strong>[UDMF]</strong> New actions: &quot;<strong>Align Ceiling Texture to Back Side</strong>&quot;, &quot;<strong>Align Ceiling Texture to Front Side</strong>&quot;, &quot;<strong>Align Floor Texture to Back Side</strong>&quot; and &quot;<strong>Align Floor Texture to Front Side</strong>&quot; (available in <strong>Linedefs -&gt; Align Textures</strong> menu).</li> <li><span class="style1"><strong>[new]</strong></span> <strong>[UDMF]</strong> New actions: &quot;<strong>Align Ceiling Texture to Back Side</strong>&quot;, &quot;<strong>Align Ceiling Texture to Front Side</strong>&quot;, &quot;<strong>Align Floor Texture to Back Side</strong>&quot; and &quot;<strong>Align Floor Texture to Front Side</strong>&quot; (available in <strong>Linedefs -&gt; Align Textures</strong> menu).</li>
<li><span class="style1"><strong>[new]</strong></span> <strong>[UDMF]</strong> &quot;<strong>Make brightness gradient</strong>&quot; command is available in Linedefs mode.</li> <li><span class="style1"><strong>[new]</strong></span> <strong>[UDMF]</strong> &quot;<strong>Make brightness gradient</strong>&quot; command is available in Linedefs mode.</li>
<li><strong>[UDMF]</strong> Linedef info panel: relative UDMF light values are shown like this: <span class="style7">16</span> (<span class="style8">128</span>), which means &quot;<span class="style7">UDMF light value</span>&quot; (&quot;<span class="style8">total surface brightness</span>&quot;). Total surface brightness is UDMF light value + sector brightness.</li> <li><strong>[UDMF]</strong> Linedef info panel: relative UDMF light values are shown like this: <span class="style7">16</span> (<span class="style8">128</span>), which means &quot;<span class="style7">UDMF light value</span>&quot; (&quot;<span class="style8">total surface brightness</span>&quot;). Total surface brightness is UDMF light value + sector brightness.</li>
</ul></li> </ul>
</li>
<li><h3><a name="things" id="things"></a>Things mode:</h3> <li><h3><a name="things" id="things"></a>Things mode:</h3>
<ul> <ul>

View file

@ -354,11 +354,11 @@ namespace CodeImp.DoomBuilder
// Done // Done
int retries = 0; //mxd int retries = 0; //mxd
while (!General.Map.Graphics.Reset()) { while(!General.Map.Graphics.CheckAvailability()) {
Thread.Sleep(10); Thread.Sleep(100);
if (retries++ > 500) { if (retries++ > 50) { //that's 5 seconds, right?
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); 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) { if(result == DialogResult.Abort) {
General.Exit(true); General.Exit(true);
} else if (result == DialogResult.Retry) { } else if (result == DialogResult.Retry) {

View file

@ -502,7 +502,11 @@ namespace CodeImp.DoomBuilder {
UpdateScriptNames(); UpdateScriptNames();
// Center map in screen // 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 // Success
this.changed = false; this.changed = false;
@ -1752,6 +1756,11 @@ namespace CodeImp.DoomBuilder {
return io.GetType().Equals(t); return io.GetType().Equals(t);
} }
//mxd
public System.Drawing.SizeF GetTextSize(string text, float scale) {
return graphics.Font.GetTextSize(text, scale);
}
#endregion #endregion
} }
} }

View file

@ -29,6 +29,7 @@ using CodeImp.DoomBuilder.Actions;
using CodeImp.DoomBuilder.Types; using CodeImp.DoomBuilder.Types;
using CodeImp.DoomBuilder.BuilderModes.Interface; using CodeImp.DoomBuilder.BuilderModes.Interface;
using CodeImp.DoomBuilder.GZBuilder.Tools; using CodeImp.DoomBuilder.GZBuilder.Tools;
using CodeImp.DoomBuilder.Config;
#endregion #endregion
@ -60,6 +61,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Labels // Labels
private Dictionary<Sector, TextLabel[]> labels; private Dictionary<Sector, TextLabel[]> labels;
//mxd. Effects
private Dictionary<int, string[]> effects;
#endregion #endregion
#region ================== Properties #region ================== Properties
@ -73,6 +77,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Constructor // Constructor
public SectorsMode() public SectorsMode()
{ {
//mxd
effects = new Dictionary<int, string[]>();
foreach (SectorEffectInfo info in General.Map.Config.SortedSectorEffects) {
effects.Add(info.Index, new[] { info.Index + ": " + info.Title, "E"+info.Index });
}
} }
// Disposer // Disposer
@ -161,6 +170,32 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(requiredsize < s.Labels[i].radius) renderer.RenderText(l); 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(); renderer.Finish();
@ -1056,6 +1091,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{ {
// Clear labels // Clear labels
SetupLabels(); SetupLabels();
base.OnRedoEnd(); //mxd
} }
//mxd //mxd

View file

@ -82,10 +82,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
// menustrip // menustrip
// //
this.menustrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menustrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.linedefsmenu, this.linedefsmenu,
this.sectorsmenu, this.sectorsmenu,
this.thingsmenu, this.thingsmenu,
this.vertsmenu}); this.vertsmenu});
this.menustrip.Location = new System.Drawing.Point(0, 0); this.menustrip.Location = new System.Drawing.Point(0, 0);
this.menustrip.Name = "menustrip"; this.menustrip.Name = "menustrip";
this.menustrip.Size = new System.Drawing.Size(423, 24); this.menustrip.Size = new System.Drawing.Size(423, 24);
@ -95,18 +95,18 @@ namespace CodeImp.DoomBuilder.BuilderModes
// linedefsmenu // linedefsmenu
// //
this.linedefsmenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.linedefsmenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.placethingsl, this.placethingsl,
this.toolStripSeparator2, this.toolStripSeparator2,
this.selectsinglesideditem, this.selectsinglesideditem,
this.selectdoublesideditem, this.selectdoublesideditem,
this.toolStripMenuItem4, this.toolStripMenuItem4,
this.fliplinedefsitem, this.fliplinedefsitem,
this.flipsidedefsitem, this.flipsidedefsitem,
this.toolStripMenuItem1, this.toolStripMenuItem1,
this.curvelinedefsitem, this.curvelinedefsitem,
this.toolStripMenuItem3, this.toolStripMenuItem3,
this.splitlinedefsitem, this.splitlinedefsitem,
this.alignLinedefsItem}); this.alignLinedefsItem});
this.linedefsmenu.Name = "linedefsmenu"; this.linedefsmenu.Name = "linedefsmenu";
this.linedefsmenu.Size = new System.Drawing.Size(63, 20); this.linedefsmenu.Size = new System.Drawing.Size(63, 20);
this.linedefsmenu.Text = "&Linedefs"; this.linedefsmenu.Text = "&Linedefs";
@ -192,10 +192,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
// alignLinedefsItem // alignLinedefsItem
// //
this.alignLinedefsItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.alignLinedefsItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.alignFloorToFrontItem, this.alignFloorToFrontItem,
this.alignFloorToBackItem, this.alignFloorToBackItem,
this.alignCeilingToFrontItem, this.alignCeilingToFrontItem,
this.alignCeilingToBackItem}); this.alignCeilingToBackItem});
this.alignLinedefsItem.Name = "alignLinedefsItem"; this.alignLinedefsItem.Name = "alignLinedefsItem";
this.alignLinedefsItem.Size = new System.Drawing.Size(205, 22); this.alignLinedefsItem.Size = new System.Drawing.Size(205, 22);
this.alignLinedefsItem.Text = "&Align Textures"; this.alignLinedefsItem.Text = "&Align Textures";
@ -235,11 +235,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
// sectorsmenu // sectorsmenu
// //
this.sectorsmenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.sectorsmenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.placethingss, this.placethingss,
this.toolStripSeparator1, this.toolStripSeparator1,
this.joinsectorsitem, this.joinsectorsitem,
this.mergesectorsitem, this.mergesectorsitem,
this.toolStripMenuItem2}); this.toolStripMenuItem2});
this.sectorsmenu.Name = "sectorsmenu"; this.sectorsmenu.Name = "sectorsmenu";
this.sectorsmenu.Size = new System.Drawing.Size(57, 20); this.sectorsmenu.Size = new System.Drawing.Size(57, 20);
this.sectorsmenu.Text = "&Sectors"; this.sectorsmenu.Text = "&Sectors";
@ -283,9 +283,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
// thingsmenu // thingsmenu
// //
this.thingsmenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.thingsmenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.alignToWallItem, this.alignToWallItem,
this.pointAtCursorItem, this.pointAtCursorItem,
this.selectInSectorsItem}); this.selectInSectorsItem});
this.thingsmenu.Name = "thingsmenu"; this.thingsmenu.Name = "thingsmenu";
this.thingsmenu.Size = new System.Drawing.Size(55, 20); this.thingsmenu.Size = new System.Drawing.Size(55, 20);
this.thingsmenu.Text = "Things"; this.thingsmenu.Text = "Things";
@ -320,7 +320,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// vertsmenu // vertsmenu
// //
this.vertsmenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.vertsmenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.placethingsv}); this.placethingsv});
this.vertsmenu.Name = "vertsmenu"; this.vertsmenu.Name = "vertsmenu";
this.vertsmenu.Size = new System.Drawing.Size(60, 20); this.vertsmenu.Size = new System.Drawing.Size(60, 20);
this.vertsmenu.Text = "Vertices"; this.vertsmenu.Text = "Vertices";
@ -345,21 +345,21 @@ namespace CodeImp.DoomBuilder.BuilderModes
// manualstrip // manualstrip
// //
this.manualstrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.manualstrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.buttoncopyproperties, this.buttoncopyproperties,
this.buttonpasteproperties, this.buttonpasteproperties,
this.seperatorcopypaste, this.seperatorcopypaste,
this.buttonselectionnumbers, this.buttonselectionnumbers,
this.separatorsectors1, this.separatorsectors1,
this.buttonbrightnessgradient, this.buttonbrightnessgradient,
this.buttonfloorgradient, this.buttonfloorgradient,
this.buttonceilinggradient, this.buttonceilinggradient,
this.buttonflipselectionh, this.buttonflipselectionh,
this.buttonflipselectionv, this.buttonflipselectionv,
this.buttoncurvelinedefs, this.buttoncurvelinedefs,
this.brightnessGradientMode, this.brightnessGradientMode,
this.buttonMarqueSelectTouching, this.buttonMarqueSelectTouching,
this.buttonAlignThingsToWall, this.buttonAlignThingsToWall,
this.buttonTextureOffsetLock}); this.buttonTextureOffsetLock});
this.manualstrip.Location = new System.Drawing.Point(0, 49); this.manualstrip.Location = new System.Drawing.Point(0, 49);
this.manualstrip.Name = "manualstrip"; this.manualstrip.Name = "manualstrip";
this.manualstrip.Size = new System.Drawing.Size(423, 25); 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.ImageTransparentColor = System.Drawing.Color.Magenta;
this.buttonselectionnumbers.Name = "buttonselectionnumbers"; this.buttonselectionnumbers.Name = "buttonselectionnumbers";
this.buttonselectionnumbers.Size = new System.Drawing.Size(23, 22); 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); this.buttonselectionnumbers.Click += new System.EventHandler(this.buttonselectionnumbers_Click);
// //
// separatorsectors1 // separatorsectors1