diff --git a/Source/Core/Map/MapSet.cs b/Source/Core/Map/MapSet.cs index 0ff4ff1b..40cbfcb1 100755 --- a/Source/Core/Map/MapSet.cs +++ b/Source/Core/Map/MapSet.cs @@ -3710,7 +3710,7 @@ namespace CodeImp.DoomBuilder.Map // Return result return closest; } - + #endregion #region ================== Tools @@ -4172,7 +4172,7 @@ namespace CodeImp.DoomBuilder.Map // Return result return closest; } - + // This performs sidedefs compression // Note: Only use this for saving, because this messes up the expected data structure horribly. internal void CompressSidedefs() diff --git a/Source/Core/Map/Sector.cs b/Source/Core/Map/Sector.cs index 5111e9ea..af750648 100755 --- a/Source/Core/Map/Sector.cs +++ b/Source/Core/Map/Sector.cs @@ -409,7 +409,8 @@ namespace CodeImp.DoomBuilder.Map General.Plugins.OnSectorCeilingSurfaceUpdate(this, ref updateinfo.ceilvertices); updateinfo.floortexture = longfloortexname; updateinfo.ceiltexture = longceiltexname; - updateinfo.desaturation = this.Desaturation; + updateinfo.hidden = IsFlagSet("hidden"); + updateinfo.desaturation = this.Desaturation; // Update surfaces General.Map.CRenderer2D.Surfaces.UpdateSurfaces(surfaceentries, updateinfo); @@ -429,6 +430,7 @@ namespace CodeImp.DoomBuilder.Map flatvertices.CopyTo(updateinfo.floorvertices, 0); General.Plugins.OnSectorFloorSurfaceUpdate(this, ref updateinfo.floorvertices); updateinfo.floortexture = longfloortexname; + updateinfo.hidden = IsFlagSet("hidden"); updateinfo.desaturation = this.Desaturation; // Update entry @@ -446,7 +448,8 @@ namespace CodeImp.DoomBuilder.Map flatvertices.CopyTo(updateinfo.ceilvertices, 0); General.Plugins.OnSectorCeilingSurfaceUpdate(this, ref updateinfo.ceilvertices); updateinfo.ceiltexture = longceiltexname; - updateinfo.desaturation = this.Desaturation; + updateinfo.hidden = IsFlagSet("hidden"); + updateinfo.desaturation = this.Desaturation; // Update entry General.Map.CRenderer2D.Surfaces.UpdateSurfaces(surfaceentries, updateinfo); @@ -517,6 +520,10 @@ namespace CodeImp.DoomBuilder.Map BeforePropsChange(); flags[flagname] = value; + + // [XA] TODO: de-hardcode this special case thing + if(flagname == "hidden") + updateneeded = true; } } diff --git a/Source/Core/Rendering/Presentation.cs b/Source/Core/Rendering/Presentation.cs index b9bca748..767c0687 100755 --- a/Source/Core/Rendering/Presentation.cs +++ b/Source/Core/Rendering/Presentation.cs @@ -39,6 +39,9 @@ namespace CodeImp.DoomBuilder.Rendering // Static properties public static Presentation Standard { get { return standard; } } public static Presentation Things { get { return things; } } + + // Public properties + public bool SkipHiddenSectors { get; set; } // Skip drawing sectors with the "hidden" flag set (i.e. UDMF's "hide on textured automap" property) // Variables protected internal List layers; @@ -48,12 +51,14 @@ namespace CodeImp.DoomBuilder.Rendering { // Initialize layers = new List(); + SkipHiddenSectors = false; } // Copy constructor public Presentation(Presentation p) { layers = new List(p.layers); + SkipHiddenSectors = p.SkipHiddenSectors; } // This creates the static instances diff --git a/Source/Core/Rendering/Renderer2D.cs b/Source/Core/Rendering/Renderer2D.cs index 3ba12766..b8757de5 100755 --- a/Source/Core/Rendering/Renderer2D.cs +++ b/Source/Core/Rendering/Renderer2D.cs @@ -1618,17 +1618,17 @@ namespace CodeImp.DoomBuilder.Rendering switch(viewmode) { case ViewMode.Brightness: - surfaces.RenderSectorBrightness(yviewport); + surfaces.RenderSectorBrightness(yviewport, present.SkipHiddenSectors); surfaces.RenderSectorSurfaces(graphics); break; case ViewMode.FloorTextures: - surfaces.RenderSectorFloors(yviewport); + surfaces.RenderSectorFloors(yviewport, present.SkipHiddenSectors); surfaces.RenderSectorSurfaces(graphics); break; case ViewMode.CeilingTextures: - surfaces.RenderSectorCeilings(yviewport); + surfaces.RenderSectorCeilings(yviewport, present.SkipHiddenSectors); surfaces.RenderSectorSurfaces(graphics); break; } diff --git a/Source/Core/Rendering/SurfaceEntry.cs b/Source/Core/Rendering/SurfaceEntry.cs index add84fe2..305c820e 100755 --- a/Source/Core/Rendering/SurfaceEntry.cs +++ b/Source/Core/Rendering/SurfaceEntry.cs @@ -49,6 +49,9 @@ namespace CodeImp.DoomBuilder.Rendering public long floortexture; public long ceiltexture; + // Sector flags + public bool hidden; // sector is hidden on textured automap + // public double desaturation; diff --git a/Source/Core/Rendering/SurfaceManager.cs b/Source/Core/Rendering/SurfaceManager.cs index 5fbec73b..55853710 100755 --- a/Source/Core/Rendering/SurfaceManager.cs +++ b/Source/Core/Rendering/SurfaceManager.cs @@ -405,6 +405,7 @@ namespace CodeImp.DoomBuilder.Rendering Array.Copy(update.ceilvertices, update.numvertices - vertsremaining, e.ceilvertices, 0, vertsinentry); e.floortexture = update.floortexture; e.ceiltexture = update.ceiltexture; + e.hidden = update.hidden; e.desaturation = update.desaturation; entries.Add(e); @@ -429,6 +430,7 @@ namespace CodeImp.DoomBuilder.Rendering e.ceiltexture = update.ceiltexture; } + e.hidden = update.hidden; e.desaturation = update.desaturation; vertsremaining -= e.numvertices; @@ -510,7 +512,7 @@ namespace CodeImp.DoomBuilder.Rendering #region ================== Rendering // This renders all sector floors - internal void RenderSectorFloors(RectangleF viewport) + internal void RenderSectorFloors(RectangleF viewport, bool skipHidden) { surfaces = new Dictionary>(); surfacevertexoffsetmul = 0; @@ -521,14 +523,14 @@ namespace CodeImp.DoomBuilder.Rendering { foreach(SurfaceEntry entry in set.Value.entries) { - if(entry.bbox.IntersectsWith(viewport)) + if(SurfaceEntryIsVisible(entry, viewport, skipHidden)) AddSurfaceEntryForRendering(entry, entry.floortexture); } } } // This renders all sector ceilings - internal void RenderSectorCeilings(RectangleF viewport) + internal void RenderSectorCeilings(RectangleF viewport, bool skipHidden) { surfaces = new Dictionary>(); surfacevertexoffsetmul = 1; @@ -539,14 +541,14 @@ namespace CodeImp.DoomBuilder.Rendering { foreach(SurfaceEntry entry in set.Value.entries) { - if(entry.bbox.IntersectsWith(viewport)) + if(SurfaceEntryIsVisible(entry, viewport, skipHidden)) AddSurfaceEntryForRendering(entry, entry.ceiltexture); } } } // This renders all sector brightness levels - internal void RenderSectorBrightness(RectangleF viewport) + internal void RenderSectorBrightness(RectangleF viewport, bool skipHidden) { surfaces = new Dictionary>(); surfacevertexoffsetmul = 0; @@ -557,12 +559,21 @@ namespace CodeImp.DoomBuilder.Rendering { foreach(SurfaceEntry entry in set.Value.entries) { - if(entry.bbox.IntersectsWith(viewport)) + if(SurfaceEntryIsVisible(entry, viewport, skipHidden)) AddSurfaceEntryForRendering(entry, 0); } } } + // Checks to see if a particular surface entry is visible in the viewport + private bool SurfaceEntryIsVisible(SurfaceEntry entry, RectangleF viewport, bool skipHidden) + { + if (skipHidden && entry.hidden) + return false; + + return entry.bbox.IntersectsWith(viewport); + } + // This adds a surface entry to the list of surfaces private void AddSurfaceEntryForRendering(SurfaceEntry entry, long longimagename) { diff --git a/Source/Core/Rendering/SurfaceUpdate.cs b/Source/Core/Rendering/SurfaceUpdate.cs index 969f8bc8..6964da3c 100755 --- a/Source/Core/Rendering/SurfaceUpdate.cs +++ b/Source/Core/Rendering/SurfaceUpdate.cs @@ -36,8 +36,11 @@ namespace CodeImp.DoomBuilder.Rendering public long floortexture; public long ceiltexture; - // - public double desaturation; + // Sector flags + public bool hidden; + + // + public double desaturation; // Constructor internal SurfaceUpdate(int numvertices, bool updatefloor, bool updateceiling) @@ -49,6 +52,7 @@ namespace CodeImp.DoomBuilder.Rendering this.floorvertices = (updatefloor ? new FlatVertex[numvertices] : null); this.ceilvertices = (updateceiling ? new FlatVertex[numvertices] : null); + this.hidden = false; this.desaturation = 0f; } } diff --git a/Source/Plugins/AutomapMode/AutomapMode.cs b/Source/Plugins/AutomapMode/AutomapMode.cs index 1077b856..f49c5743 100755 --- a/Source/Plugins/AutomapMode/AutomapMode.cs +++ b/Source/Plugins/AutomapMode/AutomapMode.cs @@ -61,8 +61,9 @@ namespace CodeImp.DoomBuilder.AutomapMode private List validlinedefs; private HashSet secretsectors; //mxd - // Highlighted item - private Linedef highlighted; + // Highlighted items + private Linedef highlightedLine; + private Sector highlightedSector; //mxd. UI private MenusForm menusform; @@ -76,12 +77,25 @@ namespace CodeImp.DoomBuilder.AutomapMode private PixelColor ColorHiddenFlag; private PixelColor ColorInvisible; private PixelColor ColorBackground; - + + // Options + private bool invertLineVisibility; // CTRL to toggle + private bool editSectors; // SHIFT to toggle + #endregion #region ================== Properties - public override object HighlightedObject { get { return highlighted; } } + public override object HighlightedObject + { + get + { + if(highlightedLine != null) + return highlightedLine; + else + return highlightedSector; + } + } #endregion @@ -95,7 +109,8 @@ namespace CodeImp.DoomBuilder.AutomapMode menusform.ShowHiddenLines = General.Settings.ReadPluginSetting("automapmode.showhiddenlines", false); menusform.ShowSecretSectors = General.Settings.ReadPluginSetting("automapmode.showsecretsectors", false); menusform.ShowLocks = General.Settings.ReadPluginSetting("automapmode.showlocks", true); - menusform.ColorPreset = (ColorPreset)General.Settings.ReadPluginSetting("automapmode.colorpreset", (int)ColorPreset.DOOM); + menusform.ShowTextures = General.Settings.ReadPluginSetting("automapmode.showtextures", true); + menusform.ColorPreset = (ColorPreset)General.Settings.ReadPluginSetting("automapmode.colorpreset", (int)ColorPreset.DOOM); // Handle events menusform.OnShowHiddenLinesChanged += delegate @@ -106,8 +121,9 @@ namespace CodeImp.DoomBuilder.AutomapMode menusform.OnShowSecretSectorsChanged += delegate { General.Interface.RedrawDisplay(); }; menusform.OnShowLocksChanged += delegate { General.Interface.RedrawDisplay(); }; + menusform.OnShowTexturesChanged += delegate { General.Interface.RedrawDisplay(); }; - menusform.OnColorPresetChanged += delegate + menusform.OnColorPresetChanged += delegate { ApplyColorPreset(menusform.ColorPreset); General.Interface.RedrawDisplay(); @@ -121,26 +137,48 @@ namespace CodeImp.DoomBuilder.AutomapMode #region ================== Methods - // This highlights a new item - private void Highlight(Linedef l) + // Update the current highlight + private void UpdateHighlight() + { + if (EditSectors()) + { + // Get the nearest sector to the cursor; don't factor in the + // highlight range since we really just want to capture + // whichever sector is under the cursor. + Sector s = General.Map.Map.GetSectorByCoordinates(mousemappos); + + if (s != highlightedSector) HighlightSector(s); + } + else + { + // Find the nearest linedef within highlight range + Linedef l = MapSet.NearestLinedefRange(validlinedefs, mousemappos, BuilderPlug.Me.HighlightRange / renderer.Scale); + + // Highlight if not the same + if (l != highlightedLine) HighlightLine(l); + } + } + + // This highlights a new line + private void HighlightLine(Linedef l) { // Update display if(renderer.StartPlotter(false)) { // Undraw previous highlight - if((highlighted != null) && !highlighted.IsDisposed) + if((highlightedLine != null) && !highlightedLine.IsDisposed) { - PixelColor c = LinedefIsValid(highlighted) ? DetermineLinedefColor(highlighted) : PixelColor.Transparent; - renderer.PlotLine(highlighted.Start.Position, highlighted.End.Position, c, LINE_LENGTH_SCALER); + PixelColor c = LinedefIsValid(highlightedLine) ? DetermineLinedefColor(highlightedLine) : PixelColor.Transparent; + renderer.PlotLine(highlightedLine.Start.Position, highlightedLine.End.Position, c, LINE_LENGTH_SCALER); } // Set new highlight - highlighted = l; + highlightedLine = l; // Render highlighted item - if((highlighted != null) && !highlighted.IsDisposed && LinedefIsValid(highlighted)) + if((highlightedLine != null) && !highlightedLine.IsDisposed && LinedefIsValid(highlightedLine)) { - renderer.PlotLine(highlighted.Start.Position, highlighted.End.Position, General.Colors.InfoLine, LINE_LENGTH_SCALER); + renderer.PlotLine(highlightedLine.Start.Position, highlightedLine.End.Position, General.Colors.InfoLine, LINE_LENGTH_SCALER); } // Done @@ -149,8 +187,48 @@ namespace CodeImp.DoomBuilder.AutomapMode } // Show highlight info - if((highlighted != null) && !highlighted.IsDisposed) - General.Interface.ShowLinedefInfo(highlighted); + if((highlightedLine != null) && !highlightedLine.IsDisposed) + General.Interface.ShowLinedefInfo(highlightedLine); + else + General.Interface.HideInfo(); + } + + // This highlights a new sector + private void HighlightSector(Sector sector) + { + // Update display + if (renderer.StartPlotter(false)) + { + // Undraw previous highlight + if ((highlightedSector != null) && !highlightedSector.IsDisposed) + { + foreach(Sidedef sd in highlightedSector.Sidedefs) + { + if ((sd.Line != null) && !sd.Line.IsDisposed) + { + PixelColor c = LinedefIsValid(sd.Line) ? DetermineLinedefColor(sd.Line) : PixelColor.Transparent; + renderer.PlotLine(sd.Line.Start.Position, sd.Line.End.Position, c, LINE_LENGTH_SCALER); + } + } + } + + // Set new highlight + highlightedSector = sector; + + // Render highlighted sector's lines + if ((highlightedSector != null) && !highlightedSector.IsDisposed) + foreach (Sidedef sd in highlightedSector.Sidedefs) + if ((sd.Line != null) && !sd.Line.IsDisposed) + renderer.PlotLine(sd.Line.Start.Position, sd.Line.End.Position, General.Colors.Highlight, LINE_LENGTH_SCALER); + + // Done + renderer.Finish(); + renderer.Present(); + } + + // Show highlight info + if ((highlightedSector != null) && !highlightedSector.IsDisposed) + General.Interface.ShowSectorInfo(highlightedSector); else General.Interface.HideInfo(); } @@ -193,14 +271,14 @@ namespace CodeImp.DoomBuilder.AutomapMode if(ld.Front.Sector.CeilHeight == ld.Back.Sector.CeilHeight && ld.Front.Sector.FloorHeight == ld.Back.Sector.FloorHeight) return ColorMatchingHeight; - if(menusform.ShowHiddenLines ^ General.Interface.CtrlState) return ColorInvisible; + if(menusform.ShowHiddenLines ^ invertLineVisibility) return ColorInvisible; return new PixelColor(255, 255, 255, 255); } private bool LinedefIsValid(Linedef ld) { - if(menusform.ShowHiddenLines ^ General.Interface.CtrlState) return true; + if(menusform.ShowHiddenLines ^ invertLineVisibility) return true; if(ld.IsFlagSet(BuilderPlug.Me.HiddenFlag)) return false; if(ld.Back == null || ld.Front == null || ld.IsFlagSet(BuilderPlug.Me.SecretFlag)) return true; if(ld.Back != null && ld.Front != null && (ld.Front.Sector.FloorHeight != ld.Back.Sector.FloorHeight || ld.Front.Sector.CeilHeight != ld.Back.Sector.CeilHeight)) return true; @@ -208,6 +286,21 @@ namespace CodeImp.DoomBuilder.AutomapMode return false; } + private bool SectorIsVisible(Sector s) + { + return(s != null && !s.IsFlagSet("hidden")); + } + + private bool ShowTextures() + { + return menusform.ShowTextures || EditSectors(); + } + + private bool EditSectors() + { + return editSectors && General.Map.UDMF; + } + //mxd private static bool SectorIsSecret(Sector s) { @@ -318,11 +411,14 @@ namespace CodeImp.DoomBuilder.AutomapMode base.OnEngage(); renderer.DrawMapCenter = false; //mxd - // Automap presentation without the surfaces + // Automap presentation; now draws surfaces for textured mode support, + // but the surfaces are covered up with a background layer. automappresentation = new CustomPresentation(); + automappresentation.AddLayer(new PresentLayer(RendererLayer.Surface, BlendingMode.Mask)); automappresentation.AddLayer(new PresentLayer(RendererLayer.Overlay, BlendingMode.Mask)); automappresentation.AddLayer(new PresentLayer(RendererLayer.Grid, BlendingMode.Mask)); automappresentation.AddLayer(new PresentLayer(RendererLayer.Geometry, BlendingMode.Alpha, 1f, true)); + automappresentation.SkipHiddenSectors = true; renderer.SetPresentation(automappresentation); UpdateValidLinedefs(); @@ -341,7 +437,8 @@ namespace CodeImp.DoomBuilder.AutomapMode General.Settings.WritePluginSetting("automapmode.showhiddenlines", menusform.ShowHiddenLines); General.Settings.WritePluginSetting("automapmode.showsecretsectors", menusform.ShowSecretSectors); General.Settings.WritePluginSetting("automapmode.showlocks", menusform.ShowLocks); - General.Settings.WritePluginSetting("automapmode.colorpreset", (int)menusform.ColorPreset); + General.Settings.WritePluginSetting("automapmode.showtextures", menusform.ShowTextures); + General.Settings.WritePluginSetting("automapmode.colorpreset", (int)menusform.ColorPreset); //mxd. Hide UI menusform.Unregister(); @@ -382,9 +479,9 @@ namespace CodeImp.DoomBuilder.AutomapMode renderer.PlotLine(ld.Start.Position, ld.End.Position, DetermineLinedefColor(ld), LINE_LENGTH_SCALER); } - if((highlighted != null) && !highlighted.IsDisposed && LinedefIsValid(highlighted)) + if((highlightedLine != null) && !highlightedLine.IsDisposed && LinedefIsValid(highlightedLine)) { - renderer.PlotLine(highlighted.Start.Position, highlighted.End.Position, General.Colors.InfoLine, LINE_LENGTH_SCALER); + renderer.PlotLine(highlightedLine.Start.Position, highlightedLine.End.Position, General.Colors.InfoLine, LINE_LENGTH_SCALER); } renderer.Finish(); @@ -393,8 +490,10 @@ namespace CodeImp.DoomBuilder.AutomapMode //mxd. Render background if(renderer.StartOverlay(true)) { - RectangleF screenrect = new RectangleF(0, 0, General.Interface.Display.Width, General.Interface.Display.Height); - renderer.RenderRectangleFilled(screenrect, ColorBackground, false); + if(!ShowTextures()) { + RectangleF screenrect = new RectangleF(0, 0, General.Interface.Display.Width, General.Interface.Display.Height); + renderer.RenderRectangleFilled(screenrect, ColorBackground, false); + } renderer.Finish(); } @@ -403,28 +502,44 @@ namespace CodeImp.DoomBuilder.AutomapMode protected override void OnSelectEnd() { - // Item highlighted? - if((highlighted != null) && !highlighted.IsDisposed) + // Line highlighted? + if((highlightedLine != null) && !highlightedLine.IsDisposed) { General.Map.UndoRedo.CreateUndo("Toggle \"Shown as 1-sided on automap\" linedef flag"); // Toggle flag - highlighted.SetFlag(BuilderPlug.Me.SecretFlag, !highlighted.IsFlagSet(BuilderPlug.Me.SecretFlag)); + highlightedLine.SetFlag(BuilderPlug.Me.SecretFlag, !highlightedLine.IsFlagSet(BuilderPlug.Me.SecretFlag)); UpdateValidLinedefs(); } + // Sector highlighted? + if((highlightedSector != null) && !highlightedSector.IsDisposed) + { + General.Map.UndoRedo.CreateUndo("Toggle \"Not shown on textured automap\" sector flag"); + + // Toggle flag + highlightedSector.SetFlag("hidden", !highlightedSector.IsFlagSet("hidden")); + + // Redraw the universe + General.Map.Map.Update(); + General.Interface.RedrawDisplay(); + + // Re-highlight the sector since it gets lost after RedrawDisplay + HighlightSector(highlightedSector); + } + base.OnSelectEnd(); } protected override void OnEditEnd() { - // Item highlighted? - if((highlighted != null) && !highlighted.IsDisposed) + // Line highlighted? + if ((highlightedLine != null) && !highlightedLine.IsDisposed) { General.Map.UndoRedo.CreateUndo("Toggle \"Not shown on automap\" linedef flag"); // Toggle flag - highlighted.SetFlag(BuilderPlug.Me.HiddenFlag, !highlighted.IsFlagSet(BuilderPlug.Me.HiddenFlag)); + highlightedLine.SetFlag(BuilderPlug.Me.HiddenFlag, !highlightedLine.IsFlagSet(BuilderPlug.Me.HiddenFlag)); UpdateValidLinedefs(); General.Interface.RedrawDisplay(); } @@ -440,11 +555,7 @@ namespace CodeImp.DoomBuilder.AutomapMode // Not holding any buttons? if(e.Button == MouseButtons.None) { - // Find the nearest linedef within highlight range - Linedef l = MapSet.NearestLinedefRange(validlinedefs, mousemappos, BuilderPlug.Me.HighlightRange / renderer.Scale); - - // Highlight if not the same - if(l != highlighted) Highlight(l); + UpdateHighlight(); } } @@ -454,29 +565,42 @@ namespace CodeImp.DoomBuilder.AutomapMode base.OnMouseLeave(e); // Highlight nothing - Highlight(null); + HighlightLine(null); + HighlightSector(null); } + // Keyboard input handling; toggles a couple of options + public override void OnKeyDown(KeyEventArgs e) { base.OnKeyDown(e); - if(e.Control) - { - UpdateValidLinedefs(); - General.Interface.RedrawDisplay(); - } + UpdateOptions(); } public override void OnKeyUp(KeyEventArgs e) { base.OnKeyUp(e); - if(!e.Control) + UpdateOptions(); + } + + private void UpdateOptions() + { + if(invertLineVisibility != General.Interface.CtrlState) { + invertLineVisibility = General.Interface.CtrlState; UpdateValidLinedefs(); General.Interface.RedrawDisplay(); } + if(editSectors != General.Interface.ShiftState) + { + editSectors = General.Interface.ShiftState; + HighlightLine(null); + HighlightSector(null); + General.Interface.RedrawDisplay(); + UpdateHighlight(); + } } #endregion diff --git a/Source/Plugins/AutomapMode/AutomapMode.csproj b/Source/Plugins/AutomapMode/AutomapMode.csproj index b934f67b..b8adf955 100755 --- a/Source/Plugins/AutomapMode/AutomapMode.csproj +++ b/Source/Plugins/AutomapMode/AutomapMode.csproj @@ -122,4 +122,7 @@ + + + \ No newline at end of file diff --git a/Source/Plugins/AutomapMode/Interface/MenusForm.Designer.cs b/Source/Plugins/AutomapMode/Interface/MenusForm.Designer.cs index 28bcf094..7e8f7f8f 100755 --- a/Source/Plugins/AutomapMode/Interface/MenusForm.Designer.cs +++ b/Source/Plugins/AutomapMode/Interface/MenusForm.Designer.cs @@ -28,96 +28,108 @@ /// private void InitializeComponent() { - this.toolStrip1 = new System.Windows.Forms.ToolStrip(); - this.colorpresetseparator = new System.Windows.Forms.ToolStripSeparator(); - this.colorpresetlabel = new System.Windows.Forms.ToolStripLabel(); - this.colorpreset = new System.Windows.Forms.ToolStripComboBox(); - this.showhiddenlines = new System.Windows.Forms.ToolStripButton(); - this.showsecretsectors = new System.Windows.Forms.ToolStripButton(); - this.showlocks = new System.Windows.Forms.ToolStripButton(); - this.toolStrip1.SuspendLayout(); - this.SuspendLayout(); - // - // toolStrip1 - // - this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStrip1 = new System.Windows.Forms.ToolStrip(); + this.showhiddenlines = new System.Windows.Forms.ToolStripButton(); + this.showsecretsectors = new System.Windows.Forms.ToolStripButton(); + this.showlocks = new System.Windows.Forms.ToolStripButton(); + this.colorpresetseparator = new System.Windows.Forms.ToolStripSeparator(); + this.colorpresetlabel = new System.Windows.Forms.ToolStripLabel(); + this.colorpreset = new System.Windows.Forms.ToolStripComboBox(); + this.showtextures = new System.Windows.Forms.ToolStripButton(); + this.toolStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // toolStrip1 + // + this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.showhiddenlines, this.showsecretsectors, this.showlocks, + this.showtextures, this.colorpresetseparator, this.colorpresetlabel, this.colorpreset}); - this.toolStrip1.Location = new System.Drawing.Point(0, 0); - this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(731, 25); - this.toolStrip1.TabIndex = 0; - this.toolStrip1.Text = "toolStrip1"; - // - // colorpresetseparator - // - this.colorpresetseparator.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.colorpresetseparator.Name = "colorpresetseparator"; - this.colorpresetseparator.Size = new System.Drawing.Size(6, 25); - // - // colorpresetlabel - // - this.colorpresetlabel.Name = "colorpresetlabel"; - this.colorpresetlabel.Size = new System.Drawing.Size(74, 22); - this.colorpresetlabel.Text = "Color preset:"; - // - // colorpreset - // - this.colorpreset.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.colorpreset.Items.AddRange(new object[] { + this.toolStrip1.Location = new System.Drawing.Point(0, 0); + this.toolStrip1.Name = "toolStrip1"; + this.toolStrip1.Size = new System.Drawing.Size(731, 25); + this.toolStrip1.TabIndex = 0; + this.toolStrip1.Text = "toolStrip1"; + // + // showhiddenlines + // + this.showhiddenlines.CheckOnClick = true; + this.showhiddenlines.Image = global::CodeImp.DoomBuilder.AutomapMode.Properties.Resources.ShowHiddenLines; + this.showhiddenlines.ImageTransparentColor = System.Drawing.Color.Magenta; + this.showhiddenlines.Margin = new System.Windows.Forms.Padding(0, 1, 2, 2); + this.showhiddenlines.Name = "showhiddenlines"; + this.showhiddenlines.Size = new System.Drawing.Size(123, 22); + this.showhiddenlines.Text = "Show hidden lines"; + this.showhiddenlines.CheckedChanged += new System.EventHandler(this.showhiddenlines_CheckedChanged); + // + // showsecretsectors + // + this.showsecretsectors.CheckOnClick = true; + this.showsecretsectors.Image = global::CodeImp.DoomBuilder.AutomapMode.Properties.Resources.ShowSecrets; + this.showsecretsectors.Margin = new System.Windows.Forms.Padding(0, 1, 2, 2); + this.showsecretsectors.Name = "showsecretsectors"; + this.showsecretsectors.Size = new System.Drawing.Size(95, 22); + this.showsecretsectors.Text = "Show secrets"; + this.showsecretsectors.CheckedChanged += new System.EventHandler(this.showsecretsectors_CheckedChanged); + // + // showlocks + // + this.showlocks.CheckOnClick = true; + this.showlocks.Image = global::CodeImp.DoomBuilder.AutomapMode.Properties.Resources.ShowLocks; + this.showlocks.ImageTransparentColor = System.Drawing.Color.Magenta; + this.showlocks.Name = "showlocks"; + this.showlocks.Size = new System.Drawing.Size(86, 22); + this.showlocks.Text = "Show locks"; + this.showlocks.CheckedChanged += new System.EventHandler(this.showlocks_CheckedChanged); + // + // colorpresetseparator + // + this.colorpresetseparator.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.colorpresetseparator.Name = "colorpresetseparator"; + this.colorpresetseparator.Size = new System.Drawing.Size(6, 25); + // + // colorpresetlabel + // + this.colorpresetlabel.Name = "colorpresetlabel"; + this.colorpresetlabel.Size = new System.Drawing.Size(74, 22); + this.colorpresetlabel.Text = "Color preset:"; + // + // colorpreset + // + this.colorpreset.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.colorpreset.Items.AddRange(new object[] { "Doom", "Hexen", "Strife"}); - this.colorpreset.Name = "colorpreset"; - this.colorpreset.Size = new System.Drawing.Size(75, 25); - this.colorpreset.SelectedIndexChanged += new System.EventHandler(this.colorpreset_SelectedIndexChanged); - // - // showhiddenlines - // - this.showhiddenlines.CheckOnClick = true; - this.showhiddenlines.Image = global::CodeImp.DoomBuilder.AutomapMode.Properties.Resources.ShowHiddenLines; - this.showhiddenlines.ImageTransparentColor = System.Drawing.Color.Magenta; - this.showhiddenlines.Margin = new System.Windows.Forms.Padding(0, 1, 2, 2); - this.showhiddenlines.Name = "showhiddenlines"; - this.showhiddenlines.Size = new System.Drawing.Size(123, 22); - this.showhiddenlines.Text = "Show hidden lines"; - this.showhiddenlines.CheckedChanged += new System.EventHandler(this.showhiddenlines_CheckedChanged); - // - // showsecretsectors - // - this.showsecretsectors.CheckOnClick = true; - this.showsecretsectors.Image = global::CodeImp.DoomBuilder.AutomapMode.Properties.Resources.ShowSecrets; - this.showsecretsectors.Margin = new System.Windows.Forms.Padding(0, 1, 2, 2); - this.showsecretsectors.Name = "showsecretsectors"; - this.showsecretsectors.Size = new System.Drawing.Size(95, 22); - this.showsecretsectors.Text = "Show secrets"; - this.showsecretsectors.CheckedChanged += new System.EventHandler(this.showsecretsectors_CheckedChanged); - // - // showlocks - // - this.showlocks.CheckOnClick = true; - this.showlocks.Image = global::CodeImp.DoomBuilder.AutomapMode.Properties.Resources.ShowLocks; - this.showlocks.ImageTransparentColor = System.Drawing.Color.Magenta; - this.showlocks.Name = "showlocks"; - this.showlocks.Size = new System.Drawing.Size(86, 22); - this.showlocks.Text = "Show locks"; - this.showlocks.CheckedChanged += new System.EventHandler(this.showlocks_CheckedChanged); - // - // MenusForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.toolStrip1); - this.Name = "MenusForm"; - this.Size = new System.Drawing.Size(731, 65); - this.toolStrip1.ResumeLayout(false); - this.toolStrip1.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); + this.colorpreset.Name = "colorpreset"; + this.colorpreset.Size = new System.Drawing.Size(75, 25); + this.colorpreset.SelectedIndexChanged += new System.EventHandler(this.colorpreset_SelectedIndexChanged); + // + // showtextures + // + this.showtextures.CheckOnClick = true; + this.showtextures.Image = global::CodeImp.DoomBuilder.AutomapMode.Properties.Resources.ShowTextures; + this.showtextures.ImageTransparentColor = System.Drawing.Color.Magenta; + this.showtextures.Name = "showtextures"; + this.showtextures.Size = new System.Drawing.Size(101, 22); + this.showtextures.Text = "Show textures"; + this.showtextures.CheckedChanged += new System.EventHandler(this.showtextures_CheckedChanged); + // + // MenusForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.toolStrip1); + this.Name = "MenusForm"; + this.Size = new System.Drawing.Size(731, 65); + this.toolStrip1.ResumeLayout(false); + this.toolStrip1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -130,5 +142,6 @@ private System.Windows.Forms.ToolStripLabel colorpresetlabel; private System.Windows.Forms.ToolStripComboBox colorpreset; private System.Windows.Forms.ToolStripButton showlocks; - } + private System.Windows.Forms.ToolStripButton showtextures; + } } diff --git a/Source/Plugins/AutomapMode/Interface/MenusForm.cs b/Source/Plugins/AutomapMode/Interface/MenusForm.cs index 7fef8644..93781797 100755 --- a/Source/Plugins/AutomapMode/Interface/MenusForm.cs +++ b/Source/Plugins/AutomapMode/Interface/MenusForm.cs @@ -8,11 +8,13 @@ namespace CodeImp.DoomBuilder.AutomapMode public event EventHandler OnShowHiddenLinesChanged; public event EventHandler OnShowSecretSectorsChanged; public event EventHandler OnShowLocksChanged; - internal event EventHandler OnColorPresetChanged; + public event EventHandler OnShowTexturesChanged; + internal event EventHandler OnColorPresetChanged; public bool ShowHiddenLines { get { return showhiddenlines.Checked; } set { showhiddenlines.Checked = value; } } public bool ShowSecretSectors { get { return showsecretsectors.Checked; } set { showsecretsectors.Checked = value; } } public bool ShowLocks { get { return showlocks.Checked; } set { showlocks.Checked = value; } } + public bool ShowTextures { get { return showtextures.Checked; } set { showtextures.Checked = value; } } internal AutomapMode.ColorPreset ColorPreset { get { return (AutomapMode.ColorPreset)colorpreset.SelectedIndex; } set { colorpreset.SelectedIndex = (int)value; } } public MenusForm() @@ -26,6 +28,7 @@ namespace CodeImp.DoomBuilder.AutomapMode General.Interface.AddButton(showhiddenlines); General.Interface.AddButton(showsecretsectors); if(!General.Map.DOOM) General.Interface.AddButton(showlocks); + General.Interface.AddButton(showtextures); General.Interface.AddButton(colorpresetseparator); General.Interface.AddButton(colorpresetlabel); General.Interface.AddButton(colorpreset); @@ -39,7 +42,8 @@ namespace CodeImp.DoomBuilder.AutomapMode General.Interface.RemoveButton(colorpresetlabel); General.Interface.RemoveButton(colorpresetseparator); General.Interface.RemoveButton(showlocks); - General.Interface.RemoveButton(showsecretsectors); + General.Interface.RemoveButton(showtextures); + General.Interface.RemoveButton(showsecretsectors); General.Interface.RemoveButton(showhiddenlines); General.Interface.EndToolbarUpdate(); //mxd } @@ -57,9 +61,14 @@ namespace CodeImp.DoomBuilder.AutomapMode private void showlocks_CheckedChanged(object sender, EventArgs e) { if(OnShowLocksChanged != null) OnShowLocksChanged(showlocks.Checked, EventArgs.Empty); - } + } - private void colorpreset_SelectedIndexChanged(object sender, EventArgs e) + private void showtextures_CheckedChanged(object sender, EventArgs e) + { + if (OnShowTexturesChanged != null) OnShowTexturesChanged(showtextures.Checked, EventArgs.Empty); + } + + private void colorpreset_SelectedIndexChanged(object sender, EventArgs e) { if(OnColorPresetChanged != null) OnColorPresetChanged(colorpreset.SelectedIndex, EventArgs.Empty); } diff --git a/Source/Plugins/AutomapMode/Properties/Resources.Designer.cs b/Source/Plugins/AutomapMode/Properties/Resources.Designer.cs index b2dedc6f..14565e51 100755 --- a/Source/Plugins/AutomapMode/Properties/Resources.Designer.cs +++ b/Source/Plugins/AutomapMode/Properties/Resources.Designer.cs @@ -89,5 +89,15 @@ namespace CodeImp.DoomBuilder.AutomapMode.Properties { return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap ShowTextures { + get { + object obj = ResourceManager.GetObject("ShowTextures", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/Source/Plugins/AutomapMode/Properties/Resources.resx b/Source/Plugins/AutomapMode/Properties/Resources.resx index 80e0c05e..3feae91b 100755 --- a/Source/Plugins/AutomapMode/Properties/Resources.resx +++ b/Source/Plugins/AutomapMode/Properties/Resources.resx @@ -127,4 +127,7 @@ ..\Resources\ShowLocks.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\ShowTextures.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/Source/Plugins/AutomapMode/Resources/Hints.cfg b/Source/Plugins/AutomapMode/Resources/Hints.cfg index f004af3e..b5810457 100755 --- a/Source/Plugins/AutomapMode/Resources/Hints.cfg +++ b/Source/Plugins/AutomapMode/Resources/Hints.cfg @@ -8,4 +8,5 @@ class AutomapMode group general "Left click on a line to toggle the 'Shown as 1-sided on automap' flag." "Right click on a line to toggle the 'Not shown on automap' flag." -"Hold Ctrl to toggle the display of the lines that are not drawn, either because there was no height change (gray) or the 'Not shown on automap' flag is set (light gray)." \ No newline at end of file +"Hold Ctrl to toggle the display of the lines that are not drawn, either because there was no height change (gray) or the 'Not shown on automap' flag is set (light gray)." +"Hold Shift to highlight and edit sectors, rather than lines. Clicking on sectors will toggle 'Not shown on textured automap' flag. This action is only available for UDMF maps." \ No newline at end of file diff --git a/Source/Plugins/AutomapMode/Resources/ShowTextures.png b/Source/Plugins/AutomapMode/Resources/ShowTextures.png new file mode 100644 index 00000000..d3ae3a9a Binary files /dev/null and b/Source/Plugins/AutomapMode/Resources/ShowTextures.png differ