Added Preferences -> Appearance -> "Things transparency" slider. It controls Things transparency in all classic modes except Things mode.

Added Preferences -> Appearance -> "Hidden Things transparency" slider. It controls transparency of Things hidden by Things filter in Things mode, of all things :)
This commit is contained in:
MaxED 2016-03-30 11:29:39 +00:00 committed by spherallic
parent 9972816a3e
commit d09000dc71
19 changed files with 2667 additions and 2544 deletions

View file

@ -50,6 +50,8 @@ namespace CodeImp.DoomBuilder.Config
private float visualmousesensy;
private int imagebrightness;
private float doublesidedalpha;
private float inactivethingsalpha; //mxd
private float hiddenthingsalpha; //mxd
private byte doublesidedalphabyte;
private int nightscircleprecision;
private float backgroundalpha;
@ -161,7 +163,9 @@ namespace CodeImp.DoomBuilder.Config
public int ImageBrightness { get { return imagebrightness; } internal set { imagebrightness = value; } }
public float DoubleSidedAlpha { get { return doublesidedalpha; } internal set { doublesidedalpha = value; doublesidedalphabyte = (byte)(doublesidedalpha * 255f); } }
public byte DoubleSidedAlphaByte { get { return doublesidedalphabyte; } }
public int NiGHTSCirclePrecision { get { return nightscircleprecision; } internal set { nightscircleprecision = value; } }
public int NiGHTSCirclePrecision { get { return nightscircleprecision; } internal set { nightscircleprecision = value; } }
public float InactiveThingsAlpha { get { return inactivethingsalpha; } internal set { inactivethingsalpha = value; } } //mxd
public float HiddenThingsAlpha { get { return hiddenthingsalpha; } internal set { hiddenthingsalpha = value; } } //mxd
public float BackgroundAlpha { get { return backgroundalpha; } internal set { backgroundalpha = value; } }
public float VisualMouseSensX { get { return visualmousesensx; } internal set { visualmousesensx = value; } }
public float VisualMouseSensY { get { return visualmousesensy; } internal set { visualmousesensy = value; } }
@ -299,7 +303,9 @@ namespace CodeImp.DoomBuilder.Config
doublesidedalpha = cfg.ReadSetting("doublesidedalpha", 0.4f);
doublesidedalphabyte = (byte)(doublesidedalpha * 255f);
nightscircleprecision = cfg.ReadSetting("nightscircleprecision", 360);
backgroundalpha = cfg.ReadSetting("backgroundalpha", 1.0f);
inactivethingsalpha = cfg.ReadSetting("inactivethingsalpha", Presentation.THINGS_BACK_ALPHA); //mxd
hiddenthingsalpha = cfg.ReadSetting("hiddenthingsalpha", Presentation.THINGS_HIDDEN_ALPHA); //mxd
backgroundalpha = cfg.ReadSetting("backgroundalpha", 1.0f);
qualitydisplay = cfg.ReadSetting("qualitydisplay", true);
testmonsters = cfg.ReadSetting("testmonsters", true);
defaultviewmode = cfg.ReadSetting("defaultviewmode", (int)ViewMode.Normal);
@ -415,7 +421,9 @@ namespace CodeImp.DoomBuilder.Config
cfg.WriteSetting("testmonsters", testmonsters);
cfg.WriteSetting("doublesidedalpha", doublesidedalpha);
cfg.WriteSetting("nightscircleprecision", nightscircleprecision);
cfg.WriteSetting("backgroundalpha", backgroundalpha);
cfg.WriteSetting("inactivethingsalpha", inactivethingsalpha); //mxd
cfg.WriteSetting("hiddenthingsalpha", hiddenthingsalpha); //mxd
cfg.WriteSetting("backgroundalpha", backgroundalpha);
cfg.WriteSetting("defaultviewmode", defaultviewmode);
cfg.WriteSetting("classicbilinear", classicbilinear);
cfg.WriteSetting("visualbilinear", visualbilinear);

View file

