Fixed, Texture Browser form: we should not save "Long texture names" value when Map.Config.UseLongTextureNames is disabled.

Fixed, Linedef Edit form (UDMF): fixed a crash on opening the form when "linedefrenderstyles" block was missing from game configuration.
This commit is contained in:
MaxED 2014-12-04 07:50:01 +00:00
parent 0ab9f07087
commit 1e421bda7e
2 changed files with 5 additions and 11 deletions

View file

@ -237,16 +237,10 @@ namespace CodeImp.DoomBuilder.Windows
frontUdmfControls = new List<PairedFieldsControl> { pfcFrontOffsetTop, pfcFrontOffsetMid, pfcFrontOffsetBottom, pfcFrontScaleTop, pfcFrontScaleMid, pfcFrontScaleBottom };
backUdmfControls = new List<PairedFieldsControl> { pfcBackOffsetTop, pfcBackOffsetMid, pfcBackOffsetBottom, pfcBackScaleTop, pfcBackScaleMid, pfcBackScaleBottom };
// Store renderstyle keys?
if(General.Map.Config.LinedefRenderStyles.Count > 0)
{
renderstyles = new string[General.Map.Config.LinedefRenderStyles.Count];
General.Map.Config.LinedefRenderStyles.Keys.CopyTo(renderstyles, 0);
}
else
{
renderStyle.Enabled = false;
}
// Setup renderstyles
renderstyles = new string[General.Map.Config.LinedefRenderStyles.Count];
General.Map.Config.LinedefRenderStyles.Keys.CopyTo(renderstyles, 0);
renderStyle.Enabled = (General.Map.Config.LinedefRenderStyles.Count > 0);
// Fill renderstyles
foreach(KeyValuePair<string, string> lf in General.Map.Config.LinedefRenderStyles)

View file

@ -447,7 +447,7 @@ namespace CodeImp.DoomBuilder.Windows
//mxd. Save ImageBrowserControl settings
General.Settings.WriteSetting("browserwindow.showtexturesizes", ImageBrowserControl.ShowTextureSizes);
General.Settings.WriteSetting("browserwindow.uselongtexturenames", ImageBrowserControl.UseLongTextureNames);
if(General.Map.Config.UseLongTextureNames) General.Settings.WriteSetting("browserwindow.uselongtexturenames", ImageBrowserControl.UseLongTextureNames);
// Clean up
browser.CleanUp();