diff --git a/.gitignore b/.gitignore index 903ceea..002f855 100644 --- a/.gitignore +++ b/.gitignore @@ -464,3 +464,4 @@ /Build/D3D8.dll /UpgradeLog.htm /UpgradeLog2.htm +/UpgradeLog3.htm diff --git a/Source/Core/Builder.csproj b/Source/Core/Builder.csproj index f6a3d91..baebb5b 100644 --- a/Source/Core/Builder.csproj +++ b/Source/Core/Builder.csproj @@ -838,6 +838,9 @@ Component + + Component + Component diff --git a/Source/Core/Controls/LinedefInfoPanel.Designer.cs b/Source/Core/Controls/LinedefInfoPanel.Designer.cs index 119f622..b09e832 100644 --- a/Source/Core/Controls/LinedefInfoPanel.Designer.cs +++ b/Source/Core/Controls/LinedefInfoPanel.Designer.cs @@ -109,7 +109,7 @@ namespace CodeImp.DoomBuilder.Controls this.backlowname = new System.Windows.Forms.Label(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.flagsPanel = new System.Windows.Forms.GroupBox(); - this.flags = new System.Windows.Forms.ListView(); + this.flags = new CodeImp.DoomBuilder.Controls.TransparentListView(); this.infopanel.SuspendLayout(); this.frontpanel.SuspendLayout(); this.flowLayoutPanelFront.SuspendLayout(); @@ -1017,7 +1017,7 @@ namespace CodeImp.DoomBuilder.Controls this.flags.Name = "flags"; this.flags.Scrollable = false; this.flags.ShowGroups = false; - this.flags.Size = new System.Drawing.Size(443, 73); + this.flags.Size = new System.Drawing.Size(443, 88); this.flags.TabIndex = 0; this.flags.UseCompatibleStateImageBehavior = false; this.flags.View = System.Windows.Forms.View.List; @@ -1145,7 +1145,7 @@ namespace CodeImp.DoomBuilder.Controls private System.Windows.Forms.Label labelTextureBackBottom; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; private System.Windows.Forms.GroupBox flagsPanel; - private System.Windows.Forms.ListView flags; + private CodeImp.DoomBuilder.Controls.TransparentListView flags; private System.Windows.Forms.Label taglabel; private System.Windows.Forms.Label anglelabel; private System.Windows.Forms.Label lengthlabel; diff --git a/Source/Core/Controls/LinedefInfoPanel.cs b/Source/Core/Controls/LinedefInfoPanel.cs index cf18a4e..612b16a 100644 --- a/Source/Core/Controls/LinedefInfoPanel.cs +++ b/Source/Core/Controls/LinedefInfoPanel.cs @@ -512,7 +512,17 @@ namespace CodeImp.DoomBuilder.Controls flagsPanel.Visible = (flags.Items.Count > 0); if(flags.Items.Count > 0) { - flags.Width = flags.GetItemRect(0).Width * (int)Math.Ceiling(flags.Items.Count / 4.0f); + Rectangle rect = flags.GetItemRect(0); + int itemspercolumn = 1; + + // Check how many items per column we have... + for(int i = 1; i < flags.Items.Count; i++) + { + if(flags.GetItemRect(i).X != rect.X) break; + itemspercolumn++; + } + + flags.Width = rect.Width * (int)Math.Ceiling(flags.Items.Count / (float)itemspercolumn); flagsPanel.Width = flags.Width + flags.Left * 2; } diff --git a/Source/Core/Controls/SectorInfoPanel.Designer.cs b/Source/Core/Controls/SectorInfoPanel.Designer.cs index 10e8512..03764a2 100644 --- a/Source/Core/Controls/SectorInfoPanel.Designer.cs +++ b/Source/Core/Controls/SectorInfoPanel.Designer.cs @@ -71,7 +71,7 @@ namespace CodeImp.DoomBuilder.Controls this.labelFloorTextureSize = new System.Windows.Forms.Label(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.flagsPanel = new System.Windows.Forms.GroupBox(); - this.flags = new System.Windows.Forms.ListView(); + this.flags = new CodeImp.DoomBuilder.Controls.TransparentListView(); label13 = new System.Windows.Forms.Label(); label5 = new System.Windows.Forms.Label(); this.sectorinfo.SuspendLayout(); @@ -128,7 +128,7 @@ namespace CodeImp.DoomBuilder.Controls this.taglabel.Text = "Tag:"; this.taglabel.TextAlign = System.Drawing.ContentAlignment.TopRight; // - // labelEffect + // effectlabel // this.effectlabel.Location = new System.Drawing.Point(8, 19); this.effectlabel.Name = "effectlabel"; @@ -531,7 +531,7 @@ namespace CodeImp.DoomBuilder.Controls this.flags.Name = "flags"; this.flags.Scrollable = false; this.flags.ShowGroups = false; - this.flags.Size = new System.Drawing.Size(443, 73); + this.flags.Size = new System.Drawing.Size(443, 88); this.flags.TabIndex = 0; this.flags.UseCompatibleStateImageBehavior = false; this.flags.View = System.Windows.Forms.View.List; @@ -600,7 +600,7 @@ namespace CodeImp.DoomBuilder.Controls private System.Windows.Forms.Label labelFade; private System.Windows.Forms.Label labelLight; private System.Windows.Forms.GroupBox flagsPanel; - private System.Windows.Forms.ListView flags; + private CodeImp.DoomBuilder.Controls.TransparentListView flags; private System.Windows.Forms.Label taglabel; private System.Windows.Forms.Label effectlabel; private System.Windows.Forms.Label labelfloor; diff --git a/Source/Core/Controls/SectorInfoPanel.cs b/Source/Core/Controls/SectorInfoPanel.cs index 9883089..47f61a1 100644 --- a/Source/Core/Controls/SectorInfoPanel.cs +++ b/Source/Core/Controls/SectorInfoPanel.cs @@ -311,7 +311,17 @@ namespace CodeImp.DoomBuilder.Controls flagsPanel.Visible = (flags.Items.Count > 0); if(flags.Items.Count > 0) { - flags.Width = flags.GetItemRect(0).Width * (int)Math.Ceiling(flags.Items.Count / 4.0f); + Rectangle rect = flags.GetItemRect(0); + int itemspercolumn = 1; + + // Check how many items per column we have... + for(int i = 1; i < flags.Items.Count; i++) + { + if(flags.GetItemRect(i).X != rect.X) break; + itemspercolumn++; + } + + flags.Width = rect.Width * (int)Math.Ceiling(flags.Items.Count / (float)itemspercolumn); flagsPanel.Width = flags.Width + flags.Left * 2; } diff --git a/Source/Core/Controls/ThingInfoPanel.Designer.cs b/Source/Core/Controls/ThingInfoPanel.Designer.cs index e979ce4..ade33dd 100644 --- a/Source/Core/Controls/ThingInfoPanel.Designer.cs +++ b/Source/Core/Controls/ThingInfoPanel.Designer.cs @@ -59,7 +59,7 @@ namespace CodeImp.DoomBuilder.Controls this.spritename = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.flagsPanel = new System.Windows.Forms.GroupBox(); - this.flags = new System.Windows.Forms.ListView(); + this.flags = new CodeImp.DoomBuilder.Controls.TransparentListView(); this.flagsvalue = new System.Windows.Forms.Label(); this.flagsvaluelabel = new System.Windows.Forms.Label(); this.spritetex = new CodeImp.DoomBuilder.Controls.ConfigurablePictureBox(); @@ -407,7 +407,7 @@ namespace CodeImp.DoomBuilder.Controls this.flags.Name = "flags"; this.flags.Scrollable = false; this.flags.ShowGroups = false; - this.flags.Size = new System.Drawing.Size(556, 73); + this.flags.Size = new System.Drawing.Size(556, 88); this.flags.TabIndex = 0; this.flags.UseCompatibleStateImageBehavior = false; this.flags.View = System.Windows.Forms.View.List; @@ -500,7 +500,7 @@ namespace CodeImp.DoomBuilder.Controls private System.Windows.Forms.Label arg1; private System.Windows.Forms.GroupBox infopanel; private System.Windows.Forms.GroupBox flagsPanel; - private System.Windows.Forms.ListView flags; + private CodeImp.DoomBuilder.Controls.TransparentListView flags; private System.Windows.Forms.Label flagsvalue; private System.Windows.Forms.Label flagsvaluelabel; private System.Windows.Forms.Label labelangle; diff --git a/Source/Core/Controls/ThingInfoPanel.cs b/Source/Core/Controls/ThingInfoPanel.cs index d10c548..99b0acb 100644 --- a/Source/Core/Controls/ThingInfoPanel.cs +++ b/Source/Core/Controls/ThingInfoPanel.cs @@ -17,6 +17,7 @@ #region ================== Namespaces using System; +using System.Drawing; using System.Globalization; using System.Windows.Forms; using CodeImp.DoomBuilder.Data; @@ -237,9 +238,20 @@ namespace CodeImp.DoomBuilder.Controls } //mxd. Flags panel visibility and size - if (flags.Items.Count > 0) + flagsPanel.Visible = (flags.Items.Count > 0); + if(flags.Items.Count > 0) { - flags.Width = flags.GetItemRect(0).Width * (int)Math.Ceiling(flags.Items.Count / 4.0f); + Rectangle rect = flags.GetItemRect(0); + int itemspercolumn = 1; + + // Check how many items per column we have... + for(int i = 1; i < flags.Items.Count; i++) + { + if(flags.GetItemRect(i).X != rect.X) break; + itemspercolumn++; + } + + flags.Width = rect.Width * (int)Math.Ceiling(flags.Items.Count / (float)itemspercolumn); flagsPanel.Width = flags.Width + flags.Left * 2; } diff --git a/Source/Core/Controls/TransparentListView.cs b/Source/Core/Controls/TransparentListView.cs new file mode 100644 index 0000000..f21c163 --- /dev/null +++ b/Source/Core/Controls/TransparentListView.cs @@ -0,0 +1,23 @@ +using System.Windows.Forms; + +namespace CodeImp.DoomBuilder.Controls +{ + public class TransparentListView : ListView + { + protected override CreateParams CreateParams + { + get + { + CreateParams cp = base.CreateParams; + cp.ExStyle |= 0x00000020; //WS_EX_TRANSPARENT + + return cp; + } + } + + protected override void OnPaintBackground(PaintEventArgs pevent) + { + // Don't paint background + } + } +} diff --git a/Source/Core/Windows/MainForm.Designer.cs b/Source/Core/Windows/MainForm.Designer.cs index 998c377..a4c9ed4 100644 --- a/Source/Core/Windows/MainForm.Designer.cs +++ b/Source/Core/Windows/MainForm.Designer.cs @@ -2466,31 +2466,37 @@ namespace CodeImp.DoomBuilder.Windows // // linedefinfo // + this.linedefinfo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.linedefinfo.Location = new System.Drawing.Point(3, 3); this.linedefinfo.MaximumSize = new System.Drawing.Size(10000, 100); this.linedefinfo.MinimumSize = new System.Drawing.Size(100, 100); this.linedefinfo.Name = "linedefinfo"; - this.linedefinfo.Size = new System.Drawing.Size(1560, 100); + this.linedefinfo.Size = new System.Drawing.Size(1006, 100); this.linedefinfo.TabIndex = 0; this.linedefinfo.Visible = false; // // thinginfo // + this.thinginfo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.thinginfo.Location = new System.Drawing.Point(3, 3); this.thinginfo.MaximumSize = new System.Drawing.Size(10000, 100); this.thinginfo.MinimumSize = new System.Drawing.Size(100, 100); this.thinginfo.Name = "thinginfo"; - this.thinginfo.Size = new System.Drawing.Size(1190, 100); + this.thinginfo.Size = new System.Drawing.Size(1006, 100); this.thinginfo.TabIndex = 3; this.thinginfo.Visible = false; // // sectorinfo // + this.sectorinfo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.sectorinfo.Location = new System.Drawing.Point(3, 3); this.sectorinfo.MaximumSize = new System.Drawing.Size(10000, 100); this.sectorinfo.MinimumSize = new System.Drawing.Size(100, 100); this.sectorinfo.Name = "sectorinfo"; - this.sectorinfo.Size = new System.Drawing.Size(1090, 100); + this.sectorinfo.Size = new System.Drawing.Size(1006, 100); this.sectorinfo.TabIndex = 2; this.sectorinfo.Visible = false; // diff --git a/Source/Core/ZDoom/TextureStructure.cs b/Source/Core/ZDoom/TextureStructure.cs index 47eda03..e3c5529 100644 --- a/Source/Core/ZDoom/TextureStructure.cs +++ b/Source/Core/ZDoom/TextureStructure.cs @@ -45,6 +45,8 @@ namespace CodeImp.DoomBuilder.ZDoom private readonly int xoffset; private readonly int yoffset; private readonly bool worldpanning; + private readonly bool optional; //mxd + private readonly bool nulltexture; //mxd // Patches private readonly List patches; @@ -61,7 +63,8 @@ namespace CodeImp.DoomBuilder.ZDoom public float YScale { get { return yscale; } } public int XOffset { get { return xoffset; } } public int YOffset { get { return yoffset; } } - public bool WorldPanning { get { return worldpanning; } } + public bool Optional { get { return optional; } } + public bool NullTexture { get { return nulltexture; } } public ICollection Patches { get { return patches; } } #endregion @@ -88,6 +91,7 @@ namespace CodeImp.DoomBuilder.ZDoom //mxd. It can also be "optional" keyword. if(name.ToLowerInvariant() == "optional") { + optional = true; parser.SkipWhitespace(true); name = parser.StripTokenQuotes(parser.ReadToken(false)); //mxd. Don't skip newline } @@ -150,6 +154,10 @@ namespace CodeImp.DoomBuilder.ZDoom worldpanning = true; break; + case "nulltexture": //mxd + nulltexture = true; + break; + case "offset": // Read x offset if(!ReadTokenInt(parser, token, out xoffset)) return;