@ -63,7 +63,7 @@ namespace CodeImp.DoomBuilder.Rendering
standard = new Presentation();
standard.layers.Add(new PresentLayer(RendererLayer.Background, BlendingMode.Mask, General.Settings.BackgroundAlpha));
standard.layers.Add(new PresentLayer(RendererLayer.Surface, BlendingMode.Mask));
standard.layers.Add(new PresentLayer(RendererLayer.Things, BlendingMode.Alpha, THINGS_BACK_ALPHA));
standard.layers.Add(new PresentLayer(RendererLayer.Things, BlendingMode.Alpha, General.Settings.InactiveThingsAlpha));
standard.layers.Add(new PresentLayer(RendererLayer.Grid, BlendingMode.Mask));
standard.layers.Add(new PresentLayer(RendererLayer.Geometry, BlendingMode.Alpha, 1f, true));
standard.layers.Add(new PresentLayer(RendererLayer.Overlay, BlendingMode.Alpha, 1f, true));

File diff suppressed because it is too large Load diff

View file

@ -64,7 +64,9 @@ namespace CodeImp.DoomBuilder.Windows
imagebrightness.Value = General.Settings.ImageBrightness;
doublesidedalpha.Value = General.Clamp((int)((1.0f - General.Settings.DoubleSidedAlpha) * 10.0f), doublesidedalpha.Minimum, doublesidedalpha.Maximum);
nightscircleprecision.Value = General.Clamp((int)(General.Settings.NiGHTSCirclePrecision)/10, nightscircleprecision.Minimum, nightscircleprecision.Maximum);
defaultviewmode.SelectedIndex = General.Settings.DefaultViewMode;
inactivethingsalpha.Value = General.Clamp((int)((1.0f - General.Settings.InactiveThingsAlpha) * 10.0f), inactivethingsalpha.Minimum, inactivethingsalpha.Maximum); //mxd
hiddenthingsalpha.Value = General.Clamp((int)((1.0f - General.Settings.HiddenThingsAlpha) * 10.0f), hiddenthingsalpha.Minimum, hiddenthingsalpha.Maximum); //mxd
defaultviewmode.SelectedIndex = General.Settings.DefaultViewMode;
fieldofview.Value = General.Clamp(General.Settings.VisualFOV / 10, fieldofview.Minimum, fieldofview.Maximum);
mousespeed.Value = General.Clamp(General.Settings.MouseSpeed / 100, mousespeed.Minimum, mousespeed.Maximum);
movespeed.Value = General.Clamp(General.Settings.MoveSpeed / 100, movespeed.Minimum, movespeed.Maximum);
@ -276,7 +278,9 @@ namespace CodeImp.DoomBuilder.Windows
General.Settings.ImageBrightness = imagebrightness.Value;
General.Settings.DoubleSidedAlpha = 1.0f - (doublesidedalpha.Value * 0.1f);
General.Settings.NiGHTSCirclePrecision = nightscircleprecision.Value * 10;
General.Settings.DefaultViewMode = defaultviewmode.SelectedIndex;
General.Settings.InactiveThingsAlpha = 1.0f - (inactivethingsalpha.Value * 0.1f); //mxd
General.Settings.HiddenThingsAlpha = 1.0f - (hiddenthingsalpha.Value * 0.1f); //mxd
General.Settings.DefaultViewMode = defaultviewmode.SelectedIndex;
General.Settings.VisualFOV = fieldofview.Value * 10;
General.Settings.MouseSpeed = mousespeed.Value * 100;
General.Settings.MoveSpeed = movespeed.Value * 100;
@ -970,8 +974,22 @@ namespace CodeImp.DoomBuilder.Windows
nightscircleprecisionlabel.Text = value.ToString();
}
//mxd
private void tbDynLightCount_ValueChanged(object sender, EventArgs e)
//mxd
private void inactivethingsalpha_ValueChanged(object sender, EventArgs e)
{
int percent = inactivethingsalpha.Value * 10;
inactivethingsalphalabel.Text = percent + "%";
}
//mxd
private void hiddenthingsalpha_ValueChanged(object sender, EventArgs e)
{
int percent = hiddenthingsalpha.Value * 10;
hiddenthingsalphalabel.Text = percent + "%";
}
//mxd
private void tbDynLightCount_ValueChanged(object sender, EventArgs e)
{
labelDynLightCount.Text = tbDynLightCount.Value.ToString();
}
@ -1247,7 +1265,12 @@ namespace CodeImp.DoomBuilder.Windows
}
}
/*
private void label30_Click(object sender, EventArgs e)
{
}
/*
// This writes all action help files using a template and some basic info from the actions.
// Also writes actioncontents.txt with all files to be inserted into Contents.hhc.
// Only used during development. Actual button to call this has been removed.
@ -1279,5 +1302,5 @@ namespace CodeImp.DoomBuilder.Windows
File.WriteAllText(filename, contents.ToString());
}
*/
}
}
}

