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) { if (e.Button == MouseButtons.Left) {
thisAngle = (int)Math.Round(thisAngle / 45f) * 45; thisAngle = (int)Math.Round(thisAngle / 45f) * 45;
if(thisAngle == 360) thisAngle = 0;
} }
if(thisAngle != this.Angle) { if(thisAngle != this.Angle) {

View file

@ -206,6 +206,10 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom {
break; 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 //I wrote logic for dynamic lights animation first, so here I modify gldefs settings to fit in existing logic
if (lightType == GldefsLightType.PULSE) { if (lightType == GldefsLightType.PULSE) {
light.Interval = (int)(interval * 35); //measured in tics (35 per second) in PointLightPulse, measured in seconds in gldefs' PulseLight 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) { private void addRow(int tag, string label, int sectorsCount, int linesCount, int thingsCount) {
DataGridViewRow row = new DataGridViewRow(); DataGridViewRow row = new DataGridViewRow();
DataGridViewTextBoxCell cTag = new DataGridViewTextBoxCell(); var cTag = new DataGridViewTextBoxCell {Value = tag};
cTag.Value = tag; var cLabel = new DataGridViewTextBoxCell { Value = label };
var cSectors = new DataGridViewTextBoxCell { Value = sectorsCount };
DataGridViewTextBoxCell cLabel = new DataGridViewTextBoxCell(); var cLines = new DataGridViewTextBoxCell { Value = linesCount };
cLabel.Value = label; var cThings = new DataGridViewTextBoxCell { Value = thingsCount };
DataGridViewTextBoxCell cSectors = new DataGridViewTextBoxCell();
cSectors.Value = sectorsCount;
DataGridViewTextBoxCell cLines = new DataGridViewTextBoxCell();
cLines.Value = linesCount;
DataGridViewTextBoxCell cThings = new DataGridViewTextBoxCell();
cThings.Value = thingsCount;
row.Cells.Add(cTag); row.Cells.Add(cTag);
row.Cells.Add(cLabel); row.Cells.Add(cLabel);

View file

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

View file

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

View file

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