Texture size is now shown in Linedef and Sector info panels and in Linedef and Sector edit forms.

This commit is contained in:
MaxED 2013-06-17 13:17:53 +00:00
parent 776c357265
commit 806db41ced
8 changed files with 239 additions and 12 deletions

View file

@ -18,6 +18,7 @@
using System.Drawing;
using CodeImp.DoomBuilder.Windows;
using CodeImp.DoomBuilder.Data;
#endregion
@ -40,13 +41,20 @@ namespace CodeImp.DoomBuilder.Controls
// Check if name is a "none" texture
if((imagename.Length < 1) || (imagename[0] == '-'))
{
DisplayImageSize(-1, -1); //mxd
// Flat required!
return CodeImp.DoomBuilder.Properties.Resources.MissingTexture;
}
else
{
//mxd
ImageData texture = General.Map.Data.GetFlatImage(imagename);
if(texture.ImageState == ImageLoadState.Ready) DisplayImageSize(texture.Width, texture.Height);
else DisplayImageSize(-1, -1);
// Set the image
return General.Map.Data.GetFlatImage(imagename).GetPreview();
return texture.GetPreview();
}
}

View file

@ -30,7 +30,9 @@ namespace CodeImp.DoomBuilder.Controls
private void InitializeComponent()
{
this.preview = new System.Windows.Forms.Panel();
this.labelSize = new System.Windows.Forms.Label();
this.name = new CodeImp.DoomBuilder.Controls.AutoSelectTextbox();
this.preview.SuspendLayout();
this.SuspendLayout();
//
// preview
@ -38,6 +40,7 @@ namespace CodeImp.DoomBuilder.Controls
this.preview.BackColor = System.Drawing.SystemColors.AppWorkspace;
this.preview.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.preview.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.preview.Controls.Add(this.labelSize);
this.preview.Location = new System.Drawing.Point(0, 0);
this.preview.Name = "preview";
this.preview.Size = new System.Drawing.Size(68, 60);
@ -49,6 +52,19 @@ namespace CodeImp.DoomBuilder.Controls
this.preview.MouseUp += new System.Windows.Forms.MouseEventHandler(this.preview_MouseUp);
this.preview.MouseEnter += new System.EventHandler(this.preview_MouseEnter);
//
// labelSize
//
this.labelSize.AutoSize = true;
this.labelSize.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
this.labelSize.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.labelSize.ForeColor = System.Drawing.Color.White;
this.labelSize.Location = new System.Drawing.Point(1, 1);
this.labelSize.MaximumSize = new System.Drawing.Size(0, 13);
this.labelSize.Name = "labelSize";
this.labelSize.Size = new System.Drawing.Size(48, 13);
this.labelSize.TabIndex = 0;
this.labelSize.Text = "128x128";
//
// name
//
this.name.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
@ -71,6 +87,8 @@ namespace CodeImp.DoomBuilder.Controls
this.Size = new System.Drawing.Size(115, 136);
this.Layout += new System.Windows.Forms.LayoutEventHandler(this.ImageSelectorControl_Layout);
this.Resize += new System.EventHandler(this.ImageSelectorControl_Resize);
this.preview.ResumeLayout(false);
this.preview.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@ -80,6 +98,7 @@ namespace CodeImp.DoomBuilder.Controls
protected System.Windows.Forms.Panel preview;
protected CodeImp.DoomBuilder.Controls.AutoSelectTextbox name;
private System.Windows.Forms.Label labelSize;
}
}

View file

@ -186,6 +186,17 @@ namespace CodeImp.DoomBuilder.Controls
OnValueChanged(this, EventArgs.Empty);
}
}
//mxd
protected void DisplayImageSize(int width, int height) {
if(width == -1 && height == -1) {
labelSize.Visible = false;
return;
}
labelSize.Visible = true;
labelSize.Text = width + "x" + height;
}
// This must determine and return the image to show
protected abstract Image FindImage(string imagename);

View file