View file

@ -147,6 +147,12 @@
<metadata name="label29.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="label31.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="label30.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<data name="scriptallmanstyle.ToolTip" xml:space="preserve">
<value>When enabled, the opening brace
will be placed on a new line when

View file

@ -160,7 +160,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
//mxd. Render things
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha);
renderer.RenderThingSet(unselectedthings, Presentation.THINGS_ALPHA);
renderer.RenderThingSet(selectedthings, Presentation.THINGS_ALPHA);
renderer.RenderNiGHTSPath();

View file

@ -180,7 +180,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
//mxd. Render things
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha);
renderer.RenderThingSet(unselectedthings, Presentation.THINGS_ALPHA);
renderer.RenderThingSet(selectedthings, Presentation.THINGS_ALPHA);
renderer.RenderNiGHTSPath();

View file

@ -313,7 +313,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(renderer.StartThings(true))
{
// Render things
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha);
renderer.RenderThingSet(unselectedthings, Presentation.THINGS_ALPHA);
renderer.RenderThingSet(selectedthings, Presentation.THINGS_ALPHA);
renderer.RenderNiGHTSPath();

View file

@ -148,7 +148,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
//mxd. Render things
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha);
renderer.RenderThingSet(unselectedthings, Presentation.THINGS_ALPHA);
renderer.RenderThingSet(selectedthings, Presentation.THINGS_ALPHA);
renderer.RenderNiGHTSPath();

View file

@ -1571,8 +1571,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Render things
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, Presentation.THINGS_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, General.Settings.InactiveThingsAlpha);
if(highlighted is Thing) renderer.RenderThing((Thing)highlighted, General.Colors.Highlight, Presentation.THINGS_ALPHA);
renderer.RenderNiGHTSPath();
renderer.Finish();

View file

@ -875,8 +875,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Render things
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, Presentation.THINGS_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, General.Settings.InactiveThingsAlpha);
renderer.RenderNiGHTSPath();
renderer.Finish();
}

View file

@ -510,8 +510,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Render things
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, Presentation.THINGS_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, General.Settings.InactiveThingsAlpha);
renderer.RenderNiGHTSPath();
renderer.Finish();
}

View file

@ -308,7 +308,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
p.AddLayer(new PresentLayer(RendererLayer.Surface, BlendingMode.Mask));
p.AddLayer(new PresentLayer(RendererLayer.Grid, BlendingMode.Mask));
p.AddLayer(new PresentLayer(RendererLayer.Overlay, BlendingMode.Alpha, 1f, true));
p.AddLayer(new PresentLayer(RendererLayer.Things, BlendingMode.Alpha, Presentation.THINGS_BACK_ALPHA, false));
p.AddLayer(new PresentLayer(RendererLayer.Things, BlendingMode.Alpha, General.Settings.InactiveThingsAlpha, false));
p.AddLayer(new PresentLayer(RendererLayer.Geometry, BlendingMode.Alpha, 1f, true));
renderer.SetPresentation(p);
General.Map.Map.SelectionType = SelectionType.All;
@ -344,8 +344,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Render things
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, Presentation.THINGS_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, General.Settings.InactiveThingsAlpha);
renderer.RenderNiGHTSPath();
renderer.Finish();
}

View file

@ -763,8 +763,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Render things
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, Presentation.THINGS_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, General.Settings.InactiveThingsAlpha);
renderer.RenderNiGHTSPath();
renderer.Finish();
}

View file

@ -203,8 +203,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Render things
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, Presentation.THINGS_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, General.Settings.InactiveThingsAlpha);
renderer.RenderNiGHTSPath();
for (int i = 0; i < Thing.NUM_ARGS; i++) BuilderPlug.RenderAssociations(renderer, association[i], eventlines);

View file

