Linedef edit form, UDMF: front sidedef's Fields button was not shown.

Visual mode: fixed a crash after disabling GZDoom rendering effects (Tab key) when visual sector was not created for sector with 3d floor's control linedef.
This commit is contained in:
MaxED 2013-06-19 11:18:13 +00:00
parent 962ea2b80e
commit 16cc4d8a8d
6 changed files with 22 additions and 28 deletions

View file

@ -79,19 +79,6 @@ namespace CodeImp.DoomBuilder.Controls
// Initialize // Initialize
InitializeComponent(); InitializeComponent();
items = new List<ImageBrowserItem>(); items = new List<ImageBrowserItem>();
//mxd
if(General.Map.Config.MixTexturesFlats) {
cbMixMode.SelectedIndex = mixMode;
} else {
labelMixMode.Visible = false;
cbMixMode.Visible = false;
label.Left = labelMixMode.Left;
objectname.Left = label.Right + label.Margin.Right + objectname.Margin.Left;
texturesizelabel.Left = objectname.Right + objectname.Margin.Right;
texturesize.Left = texturesizelabel.Right + texturesizelabel.Margin.Right;
mixMode = 0;
}
} }
// This applies the application settings // This applies the application settings
@ -111,6 +98,19 @@ namespace CodeImp.DoomBuilder.Controls
int itemheight = General.Map.Data.Previews.MaxImageHeight + 26; int itemheight = General.Map.Data.Previews.MaxImageHeight + 26;
if(General.Settings.ShowTextureSizes) itemheight += 12; if(General.Settings.ShowTextureSizes) itemheight += 12;
list.TileSize = new Size(itemwidth, itemheight); list.TileSize = new Size(itemwidth, itemheight);
//mxd
if(General.Map.Config.MixTexturesFlats) {
cbMixMode.SelectedIndex = mixMode;
} else {
labelMixMode.Visible = false;
cbMixMode.Visible = false;
label.Left = labelMixMode.Left;
objectname.Left = label.Right + label.Margin.Right + objectname.Margin.Left;
texturesizelabel.Left = objectname.Right + objectname.Margin.Right;
texturesize.Left = texturesizelabel.Right + texturesizelabel.Margin.Right;
mixMode = 0;
}
} }
} }

View file

@ -72,6 +72,10 @@ namespace CodeImp.DoomBuilder.Controls
// This checks if a redraw is needed // This checks if a redraw is needed
public bool CheckRedrawNeeded() public bool CheckRedrawNeeded()
{ {
//mxd. Update texture size if needed
if(General.Settings.ShowTextureSizes && imageloaded != icon.IsPreviewLoaded)
displaytext = Text + "\n" + icon.ScaledWidth + " x " + icon.ScaledHeight;
return (icon.IsPreviewLoaded != imageloaded); return (icon.IsPreviewLoaded != imageloaded);
} }
@ -81,10 +85,6 @@ namespace CodeImp.DoomBuilder.Controls
Brush forecolor; Brush forecolor;
Brush backcolor; Brush backcolor;
//mxd. Update texture size if needed
if(General.Settings.ShowTextureSizes && imageloaded != icon.IsPreviewLoaded)
displaytext = Text + "\n" + icon.ScaledWidth + " x " + icon.ScaledHeight;
// Remember if the preview is loaded // Remember if the preview is loaded
imageloaded = icon.IsPreviewLoaded; imageloaded = icon.IsPreviewLoaded;

View file

@ -943,7 +943,10 @@ namespace CodeImp.DoomBuilder.VisualModes
/// <summary> /// <summary>
/// This returns the VisualSector for the given Sector. /// This returns the VisualSector for the given Sector.
/// </summary> /// </summary>
public VisualSector GetVisualSector(Sector s) { return allsectors[s]; } public VisualSector GetVisualSector(Sector s) {
if(!allsectors.ContainsKey(s)) return null; //mxd
return allsectors[s];
}
/// <summary> /// <summary>
/// This returns the VisualThing for the given Thing. /// This returns the VisualThing for the given Thing.

View file

@ -863,7 +863,6 @@ namespace CodeImp.DoomBuilder.Windows
this.customfrontbutton.TabIndex = 3; this.customfrontbutton.TabIndex = 3;
this.customfrontbutton.Text = "Custom fields..."; this.customfrontbutton.Text = "Custom fields...";
this.customfrontbutton.UseVisualStyleBackColor = true; this.customfrontbutton.UseVisualStyleBackColor = true;
this.customfrontbutton.Visible = false;
this.customfrontbutton.Click += new System.EventHandler(this.customfrontbutton_Click); this.customfrontbutton.Click += new System.EventHandler(this.customfrontbutton_Click);
// //
// frontlow // frontlow
@ -1194,7 +1193,6 @@ namespace CodeImp.DoomBuilder.Windows
this.custombackbutton.TabIndex = 3; this.custombackbutton.TabIndex = 3;
this.custombackbutton.Text = "Custom fields..."; this.custombackbutton.Text = "Custom fields...";
this.custombackbutton.UseVisualStyleBackColor = true; this.custombackbutton.UseVisualStyleBackColor = true;
this.custombackbutton.Visible = false;
this.custombackbutton.Click += new System.EventHandler(this.custombackbutton_Click); this.custombackbutton.Click += new System.EventHandler(this.custombackbutton_Click);
// //
// backlow // backlow

View file

@ -121,20 +121,15 @@ namespace CodeImp.DoomBuilder.Windows
fsAlpha.SetLimits(0f, 1f); fsAlpha.SetLimits(0f, 1f);
} else { } else {
tabs.TabPages.Remove(tabcustom); tabs.TabPages.Remove(tabcustom);
settingsGroup.Visible = false; settingsGroup.Visible = false;
customfrontbutton.Visible = false; customfrontbutton.Visible = false;
custombackbutton.Visible = false; custombackbutton.Visible = false;
labelLightFront.Visible = false; labelLightFront.Visible = false;
lightFront.Visible = false; lightFront.Visible = false;
cbLightAbsoluteFront.Visible = false; cbLightAbsoluteFront.Visible = false;
labelLightBack.Visible = false; labelLightBack.Visible = false;
lightBack.Visible = false; lightBack.Visible = false;
cbLightAbsoluteBack.Visible = false; cbLightAbsoluteBack.Visible = false;
udmfPropertiesFront.Visible = false; udmfPropertiesFront.Visible = false;
udmfPropertiesBack.Visible = false; udmfPropertiesBack.Visible = false;
} }
@ -423,8 +418,6 @@ namespace CodeImp.DoomBuilder.Windows
if (backoffsetx.Text != l.Back.OffsetX.ToString()) backoffsetx.Text = ""; if (backoffsetx.Text != l.Back.OffsetX.ToString()) backoffsetx.Text = "";
if (backoffsety.Text != l.Back.OffsetY.ToString()) backoffsety.Text = ""; if (backoffsety.Text != l.Back.OffsetY.ToString()) backoffsety.Text = "";
if(General.Map.FormatInterface.HasCustomFields) custombackbutton.Visible = true;
} }
// Custom fields // Custom fields

View file

@ -184,7 +184,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{ {
//mxd //mxd
BaseVisualSector vs = (BaseVisualSector)mode.GetVisualSector(s.Key); BaseVisualSector vs = (BaseVisualSector)mode.GetVisualSector(s.Key);
if(vs.Changed) continue; if(vs == null || vs.Changed) continue;
SectorData sd = mode.GetSectorData(s.Key); SectorData sd = mode.GetSectorData(s.Key);
sd.Reset(); sd.Reset();