mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-18 22:41:46 +00:00
@ Renamed sector fixed index to resolve conflict with real index lookup functions
All info panels now show the current real index of the element (as it would be when saved or loaded at that moment)
This commit is contained in:
parent
565e0a1317
commit
eaffa440be
19 changed files with 68 additions and 45 deletions
|
@ -45,6 +45,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="ClassicModes\BaseClassicMode.cs" />
|
<Compile Include="ClassicModes\BaseClassicMode.cs" />
|
||||||
<Compile Include="ClassicModes\BrightnessMode.cs" />
|
<Compile Include="ClassicModes\BrightnessMode.cs" />
|
||||||
|
<Compile Include="ClassicModes\HeightsMode.cs" />
|
||||||
<Compile Include="ClassicModes\ErrorCheckMode.cs" />
|
<Compile Include="ClassicModes\ErrorCheckMode.cs" />
|
||||||
<Compile Include="ClassicModes\EditSelectionMode.cs" />
|
<Compile Include="ClassicModes\EditSelectionMode.cs" />
|
||||||
<Compile Include="ClassicModes\CurveLinedefsMode.cs" />
|
<Compile Include="ClassicModes\CurveLinedefsMode.cs" />
|
||||||
|
@ -224,6 +225,9 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Resources\FlipSelectionV.png" />
|
<None Include="Resources\FlipSelectionV.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Resources\HeightsMode.png" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|
|
@ -290,7 +290,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
|
|
||||||
if(update)
|
if(update)
|
||||||
{
|
{
|
||||||
UpdateOverlay();
|
|
||||||
UpdateOverlay();
|
UpdateOverlay();
|
||||||
renderer.Present();
|
renderer.Present();
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
|
|
||||||
private Sector sector;
|
private Sector sector;
|
||||||
private List<Vertex> vertices;
|
private List<Vertex> vertices;
|
||||||
|
private int index;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -62,6 +63,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
this.viewobjects.Add(s);
|
this.viewobjects.Add(s);
|
||||||
foreach(Vertex vv in v) this.viewobjects.Add(vv);
|
foreach(Vertex vv in v) this.viewobjects.Add(vv);
|
||||||
this.description = "This sector is not a closed region and could cause problems with clipping and rendering in the game. The 'leaks' in the sector are indicated by the colored vertices.";
|
this.description = "This sector is not a closed region and could cause problems with clipping and rendering in the game. The 'leaks' in the sector are indicated by the colored vertices.";
|
||||||
|
this.index = s.Map.GetIndexForSector(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -71,7 +73,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
// This must return the string that is displayed in the listbox
|
// This must return the string that is displayed in the listbox
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return "Sector " + sector.Index + " is not closed";
|
return "Sector " + index + " is not closed";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rendering
|
// Rendering
|
||||||
|
|
|
@ -112,7 +112,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
if(replacewith != null) s.Tag = replacetag;
|
if(replacewith != null) s.Tag = replacetag;
|
||||||
|
|
||||||
// Add to list
|
// Add to list
|
||||||
objs.Add(new FindReplaceObject(s, "Sector " + s.Index));
|
objs.Add(new FindReplaceObject(s, "Sector " + s.Map.GetIndexForSector(s)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,16 @@ brightnessmode
|
||||||
allowscroll = true;
|
allowscroll = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
heightsmode
|
||||||
|
{
|
||||||
|
title = "Sector Heights Mode";
|
||||||
|
category = "modes";
|
||||||
|
description = "Switches to sectors heights editing mode.";
|
||||||
|
allowkeys = true;
|
||||||
|
allowmouse = true;
|
||||||
|
allowscroll = true;
|
||||||
|
}
|
||||||
|
|
||||||
thingsmode
|
thingsmode
|
||||||
{
|
{
|
||||||
title = "Things Mode";
|
title = "Things Mode";
|
||||||
|
|
|
@ -285,7 +285,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
// Sector brightness change
|
// Sector brightness change
|
||||||
public virtual void OnChangeTargetBrightness(bool up)
|
public virtual void OnChangeTargetBrightness(bool up)
|
||||||
{
|
{
|
||||||
General.Map.UndoRedo.CreateUndo("Change sector brightness", UndoGroup.SectorBrightnessChange, Sector.Sector.Index);
|
General.Map.UndoRedo.CreateUndo("Change sector brightness", UndoGroup.SectorBrightnessChange, Sector.Sector.FixedIndex);
|
||||||
|
|
||||||
if(up)
|
if(up)
|
||||||
Sector.Sector.Brightness = General.Map.Config.BrightnessLevels.GetNextHigher(Sector.Sector.Brightness);
|
Sector.Sector.Brightness = General.Map.Config.BrightnessLevels.GetNextHigher(Sector.Sector.Brightness);
|
||||||
|
|
|
@ -533,7 +533,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
public virtual void OnChangeTargetBrightness(bool up)
|
public virtual void OnChangeTargetBrightness(bool up)
|
||||||
{
|
{
|
||||||
// Change brightness
|
// Change brightness
|
||||||
General.Map.UndoRedo.CreateUndo("Change sector brightness", UndoGroup.SectorBrightnessChange, Sector.Sector.Index);
|
General.Map.UndoRedo.CreateUndo("Change sector brightness", UndoGroup.SectorBrightnessChange, Sector.Sector.FixedIndex);
|
||||||
|
|
||||||
if(up)
|
if(up)
|
||||||
Sector.Sector.Brightness = General.Map.Config.BrightnessLevels.GetNextHigher(Sector.Sector.Brightness);
|
Sector.Sector.Brightness = General.Map.Config.BrightnessLevels.GetNextHigher(Sector.Sector.Brightness);
|
||||||
|
|
|
@ -147,7 +147,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
// This changes the height
|
// This changes the height
|
||||||
protected override void ChangeHeight(int amount)
|
protected override void ChangeHeight(int amount)
|
||||||
{
|
{
|
||||||
General.Map.UndoRedo.CreateUndo("Change ceiling height", UndoGroup.CeilingHeightChange, this.Sector.Sector.Index);
|
General.Map.UndoRedo.CreateUndo("Change ceiling height", UndoGroup.CeilingHeightChange, this.Sector.Sector.FixedIndex);
|
||||||
this.Sector.Sector.CeilHeight += amount;
|
this.Sector.Sector.CeilHeight += amount;
|
||||||
General.Interface.DisplayStatus(StatusType.Action, "Changed ceiling height to " + Sector.Sector.CeilHeight + ".");
|
General.Interface.DisplayStatus(StatusType.Action, "Changed ceiling height to " + Sector.Sector.CeilHeight + ".");
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,7 +134,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
// This changes the height
|
// This changes the height
|
||||||
protected override void ChangeHeight(int amount)
|
protected override void ChangeHeight(int amount)
|
||||||
{
|
{
|
||||||
General.Map.UndoRedo.CreateUndo("Change floor height", UndoGroup.FloorHeightChange, this.Sector.Sector.Index);
|
General.Map.UndoRedo.CreateUndo("Change floor height", UndoGroup.FloorHeightChange, this.Sector.Sector.FixedIndex);
|
||||||
this.Sector.Sector.FloorHeight += amount;
|
this.Sector.Sector.FloorHeight += amount;
|
||||||
General.Interface.DisplayStatus(StatusType.Action, "Changed floor height to " + Sector.Sector.FloorHeight + ".");
|
General.Interface.DisplayStatus(StatusType.Action, "Changed floor height to " + Sector.Sector.FloorHeight + ".");
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,6 +119,7 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
peggedness = "None";
|
peggedness = "None";
|
||||||
|
|
||||||
// Linedef info
|
// Linedef info
|
||||||
|
infopanel.Text = " Lindedef " + l.Map.GetIndexForLinedef(l) + " ";
|
||||||
action.Text = actioninfo;
|
action.Text = actioninfo;
|
||||||
length.Text = l.Length.ToString("0.##");
|
length.Text = l.Length.ToString("0.##");
|
||||||
angle.Text = l.AngleDeg.ToString() + "\u00B0";
|
angle.Text = l.AngleDeg.ToString() + "\u00B0";
|
||||||
|
@ -182,6 +183,7 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
if(l.Front != null)
|
if(l.Front != null)
|
||||||
{
|
{
|
||||||
// Show sidedef info
|
// Show sidedef info
|
||||||
|
frontpanel.Text = " Front Sidedef " + l.Map.GetIndexForSidedef(l.Front) + " ";
|
||||||
frontoffset.Text = l.Front.OffsetX + ", " + l.Front.OffsetY;
|
frontoffset.Text = l.Front.OffsetX + ", " + l.Front.OffsetY;
|
||||||
fronthighname.Text = l.Front.HighTexture;
|
fronthighname.Text = l.Front.HighTexture;
|
||||||
frontmidname.Text = l.Front.MiddleTexture;
|
frontmidname.Text = l.Front.MiddleTexture;
|
||||||
|
@ -196,6 +198,7 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Show no info
|
// Show no info
|
||||||
|
frontpanel.Text = " Front Sidedef ";
|
||||||
frontoffsetlabel.Enabled = false;
|
frontoffsetlabel.Enabled = false;
|
||||||
frontoffset.Enabled = false;
|
frontoffset.Enabled = false;
|
||||||
frontpanel.Enabled = false;
|
frontpanel.Enabled = false;
|
||||||
|
@ -212,6 +215,7 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
if(l.Back != null)
|
if(l.Back != null)
|
||||||
{
|
{
|
||||||
// Show sidedef info
|
// Show sidedef info
|
||||||
|
backpanel.Text = " Back Sidedef " + l.Map.GetIndexForSidedef(l.Back) + " ";
|
||||||
backoffset.Text = l.Back.OffsetX + ", " + l.Back.OffsetY;
|
backoffset.Text = l.Back.OffsetX + ", " + l.Back.OffsetY;
|
||||||
backhighname.Text = l.Back.HighTexture;
|
backhighname.Text = l.Back.HighTexture;
|
||||||
backmidname.Text = l.Back.MiddleTexture;
|
backmidname.Text = l.Back.MiddleTexture;
|
||||||
|
@ -226,6 +230,7 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Show no info
|
// Show no info
|
||||||
|
backpanel.Text = " Back Sidedef ";
|
||||||
backoffsetlabel.Enabled = false;
|
backoffsetlabel.Enabled = false;
|
||||||
backoffset.Enabled = false;
|
backoffset.Enabled = false;
|
||||||
backpanel.Enabled = false;
|
backpanel.Enabled = false;
|
||||||
|
|
|
@ -56,7 +56,7 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
effectinfo = s.Effect.ToString() + " - Unknown";
|
effectinfo = s.Effect.ToString() + " - Unknown";
|
||||||
|
|
||||||
// Sector info
|
// Sector info
|
||||||
sectorinfo.Text = " Sector " + s.Index.ToString() + " ";
|
sectorinfo.Text = " Sector " + s.Map.GetIndexForSector(s) + " ";
|
||||||
effect.Text = effectinfo;
|
effect.Text = effectinfo;
|
||||||
ceiling.Text = s.CeilHeight.ToString();
|
ceiling.Text = s.CeilHeight.ToString();
|
||||||
floor.Text = s.FloorHeight.ToString();
|
floor.Text = s.FloorHeight.ToString();
|
||||||
|
|
|
@ -131,6 +131,7 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
}
|
}
|
||||||
|
|
||||||
// Thing info
|
// Thing info
|
||||||
|
infopanel.Text = " Thing " + t.Map.GetIndexForThing(t) + " ";
|
||||||
type.Text = t.Type + " - " + ti.Title;
|
type.Text = t.Type + " - " + ti.Title;
|
||||||
action.Text = actioninfo;
|
action.Text = actioninfo;
|
||||||
position.Text = t.Position.x.ToString() + ", " + t.Position.y.ToString() + ", " + zinfo;
|
position.Text = t.Position.x.ToString() + ", " + t.Position.y.ToString() + ", " + zinfo;
|
||||||
|
|
30
Source/Controls/VertexInfoPanel.Designer.cs
generated
30
Source/Controls/VertexInfoPanel.Designer.cs
generated
|
@ -28,24 +28,23 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
System.Windows.Forms.GroupBox groupBox1;
|
|
||||||
System.Windows.Forms.Label label1;
|
System.Windows.Forms.Label label1;
|
||||||
|
this.vertexinfo = new System.Windows.Forms.GroupBox();
|
||||||
this.position = new System.Windows.Forms.Label();
|
this.position = new System.Windows.Forms.Label();
|
||||||
groupBox1 = new System.Windows.Forms.GroupBox();
|
|
||||||
label1 = new System.Windows.Forms.Label();
|
label1 = new System.Windows.Forms.Label();
|
||||||
groupBox1.SuspendLayout();
|
this.vertexinfo.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// groupBox1
|
// vertexinfo
|
||||||
//
|
//
|
||||||
groupBox1.Controls.Add(this.position);
|
this.vertexinfo.Controls.Add(this.position);
|
||||||
groupBox1.Controls.Add(label1);
|
this.vertexinfo.Controls.Add(label1);
|
||||||
groupBox1.Location = new System.Drawing.Point(0, 0);
|
this.vertexinfo.Location = new System.Drawing.Point(0, 0);
|
||||||
groupBox1.Name = "groupBox1";
|
this.vertexinfo.Name = "vertexinfo";
|
||||||
groupBox1.Size = new System.Drawing.Size(163, 100);
|
this.vertexinfo.Size = new System.Drawing.Size(163, 100);
|
||||||
groupBox1.TabIndex = 0;
|
this.vertexinfo.TabIndex = 0;
|
||||||
groupBox1.TabStop = false;
|
this.vertexinfo.TabStop = false;
|
||||||
groupBox1.Text = " Vertex ";
|
this.vertexinfo.Text = " Vertex ";
|
||||||
//
|
//
|
||||||
// position
|
// position
|
||||||
//
|
//
|
||||||
|
@ -68,14 +67,14 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
// VertexInfoPanel
|
// VertexInfoPanel
|
||||||
//
|
//
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||||
this.Controls.Add(groupBox1);
|
this.Controls.Add(this.vertexinfo);
|
||||||
this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.MaximumSize = new System.Drawing.Size(10000, 100);
|
this.MaximumSize = new System.Drawing.Size(10000, 100);
|
||||||
this.MinimumSize = new System.Drawing.Size(100, 100);
|
this.MinimumSize = new System.Drawing.Size(100, 100);
|
||||||
this.Name = "VertexInfoPanel";
|
this.Name = "VertexInfoPanel";
|
||||||
this.Size = new System.Drawing.Size(393, 100);
|
this.Size = new System.Drawing.Size(393, 100);
|
||||||
groupBox1.ResumeLayout(false);
|
this.vertexinfo.ResumeLayout(false);
|
||||||
groupBox1.PerformLayout();
|
this.vertexinfo.PerformLayout();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -83,6 +82,7 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private System.Windows.Forms.Label position;
|
private System.Windows.Forms.Label position;
|
||||||
|
private System.Windows.Forms.GroupBox vertexinfo;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,7 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
public void ShowInfo(Vertex v)
|
public void ShowInfo(Vertex v)
|
||||||
{
|
{
|
||||||
// Vertex info
|
// Vertex info
|
||||||
|
vertexinfo.Text = " Vertex " + v.Map.GetIndexForVertex(v) + " ";
|
||||||
position.Text = v.Position.x.ToString("0.##") + ", " + v.Position.y.ToString("0.##");
|
position.Text = v.Position.x.ToString("0.##") + ", " + v.Position.y.ToString("0.##");
|
||||||
|
|
||||||
// Show the whole thing
|
// Show the whole thing
|
||||||
|
|
|
@ -117,10 +117,7 @@
|
||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<metadata name="groupBox1.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="vertexinfo.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>False</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="groupBox1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="position.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="position.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
|
|
@ -1326,7 +1326,7 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the thing at the specified index. Returns null when index is out of range. This is a O(n) operation.
|
/// Returns the thing at the specified index. Returns null when index is out of range. This is a O(n) operation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Sector GetThingByIndex(int index)
|
public Thing GetThingByIndex(int index)
|
||||||
{
|
{
|
||||||
if(index < things.Count)
|
if(index < things.Count)
|
||||||
return General.GetByIndex<Thing>(things, index);
|
return General.GetByIndex<Thing>(things, index);
|
||||||
|
@ -1340,7 +1340,7 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
public int GetIndexForVertex(Vertex v)
|
public int GetIndexForVertex(Vertex v)
|
||||||
{
|
{
|
||||||
int index = 0;
|
int index = 0;
|
||||||
foreach(LinkedListNode<Vertex> vn in vertices)
|
foreach(Vertex vn in vertices)
|
||||||
{
|
{
|
||||||
if(object.ReferenceEquals(vn, v)) return index;
|
if(object.ReferenceEquals(vn, v)) return index;
|
||||||
index++;
|
index++;
|
||||||
|
@ -1354,7 +1354,7 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
public int GetIndexForLinedef(Linedef l)
|
public int GetIndexForLinedef(Linedef l)
|
||||||
{
|
{
|
||||||
int index = 0;
|
int index = 0;
|
||||||
foreach(LinkedListNode<Linedef> ln in linedefs)
|
foreach(Linedef ln in linedefs)
|
||||||
{
|
{
|
||||||
if(object.ReferenceEquals(ln, l)) return index;
|
if(object.ReferenceEquals(ln, l)) return index;
|
||||||
index++;
|
index++;
|
||||||
|
@ -1368,7 +1368,7 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
public int GetIndexForSidedef(Sidedef sd)
|
public int GetIndexForSidedef(Sidedef sd)
|
||||||
{
|
{
|
||||||
int index = 0;
|
int index = 0;
|
||||||
foreach(LinkedListNode<Sidedef> sn in sidedefs)
|
foreach(Sidedef sn in sidedefs)
|
||||||
{
|
{
|
||||||
if(object.ReferenceEquals(sn, sd)) return index;
|
if(object.ReferenceEquals(sn, sd)) return index;
|
||||||
index++;
|
index++;
|
||||||
|
@ -1382,7 +1382,7 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
public int GetIndexForSector(Sector s)
|
public int GetIndexForSector(Sector s)
|
||||||
{
|
{
|
||||||
int index = 0;
|
int index = 0;
|
||||||
foreach(LinkedListNode<Sector> sn in sectors)
|
foreach(Sector sn in sectors)
|
||||||
{
|
{
|
||||||
if(object.ReferenceEquals(sn, s)) return index;
|
if(object.ReferenceEquals(sn, s)) return index;
|
||||||
index++;
|
index++;
|
||||||
|
@ -1396,7 +1396,7 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
public int GetIndexForThing(Thing t)
|
public int GetIndexForThing(Thing t)
|
||||||
{
|
{
|
||||||
int index = 0;
|
int index = 0;
|
||||||
foreach(LinkedListNode<Thing> tn in things)
|
foreach(Thing tn in things)
|
||||||
{
|
{
|
||||||
if(object.ReferenceEquals(tn, t)) return index;
|
if(object.ReferenceEquals(tn, t)) return index;
|
||||||
index++;
|
index++;
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
private LinkedList<Sidedef> sidedefs;
|
private LinkedList<Sidedef> sidedefs;
|
||||||
|
|
||||||
// Properties
|
// Properties
|
||||||
private int index;
|
private int fixedindex;
|
||||||
private int floorheight;
|
private int floorheight;
|
||||||
private int ceilheight;
|
private int ceilheight;
|
||||||
private string floortexname;
|
private string floortexname;
|
||||||
|
@ -82,7 +82,11 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
|
|
||||||
public MapSet Map { get { return map; } }
|
public MapSet Map { get { return map; } }
|
||||||
public ICollection<Sidedef> Sidedefs { get { return sidedefs; } }
|
public ICollection<Sidedef> Sidedefs { get { return sidedefs; } }
|
||||||
public int Index { get { return index; } }
|
|
||||||
|
/// <summary>
|
||||||
|
/// An unique index that does not change when other sectors are removed.
|
||||||
|
/// </summary>
|
||||||
|
public int FixedIndex { get { return fixedindex; } }
|
||||||
public int FloorHeight { get { return floorheight; } set { floorheight = value; } }
|
public int FloorHeight { get { return floorheight; } set { floorheight = value; } }
|
||||||
public int CeilHeight { get { return ceilheight; } set { ceilheight = value; } }
|
public int CeilHeight { get { return ceilheight; } set { ceilheight = value; } }
|
||||||
public string FloorTexture { get { return floortexname; } }
|
public string FloorTexture { get { return floortexname; } }
|
||||||
|
@ -113,7 +117,7 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
this.map = map;
|
this.map = map;
|
||||||
this.mainlistitem = listitem;
|
this.mainlistitem = listitem;
|
||||||
this.sidedefs = new LinkedList<Sidedef>();
|
this.sidedefs = new LinkedList<Sidedef>();
|
||||||
this.index = index;
|
this.fixedindex = index;
|
||||||
this.floortexname = "-";
|
this.floortexname = "-";
|
||||||
this.ceiltexname = "-";
|
this.ceiltexname = "-";
|
||||||
this.longfloortexname = MapSet.EmptyLongName;
|
this.longfloortexname = MapSet.EmptyLongName;
|
||||||
|
@ -156,7 +160,7 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
mainlistitem.List.Remove(mainlistitem);
|
mainlistitem.List.Remove(mainlistitem);
|
||||||
|
|
||||||
// Register the index as free
|
// Register the index as free
|
||||||
map.AddSectorIndexHole(index);
|
map.AddSectorIndexHole(fixedindex);
|
||||||
|
|
||||||
// Dispose the sidedefs that are attached to this sector
|
// Dispose the sidedefs that are attached to this sector
|
||||||
// because a sidedef cannot exist without reference to its sector.
|
// because a sidedef cannot exist without reference to its sector.
|
||||||
|
@ -187,7 +191,7 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
{
|
{
|
||||||
base.ReadWrite(s);
|
base.ReadWrite(s);
|
||||||
|
|
||||||
s.rwInt(ref index);
|
s.rwInt(ref fixedindex);
|
||||||
s.rwInt(ref floorheight);
|
s.rwInt(ref floorheight);
|
||||||
s.rwInt(ref ceilheight);
|
s.rwInt(ref ceilheight);
|
||||||
s.rwString(ref floortexname);
|
s.rwString(ref floortexname);
|
||||||
|
|
|
@ -142,7 +142,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
public int CompareTo(VisualGeometry other)
|
public int CompareTo(VisualGeometry other)
|
||||||
{
|
{
|
||||||
// Compare sectors
|
// Compare sectors
|
||||||
return this.sector.Sector.Index - other.sector.Sector.Index;
|
return this.sector.Sector.FixedIndex - other.sector.Sector.FixedIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This keeps the results for a sidedef intersection
|
// This keeps the results for a sidedef intersection
|
||||||
|
|
|
@ -164,7 +164,7 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
fronthigh.Required = fl.Front.HighRequired();
|
fronthigh.Required = fl.Front.HighRequired();
|
||||||
frontmid.Required = fl.Front.MiddleRequired();
|
frontmid.Required = fl.Front.MiddleRequired();
|
||||||
frontlow.Required = fl.Front.LowRequired();
|
frontlow.Required = fl.Front.LowRequired();
|
||||||
frontsector.Text = fl.Front.Sector.Index.ToString();
|
frontsector.Text = fl.Map.GetIndexForSector(fl.Front.Sector).ToString();
|
||||||
frontoffsetx.Text = fl.Front.OffsetX.ToString();
|
frontoffsetx.Text = fl.Front.OffsetX.ToString();
|
||||||
frontoffsety.Text = fl.Front.OffsetY.ToString();
|
frontoffsety.Text = fl.Front.OffsetY.ToString();
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,7 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
backhigh.Required = fl.Back.HighRequired();
|
backhigh.Required = fl.Back.HighRequired();
|
||||||
backmid.Required = fl.Back.MiddleRequired();
|
backmid.Required = fl.Back.MiddleRequired();
|
||||||
backlow.Required = fl.Back.LowRequired();
|
backlow.Required = fl.Back.LowRequired();
|
||||||
backsector.Text = fl.Back.Sector.Index.ToString();
|
backsector.Text = fl.Map.GetIndexForSector(fl.Back.Sector).ToString();
|
||||||
backoffsetx.Text = fl.Back.OffsetX.ToString();
|
backoffsetx.Text = fl.Back.OffsetX.ToString();
|
||||||
backoffsety.Text = fl.Back.OffsetY.ToString();
|
backoffsety.Text = fl.Back.OffsetY.ToString();
|
||||||
}
|
}
|
||||||
|
@ -263,7 +263,7 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
if(fronthigh.Required != l.Front.HighRequired()) fronthigh.Required = false;
|
if(fronthigh.Required != l.Front.HighRequired()) fronthigh.Required = false;
|
||||||
if(frontmid.Required != l.Front.MiddleRequired()) frontmid.Required = false;
|
if(frontmid.Required != l.Front.MiddleRequired()) frontmid.Required = false;
|
||||||
if(frontlow.Required != l.Front.LowRequired()) frontlow.Required = false;
|
if(frontlow.Required != l.Front.LowRequired()) frontlow.Required = false;
|
||||||
if(frontsector.Text != l.Front.Sector.Index.ToString()) frontsector.Text = "";
|
if(frontsector.Text != l.Map.GetIndexForSector(l.Front.Sector).ToString()) frontsector.Text = "";
|
||||||
if(frontoffsetx.Text != l.Front.OffsetX.ToString()) frontoffsetx.Text = "";
|
if(frontoffsetx.Text != l.Front.OffsetX.ToString()) frontoffsetx.Text = "";
|
||||||
if(frontoffsety.Text != l.Front.OffsetY.ToString()) frontoffsety.Text = "";
|
if(frontoffsety.Text != l.Front.OffsetY.ToString()) frontoffsety.Text = "";
|
||||||
if(General.Map.IsType(typeof(UniversalMapSetIO))) customfrontbutton.Visible = true;
|
if(General.Map.IsType(typeof(UniversalMapSetIO))) customfrontbutton.Visible = true;
|
||||||
|
@ -278,7 +278,7 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
if(backhigh.Required != l.Back.HighRequired()) backhigh.Required = false;
|
if(backhigh.Required != l.Back.HighRequired()) backhigh.Required = false;
|
||||||
if(backmid.Required != l.Back.MiddleRequired()) backmid.Required = false;
|
if(backmid.Required != l.Back.MiddleRequired()) backmid.Required = false;
|
||||||
if(backlow.Required != l.Back.LowRequired()) backlow.Required = false;
|
if(backlow.Required != l.Back.LowRequired()) backlow.Required = false;
|
||||||
if(backsector.Text != l.Back.Sector.Index.ToString()) backsector.Text = "";
|
if(backsector.Text != l.Map.GetIndexForSector(l.Back.Sector).ToString()) backsector.Text = "";
|
||||||
if(backoffsetx.Text != l.Back.OffsetX.ToString()) backoffsetx.Text = "";
|
if(backoffsetx.Text != l.Back.OffsetX.ToString()) backoffsetx.Text = "";
|
||||||
if(backoffsety.Text != l.Back.OffsetY.ToString()) backoffsety.Text = "";
|
if(backoffsety.Text != l.Back.OffsetY.ToString()) backoffsety.Text = "";
|
||||||
if(General.Map.IsType(typeof(UniversalMapSetIO))) custombackbutton.Visible = true;
|
if(General.Map.IsType(typeof(UniversalMapSetIO))) custombackbutton.Visible = true;
|
||||||
|
@ -381,7 +381,7 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
else if(frontside.CheckState == CheckState.Checked)
|
else if(frontside.CheckState == CheckState.Checked)
|
||||||
{
|
{
|
||||||
// Make sure we have a valid sector (make a new one if needed)
|
// Make sure we have a valid sector (make a new one if needed)
|
||||||
if(l.Front != null) index = l.Front.Sector.Index; else index = -1;
|
if(l.Front != null) index = l.Map.GetIndexForSector(l.Front.Sector); else index = -1;
|
||||||
s = General.Map.Map.GetSectorByIndex(frontsector.GetResult(index));
|
s = General.Map.Map.GetSectorByIndex(frontsector.GetResult(index));
|
||||||
if(s == null) s = General.Map.Map.CreateSector();
|
if(s == null) s = General.Map.Map.CreateSector();
|
||||||
|
|
||||||
|
@ -408,7 +408,7 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
else if(backside.CheckState == CheckState.Checked)
|
else if(backside.CheckState == CheckState.Checked)
|
||||||
{
|
{
|
||||||
// Make sure we have a valid sector (make a new one if needed)
|
// Make sure we have a valid sector (make a new one if needed)
|
||||||
if(l.Back != null) index = l.Back.Sector.Index; else index = -1;
|
if(l.Back != null) index = l.Map.GetIndexForSector(l.Back.Sector); else index = -1;
|
||||||
s = General.Map.Map.GetSectorByIndex(backsector.GetResult(index));
|
s = General.Map.Map.GetSectorByIndex(backsector.GetResult(index));
|
||||||
if(s == null) s = General.Map.Map.CreateSector();
|
if(s == null) s = General.Map.Map.CreateSector();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue