Angle control: in some cases angle was set to 360 instead of 0 when clicking on the control.

GLDEFS parser: added a warning when the interval of animated dynamic light is 0.
Visual mode: fixed a crash when an angle of animated dynamic light was set to 0 and light animation was enabled.
Tag explorer: removed unnecessary mode switching when selecting map elements of the same type.
This commit is contained in:
MaxED 2014-03-11 09:44:39 +00:00
parent fb19f62fdb
commit abb77e4aab
6 changed files with 18 additions and 18 deletions

View file

@ -129,6 +129,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Controls
if (e.Button == MouseButtons.Left) {
thisAngle = (int)Math.Round(thisAngle / 45f) * 45;
if(thisAngle == 360) thisAngle = 0;
}
if(thisAngle != this.Angle) {

View file

@ -206,6 +206,10 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom {
break;
}
if(interval == 0) {
General.ErrorLogger.Add(ErrorType.Warning, "Warning in '" + sourcefilename + "' at line " + GetCurrentLineNumber() + ": Interval value should be greater than zero");
}
//I wrote logic for dynamic lights animation first, so here I modify gldefs settings to fit in existing logic
if (lightType == GldefsLightType.PULSE) {
light.Interval = (int)(interval * 35); //measured in tics (35 per second) in PointLightPulse, measured in seconds in gldefs' PulseLight

View file

@ -91,20 +91,11 @@ namespace CodeImp.DoomBuilder.GZBuilder.Windows
private void addRow(int tag, string label, int sectorsCount, int linesCount, int thingsCount) {
DataGridViewRow row = new DataGridViewRow();
DataGridViewTextBoxCell cTag = new DataGridViewTextBoxCell();
cTag.Value = tag;
DataGridViewTextBoxCell cLabel = new DataGridViewTextBoxCell();
cLabel.Value = label;
DataGridViewTextBoxCell cSectors = new DataGridViewTextBoxCell();
cSectors.Value = sectorsCount;
DataGridViewTextBoxCell cLines = new DataGridViewTextBoxCell();
cLines.Value = linesCount;
DataGridViewTextBoxCell cThings = new DataGridViewTextBoxCell();
cThings.Value = thingsCount;
var cTag = new DataGridViewTextBoxCell {Value = tag};
var cLabel = new DataGridViewTextBoxCell { Value = label };
var cSectors = new DataGridViewTextBoxCell { Value = sectorsCount };
var cLines = new DataGridViewTextBoxCell { Value = linesCount };
var cThings = new DataGridViewTextBoxCell { Value = thingsCount };
row.Cells.Add(cTag);
row.Cells.Add(cLabel);

View file

@ -449,6 +449,11 @@ namespace CodeImp.DoomBuilder.VisualModes
return;
}
if(interval == 0) {
lightRadius = 0;
return;
}
float time = General.Clock.CurrentTime;
float rMin = Math.Min(lightPrimaryRadius, lightSecondaryRadius);
float rMax = Math.Max(lightPrimaryRadius, lightSecondaryRadius);

View file

@ -42,7 +42,6 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Trackbar, Version=1.0.2486.37933, Culture=neutral, PublicKeyToken=503bf28f63ad27b4">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Build\Trackbar.dll</HintPath>

View file

@ -585,19 +585,19 @@ namespace CodeImp.DoomBuilder.TagExplorer
//make selection
if (info.Type == NodeInfoType.THING)
{
General.Editing.ChangeMode("ThingsMode");
if(General.Editing.Mode.GetType().Name != "ThingsMode") General.Editing.ChangeMode("ThingsMode");
Thing t = General.Map.Map.GetThingByIndex(info.Index);
if (t != null) t.Selected = true;
}
else if (info.Type == NodeInfoType.LINEDEF)
{
General.Editing.ChangeMode("LinedefsMode");
if(General.Editing.Mode.GetType().Name != "LinedefsMode") General.Editing.ChangeMode("LinedefsMode");
Linedef l = General.Map.Map.GetLinedefByIndex(info.Index);
if (l != null) l.Selected = true;
}
else
{
General.Editing.ChangeMode("SectorsMode");
if(General.Editing.Mode.GetType().Name != "SectorsMode") General.Editing.ChangeMode("SectorsMode");
Sector s = General.Map.Map.GetSectorByIndex(info.Index);
if (s != null)
{