@ -58,6 +58,7 @@ namespace CodeImp.DoomBuilder.Controls
this.flowLayoutPanelFront = new System.Windows.Forms.FlowLayoutPanel();
this.panel4 = new System.Windows.Forms.Panel();
this.fronthightex = new System.Windows.Forms.Panel();
this.labelTextureFrontTop = new System.Windows.Forms.Label();
this.fronthighname = new System.Windows.Forms.Label();
this.panelUDMFFrontTop = new System.Windows.Forms.Panel();
this.frontTopUDMFScale = new System.Windows.Forms.Label();
@ -66,6 +67,7 @@ namespace CodeImp.DoomBuilder.Controls
this.frontTopUDMFOffsetLabel = new System.Windows.Forms.Label();
this.panel7 = new System.Windows.Forms.Panel();
this.frontmidtex = new System.Windows.Forms.Panel();
this.labelTextureFrontMid = new System.Windows.Forms.Label();
this.frontmidname = new System.Windows.Forms.Label();
this.panelUDMFFrontMid = new System.Windows.Forms.Panel();
this.frontMidUDMFScale = new System.Windows.Forms.Label();
@ -74,6 +76,7 @@ namespace CodeImp.DoomBuilder.Controls
this.frontMidUDMFOffsetLabel = new System.Windows.Forms.Label();
this.panelFrontLowTex = new System.Windows.Forms.Panel();
this.frontlowtex = new System.Windows.Forms.Panel();
this.labelTextureFrontBottom = new System.Windows.Forms.Label();
this.frontlowname = new System.Windows.Forms.Label();
this.panelUDMFFrontBottom = new System.Windows.Forms.Panel();
this.frontBottomUDMFScale = new System.Windows.Forms.Label();
@ -85,6 +88,7 @@ namespace CodeImp.DoomBuilder.Controls
this.flowLayoutPanelBack = new System.Windows.Forms.FlowLayoutPanel();
this.panel1 = new System.Windows.Forms.Panel();
this.backhightex = new System.Windows.Forms.Panel();
this.labelTextureBackTop = new System.Windows.Forms.Label();
this.backhighname = new System.Windows.Forms.Label();
this.panelUDMFBackTop = new System.Windows.Forms.Panel();
this.backTopUDMFScale = new System.Windows.Forms.Label();
@ -93,6 +97,7 @@ namespace CodeImp.DoomBuilder.Controls
this.backTopUDMFOffsetLabel = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
this.backmidtex = new System.Windows.Forms.Panel();
this.labelTextureBackMid = new System.Windows.Forms.Label();
this.backmidname = new System.Windows.Forms.Label();
this.panelUDMFBackMid = new System.Windows.Forms.Panel();
this.backMidUDMFScale = new System.Windows.Forms.Label();
@ -101,6 +106,7 @@ namespace CodeImp.DoomBuilder.Controls
this.backMidUDMFOffsetLabel = new System.Windows.Forms.Label();
this.panelBackLowTex = new System.Windows.Forms.Panel();
this.backlowtex = new System.Windows.Forms.Panel();
this.labelTextureBackBottom = new System.Windows.Forms.Label();
this.backlowname = new System.Windows.Forms.Label();
this.panelUDMFBackBottom = new System.Windows.Forms.Panel();
this.backBottomUDMFScale = new System.Windows.Forms.Label();
@ -115,18 +121,24 @@ namespace CodeImp.DoomBuilder.Controls
this.frontpanel.SuspendLayout();
this.flowLayoutPanelFront.SuspendLayout();
this.panel4.SuspendLayout();
this.fronthightex.SuspendLayout();
this.panelUDMFFrontTop.SuspendLayout();
this.panel7.SuspendLayout();
this.frontmidtex.SuspendLayout();
this.panelUDMFFrontMid.SuspendLayout();
this.panelFrontLowTex.SuspendLayout();
this.frontlowtex.SuspendLayout();
this.panelUDMFFrontBottom.SuspendLayout();
this.backpanel.SuspendLayout();
this.flowLayoutPanelBack.SuspendLayout();
this.panel1.SuspendLayout();
this.backhightex.SuspendLayout();
this.panelUDMFBackTop.SuspendLayout();
this.panel2.SuspendLayout();
this.backmidtex.SuspendLayout();
this.panelUDMFBackMid.SuspendLayout();
this.panelBackLowTex.SuspendLayout();
this.backlowtex.SuspendLayout();
this.panelUDMFBackBottom.SuspendLayout();
this.SuspendLayout();
//
@ -453,11 +465,25 @@ namespace CodeImp.DoomBuilder.Controls
this.fronthightex.BackColor = System.Drawing.SystemColors.AppWorkspace;
this.fronthightex.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.fronthightex.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.fronthightex.Controls.Add(this.labelTextureFrontTop);
this.fronthightex.Location = new System.Drawing.Point(11, 2);
this.fronthightex.Name = "fronthightex";
this.fronthightex.Size = new System.Drawing.Size(68, 60);
this.fronthightex.TabIndex = 0;
//
// labelTextureFrontTop
//
this.labelTextureFrontTop.AutoSize = true;
this.labelTextureFrontTop.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
this.labelTextureFrontTop.Font = new System.Drawing.Font("Arial", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelTextureFrontTop.ForeColor = System.Drawing.Color.White;
this.labelTextureFrontTop.Location = new System.Drawing.Point(2, 1);
this.labelTextureFrontTop.MaximumSize = new System.Drawing.Size(0, 13);
this.labelTextureFrontTop.Name = "labelTextureFrontTop";
this.labelTextureFrontTop.Size = new System.Drawing.Size(48, 13);
this.labelTextureFrontTop.TabIndex = 0;
this.labelTextureFrontTop.Text = "128x128";
//
// fronthighname
//
this.fronthighname.BackColor = System.Drawing.SystemColors.Control;
@ -528,11 +554,25 @@ namespace CodeImp.DoomBuilder.Controls
this.frontmidtex.BackColor = System.Drawing.SystemColors.AppWorkspace;
this.frontmidtex.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.frontmidtex.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.frontmidtex.Controls.Add(this.labelTextureFrontMid);
this.frontmidtex.Location = new System.Drawing.Point(11, 2);
this.frontmidtex.Name = "frontmidtex";
this.frontmidtex.Size = new System.Drawing.Size(68, 60);
this.frontmidtex.TabIndex = 2;
//
// labelTextureFrontMid
//
this.labelTextureFrontMid.AutoSize = true;
this.labelTextureFrontMid.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
this.labelTextureFrontMid.Font = new System.Drawing.Font("Arial", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelTextureFrontMid.ForeColor = System.Drawing.Color.White;
this.labelTextureFrontMid.Location = new System.Drawing.Point(2, 1);
this.labelTextureFrontMid.MaximumSize = new System.Drawing.Size(0, 13);
this.labelTextureFrontMid.Name = "labelTextureFrontMid";
this.labelTextureFrontMid.Size = new System.Drawing.Size(48, 13);
this.labelTextureFrontMid.TabIndex = 1;
this.labelTextureFrontMid.Text = "128x128";
//
// frontmidname
//
this.frontmidname.BackColor = System.Drawing.SystemColors.Control;
@ -603,11 +643,25 @@ namespace CodeImp.DoomBuilder.Controls
this.frontlowtex.BackColor = System.Drawing.SystemColors.AppWorkspace;
this.frontlowtex.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.frontlowtex.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.frontlowtex.Controls.Add(this.labelTextureFrontBottom);
this.frontlowtex.Location = new System.Drawing.Point(11, 2);
this.frontlowtex.Name = "frontlowtex";
this.frontlowtex.Size = new System.Drawing.Size(68, 60);
this.frontlowtex.TabIndex = 4;
//
// labelTextureFrontBottom
//
this.labelTextureFrontBottom.AutoSize = true;
this.labelTextureFrontBottom.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
this.labelTextureFrontBottom.Font = new System.Drawing.Font("Arial", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelTextureFrontBottom.ForeColor = System.Drawing.Color.White;
this.labelTextureFrontBottom.Location = new System.Drawing.Point(2, 1);
this.labelTextureFrontBottom.MaximumSize = new System.Drawing.Size(0, 13);
this.labelTextureFrontBottom.Name = "labelTextureFrontBottom";
this.labelTextureFrontBottom.Size = new System.Drawing.Size(48, 13);
this.labelTextureFrontBottom.TabIndex = 2;
this.labelTextureFrontBottom.Text = "128x128";
//
// frontlowname
//
this.frontlowname.BackColor = System.Drawing.SystemColors.Control;
@ -714,11 +768,25 @@ namespace CodeImp.DoomBuilder.Controls
this.backhightex.BackColor = System.Drawing.SystemColors.AppWorkspace;
this.backhightex.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.backhightex.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.backhightex.Controls.Add(this.labelTextureBackTop);
this.backhightex.Location = new System.Drawing.Point(11, 2);
this.backhightex.Name = "backhightex";
this.backhightex.Size = new System.Drawing.Size(68, 60);
this.backhightex.TabIndex = 0;
//
// labelTextureBackTop
//
this.labelTextureBackTop.AutoSize = true;
this.labelTextureBackTop.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
this.labelTextureBackTop.Font = new System.Drawing.Font("Arial", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelTextureBackTop.ForeColor = System.Drawing.Color.White;
this.labelTextureBackTop.Location = new System.Drawing.Point(2, 1);
this.labelTextureBackTop.MaximumSize = new System.Drawing.Size(0, 13);
this.labelTextureBackTop.Name = "labelTextureBackTop";
this.labelTextureBackTop.Size = new System.Drawing.Size(48, 13);
this.labelTextureBackTop.TabIndex = 3;
this.labelTextureBackTop.Text = "128x128";
//
// backhighname
//
this.backhighname.BackColor = System.Drawing.SystemColors.Control;
@ -789,11 +857,25 @@ namespace CodeImp.DoomBuilder.Controls
this.backmidtex.BackColor = System.Drawing.SystemColors.AppWorkspace;
this.backmidtex.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.backmidtex.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.backmidtex.Controls.Add(this.labelTextureBackMid);
this.backmidtex.Location = new System.Drawing.Point(11, 2);
this.backmidtex.Name = "backmidtex";
this.backmidtex.Size = new System.Drawing.Size(68, 60);
this.backmidtex.TabIndex = 2;
//
// labelTextureBackMid
//
this.labelTextureBackMid.AutoSize = true;
this.labelTextureBackMid.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
this.labelTextureBackMid.Font = new System.Drawing.Font("Arial", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelTextureBackMid.ForeColor = System.Drawing.Color.White;
this.labelTextureBackMid.Location = new System.Drawing.Point(2, 1);
this.labelTextureBackMid.MaximumSize = new System.Drawing.Size(0, 13);
this.labelTextureBackMid.Name = "labelTextureBackMid";
this.labelTextureBackMid.Size = new System.Drawing.Size(48, 13);
this.labelTextureBackMid.TabIndex = 2;
this.labelTextureBackMid.Text = "128x128";
//
// backmidname
//
this.backmidname.BackColor = System.Drawing.SystemColors.Control;
@ -864,11 +946,25 @@ namespace CodeImp.DoomBuilder.Controls
this.backlowtex.BackColor = System.Drawing.SystemColors.AppWorkspace;
this.backlowtex.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.backlowtex.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.backlowtex.Controls.Add(this.labelTextureBackBottom);
this.backlowtex.Location = new System.Drawing.Point(11, 2);
this.backlowtex.Name = "backlowtex";
this.backlowtex.Size = new System.Drawing.Size(68, 60);
this.backlowtex.TabIndex = 4;
//
// labelTextureBackBottom
//
this.labelTextureBackBottom.AutoSize = true;
this.labelTextureBackBottom.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
this.labelTextureBackBottom.Font = new System.Drawing.Font("Arial", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelTextureBackBottom.ForeColor = System.Drawing.Color.White;
this.labelTextureBackBottom.Location = new System.Drawing.Point(2, 1);
this.labelTextureBackBottom.MaximumSize = new System.Drawing.Size(0, 13);
this.labelTextureBackBottom.Name = "labelTextureBackBottom";
this.labelTextureBackBottom.Size = new System.Drawing.Size(48, 13);
this.labelTextureBackBottom.TabIndex = 3;
this.labelTextureBackBottom.Text = "128x128";
//
// backlowname
//
this.backlowname.BackColor = System.Drawing.SystemColors.Control;
@ -943,19 +1039,31 @@ namespace CodeImp.DoomBuilder.Controls
this.frontpanel.PerformLayout();
this.flowLayoutPanelFront.ResumeLayout(false);
this.panel4.ResumeLayout(false);
this.fronthightex.ResumeLayout(false);
this.fronthightex.PerformLayout();
this.panelUDMFFrontTop.ResumeLayout(false);
this.panel7.ResumeLayout(false);
this.frontmidtex.ResumeLayout(false);
this.frontmidtex.PerformLayout();
this.panelUDMFFrontMid.ResumeLayout(false);
this.panelFrontLowTex.ResumeLayout(false);
this.frontlowtex.ResumeLayout(false);
this.frontlowtex.PerformLayout();
this.panelUDMFFrontBottom.ResumeLayout(false);
this.backpanel.ResumeLayout(false);
this.backpanel.PerformLayout();
this.flowLayoutPanelBack.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.backhightex.ResumeLayout(false);
this.backhightex.PerformLayout();
this.panelUDMFBackTop.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.backmidtex.ResumeLayout(false);
this.backmidtex.PerformLayout();
this.panelUDMFBackMid.ResumeLayout(false);
this.panelBackLowTex.ResumeLayout(false);
this.backlowtex.ResumeLayout(false);
this.backlowtex.PerformLayout();
this.panelUDMFBackBottom.ResumeLayout(false);
this.ResumeLayout(false);
@ -1038,6 +1146,12 @@ namespace CodeImp.DoomBuilder.Controls
private System.Windows.Forms.Label frontBottomUDMFOffset;
private System.Windows.Forms.Label frontBottomUDMFScaleLabel;
private System.Windows.Forms.Label frontBottomUDMFOffsetLabel;
private System.Windows.Forms.Label labelTextureFrontTop;
private System.Windows.Forms.Label labelTextureFrontMid;
private System.Windows.Forms.Label labelTextureFrontBottom;
private System.Windows.Forms.Label labelTextureBackTop;
private System.Windows.Forms.Label labelTextureBackMid;
private System.Windows.Forms.Label labelTextureBackBottom;
}
}

View file

@ -23,6 +23,7 @@ using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Config;
using CodeImp.DoomBuilder.Types;
using CodeImp.DoomBuilder.GZBuilder;
using CodeImp.DoomBuilder.Data;
#endregion
@ -217,9 +218,9 @@ namespace CodeImp.DoomBuilder.Controls
fronthighname.Text = l.Front.HighTexture;
frontmidname.Text = l.Front.MiddleTexture;
frontlowname.Text = l.Front.LowTexture;
DisplaySidedefTexture(fronthightex, l.Front.HighTexture, l.Front.HighRequired());
DisplaySidedefTexture(frontmidtex, l.Front.MiddleTexture, l.Front.MiddleRequired());
DisplaySidedefTexture(frontlowtex, l.Front.LowTexture, l.Front.LowRequired());
DisplaySidedefTexture(fronthightex, labelTextureFrontTop, l.Front.HighTexture, l.Front.HighRequired());
DisplaySidedefTexture(frontmidtex, labelTextureFrontMid, l.Front.MiddleTexture, l.Front.MiddleRequired());
DisplaySidedefTexture(frontlowtex, labelTextureFrontBottom, l.Front.LowTexture, l.Front.LowRequired());
//mxd. Position panel
frontpanel.Left = infopanel.Left + infopanel.Width + infopanel.Margin.Right + frontpanel.Margin.Left;
@ -318,9 +319,9 @@ namespace CodeImp.DoomBuilder.Controls
backhighname.Text = l.Back.HighTexture;
backmidname.Text = l.Back.MiddleTexture;
backlowname.Text = l.Back.LowTexture;
DisplaySidedefTexture(backhightex, l.Back.HighTexture, l.Back.HighRequired());
DisplaySidedefTexture(backmidtex, l.Back.MiddleTexture, l.Back.MiddleRequired());
DisplaySidedefTexture(backlowtex, l.Back.LowTexture, l.Back.LowRequired());
DisplaySidedefTexture(backhightex, labelTextureBackTop, l.Back.HighTexture, l.Back.HighRequired());
DisplaySidedefTexture(backmidtex, labelTextureBackMid, l.Back.MiddleTexture, l.Back.MiddleRequired());
DisplaySidedefTexture(backlowtex, labelTextureBackBottom, l.Back.LowTexture, l.Back.LowRequired());
//mxd. Position panel
backpanel.Left = (l.Front != null ? frontpanel.Right : infopanel.Right) + 3;
@ -427,11 +428,13 @@ namespace CodeImp.DoomBuilder.Controls
}
// This shows a sidedef texture in a panel
private void DisplaySidedefTexture(Panel panel, string name, bool required)
private void DisplaySidedefTexture(Panel panel, Label label, string name, bool required)
{
// Check if name is a "none" texture
if((name.Length < 1) || (name[0] == '-'))
{
label.Visible = false; //mxd
// Determine image to show
if(required)
panel.BackgroundImage = CodeImp.DoomBuilder.Properties.Resources.MissingTexture;
@ -440,8 +443,17 @@ namespace CodeImp.DoomBuilder.Controls
}
else
{
//mxd
ImageData texture = General.Map.Data.GetTextureImage(name);
if(texture.ImageState == ImageLoadState.Ready) {
label.Visible = true;
label.Text = texture.Width + "x" + texture.Height;
} else {
label.Visible = false;
}
// Set the image
panel.BackgroundImage = General.Map.Data.GetTextureImage(name).GetPreview();
panel.BackgroundImage = texture.GetPreview();
}
// Image not null?

View file

@ -57,6 +57,7 @@ namespace CodeImp.DoomBuilder.Controls
this.ceilingInfo = new System.Windows.Forms.Panel();
this.ceilingname = new System.Windows.Forms.Label();
this.ceilingtex = new System.Windows.Forms.Panel();
this.labelCeilTextureSize = new System.Windows.Forms.Label();
this.floorpanel = new System.Windows.Forms.GroupBox();
this.floorInfo = new System.Windows.Forms.Panel();
this.floorLight = new System.Windows.Forms.Label();
@ -65,6 +66,7 @@ namespace CodeImp.DoomBuilder.Controls
this.floorAngle = new System.Windows.Forms.Label();
this.floorname = new System.Windows.Forms.Label();
this.floortex = new System.Windows.Forms.Panel();
this.labelFloorTextureSize = new System.Windows.Forms.Label();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
label13 = new System.Windows.Forms.Label();
label5 = new System.Windows.Forms.Label();
@ -75,8 +77,10 @@ namespace CodeImp.DoomBuilder.Controls
this.sectorinfo.SuspendLayout();
this.ceilingpanel.SuspendLayout();
this.ceilingInfo.SuspendLayout();
this.ceilingtex.SuspendLayout();
this.floorpanel.SuspendLayout();
this.floorInfo.SuspendLayout();
this.floortex.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
@ -351,11 +355,25 @@ namespace CodeImp.DoomBuilder.Controls
this.ceilingtex.BackColor = System.Drawing.SystemColors.AppWorkspace;
this.ceilingtex.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.ceilingtex.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.ceilingtex.Controls.Add(this.labelCeilTextureSize);
this.ceilingtex.Location = new System.Drawing.Point(8, 19);
this.ceilingtex.Name = "ceilingtex";
this.ceilingtex.Size = new System.Drawing.Size(68, 60);
this.ceilingtex.TabIndex = 0;
//
// labelCeilTextureSize
//
this.labelCeilTextureSize.AutoSize = true;
this.labelCeilTextureSize.BackColor = System.Drawing.Color.Black;
this.labelCeilTextureSize.Font = new System.Drawing.Font("Arial", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelCeilTextureSize.ForeColor = System.Drawing.Color.White;
this.labelCeilTextureSize.Location = new System.Drawing.Point(3, 1);
this.labelCeilTextureSize.MaximumSize = new System.Drawing.Size(0, 13);
this.labelCeilTextureSize.Name = "labelCeilTextureSize";
this.labelCeilTextureSize.Size = new System.Drawing.Size(48, 13);
this.labelCeilTextureSize.TabIndex = 1;
this.labelCeilTextureSize.Text = "128x128";
//
// floorpanel
//
this.floorpanel.Controls.Add(this.floorInfo);
@ -430,11 +448,25 @@ namespace CodeImp.DoomBuilder.Controls
this.floortex.BackColor = System.Drawing.SystemColors.AppWorkspace;
this.floortex.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.floortex.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.floortex.Controls.Add(this.labelFloorTextureSize);
this.floortex.Location = new System.Drawing.Point(8, 19);
this.floortex.Name = "floortex";
this.floortex.Size = new System.Drawing.Size(68, 60);
this.floortex.TabIndex = 0;
//
// labelFloorTextureSize
//
this.labelFloorTextureSize.AutoSize = true;
this.labelFloorTextureSize.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
this.labelFloorTextureSize.Font = new System.Drawing.Font("Arial", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelFloorTextureSize.ForeColor = System.Drawing.Color.White;
this.labelFloorTextureSize.Location = new System.Drawing.Point(3, 1);
this.labelFloorTextureSize.MaximumSize = new System.Drawing.Size(0, 13);
this.labelFloorTextureSize.Name = "labelFloorTextureSize";
this.labelFloorTextureSize.Size = new System.Drawing.Size(48, 13);
this.labelFloorTextureSize.TabIndex = 0;
this.labelFloorTextureSize.Text = "128x128";
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Controls.Add(this.sectorinfo);
@ -461,8 +493,12 @@ namespace CodeImp.DoomBuilder.Controls
this.sectorinfo.PerformLayout();
this.ceilingpanel.ResumeLayout(false);
this.ceilingInfo.ResumeLayout(false);
this.ceilingtex.ResumeLayout(false);
this.ceilingtex.PerformLayout();
this.floorpanel.ResumeLayout(false);
this.floorInfo.ResumeLayout(false);
this.floortex.ResumeLayout(false);
this.floortex.PerformLayout();
this.flowLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
@ -502,5 +538,7 @@ namespace CodeImp.DoomBuilder.Controls
private System.Windows.Forms.Label floorLightLabel;
private System.Windows.Forms.Label floorAngleLabel;
private System.Windows.Forms.Label floorScaleLabel;
private System.Windows.Forms.Label labelCeilTextureSize;
private System.Windows.Forms.Label labelFloorTextureSize;
}
}

View file

@ -19,6 +19,7 @@
using System;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Data;
#endregion
@ -61,8 +62,15 @@ namespace CodeImp.DoomBuilder.Controls
brightness.Text = s.Brightness.ToString();
floorname.Text = s.FloorTexture;
ceilingname.Text = s.CeilTexture;
General.DisplayZoomedImage(floortex, General.Map.Data.GetFlatImage(s.FloorTexture).GetPreview());
General.DisplayZoomedImage(ceilingtex, General.Map.Data.GetFlatImage(s.CeilTexture).GetPreview());
ImageData floorImage = General.Map.Data.GetFlatImage(s.FloorTexture); //mxd
ImageData ceilingImage = General.Map.Data.GetFlatImage(s.CeilTexture); //mxd
DisplayTextureSize(labelFloorTextureSize, floorImage); //mxd
DisplayTextureSize(labelCeilTextureSize, ceilingImage); //mxd
General.DisplayZoomedImage(floortex, floorImage.GetPreview());
General.DisplayZoomedImage(ceilingtex, ceilingImage.GetPreview());
//mxd
bool showExtededFloorInfo = false;
@ -212,6 +220,15 @@ namespace CodeImp.DoomBuilder.Controls
this.Update();
}
protected void DisplayTextureSize(Label label, ImageData texture) {
if(texture.ImageState == ImageLoadState.Ready) {
label.Visible = true;
label.Text = texture.Width + "x" + texture.Height;
} else {
label.Visible = false;
}
}
// When visible changed
protected override void OnVisibleChanged(EventArgs e)
{

View file

@ -18,6 +18,7 @@
using System.Drawing;
using CodeImp.DoomBuilder.Windows;
using CodeImp.DoomBuilder.Data;
#endregion
@ -47,6 +48,8 @@ namespace CodeImp.DoomBuilder.Controls
// Check if name is a "none" texture
if((imagename.Length < 1) || (imagename[0] == '-'))
{
DisplayImageSize(-1, -1); //mxd
// Determine image to show
if(required)
return CodeImp.DoomBuilder.Properties.Resources.MissingTexture;
@ -55,8 +58,13 @@ namespace CodeImp.DoomBuilder.Controls
}
else
{
//mxd
ImageData texture = General.Map.Data.GetTextureImage(imagename);
if(texture.ImageState == ImageLoadState.Ready) DisplayImageSize(texture.Width, texture.Height);
else DisplayImageSize(-1, -1);
// Set the image
return General.Map.Data.GetTextureImage(imagename).GetPreview();
return texture.GetPreview();
}
}