2015-01-10 11:45:25 +00:00
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Windows.Forms;
|
2014-05-08 12:34:24 +00:00
|
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.Controls
|
|
|
|
|
{
|
|
|
|
|
public partial class StatisticsControl : UserControl
|
|
|
|
|
{
|
2014-12-03 23:15:26 +00:00
|
|
|
|
public StatisticsControl()
|
|
|
|
|
{
|
2014-05-08 12:34:24 +00:00
|
|
|
|
InitializeComponent();
|
|
|
|
|
this.Visible = false;
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-03 23:15:26 +00:00
|
|
|
|
public void UpdateStatistics()
|
|
|
|
|
{
|
2015-01-10 11:45:25 +00:00
|
|
|
|
// Update statistics
|
2014-05-08 12:34:24 +00:00
|
|
|
|
verticescount.Text = General.Map.Map.Vertices.Count.ToString();
|
|
|
|
|
linedefscount.Text = General.Map.Map.Linedefs.Count.ToString();
|
|
|
|
|
sidedefscount.Text = General.Map.Map.Sidedefs.Count.ToString();
|
|
|
|
|
sectorscount.Text = General.Map.Map.Sectors.Count.ToString();
|
|
|
|
|
thingscount.Text = General.Map.Map.Things.Count.ToString();
|
2015-01-10 11:45:25 +00:00
|
|
|
|
|
|
|
|
|
// Exceeding them limits?
|
|
|
|
|
verticescount.ForeColor = (General.Map.Map.Vertices.Count > General.Map.FormatInterface.MaxVertices ? Color.Red : SystemColors.GrayText);
|
|
|
|
|
linedefscount.ForeColor = (General.Map.Map.Linedefs.Count > General.Map.FormatInterface.MaxLinedefs ? Color.Red : SystemColors.GrayText);
|
|
|
|
|
sidedefscount.ForeColor = (General.Map.Map.Sidedefs.Count > General.Map.FormatInterface.MaxSidedefs ? Color.Red : SystemColors.GrayText);
|
|
|
|
|
sectorscount.ForeColor = (General.Map.Map.Sectors.Count > General.Map.FormatInterface.MaxSectors ? Color.Red : SystemColors.GrayText);
|
2015-01-10 23:12:19 +00:00
|
|
|
|
thingscount.ForeColor = (General.Map.Map.Things.Count > General.Map.FormatInterface.MaxThings ? Color.Red : SystemColors.GrayText);
|
2015-01-10 11:45:25 +00:00
|
|
|
|
|
|
|
|
|
verticeslabel.ForeColor = verticescount.ForeColor;
|
|
|
|
|
linedefslabel.ForeColor = linedefscount.ForeColor;
|
|
|
|
|
sidedefslabel.ForeColor = sidedefscount.ForeColor;
|
|
|
|
|
sectorslabel.ForeColor = sectorscount.ForeColor;
|
|
|
|
|
thingslabel.ForeColor = thingscount.ForeColor;
|
2014-05-08 12:34:24 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|