@ -167,8 +167,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Render things
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, Presentation.THINGS_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, General.Settings.InactiveThingsAlpha);
renderer.RenderNiGHTSPath();
renderer.Finish();
}
@ -831,8 +831,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// This creates a new vertex at the mouse position
[BeginAction("insertitem", BaseAction = true)]
public void InsertVertexAction() { VerticesMode.InsertVertex(mousemappos, renderer.Scale); }
public static void InsertVertex(Vector2D mousemappos, float rendererscale)
private void InsertVertex()
{
bool snaptogrid = General.Interface.ShiftState ^ General.Interface.SnapToGrid;
bool snaptonearest = General.Interface.CtrlState ^ General.Interface.AutoMerge;
@ -846,7 +845,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Map.UndoRedo.CreateUndo("Insert vertex");
// Snap to geometry?
Linedef l = General.Map.Map.NearestLinedefRange(mousemappos, BuilderPlug.Me.SplitLinedefsRange / rendererscale);
Linedef l = General.Map.Map.NearestLinedefRange(mousemappos, BuilderPlug.Me.SplitLinedefsRange / renderer.Scale);
if(snaptonearest && (l != null))
{
// Snip to grid also?
@ -907,7 +906,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(snaptonearest)
{
//mxd. Check if snapped vertex is still on top of a linedef
l = General.Map.Map.NearestLinedefRange(v.Position, BuilderPlug.Me.SplitLinedefsRange / rendererscale);
l = General.Map.Map.NearestLinedefRange(v.Position, BuilderPlug.Me.SplitLinedefsRange / renderer.Scale);
if(l != null)
{
@ -1307,7 +1306,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
dv2.stitch = true;
dv1.pos = start;
dv2.pos = end;
Tools.DrawLines(new List<DrawnVertex>() { dv1, dv2 }, false, false);
Tools.DrawLines(new List<DrawnVertex> { dv1, dv2 }, false, false);
// Update cache values
General.Map.Map.Update();

View file

@ -48,7 +48,7 @@
this.buttonOK.Location = new System.Drawing.Point(95, 148);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 4;
this.buttonOK.TabIndex = 7;
this.buttonOK.Text = "OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
@ -60,7 +60,7 @@
this.buttonCancel.Location = new System.Drawing.Point(177, 148);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 5;
this.buttonCancel.TabIndex = 8;
this.buttonCancel.Text = "Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
@ -159,7 +159,7 @@
this.cbMirror.Location = new System.Drawing.Point(168, 96);
this.cbMirror.Name = "cbMirror";
this.cbMirror.Size = new System.Drawing.Size(81, 17);
this.cbMirror.TabIndex = 10;
this.cbMirror.TabIndex = 4;
this.cbMirror.Text = "Mirror mode";
this.cbMirror.UseVisualStyleBackColor = true;
this.cbMirror.CheckStateChanged += new System.EventHandler(this.cbMirror_CheckStateChanged);
@ -170,7 +170,7 @@
this.cbCopy.Location = new System.Drawing.Point(168, 119);
this.cbCopy.Name = "cbCopy";
this.cbCopy.Size = new System.Drawing.Size(79, 17);
this.cbCopy.TabIndex = 10;
this.cbCopy.TabIndex = 5;
this.cbCopy.Text = "Copy mode";
this.cbCopy.UseVisualStyleBackColor = true;
this.cbCopy.CheckedChanged += new System.EventHandler(this.cbCopy_CheckedChanged);

View file

@ -306,11 +306,11 @@ namespace CodeImp.DoomBuilder.SoundPropagationMode
// Render things
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_BACK_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderNiGHTSPath();
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, General.Settings.InactiveThingsAlpha);
renderer.RenderNiGHTSPath();
lock (BuilderPlug.Me.SoundEnvironments)
lock (BuilderPlug.Me.SoundEnvironments)
{
foreach(SoundEnvironment se in BuilderPlug.Me.SoundEnvironments)
{

View file

@ -276,10 +276,10 @@ namespace CodeImp.DoomBuilder.SoundPropagationMode
// Render things
if(renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_BACK_ALPHA);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, Presentation.THINGS_HIDDEN_ALPHA);
renderer.RenderNiGHTSPath();
foreach (Thing thing in huntingThings)
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha);
renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, General.Settings.InactiveThingsAlpha);
renderer.RenderNiGHTSPath();
foreach (Thing thing in huntingThings)
{
renderer.RenderThing(thing, General.Colors.Selection, Presentation.THINGS_ALPHA);
}