mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-17 01:22:18 +00:00
Some fixes to sector brightness/heights override logic added in previous commit.
This commit is contained in:
parent
e8f52aecb9
commit
52985db127
3 changed files with 36 additions and 23 deletions
|
@ -113,6 +113,9 @@ namespace CodeImp.DoomBuilder.Config
|
|||
private int maxRecentFiles;
|
||||
|
||||
// These are not stored in the configuration, only used at runtime
|
||||
private int defaultbrightness;
|
||||
private int defaultfloorheight;
|
||||
private int defaultceilheight;
|
||||
private int defaultthingtype = 1;
|
||||
private float defaultthingangle;
|
||||
private List<string> defaultthingflags;
|
||||
|
@ -195,9 +198,9 @@ namespace CodeImp.DoomBuilder.Config
|
|||
public string DefaultTexture { get { return General.Map != null ? General.Map.Options.DefaultWallTexture : "-"; } set { if(General.Map != null) General.Map.Options.DefaultWallTexture = value; } }
|
||||
public string DefaultFloorTexture { get { return General.Map != null ? General.Map.Options.DefaultFloorTexture : "-"; } set { if(General.Map != null) General.Map.Options.DefaultFloorTexture = value; } }
|
||||
public string DefaultCeilingTexture { get { return General.Map != null ? General.Map.Options.DefaultCeilingTexture : "-"; } set { if(General.Map != null) General.Map.Options.DefaultCeilingTexture = value; } }
|
||||
public int DefaultBrightness { get { return General.Map != null ? General.Map.Options.DefaultBrightness : 196; } set { if(General.Map != null) General.Map.Options.DefaultBrightness = value; } }
|
||||
public int DefaultFloorHeight { get { return General.Map != null ? General.Map.Options.DefaultFloorHeight : 0; } set { if(General.Map != null) General.Map.Options.DefaultFloorHeight = value; } }
|
||||
public int DefaultCeilingHeight { get { return General.Map != null ? General.Map.Options.DefaultCeilingHeight : 128; } set { if(General.Map != null) General.Map.Options.DefaultCeilingHeight = value; } }
|
||||
public int DefaultBrightness { get { return defaultbrightness; } set { defaultbrightness = value; } }
|
||||
public int DefaultFloorHeight { get { return defaultfloorheight; } set { defaultfloorheight = value; } }
|
||||
public int DefaultCeilingHeight { get { return defaultceilheight; } set { defaultceilheight = value; } }
|
||||
|
||||
public int DefaultThingType { get { return defaultthingtype; } set { defaultthingtype = value; } }
|
||||
public float DefaultThingAngle { get { return defaultthingangle; } set { defaultthingangle = value; } }
|
||||
|
@ -293,6 +296,11 @@ namespace CodeImp.DoomBuilder.Config
|
|||
lastUsedConfigName = cfg.ReadSetting("lastusedconfigname", "");
|
||||
gzMarkExtraFloors = cfg.ReadSetting("gzmarkextrafloors", true);
|
||||
maxRecentFiles = cfg.ReadSetting("maxrecentfiles", 8);
|
||||
|
||||
//mxd. Sector defaults
|
||||
defaultceilheight = cfg.ReadSetting("defaultceilheight", 128);
|
||||
defaultfloorheight = cfg.ReadSetting("defaultfloorheight", 0);
|
||||
defaultbrightness = cfg.ReadSetting("defaultbrightness", 192);
|
||||
|
||||
// Success
|
||||
return true;
|
||||
|
@ -374,6 +382,11 @@ namespace CodeImp.DoomBuilder.Config
|
|||
if(!string.IsNullOrEmpty(lastUsedConfigName))
|
||||
cfg.WriteSetting("lastusedconfigname", lastUsedConfigName);
|
||||
cfg.WriteSetting("maxrecentfiles", maxRecentFiles);
|
||||
|
||||
//mxd. Sector defaults
|
||||
cfg.WriteSetting("defaultceilheight", defaultceilheight);
|
||||
cfg.WriteSetting("defaultfloorheight", defaultfloorheight);
|
||||
cfg.WriteSetting("defaultbrightness", defaultbrightness);
|
||||
|
||||
// Save settings configuration
|
||||
General.WriteLogLine("Saving program configuration...");
|
||||
|
|
|
@ -531,9 +531,9 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
if(useOverrides) {
|
||||
if (General.Map.Options.OverrideCeilingTexture) newsector.SetCeilTexture(General.Map.Options.DefaultCeilingTexture);
|
||||
if (General.Map.Options.OverrideFloorTexture) newsector.SetFloorTexture(General.Map.Options.DefaultFloorTexture);
|
||||
if (General.Map.Options.OverrideCeilingHeight) newsector.CeilHeight = General.Map.Options.DefaultCeilingHeight;
|
||||
if (General.Map.Options.OverrideFloorHeight) newsector.FloorHeight = General.Map.Options.DefaultFloorHeight;
|
||||
if (General.Map.Options.OverrideBrightness) newsector.Brightness = General.Map.Options.DefaultBrightness;
|
||||
if (General.Map.Options.OverrideCeilingHeight) newsector.CeilHeight = General.Map.Options.CustomCeilingHeight;
|
||||
if (General.Map.Options.OverrideFloorHeight) newsector.FloorHeight = General.Map.Options.CustomFloorHeight;
|
||||
if (General.Map.Options.OverrideBrightness) newsector.Brightness = General.Map.Options.CustomBrightness;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -717,9 +717,9 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
{
|
||||
s.SetFloorTexture(General.Map.Options.DefaultFloorTexture);
|
||||
s.SetCeilTexture(General.Map.Options.DefaultCeilingTexture);
|
||||
s.FloorHeight = General.Map.Options.DefaultFloorHeight;
|
||||
s.CeilHeight = General.Map.Options.DefaultCeilingHeight;
|
||||
s.Brightness = General.Map.Options.DefaultBrightness;
|
||||
s.FloorHeight = (General.Map.Options.OverrideFloorHeight ? General.Map.Options.CustomFloorHeight : General.Settings.DefaultFloorHeight);
|
||||
s.CeilHeight = (General.Map.Options.OverrideCeilingHeight ? General.Map.Options.CustomCeilingHeight : General.Settings.DefaultCeilingHeight);
|
||||
s.Brightness = (General.Map.Options.OverrideBrightness ? General.Map.Options.CustomBrightness : General.Settings.DefaultBrightness);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -61,9 +61,9 @@ namespace CodeImp.DoomBuilder.Map
|
|||
private string defaultfloortexture;
|
||||
private string defaultceiltexture;
|
||||
private string defaultwalltexture;
|
||||
private int defaultbrightness;
|
||||
private int defaultfloorheight;
|
||||
private int defaultceilheight;
|
||||
private int custombrightness;
|
||||
private int customfloorheight;
|
||||
private int customceilheight;
|
||||
|
||||
//mxd. Sector drawing overrides
|
||||
private bool overridefloortexture;
|
||||
|
@ -105,9 +105,9 @@ namespace CodeImp.DoomBuilder.Map
|
|||
public string DefaultWallTexture { get { return defaultwalltexture; } set { defaultwalltexture = value; } }
|
||||
public string DefaultFloorTexture { get { return defaultfloortexture; } set { defaultfloortexture = value; } }
|
||||
public string DefaultCeilingTexture { get { return defaultceiltexture; } set { defaultceiltexture = value; } }
|
||||
public int DefaultBrightness { get { return defaultbrightness; } set { defaultbrightness = value; } }
|
||||
public int DefaultFloorHeight { get { return defaultfloorheight; } set { defaultfloorheight = value; } }
|
||||
public int DefaultCeilingHeight { get { return defaultceilheight; } set { defaultceilheight = value; } }
|
||||
public int CustomBrightness { get { return custombrightness; } set { custombrightness = value; } }
|
||||
public int CustomFloorHeight { get { return customfloorheight; } set { customfloorheight = value; } }
|
||||
public int CustomCeilingHeight { get { return customceilheight; } set { customceilheight = value; } }
|
||||
|
||||
//mxd. Sector drawing overrides
|
||||
public bool OverrideFloorTexture { get { return overridefloortexture; } set { overridefloortexture = value; } }
|
||||
|
@ -135,8 +135,8 @@ namespace CodeImp.DoomBuilder.Map
|
|||
this.tagLabels = new Dictionary<int, string>(); //mxd
|
||||
|
||||
//mxd. Sector drawing options
|
||||
this.defaultbrightness = 196;
|
||||
this.defaultceilheight = 128;
|
||||
this.custombrightness = 196;
|
||||
this.customceilheight = 128;
|
||||
}
|
||||
|
||||
// Constructor to load from Doom Builder Map Settings Configuration
|
||||
|
@ -178,9 +178,9 @@ namespace CodeImp.DoomBuilder.Map
|
|||
defaultfloortexture = this.mapconfig.ReadSetting("defaultfloortexture", string.Empty);
|
||||
defaultceiltexture = this.mapconfig.ReadSetting("defaultceiltexture", string.Empty);
|
||||
defaultwalltexture = this.mapconfig.ReadSetting("defaultwalltexture", string.Empty);
|
||||
defaultbrightness = General.Clamp(this.mapconfig.ReadSetting("defaultbrightness", 196), 0, 255);
|
||||
defaultfloorheight = this.mapconfig.ReadSetting("defaultfloorheight", 0);
|
||||
defaultceilheight = this.mapconfig.ReadSetting("defaultceilheight", 128);
|
||||
custombrightness = General.Clamp(this.mapconfig.ReadSetting("custombrightness", 196), 0, 255);
|
||||
customfloorheight = this.mapconfig.ReadSetting("customfloorheight", 0);
|
||||
customceilheight = this.mapconfig.ReadSetting("customceilheight", 128);
|
||||
|
||||
//mxd. Read Sector drawing overrides
|
||||
overridefloortexture = this.mapconfig.ReadSetting("overridefloortexture", false);
|
||||
|
@ -290,9 +290,9 @@ namespace CodeImp.DoomBuilder.Map
|
|||
mapconfig.WriteSetting("defaultfloortexture", defaultfloortexture);
|
||||
mapconfig.WriteSetting("defaultceiltexture", defaultceiltexture);
|
||||
mapconfig.WriteSetting("defaultwalltexture", defaultwalltexture);
|
||||
mapconfig.WriteSetting("defaultbrightness", defaultbrightness);
|
||||
mapconfig.WriteSetting("defaultfloorheight", defaultfloorheight);
|
||||
mapconfig.WriteSetting("defaultceilheight", defaultceilheight);
|
||||
mapconfig.WriteSetting("custombrightness", custombrightness);
|
||||
mapconfig.WriteSetting("customfloorheight", customfloorheight);
|
||||
mapconfig.WriteSetting("customceilheight", customceilheight);
|
||||
|
||||
//mxd. Write Sector drawing overrides
|
||||
mapconfig.WriteSetting("overridefloortexture", overridefloortexture);
|
||||
|
|
Loading…
Reference in a new issue