From 414a18ad90fdf76b106515d22c54aef9c92e5eee Mon Sep 17 00:00:00 2001 From: MaxED Date: Thu, 2 Jul 2015 10:07:43 +0000 Subject: [PATCH] Fixed, Randomize Things window: "Same width and height" scale setting was not applied properly. Fixed incorrect formatting of changelog messages displayed in the updater window. Changed, Classic modes: models for things hidden by thing filter are now rendered with much lower alpha than the "regular" ones. --- Source/Core/General/UpdateChecker.cs | 5 ++-- Source/Core/Rendering/Renderer2D.cs | 5 ++++ .../Interface/JitterThingsForm.cs | 26 ++++++++++--------- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/Source/Core/General/UpdateChecker.cs b/Source/Core/General/UpdateChecker.cs index fa620eac..e32d4b38 100644 --- a/Source/Core/General/UpdateChecker.cs +++ b/Source/Core/General/UpdateChecker.cs @@ -1,4 +1,5 @@ -using System.ComponentModel; +using System; +using System.ComponentModel; using System.IO; using System.Net; using System.Text; @@ -121,7 +122,7 @@ namespace CodeImp.DoomBuilder { if(prop.Name == "msg") { - sb.Append(prop.InnerText.Trim()).Append(@"\par\par "); + sb.Append(prop.InnerText.Trim().Replace(Environment.NewLine, @"\par ")).Append(@"\par\par "); break; } } diff --git a/Source/Core/Rendering/Renderer2D.cs b/Source/Core/Rendering/Renderer2D.cs index ec0e2b74..38cf30a9 100644 --- a/Source/Core/Rendering/Renderer2D.cs +++ b/Source/Core/Rendering/Renderer2D.cs @@ -1326,6 +1326,11 @@ namespace CodeImp.DoomBuilder.Rendering Color4 cHighlight = General.Colors.Highlight.ToColorValue(); Color4 cWire = General.Colors.ModelWireframe.ToColorValue(); + if(alpha < 1.0f) + { + cHighlight.Alpha = alpha * 0.25f; + cWire.Alpha = cHighlight.Alpha; + } Matrix viewscale = Matrix.Scaling(scale, -scale, 0.0f); ModelData mde; diff --git a/Source/Plugins/BuilderEffects/Interface/JitterThingsForm.cs b/Source/Plugins/BuilderEffects/Interface/JitterThingsForm.cs index 300d5429..2b1fd42e 100644 --- a/Source/Plugins/BuilderEffects/Interface/JitterThingsForm.cs +++ b/Source/Plugins/BuilderEffects/Interface/JitterThingsForm.cs @@ -264,14 +264,7 @@ namespace CodeImp.DoomBuilder.BuilderEffects private void ApplyScale() { - if(cbUniformScale.Checked) - { - ApplyScale((float)minScaleX.Value, (float)maxScaleX.Value, (float)minScaleX.Value, (float)maxScaleX.Value); - } - else - { - ApplyScale((float)minScaleX.Value, (float)maxScaleX.Value, (float)minScaleY.Value, (float)maxScaleY.Value); - } + ApplyScale((float)minScaleX.Value, (float)maxScaleX.Value, (float)minScaleY.Value, (float)maxScaleY.Value); //update view if(editingModeName == "ThingsMode") General.Interface.RedrawDisplay(); @@ -279,6 +272,12 @@ namespace CodeImp.DoomBuilder.BuilderEffects private void ApplyScale(float minX, float maxX, float minY, float maxY) { + if(cbUniformScale.Checked) + { + minY = minX; + maxY = maxX; + } + if(minX > maxX) General.Swap(ref minX, ref maxX); if(minY > maxY) General.Swap(ref minY, ref maxY); @@ -288,15 +287,18 @@ namespace CodeImp.DoomBuilder.BuilderEffects for(int i = 0; i < selection.Count; i++) { + float jitterX = thingData[i].JitterScaleX; + float jitterY = (cbUniformScale.Checked ? jitterX : thingData[i].JitterScaleY); + if (cbRelativeScale.Checked) { - sx = thingData[i].ScaleX + minX + diffX * thingData[i].JitterScaleX; - sy = thingData[i].ScaleY + minY + diffY * thingData[i].JitterScaleY; + sx = thingData[i].ScaleX + minX + diffX * jitterX; + sy = thingData[i].ScaleY + minY + diffY * jitterY; } else { - sx = minX + diffX * thingData[i].JitterScaleX; - sy = minY + diffY * thingData[i].JitterScaleY; + sx = minX + diffX * jitterX; + sy = minY + diffY * jitterY; } selection[i].SetScale(sx, sy);