Line angle is now displayed when a line is drawn in Draw Geometry mode.

TranslucentLine (208) action's "additive" property values were inverted.
This commit is contained in:
MaxED 2012-11-11 21:52:08 +00:00
parent 42368ae530
commit 436bc14a86
8 changed files with 257 additions and 246 deletions

View file

@ -3499,7 +3499,7 @@ zdoom
{
title = "Additive";
type = 11;
enum = "yesno";
enum = "noyes";
}
}
}

View file

@ -149,12 +149,12 @@ namespace CodeImp.DoomBuilder.Rendering
// This updates the text if needed
internal void Update(float translatex, float translatey, float scalex, float scaley)
{
FlatVertex[] verts;
//FlatVertex[] verts;
RectangleF absview;
float beginx = 0;
float beginy = 0;
bool colorcode = false;
int characters = 0;
//bool colorcode = false;
//int characters = 0;
byte[] textbytes;
DataStream stream;

View file

@ -91,11 +91,12 @@ namespace CodeImp.DoomBuilder.Windows
//
label2.BackColor = System.Drawing.Color.White;
label2.FlatStyle = System.Windows.Forms.FlatStyle.System;
label2.Location = new System.Drawing.Point(11, 152);
label2.Location = new System.Drawing.Point(11, 143);
label2.Name = "label2";
label2.Size = new System.Drawing.Size(349, 23);
label2.Size = new System.Drawing.Size(366, 32);
label2.TabIndex = 14;
label2.Text = "GZDoom Builder is designed and programmed by MaxED.\r\n";
label2.Text = "GZDoom Builder is designed and programmed by MaxED.\r\nGZDoom Builder uses game con" +
"figurations based on ones created by Gez.";
//
// close
//

View file

@ -393,7 +393,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
newpoint.stitch = stitch;
newpoint.stitchline = stitchline;
points.Add(newpoint);
labels.Add(new LineLengthLabel());
labels.Add(new LineLengthLabel(true));
labels[labels.Count - 1].Start = newpoint.pos;
if(labels.Count > 1) labels[labels.Count - 2].End = newpoint.pos;
Update();

View file

@ -215,7 +215,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.ClassicModes
points.Add(newpoint);
if (points.Count == 1) { //add point and labels
labels.AddRange(new LineLengthLabel[] { new LineLengthLabel(), new LineLengthLabel(), new LineLengthLabel(), new LineLengthLabel() });
labels.AddRange(new LineLengthLabel[] { new LineLengthLabel(false), new LineLengthLabel(false), new LineLengthLabel(false), new LineLengthLabel(false) });
hintLabel = new HintLabel();
Update();
} else if (points[0].pos == points[1].pos) { //nothing is drawn

View file

@ -24,7 +24,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
}
public HintLabel() : base() {
public HintLabel() : base(false) {
label.Color = General.Colors.BrightColors[new Random().Next(General.Colors.BrightColors.Length - 1)];
}

View file

@ -40,7 +40,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
#region ================== Constants
private const int TEXT_CAPACITY = 10;
private const int TEXT_CAPACITY = 15;
private const float TEXT_SCALE = 14f;
private const string VALUE_FORMAT = "0";
@ -51,6 +51,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
protected TextLabel label;
protected Vector2D start;
protected Vector2D end;
private bool showAngle; //mxd
#endregion
@ -65,8 +66,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
#region ================== Constructor / Disposer
// Constructor
public LineLengthLabel()
public LineLengthLabel(bool showAngle)
{
this.showAngle = showAngle; //mxd
// Initialize
Initialize();
}
@ -106,7 +108,15 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
Vector2D delta = end - start;
float length = delta.GetLength();
//mxd
if(showAngle) {
int angle = (int)Math.Round(delta.GetAngle() * 180 / Math.PI);
label.Text = "l:" + length.ToString(VALUE_FORMAT) + "; a:" + angle;
} else {
label.Text = length.ToString(VALUE_FORMAT);
}
label.Rectangle = new RectangleF(start.x + delta.x * 0.5f, start.y + delta.y * 0.5f, 0f, 0f);
}