mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-18 14:31:50 +00:00
Selected things are now dragged while dragging vertices, linedefs and sectors.
Error checks: added "Check unused textures" option. Replaced MissingTexture3D and UnknownTexture3D. Sectors mode: restored "Lower/Raise Floor/Ceiling by 8 mp" actions. Visual mode: in some cases sidedefs were rendered as selected when they were not. Existing linedefs were not split while drawing new lines in some cases. Texture and height overrides were not applied correctly in some cases. Preferences form: "Ctrl+Alt+ScrollUp" and "Ctrl+Alt+ScrollDown" dropdown items were setting the shortcut to "Ctrl+Shift+ScrollUp" and "Ctrl+Shift+ScrollDown".
This commit is contained in:
parent
f7085bd201
commit
c087d014a1
39 changed files with 509 additions and 172 deletions
|
@ -163,7 +163,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
this.args[i] = new ArgumentInfo(cfg, "thingtypes." + cat.Name + "." + key, i, enums);
|
||||
|
||||
// Safety
|
||||
if(this.radius < 4f) this.radius = 8f;
|
||||
if(this.radius < 4f) this.radius = 16f;
|
||||
|
||||
// Make long name for sprite lookup
|
||||
if(this.sprite.Length <= 8)
|
||||
|
|
33
Source/Core/Controls/ThingInfoPanel.Designer.cs
generated
33
Source/Core/Controls/ThingInfoPanel.Designer.cs
generated
|
@ -54,6 +54,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.spritetex = new System.Windows.Forms.Panel();
|
||||
this.flagsPanel = new System.Windows.Forms.GroupBox();
|
||||
this.flags = new System.Windows.Forms.ListView();
|
||||
this.anglecontrol = new CodeImp.DoomBuilder.GZBuilder.Controls.AngleControl();
|
||||
label5 = new System.Windows.Forms.Label();
|
||||
label4 = new System.Windows.Forms.Label();
|
||||
label3 = new System.Windows.Forms.Label();
|
||||
|
@ -90,15 +91,6 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
label3.TabIndex = 3;
|
||||
label3.Text = "Position:";
|
||||
//
|
||||
// labelaction
|
||||
//
|
||||
this.labelaction.AutoSize = true;
|
||||
this.labelaction.Location = new System.Drawing.Point(17, 39);
|
||||
this.labelaction.Name = "labelaction";
|
||||
this.labelaction.Size = new System.Drawing.Size(41, 14);
|
||||
this.labelaction.TabIndex = 2;
|
||||
this.labelaction.Text = "Action:";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
|
@ -108,8 +100,18 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
label1.TabIndex = 0;
|
||||
label1.Text = "Type:";
|
||||
//
|
||||
// labelaction
|
||||
//
|
||||
this.labelaction.AutoSize = true;
|
||||
this.labelaction.Location = new System.Drawing.Point(17, 39);
|
||||
this.labelaction.Name = "labelaction";
|
||||
this.labelaction.Size = new System.Drawing.Size(41, 14);
|
||||
this.labelaction.TabIndex = 2;
|
||||
this.labelaction.Text = "Action:";
|
||||
//
|
||||
// infopanel
|
||||
//
|
||||
this.infopanel.Controls.Add(this.anglecontrol);
|
||||
this.infopanel.Controls.Add(this.arg5);
|
||||
this.infopanel.Controls.Add(this.arglbl5);
|
||||
this.infopanel.Controls.Add(this.arglbl4);
|
||||
|
@ -242,9 +244,9 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.angle.AutoSize = true;
|
||||
this.angle.Location = new System.Drawing.Point(206, 77);
|
||||
this.angle.Name = "angle";
|
||||
this.angle.Size = new System.Drawing.Size(13, 14);
|
||||
this.angle.Size = new System.Drawing.Size(25, 14);
|
||||
this.angle.TabIndex = 11;
|
||||
this.angle.Text = "0";
|
||||
this.angle.Text = "270";
|
||||
//
|
||||
// tag
|
||||
//
|
||||
|
@ -337,6 +339,14 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.flags.UseCompatibleStateImageBehavior = false;
|
||||
this.flags.View = System.Windows.Forms.View.List;
|
||||
//
|
||||
// anglecontrol
|
||||
//
|
||||
this.anglecontrol.Angle = 0;
|
||||
this.anglecontrol.Location = new System.Drawing.Point(234, 71);
|
||||
this.anglecontrol.Name = "anglecontrol";
|
||||
this.anglecontrol.Size = new System.Drawing.Size(24, 24);
|
||||
this.anglecontrol.TabIndex = 38;
|
||||
//
|
||||
// ThingInfoPanel
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
|
@ -381,6 +391,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
private System.Windows.Forms.GroupBox flagsPanel;
|
||||
private System.Windows.Forms.ListView flags;
|
||||
private System.Windows.Forms.Label labelaction;
|
||||
private CodeImp.DoomBuilder.GZBuilder.Controls.AngleControl anglecontrol;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -129,6 +129,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
position.Text = t.Position.x.ToString() + ", " + t.Position.y.ToString() + ", " + zinfo;
|
||||
tag.Text = t.Tag.ToString();
|
||||
angle.Text = t.AngleDoom.ToString() + "\u00B0";
|
||||
anglecontrol.Angle = t.AngleDoom;
|
||||
anglecontrol.Left = angle.Right + 1;
|
||||
|
||||
// Sprite
|
||||
if(ti.Sprite.ToLowerInvariant().StartsWith(DataManager.INTERNAL_PREFIX) && (ti.Sprite.Length > DataManager.INTERNAL_PREFIX.Length))
|
||||
|
|
|
@ -135,15 +135,15 @@
|
|||
<metadata name="label3.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="labelaction.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label1.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="labelaction.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="infopanel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
@ -201,4 +201,10 @@
|
|||
<metadata name="spritetex.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="spritename.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="spritetex.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
|
@ -77,7 +77,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Special images
|
||||
private ImageData missingtexture3d;
|
||||
private ImageData unknowntexture3d;
|
||||
private UnknownImage unknownImage; //mxd
|
||||
private UnknownImage unknownimage; //mxd
|
||||
private ImageData hourglass3d;
|
||||
private ImageData crosshair;
|
||||
private ImageData crosshairbusy;
|
||||
|
@ -168,7 +168,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
whitetexture.UseColorCorrection = false;
|
||||
whitetexture.LoadImage();
|
||||
whitetexture.CreateTexture();
|
||||
unknownImage = new UnknownImage(Properties.Resources.UnknownImage); //mxd. There should be only one!
|
||||
unknownimage = new UnknownImage(Properties.Resources.UnknownImage); //mxd. There should be only one!
|
||||
}
|
||||
|
||||
// Disposer
|
||||
|
@ -191,8 +191,8 @@ namespace CodeImp.DoomBuilder.Data
|
|||
crosshairbusy = null;
|
||||
whitetexture.Dispose();
|
||||
whitetexture = null;
|
||||
unknownImage.Dispose(); //mxd
|
||||
unknownImage = null; //mxd
|
||||
unknownimage.Dispose(); //mxd
|
||||
unknownimage = null; //mxd
|
||||
modeldefEntries = null;//mxd
|
||||
mapInfo = null;
|
||||
|
||||
|
@ -921,7 +921,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
// Return null image
|
||||
return unknownImage; //mxd
|
||||
return unknownimage; //mxd
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -1005,7 +1005,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if(flats.ContainsKey(longname)) return flats[longname];
|
||||
|
||||
// Return null image
|
||||
return unknownImage; //mxd
|
||||
return unknownimage; //mxd
|
||||
}
|
||||
|
||||
// This returns an image by long and doesn't check if it exists
|
||||
|
|
|
@ -58,5 +58,18 @@ namespace CodeImp.DoomBuilder.GZBuilder.Tools
|
|||
if(fields == null) return defaultValue;
|
||||
return fields.GetValue(key, defaultValue);
|
||||
}
|
||||
|
||||
public static void ClearFields(UniFields fields, string[] keys) {
|
||||
if(fields == null) return;
|
||||
|
||||
foreach(string key in keys){
|
||||
if(fields.ContainsKey(key)) fields.Remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
public static void ClearField(UniFields fields, string key) {
|
||||
if(fields == null || !fields.ContainsKey(key)) return;
|
||||
fields.Remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -510,7 +510,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
}
|
||||
|
||||
// Use defaults where no settings could be found
|
||||
TakeSidedefDefaults(ref sourceside, useOverrides);
|
||||
TakeSidedefDefaults(ref sourceside);
|
||||
|
||||
// Found a source sector?
|
||||
if(sourcesector != null)
|
||||
|
@ -558,11 +558,6 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
}
|
||||
|
||||
// Update line
|
||||
if(useOverrides) { //mxd
|
||||
if(ls.Line.Front != null) ls.Line.Front.ShiftTextures();
|
||||
if(ls.Line.Back != null) ls.Line.Back.ShiftTextures();
|
||||
}
|
||||
|
||||
if(ls.Line.Front != null) ls.Line.Front.RemoveUnneededTextures(wassinglesided);
|
||||
if(ls.Line.Back != null) ls.Line.Back.RemoveUnneededTextures(wassinglesided);
|
||||
|
||||
|
@ -578,7 +573,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
|
||||
|
||||
// This joins a sector with the given lines and sides. Returns null when operation could not be completed.
|
||||
public static Sector JoinSector(List<LinedefSide> alllines, Sidedef original, bool useOverrides)
|
||||
public static Sector JoinSector(List<LinedefSide> alllines, Sidedef original)
|
||||
{
|
||||
SidedefSettings sourceside = new SidedefSettings();
|
||||
|
||||
|
@ -586,7 +581,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
TakeSidedefSettings(ref sourceside, original);
|
||||
|
||||
// Use defaults where no settings could be found
|
||||
TakeSidedefDefaults(ref sourceside, useOverrides);
|
||||
TakeSidedefDefaults(ref sourceside);
|
||||
|
||||
// Go for all sides to make sidedefs
|
||||
foreach(LinedefSide ls in alllines)
|
||||
|
@ -602,7 +597,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
ls.Line.ApplySidedFlags();
|
||||
|
||||
// We must remove the (now useless) middle texture on the other side
|
||||
if(ls.Line.Back != null) ls.Line.Back.RemoveUnneededTextures(true, false, true);
|
||||
if(ls.Line.Back != null) ls.Line.Back.RemoveUnneededTextures(true, true);
|
||||
}
|
||||
// Added 23-9-08, can we do this or will it break things?
|
||||
else if(!original.Sector.IsDisposed) //mxd
|
||||
|
@ -622,7 +617,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
ls.Line.ApplySidedFlags();
|
||||
|
||||
// We must remove the (now useless) middle texture on the other side
|
||||
if(ls.Line.Front != null) ls.Line.Front.RemoveUnneededTextures(true, false, true);
|
||||
if(ls.Line.Front != null) ls.Line.Front.RemoveUnneededTextures(true, true);
|
||||
}
|
||||
// Added 23-9-08, can we do this or will it break things?
|
||||
else if(!original.Sector.IsDisposed) //mxd
|
||||
|
@ -678,15 +673,12 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
}
|
||||
|
||||
// This takes default settings if not taken yet
|
||||
private static void TakeSidedefDefaults(ref SidedefSettings settings, bool useOverrides)
|
||||
private static void TakeSidedefDefaults(ref SidedefSettings settings)
|
||||
{
|
||||
// Use defaults where no settings could be found
|
||||
if(settings.newtexhigh == null || (useOverrides && General.Map.Options.OverrideTopTexture))
|
||||
settings.newtexhigh = General.Map.Options.DefaultTopTexture;
|
||||
if(settings.newtexmid == null || (useOverrides && General.Map.Options.OverrideMiddleTexture))
|
||||
settings.newtexmid = General.Map.Options.DefaultWallTexture;
|
||||
if(settings.newtexlow == null || (useOverrides && General.Map.Options.OverrideBottomTexture))
|
||||
settings.newtexlow = General.Map.Options.DefaultBottomTexture;
|
||||
if(settings.newtexhigh == null) settings.newtexhigh = General.Map.Options.DefaultTopTexture;
|
||||
if(settings.newtexmid == null) settings.newtexmid = General.Map.Options.DefaultWallTexture;
|
||||
if(settings.newtexlow == null) settings.newtexlow = General.Map.Options.DefaultBottomTexture;
|
||||
}
|
||||
|
||||
// This takes sidedef settings if not taken yet
|
||||
|
@ -717,6 +709,13 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
s.CeilHeight = (General.Map.Options.OverrideCeilingHeight ? General.Map.Options.CustomCeilingHeight : General.Settings.DefaultCeilingHeight);
|
||||
s.Brightness = (General.Map.Options.OverrideBrightness ? General.Map.Options.CustomBrightness : General.Settings.DefaultBrightness);
|
||||
}
|
||||
|
||||
//mxd. This applies overrides to a sidedef
|
||||
private static void ApplyOverridesToSidedef(Sidedef sd) {
|
||||
if (General.Map.Options.OverrideTopTexture) sd.SetTextureHigh(General.Map.Options.DefaultTopTexture);
|
||||
if(sd.MiddleRequired() && General.Map.Options.OverrideMiddleTexture) sd.SetTextureMid(General.Map.Options.DefaultWallTexture);
|
||||
if(General.Map.Options.OverrideBottomTexture) sd.SetTextureLow(General.Map.Options.DefaultBottomTexture);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -982,11 +981,12 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
// We prefer a closed polygon, because then we can determine the interior properly
|
||||
// Check if the two ends of the polygon are closed
|
||||
bool splittingonly = false;
|
||||
bool drawingclosed = false; //mxd
|
||||
if(newlines.Count > 0)
|
||||
{
|
||||
Linedef firstline = newlines[0];
|
||||
Linedef lastline = newlines[newlines.Count - 1];
|
||||
bool drawingclosed = (firstline.Start == lastline.End);
|
||||
drawingclosed = (firstline.Start == lastline.End);
|
||||
if(!drawingclosed)
|
||||
{
|
||||
// When not closed, we will try to find a path to close it.
|
||||
|
@ -1151,10 +1151,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
*/
|
||||
|
||||
// Begin at first vertex in path
|
||||
if(pathforward)
|
||||
v1 = firstline.Start;
|
||||
else
|
||||
v1 = lastline.End;
|
||||
v1 = (pathforward ? firstline.Start : lastline.End);
|
||||
|
||||
// Go for all vertices in the path to make additional lines
|
||||
for(int i = 1; i < shortestpath.Count; i++)
|
||||
|
@ -1333,7 +1330,8 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
if(!istruenewsector || !splittingonly)
|
||||
{
|
||||
// Make the new sector
|
||||
Sector newsector = Tools.MakeSector(sectorlines, oldlines, useOverrides);
|
||||
//mxd. Apply sector overrides only if a closed drawing is created
|
||||
Sector newsector = Tools.MakeSector(sectorlines, oldlines, (useOverrides && drawingclosed && newlines.Count > 2));
|
||||
if(newsector == null) return false;
|
||||
|
||||
if(istruenewsector) newsector.Marked = true;
|
||||
|
@ -1375,7 +1373,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
joinsidedef = ls.Line.Front;
|
||||
break;
|
||||
}
|
||||
else if(!ls.Front && (ls.Line.Back != null))
|
||||
if(!ls.Front && (ls.Line.Back != null))
|
||||
{
|
||||
joinsidedef = ls.Line.Back;
|
||||
break;
|
||||
|
@ -1408,7 +1406,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
}
|
||||
|
||||
// Have our new lines join the existing sector
|
||||
if(Tools.JoinSector(newsectorlines, joinsidedef, useOverrides) == null)
|
||||
if(Tools.JoinSector(newsectorlines, joinsidedef) == null)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1432,6 +1430,15 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
if((newlines[i].Front != null) || (newlines[i].Back != null)) continue;
|
||||
newlines[i].Dispose();
|
||||
}
|
||||
|
||||
//mxd. Apply texture overrides
|
||||
if (useOverrides && !General.Settings.AutoClearSidedefTextures) {
|
||||
foreach(Linedef ld in newlines) {
|
||||
if(!newverts.Contains(ld.Start) || !newverts.Contains(ld.End)) continue;
|
||||
if (ld.Front != null) ApplyOverridesToSidedef(ld.Front);
|
||||
if (ld.Back != null) ApplyOverridesToSidedef(ld.Back);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//mxd. Auto-align new lines
|
||||
|
|
|
@ -2343,7 +2343,8 @@ namespace CodeImp.DoomBuilder.Map
|
|||
bool splitted;
|
||||
|
||||
//mxd. Create blockmap
|
||||
RectangleF area = CreateArea(verts);
|
||||
RectangleF area = CreateArea(lines);
|
||||
IncreaseArea(area, verts);
|
||||
BlockMap<BlockEntry> blockmap = new BlockMap<BlockEntry>(area);
|
||||
blockmap.AddVerticesSet(verts);
|
||||
blockmap.AddLinedefsSet(lines);
|
||||
|
|
|
@ -299,14 +299,13 @@ namespace CodeImp.DoomBuilder.Map
|
|||
// This removes textures that are not required
|
||||
public void RemoveUnneededTextures(bool removemiddle)
|
||||
{
|
||||
RemoveUnneededTextures(removemiddle, !General.Settings.AutoClearSidedefTextures, false);
|
||||
RemoveUnneededTextures(removemiddle, false);
|
||||
}
|
||||
|
||||
// This removes textures that are not required
|
||||
public void RemoveUnneededTextures(bool removemiddle, bool shiftMiddle, bool force)
|
||||
public void RemoveUnneededTextures(bool removemiddle, bool force)
|
||||
{
|
||||
bool changed = false; //mxd
|
||||
string curMidTex = this.texnamemid; //mxd
|
||||
|
||||
// The middle texture can be removed regardless of any sector tag or linedef action
|
||||
if(!MiddleRequired() && removemiddle)
|
||||
|
@ -325,61 +324,24 @@ namespace CodeImp.DoomBuilder.Map
|
|||
{
|
||||
if(!HighRequired())
|
||||
{
|
||||
if(shiftMiddle) { //mxd
|
||||
if(string.IsNullOrEmpty(this.texnamehigh) || this.texnamehigh == "-")
|
||||
SetTextureHigh(curMidTex);
|
||||
} else {
|
||||
if(!changed) { //mxd
|
||||
BeforePropsChange();
|
||||
changed = true;
|
||||
}
|
||||
this.texnamehigh = "-";
|
||||
this.longtexnamehigh = MapSet.EmptyLongName;
|
||||
General.Map.IsChanged = true;
|
||||
if(!changed) { //mxd
|
||||
BeforePropsChange();
|
||||
changed = true;
|
||||
}
|
||||
this.texnamehigh = "-";
|
||||
this.longtexnamehigh = MapSet.EmptyLongName;
|
||||
General.Map.IsChanged = true;
|
||||
}
|
||||
|
||||
if(!LowRequired())
|
||||
{
|
||||
if(shiftMiddle) { //mxd
|
||||
if(string.IsNullOrEmpty(this.texnamelow) || this.texnamelow == "-")
|
||||
SetTextureLow(curMidTex);
|
||||
} else {
|
||||
if(!changed) BeforePropsChange(); //mxd
|
||||
this.texnamelow = "-";
|
||||
this.longtexnamelow = MapSet.EmptyLongName;
|
||||
General.Map.IsChanged = true;
|
||||
}
|
||||
if(!changed) BeforePropsChange(); //mxd
|
||||
this.texnamelow = "-";
|
||||
this.longtexnamelow = MapSet.EmptyLongName;
|
||||
General.Map.IsChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//mxd
|
||||
internal void ShiftTextures() {
|
||||
BeforePropsChange();
|
||||
|
||||
if((string.IsNullOrEmpty(texnamehigh) || texnamehigh == "-") && (!General.Settings.AutoClearSidedefTextures || HighRequired())) {
|
||||
if(General.Map.Options.OverrideTopTexture) {
|
||||
texnamehigh = General.Map.Options.DefaultTopTexture;
|
||||
longtexnamehigh = Lump.MakeLongName(texnamehigh);
|
||||
} else {
|
||||
texnamehigh = texnamemid;
|
||||
longtexnamehigh = longtexnamemid;
|
||||
}
|
||||
}
|
||||
|
||||
if((string.IsNullOrEmpty(texnamelow) || texnamelow == "-") && (!General.Settings.AutoClearSidedefTextures || LowRequired())) {
|
||||
if(General.Map.Options.OverrideBottomTexture) {
|
||||
texnamelow = General.Map.Options.DefaultBottomTexture;
|
||||
longtexnamelow = Lump.MakeLongName(texnamelow);
|
||||
} else {
|
||||
texnamelow = texnamemid;
|
||||
longtexnamelow = longtexnamemid;
|
||||
}
|
||||
}
|
||||
|
||||
General.Map.IsChanged = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This checks if a texture is required
|
||||
|
|
|
@ -28,4 +28,4 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("1.14.0.1869")]
|
||||
[assembly: AssemblyVersion("1.14.0.1876")]
|
|
@ -780,18 +780,17 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
// This sets up background image vertices
|
||||
private void SetupBackground()
|
||||
{
|
||||
Vector2D ltpos, rbpos;
|
||||
Vector2D backoffset = new Vector2D(General.Map.Grid.BackgroundX, General.Map.Grid.BackgroundY);
|
||||
Vector2D backimagesize = new Vector2D(General.Map.Grid.Background.ScaledWidth, General.Map.Grid.Background.ScaledHeight);
|
||||
Vector2D backimagescale = new Vector2D(General.Map.Grid.BackgroundScaleX, General.Map.Grid.BackgroundScaleY);
|
||||
|
||||
// Scale the background image size
|
||||
backimagesize *= backimagescale;
|
||||
|
||||
// Only if a background image is set
|
||||
if((General.Map.Grid.Background != null) &&
|
||||
!(General.Map.Grid.Background is UnknownImage))
|
||||
if((General.Map.Grid.Background != null) && !(General.Map.Grid.Background is UnknownImage))
|
||||
{
|
||||
Vector2D ltpos, rbpos;
|
||||
Vector2D backoffset = new Vector2D(General.Map.Grid.BackgroundX, General.Map.Grid.BackgroundY);
|
||||
Vector2D backimagesize = new Vector2D(General.Map.Grid.Background.ScaledWidth, General.Map.Grid.Background.ScaledHeight);
|
||||
Vector2D backimagescale = new Vector2D(General.Map.Grid.BackgroundScaleX, General.Map.Grid.BackgroundScaleY);
|
||||
|
||||
// Scale the background image size
|
||||
backimagesize *= backimagescale;
|
||||
|
||||
// Make vertices
|
||||
backimageverts = CreateScreenVerts(windowsize);
|
||||
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 642 B After Width: | Height: | Size: 472 B |
Binary file not shown.
Before Width: | Height: | Size: 705 B After Width: | Height: | Size: 880 B |
|
@ -47,7 +47,6 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
|
||||
// Graphics
|
||||
protected IRenderer3D renderer;
|
||||
//private Renderer3D renderer3d;
|
||||
|
||||
// Options
|
||||
private bool processgeometry;
|
||||
|
|
|
@ -197,10 +197,8 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
// This gets the geometry list for the specified sidedef
|
||||
public List<VisualGeometry> GetSidedefGeometry(Sidedef sd)
|
||||
{
|
||||
if(sidedefgeometry.ContainsKey(sd)) {
|
||||
return sidedefgeometry[sd];
|
||||
} else
|
||||
return new List<VisualGeometry>();
|
||||
if(sidedefgeometry.ContainsKey(sd)) return sidedefgeometry[sd];
|
||||
return new List<VisualGeometry>();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -2547,12 +2547,12 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
string categoryStart = "<tr><td colspan=\"4\" bgcolor=\"#333333\"><strong style=\"color:#FFFFFF\">";
|
||||
string categoryEnd = "</strong></td></tr>";
|
||||
string fileName = "GZDB Keyboard Reference.html";
|
||||
CodeImp.DoomBuilder.Actions.Action[] actions = General.Actions.GetAllActions();
|
||||
Dictionary<string, List<CodeImp.DoomBuilder.Actions.Action>> sortedActions = new Dictionary<string, List<CodeImp.DoomBuilder.Actions.Action>>();
|
||||
Actions.Action[] actions = General.Actions.GetAllActions();
|
||||
Dictionary<string, List<Actions.Action>> sortedActions = new Dictionary<string, List<Actions.Action>>();
|
||||
|
||||
foreach(CodeImp.DoomBuilder.Actions.Action action in actions) {
|
||||
foreach(Actions.Action action in actions) {
|
||||
if(!sortedActions.ContainsKey(action.Category))
|
||||
sortedActions.Add(action.Category, new List<CodeImp.DoomBuilder.Actions.Action>());
|
||||
sortedActions.Add(action.Category, new List<Actions.Action>());
|
||||
sortedActions[action.Category].Add(action);
|
||||
}
|
||||
|
||||
|
@ -2568,23 +2568,23 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
"<tr><td colspan=\"4\" bgcolor=\"#333333\"><span style=\"font-size: 24px\"><strong style=\"color:#FFFFFF\">GZDoom Builder Shortcut Reference</strong></span></td></tr>");
|
||||
|
||||
//add descriptions
|
||||
foreach(KeyValuePair<string, List<CodeImp.DoomBuilder.Actions.Action>> category in sortedActions) {
|
||||
foreach(KeyValuePair<string, List<Actions.Action>> category in sortedActions) {
|
||||
//add category title
|
||||
html.AppendLine(categoryPadding);
|
||||
html.AppendLine(categoryStart + General.Actions.Categories[category.Key] + categoryEnd);
|
||||
html.AppendLine(columnLabels);
|
||||
|
||||
Dictionary<string, CodeImp.DoomBuilder.Actions.Action> actionsByTitle = new Dictionary<string, CodeImp.DoomBuilder.Actions.Action>();
|
||||
Dictionary<string, Actions.Action> actionsByTitle = new Dictionary<string, Actions.Action>();
|
||||
List<string> actionTitles = new List<string>();
|
||||
|
||||
foreach(CodeImp.DoomBuilder.Actions.Action action in category.Value) {
|
||||
foreach(Actions.Action action in category.Value) {
|
||||
actionsByTitle.Add(action.Title, action);
|
||||
actionTitles.Add(action.Title);
|
||||
}
|
||||
|
||||
actionTitles.Sort();
|
||||
|
||||
CodeImp.DoomBuilder.Actions.Action a;
|
||||
Actions.Action a;
|
||||
foreach(string title in actionTitles) {
|
||||
a = actionsByTitle[title];
|
||||
List<string> modifiers = new List<string>();
|
||||
|
@ -2594,6 +2594,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
html.AppendLine("<td><div align=\"center\">" + Actions.Action.GetShortcutKeyDesc(a.ShortcutKey) + "</div></td>");
|
||||
|
||||
if(a.DisregardControl) modifiers.Add("Ctrl");
|
||||
if(a.DisregardAlt) modifiers.Add("Alt");
|
||||
if(a.DisregardShift) modifiers.Add("Shift");
|
||||
|
||||
html.AppendLine("<td><div align=\"center\">" + string.Join(", ", modifiers.ToArray()) + "</div></td>");
|
||||
|
|
|
@ -625,8 +625,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
actioncontrol.Items.Add(new KeyControl(Keys.XButton2 | Keys.Alt | Keys.Control, "Ctrl+Alt+XButton2"));
|
||||
}
|
||||
if(a.AllowScroll && !a.DisregardAlt && !a.DisregardControl) {
|
||||
actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollUp | (int)Keys.Shift | (int)Keys.Alt, "Ctrl+Alt+ScrollUp"));
|
||||
actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollDown | (int)Keys.Shift | (int)Keys.Alt, "Ctrl+Alt+ScrollDown"));
|
||||
actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollUp | (int)Keys.Control | (int)Keys.Alt, "Ctrl+Alt+ScrollUp"));
|
||||
actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollDown | (int)Keys.Control | (int)Keys.Alt, "Ctrl+Alt+ScrollDown"));
|
||||
}
|
||||
|
||||
//Ctrl-Shift
|
||||
|
|
|
@ -233,6 +233,7 @@
|
|||
<Compile Include="ErrorChecks\CheckUnknownFlats.cs" />
|
||||
<Compile Include="ErrorChecks\CheckUnknownTextures.cs" />
|
||||
<Compile Include="ErrorChecks\CheckUnknownThings.cs" />
|
||||
<Compile Include="ErrorChecks\CheckUnusedTextures.cs" />
|
||||
<Compile Include="ErrorChecks\ResultNoErrors.cs" />
|
||||
<Compile Include="ErrorChecks\ResultSectorInvalid.cs" />
|
||||
<Compile Include="ErrorChecks\ResultStrayVertex.cs" />
|
||||
|
@ -241,6 +242,7 @@
|
|||
<Compile Include="ErrorChecks\ResultUnknownFlat.cs" />
|
||||
<Compile Include="ErrorChecks\ResultUnknownTexture.cs" />
|
||||
<Compile Include="ErrorChecks\ResultUnknownThing.cs" />
|
||||
<Compile Include="ErrorChecks\ResultUnusedTexture.cs" />
|
||||
<Compile Include="FindReplace\BaseFindLinedef.cs" />
|
||||
<Compile Include="FindReplace\BaseFindSector.cs" />
|
||||
<Compile Include="FindReplace\BaseFindThing.cs" />
|
||||
|
|
|
@ -46,12 +46,15 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
// List of old vertex positions
|
||||
private List<Vector2D> oldpositions;
|
||||
private List<Vector2D> oldthingpositions; //mxd
|
||||
|
||||
// List of selected items
|
||||
protected ICollection<Vertex> selectedverts;
|
||||
protected ICollection<Thing> selectedthings; //mxd
|
||||
|
||||
// List of non-selected items
|
||||
protected ICollection<Vertex> unselectedverts;
|
||||
protected ICollection<Thing> unselectedthings; //mxd
|
||||
|
||||
//mxd. List of sectors
|
||||
private List<Sector> selectedSectors;
|
||||
|
@ -117,12 +120,15 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// This will be set back to normal when we're done.
|
||||
General.Map.UndoRedo.IgnorePropChanges = true;
|
||||
|
||||
// Make list of selected vertices
|
||||
// Make list of selected vertices and things
|
||||
selectedverts = General.Map.Map.GetMarkedVertices(true);
|
||||
selectedthings = General.Map.Map.GetSelectedThings(true); //mxd
|
||||
|
||||
// Make list of non-selected vertices
|
||||
// This will be used for snapping to nearest items
|
||||
// Make list of non-selected vertices and things
|
||||
// Non-selected vertices will be used for snapping to nearest items
|
||||
unselectedverts = General.Map.Map.GetMarkedVertices(false);
|
||||
unselectedthings = new List<Thing>(); //mxd
|
||||
foreach(Thing t in General.Map.ThingsFilter.VisibleThings) if(!t.Selected) unselectedthings.Add(t);
|
||||
|
||||
// Get the nearest vertex for snapping
|
||||
dragitem = MapSet.NearestVertex(selectedverts, dragstartmappos);
|
||||
|
@ -135,6 +141,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
oldpositions = new List<Vector2D>(selectedverts.Count);
|
||||
foreach(Vertex v in selectedverts) oldpositions.Add(v.Position);
|
||||
|
||||
//mxd
|
||||
oldthingpositions = new List<Vector2D>(selectedthings.Count);
|
||||
foreach(Thing t in selectedthings) oldthingpositions.Add(t.Position);
|
||||
|
||||
// Also keep old position of the dragged item
|
||||
dragitemposition = dragitem.Position;
|
||||
|
||||
|
@ -308,6 +318,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
i++;
|
||||
}
|
||||
|
||||
//mxd. Move selected things
|
||||
i = 0;
|
||||
foreach(Thing t in selectedthings) {
|
||||
t.Move(oldthingpositions[i++] + offset);
|
||||
}
|
||||
|
||||
// Update labels
|
||||
int index = 0;
|
||||
foreach(Linedef l in unstablelines)
|
||||
|
|
|
@ -162,6 +162,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
renderer.Finish();
|
||||
}
|
||||
|
||||
//mxd. Render things
|
||||
if(renderer.StartThings(true)) {
|
||||
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
|
||||
renderer.RenderThingSet(unselectedthings, 1.0f);
|
||||
renderer.RenderThingSet(selectedthings, 1.0f);
|
||||
renderer.Finish();
|
||||
}
|
||||
|
||||
// Redraw overlay
|
||||
if(renderer.StartOverlay(true))
|
||||
{
|
||||
|
|
|
@ -168,6 +168,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
renderer.Finish();
|
||||
}
|
||||
|
||||
//mxd. Render things
|
||||
if(renderer.StartThings(true)) {
|
||||
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
|
||||
renderer.RenderThingSet(unselectedthings, 1.0f);
|
||||
renderer.RenderThingSet(selectedthings, 1.0f);
|
||||
renderer.Finish();
|
||||
}
|
||||
|
||||
// Redraw overlay
|
||||
if(renderer.StartOverlay(true))
|
||||
{
|
||||
|
|
|
@ -149,6 +149,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
renderer.Finish();
|
||||
}
|
||||
|
||||
//mxd. Render things
|
||||
if(renderer.StartThings(true)) {
|
||||
renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA);
|
||||
renderer.RenderThingSet(unselectedthings, 1.0f);
|
||||
renderer.RenderThingSet(selectedthings, 1.0f);
|
||||
renderer.Finish();
|
||||
}
|
||||
|
||||
// Redraw overlay
|
||||
if(renderer.StartOverlay(true))
|
||||
{
|
||||
|
|
|
@ -1735,6 +1735,78 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
General.Map.IsChanged = true;
|
||||
}
|
||||
|
||||
// Change heights
|
||||
[BeginAction("lowerfloor8")]
|
||||
public void LowerFloors8() {
|
||||
General.Interface.DisplayStatus(StatusType.Action, "Lowered floor heights by 8mp.");
|
||||
General.Map.UndoRedo.CreateUndo("Floor heights change", this, UndoGroup.FloorHeightChange, CreateSelectionCRC());
|
||||
|
||||
// Change heights
|
||||
ICollection<Sector> selected = General.Map.Map.GetSelectedSectors(true);
|
||||
if((selected.Count == 0) && (highlighted != null) && !highlighted.IsDisposed) selected.Add(highlighted);
|
||||
foreach(Sector s in selected) {
|
||||
s.FloorHeight -= 8;
|
||||
}
|
||||
|
||||
// Update
|
||||
General.Interface.RefreshInfo();
|
||||
General.Map.IsChanged = true;
|
||||
}
|
||||
|
||||
// Change heights
|
||||
[BeginAction("raisefloor8")]
|
||||
public void RaiseFloors8() {
|
||||
General.Interface.DisplayStatus(StatusType.Action, "Raised floor heights by 8mp.");
|
||||
General.Map.UndoRedo.CreateUndo("Floor heights change", this, UndoGroup.FloorHeightChange, CreateSelectionCRC());
|
||||
|
||||
// Change heights
|
||||
ICollection<Sector> selected = General.Map.Map.GetSelectedSectors(true);
|
||||
if((selected.Count == 0) && (highlighted != null) && !highlighted.IsDisposed) selected.Add(highlighted);
|
||||
foreach(Sector s in selected) {
|
||||
s.FloorHeight += 8;
|
||||
}
|
||||
|
||||
// Update
|
||||
General.Interface.RefreshInfo();
|
||||
General.Map.IsChanged = true;
|
||||
}
|
||||
|
||||
// Change heights
|
||||
[BeginAction("lowerceiling8")]
|
||||
public void LowerCeilings8() {
|
||||
General.Interface.DisplayStatus(StatusType.Action, "Lowered ceiling heights by 8mp.");
|
||||
General.Map.UndoRedo.CreateUndo("Ceiling heights change", this, UndoGroup.CeilingHeightChange, CreateSelectionCRC());
|
||||
|
||||
// Change heights
|
||||
ICollection<Sector> selected = General.Map.Map.GetSelectedSectors(true);
|
||||
if((selected.Count == 0) && (highlighted != null) && !highlighted.IsDisposed) selected.Add(highlighted);
|
||||
foreach(Sector s in selected) {
|
||||
s.CeilHeight -= 8;
|
||||
}
|
||||
|
||||
// Update
|
||||
General.Interface.RefreshInfo();
|
||||
General.Map.IsChanged = true;
|
||||
}
|
||||
|
||||
// Change heights
|
||||
[BeginAction("raiseceiling8")]
|
||||
public void RaiseCeilings8() {
|
||||
General.Interface.DisplayStatus(StatusType.Action, "Raised ceiling heights by 8mp.");
|
||||
General.Map.UndoRedo.CreateUndo("Ceiling heights change", this, UndoGroup.CeilingHeightChange, CreateSelectionCRC());
|
||||
|
||||
// Change heights
|
||||
ICollection<Sector> selected = General.Map.Map.GetSelectedSectors(true);
|
||||
if((selected.Count == 0) && (highlighted != null) && !highlighted.IsDisposed) selected.Add(highlighted);
|
||||
foreach(Sector s in selected) {
|
||||
s.CeilHeight += 8;
|
||||
}
|
||||
|
||||
// Update
|
||||
General.Interface.RefreshInfo();
|
||||
General.Map.IsChanged = true;
|
||||
}
|
||||
|
||||
//mxd. Raise brightness
|
||||
[BeginAction("raisebrightness8")]
|
||||
public void RaiseBrightness8() {
|
||||
|
|
|
@ -831,16 +831,21 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// Split the line with this vertex
|
||||
if(snaptonearest)
|
||||
{
|
||||
//mxd. Check if snapped vertex is on top of a linedef
|
||||
l = General.Map.Map.NearestLinedefRange(insertpos, 1 / rendererscale);
|
||||
if(l != null && l.SideOfLine(insertpos) != 0)
|
||||
l = null;
|
||||
//mxd. Check if snapped vertex is still on top of a linedef
|
||||
l = General.Map.Map.NearestLinedefRange(v.Position, BuilderPlug.Me.SplitLinedefsRange / rendererscale);
|
||||
|
||||
if(l != null) {
|
||||
//mxd
|
||||
if(v.Position == l.Start.Position || v.Position == l.End.Position) {
|
||||
General.Interface.DisplayStatus(StatusType.Info, "There's already a vertex here.");
|
||||
General.Map.UndoRedo.WithdrawUndo();
|
||||
return;
|
||||
}
|
||||
|
||||
General.Interface.DisplayStatus(StatusType.Action, "Split a linedef.");
|
||||
Linedef sld = l.Split(v);
|
||||
if(sld == null) {
|
||||
General.Map.UndoRedo.WithdrawUndo();
|
||||
General.Map.UndoRedo.WithdrawUndo();
|
||||
return;
|
||||
}
|
||||
BuilderPlug.Me.AdjustSplitCoordinates(l, sld);
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
#region ================== Namespaces
|
||||
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using System.Threading;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace CodeImp.DoomBuilder.BuilderModes
|
||||
{
|
||||
[ErrorChecker("Check unused textures", true, 60)]
|
||||
public class CheckUnusedTextures : ErrorChecker
|
||||
{
|
||||
#region ================== Constants
|
||||
|
||||
private int PROGRESS_STEP = 1000;
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Constructor / Destructor
|
||||
|
||||
// Constructor
|
||||
public CheckUnusedTextures()
|
||||
{
|
||||
// Total progress is done when all lines are checked
|
||||
SetTotalProgress(General.Map.Map.Sidedefs.Count / PROGRESS_STEP);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Methods
|
||||
|
||||
// This runs the check
|
||||
public override void Run()
|
||||
{
|
||||
int progress = 0;
|
||||
int stepprogress = 0;
|
||||
|
||||
// Go for all the sidedefs
|
||||
foreach(Sidedef sd in General.Map.Map.Sidedefs)
|
||||
{
|
||||
// Check upper texture
|
||||
if(!sd.HighRequired() && ((sd.HighTexture.Length > 1) || (sd.HighTexture != "-")))
|
||||
{
|
||||
SubmitResult(new ResultUnusedTexture(sd, SidedefPart.Upper));
|
||||
}
|
||||
|
||||
// Check lower texture
|
||||
if(!sd.LowRequired() && ((sd.LowTexture.Length > 1) || (sd.LowTexture != "-")))
|
||||
{
|
||||
SubmitResult(new ResultUnusedTexture(sd, SidedefPart.Lower));
|
||||
}
|
||||
|
||||
// Handle thread interruption
|
||||
try { Thread.Sleep(0); }
|
||||
catch(ThreadInterruptedException) { return; }
|
||||
|
||||
// We are making progress!
|
||||
if((++progress / PROGRESS_STEP) > stepprogress)
|
||||
{
|
||||
stepprogress = (progress / PROGRESS_STEP);
|
||||
AddProgress(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
#region ================== Namespaces
|
||||
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.Rendering;
|
||||
using CodeImp.DoomBuilder.GZBuilder.Tools;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace CodeImp.DoomBuilder.BuilderModes
|
||||
{
|
||||
public class ResultUnusedTexture : ErrorResult
|
||||
{
|
||||
#region ================== Variables
|
||||
|
||||
private Sidedef side;
|
||||
private SidedefPart part;
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Properties
|
||||
|
||||
public override int Buttons { get { return 1; } }
|
||||
public override string Button1Text { get { return "Remove Texture"; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Constructor / Destructor
|
||||
|
||||
// Constructor
|
||||
public ResultUnusedTexture(Sidedef sd, SidedefPart part)
|
||||
{
|
||||
// Initialize
|
||||
this.side = sd;
|
||||
this.part = part;
|
||||
this.viewobjects.Add(sd);
|
||||
this.description = "This sidedef uses an upper or lower texture, which is not required (it will never be visible ingame). Click the Remove Texture button to remove the texture (this will also reset texture offsets and scale in UDMF map format).";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Methods
|
||||
|
||||
// This must return the string that is displayed in the listbox
|
||||
public override string ToString()
|
||||
{
|
||||
switch(part)
|
||||
{
|
||||
case SidedefPart.Upper:
|
||||
return "Sidedef " + side.Index + " has unused upper texture \"" + side.HighTexture + "\"";
|
||||
|
||||
case SidedefPart.Middle:
|
||||
return "Sidedef " + side.Index + " has unused middle texture \"" + side.MiddleTexture + "\"";
|
||||
|
||||
case SidedefPart.Lower:
|
||||
return "Sidedef " + side.Index + " has unused lower texture \"" + side.LowTexture + "\"";
|
||||
|
||||
default:
|
||||
return "ERROR";
|
||||
}
|
||||
}
|
||||
|
||||
// Rendering
|
||||
public override void PlotSelection(IRenderer2D renderer)
|
||||
{
|
||||
renderer.PlotLinedef(side.Line, General.Colors.Selection);
|
||||
renderer.PlotVertex(side.Line.Start, ColorCollection.VERTICES);
|
||||
renderer.PlotVertex(side.Line.End, ColorCollection.VERTICES);
|
||||
}
|
||||
|
||||
// Fix by removing texture
|
||||
public override bool Button1Click(bool batchMode)
|
||||
{
|
||||
if(!batchMode) General.Map.UndoRedo.CreateUndo("Remove unused texture");
|
||||
if(General.Map.UDMF) side.Fields.BeforeFieldsChange();
|
||||
|
||||
switch(part)
|
||||
{
|
||||
case SidedefPart.Upper:
|
||||
side.SetTextureHigh("-");
|
||||
if(General.Map.UDMF) UDMFTools.ClearFields(side.Fields, new[] { "scalex_top", "scaley_top", "offsetx_top", "offsety_top" });
|
||||
break;
|
||||
|
||||
case SidedefPart.Lower:
|
||||
side.SetTextureLow("-");
|
||||
if(General.Map.UDMF) UDMFTools.ClearFields(side.Fields, new[] { "scalex_bottom", "scaley_bottom", "offsetx_bottom", "offsety_bottom" });
|
||||
break;
|
||||
}
|
||||
|
||||
General.Map.Map.Update();
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -28,4 +28,4 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("1.14.0.0")]
|
||||
[assembly: AssemblyVersion("1.14.0.1876")]
|
||||
|
|
|
@ -484,6 +484,54 @@ makedoor
|
|||
allowscroll = true;
|
||||
}
|
||||
|
||||
lowerfloor8
|
||||
{
|
||||
title = "Lower Floor by 8 mp";
|
||||
category = "sectors";
|
||||
description = "Lowers the highlighted or selected floor heights by 8 mp.";
|
||||
allowkeys = true;
|
||||
allowmouse = true;
|
||||
allowscroll = true;
|
||||
repeat = true;
|
||||
default = 458747;
|
||||
}
|
||||
|
||||
raisefloor8
|
||||
{
|
||||
title = "Raise Floor by 8 mp";
|
||||
category = "sectors";
|
||||
description = "Raises the highlighted or selected floor heights by 8 mp.";
|
||||
allowkeys = true;
|
||||
allowmouse = true;
|
||||
allowscroll = true;
|
||||
repeat = true;
|
||||
default = 458746;
|
||||
}
|
||||
|
||||
lowerceiling8
|
||||
{
|
||||
title = "Lower Ceiling by 8 mp";
|
||||
category = "sectors";
|
||||
description = "Lowers the highlighted or selected ceiling heights by 8 mp.";
|
||||
allowkeys = true;
|
||||
allowmouse = true;
|
||||
allowscroll = true;
|
||||
repeat = true;
|
||||
default = 393211;
|
||||
}
|
||||
|
||||
raiseceiling8
|
||||
{
|
||||
title = "Raise Ceiling by 8 mp";
|
||||
category = "sectors";
|
||||
description = "Raises the highlighted or selected ceiling heights by 8 mp.";
|
||||
allowkeys = true;
|
||||
allowmouse = true;
|
||||
allowscroll = true;
|
||||
repeat = true;
|
||||
default = 393210;
|
||||
}
|
||||
|
||||
errorcheckmode
|
||||
{
|
||||
title = "Map Analysis Mode";
|
||||
|
|
|
@ -1743,11 +1743,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
foreach(Sidedef sd in vs.Key.Sidedefs)
|
||||
{
|
||||
List<VisualGeometry> sidedefgeos = bvs.GetSidedefGeometry(sd);
|
||||
foreach(VisualGeometry sdg in sidedefgeos)
|
||||
{
|
||||
sdg.Selected = false;
|
||||
}
|
||||
//mxd. VisualSidedefParts can contain references to visual geometry, which is not present in VisualSector.sidedefgeometry
|
||||
bvs.GetSidedefParts(sd).DeselectAllParts();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1784,7 +1781,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
[EndAction("visualselect", BaseAction = true)]
|
||||
public void EndSelect()
|
||||
{
|
||||
//PreActionNoChange();
|
||||
IVisualEventReceiver target = GetTargetEventReceiver(true);
|
||||
target.OnSelectEnd();
|
||||
|
||||
|
@ -1957,9 +1953,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
if(minSelectedCeilingHeight < maxSelectedHeight) {
|
||||
General.Interface.DisplayStatus(StatusType.Warning, "Can't do: lowest ceiling is lower than highest floor!");
|
||||
return;
|
||||
} else {
|
||||
targetFloorHeight = maxSelectedHeight;
|
||||
}
|
||||
}
|
||||
targetFloorHeight = maxSelectedHeight;
|
||||
} else {
|
||||
//get next higher floor from surrounding unselected sectors
|
||||
foreach(KeyValuePair<Sector, VisualFloor> group in floors) {
|
||||
|
@ -2129,9 +2124,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
if(minSelectedHeight < maxSelectedFloorHeight) {
|
||||
General.Interface.DisplayStatus(StatusType.Warning, "Can't do: lowest ceiling is lower than highest floor!");
|
||||
return;
|
||||
} else {
|
||||
targetCeilingHeight = minSelectedHeight;
|
||||
}
|
||||
}
|
||||
targetCeilingHeight = minSelectedHeight;
|
||||
} else {
|
||||
//get next lower ceiling height from surrounding unselected sectors
|
||||
foreach(KeyValuePair<Sector, VisualCeiling> group in ceilings) {
|
||||
|
|
|
@ -116,8 +116,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// This updates this virtual the sector and neightbours if needed
|
||||
override public void UpdateSectorGeometry(bool includeneighbours)
|
||||
{
|
||||
if(isupdating)
|
||||
return;
|
||||
if(isupdating) return;
|
||||
|
||||
isupdating = true;
|
||||
changed = true;
|
||||
|
@ -302,18 +301,15 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
// Create upper part
|
||||
VisualUpper vu = parts.upper ?? new VisualUpper(mode, this, sd);
|
||||
if(vu.Setup())
|
||||
base.AddGeometry(vu);
|
||||
if(vu.Setup()) base.AddGeometry(vu);
|
||||
|
||||
// Create lower part
|
||||
VisualLower vl = parts.lower ?? new VisualLower(mode, this, sd);
|
||||
if(vl.Setup())
|
||||
base.AddGeometry(vl);
|
||||
if(vl.Setup()) base.AddGeometry(vl);
|
||||
|
||||
// Create middle part
|
||||
VisualMiddleDouble vm = parts.middledouble ?? new VisualMiddleDouble(mode, this, sd);
|
||||
if(vm.Setup())
|
||||
base.AddGeometry(vm);
|
||||
if(vm.Setup()) base.AddGeometry(vm);
|
||||
|
||||
// Create 3D wall parts
|
||||
SectorData osd = mode.GetSectorData(sd.Other.Sector);
|
||||
|
@ -325,10 +321,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
if(!ef.VavoomType && ef.IgnoreBottomHeight) continue; //mxd
|
||||
|
||||
VisualMiddle3D vm3 = (i < middles.Count) ? middles[i] : new VisualMiddle3D(mode, this, sd);
|
||||
if(vm3.Setup(ef))
|
||||
base.AddGeometry(vm3);
|
||||
if(i >= middles.Count)
|
||||
middles.Add(vm3);
|
||||
if(vm3.Setup(ef)) base.AddGeometry(vm3);
|
||||
if(i >= middles.Count) middles.Add(vm3);
|
||||
}
|
||||
|
||||
//mxd. Create backsides
|
||||
|
@ -338,8 +332,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
if (!ef.VavoomType && ef.RenderInside && !ef.IgnoreBottomHeight) {
|
||||
VisualMiddleBack vms = new VisualMiddleBack(mode, this, sd);
|
||||
if (vms.Setup(ef))
|
||||
base.AddGeometry(vms);
|
||||
if (vms.Setup(ef)) base.AddGeometry(vms);
|
||||
middlebacks.Add(vms);
|
||||
}
|
||||
}
|
||||
|
@ -351,8 +344,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
// Create middle part
|
||||
VisualMiddleSingle vm = parts.middlesingle ?? new VisualMiddleSingle(mode, this, sd);
|
||||
if(vm.Setup())
|
||||
base.AddGeometry(vm);
|
||||
if(vm.Setup()) base.AddGeometry(vm);
|
||||
|
||||
// Store
|
||||
sides.Add(sd, new VisualSidedefParts(vm));
|
||||
|
@ -366,10 +358,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// This returns the visual sidedef parts for a given sidedef
|
||||
public VisualSidedefParts GetSidedefParts(Sidedef sd)
|
||||
{
|
||||
if(sides.ContainsKey(sd))
|
||||
return sides[sd];
|
||||
else
|
||||
return new VisualSidedefParts();
|
||||
if(sides.ContainsKey(sd)) return sides[sd];
|
||||
return new VisualSidedefParts();
|
||||
}
|
||||
|
||||
//mxd
|
||||
|
|
|
@ -26,6 +26,7 @@ using CodeImp.DoomBuilder.Rendering;
|
|||
using CodeImp.DoomBuilder.Types;
|
||||
using CodeImp.DoomBuilder.VisualModes;
|
||||
using CodeImp.DoomBuilder.GZBuilder.Tools;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -90,7 +91,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
//Load ceiling texture
|
||||
if((s.CeilTexture.Length > 0) && (s.CeilTexture != "-")) {
|
||||
base.Texture = General.Map.Data.GetFlatImage(s.LongCeilTexture);
|
||||
if(base.Texture == null) {
|
||||
if(base.Texture == null || base.Texture is UnknownImage) {
|
||||
base.Texture = General.Map.Data.UnknownTexture3D;
|
||||
setuponloadedtexture = s.LongCeilTexture;
|
||||
} else {
|
||||
|
|
|
@ -26,6 +26,7 @@ using CodeImp.DoomBuilder.Rendering;
|
|||
using CodeImp.DoomBuilder.Types;
|
||||
using CodeImp.DoomBuilder.VisualModes;
|
||||
using CodeImp.DoomBuilder.GZBuilder.Tools;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -91,7 +92,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
if ((s.FloorTexture.Length > 0) && (s.FloorTexture != "-"))
|
||||
{
|
||||
base.Texture = General.Map.Data.GetFlatImage(s.LongFloorTexture);
|
||||
if (base.Texture == null)
|
||||
if(base.Texture == null || base.Texture is UnknownImage)
|
||||
{
|
||||
base.Texture = General.Map.Data.UnknownTexture3D;
|
||||
setuponloadedtexture = s.LongFloorTexture;
|
||||
|
|
|
@ -25,6 +25,7 @@ using CodeImp.DoomBuilder.Rendering;
|
|||
using CodeImp.DoomBuilder.Types;
|
||||
using CodeImp.DoomBuilder.VisualModes;
|
||||
using CodeImp.DoomBuilder.GZBuilder.Tools;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -94,7 +95,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
// Load texture
|
||||
base.Texture = General.Map.Data.GetTextureImage(Sidedef.LongLowTexture);
|
||||
if(base.Texture == null)
|
||||
if(base.Texture == null || base.Texture is UnknownImage)
|
||||
{
|
||||
base.Texture = General.Map.Data.UnknownTexture3D;
|
||||
setuponloadedtexture = Sidedef.LongLowTexture;
|
||||
|
|
|
@ -24,6 +24,7 @@ using CodeImp.DoomBuilder.Geometry;
|
|||
using CodeImp.DoomBuilder.Rendering;
|
||||
using CodeImp.DoomBuilder.Types;
|
||||
using CodeImp.DoomBuilder.VisualModes;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -110,7 +111,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
// Load texture
|
||||
base.Texture = General.Map.Data.GetTextureImage(textureLong);
|
||||
if(base.Texture == null)
|
||||
if(base.Texture == null || base.Texture is UnknownImage)
|
||||
{
|
||||
base.Texture = General.Map.Data.UnknownTexture3D;
|
||||
setuponloadedtexture = textureLong;
|
||||
|
|
|
@ -8,6 +8,7 @@ using CodeImp.DoomBuilder.Geometry;
|
|||
using CodeImp.DoomBuilder.Rendering;
|
||||
using CodeImp.DoomBuilder.Types;
|
||||
using CodeImp.DoomBuilder.VisualModes;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -87,7 +88,7 @@ namespace CodeImp.DoomBuilder.BuilderModes {
|
|||
if (textureLong != 0) {
|
||||
// Load texture
|
||||
base.Texture = General.Map.Data.GetTextureImage(textureLong);
|
||||
if (base.Texture == null) {
|
||||
if(base.Texture == null || base.Texture is UnknownImage) {
|
||||
base.Texture = General.Map.Data.UnknownTexture3D;
|
||||
setuponloadedtexture = textureLong;
|
||||
} else if (!base.Texture.IsImageLoaded) {
|
||||
|
|
|
@ -25,6 +25,7 @@ using CodeImp.DoomBuilder.Rendering;
|
|||
using CodeImp.DoomBuilder.Types;
|
||||
using CodeImp.DoomBuilder.VisualModes;
|
||||
using CodeImp.DoomBuilder.GZBuilder.Tools;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -99,7 +100,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// Load texture
|
||||
if ((Sidedef.MiddleTexture.Length > 0) && (Sidedef.MiddleTexture != "-")){
|
||||
base.Texture = General.Map.Data.GetTextureImage(Sidedef.LongMiddleTexture);
|
||||
if (base.Texture == null){
|
||||
if(base.Texture == null || base.Texture is UnknownImage) {
|
||||
base.Texture = General.Map.Data.UnknownTexture3D;
|
||||
setuponloadedtexture = Sidedef.LongMiddleTexture;
|
||||
} else if (!base.Texture.IsImageLoaded) {
|
||||
|
|
|
@ -25,6 +25,7 @@ using CodeImp.DoomBuilder.Rendering;
|
|||
using CodeImp.DoomBuilder.Types;
|
||||
using CodeImp.DoomBuilder.VisualModes;
|
||||
using CodeImp.DoomBuilder.GZBuilder.Tools;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -92,7 +93,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
// Load texture
|
||||
base.Texture = General.Map.Data.GetTextureImage(Sidedef.LongMiddleTexture);
|
||||
if(base.Texture == null)
|
||||
if(base.Texture == null || base.Texture is UnknownImage)
|
||||
{
|
||||
base.Texture = General.Map.Data.UnknownTexture3D;
|
||||
setuponloadedtexture = Sidedef.LongMiddleTexture;
|
||||
|
|
|
@ -71,5 +71,21 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
m.Setup();
|
||||
}
|
||||
}
|
||||
|
||||
//mxd
|
||||
public void DeselectAllParts() {
|
||||
if(lower != null) lower.Selected = false;
|
||||
if(middledouble != null) middledouble.Selected = false;
|
||||
if(middlesingle != null) middlesingle.Selected = false;
|
||||
if(upper != null) upper.Selected = false;
|
||||
if(middle3d != null) {
|
||||
foreach(VisualMiddle3D m in middle3d)
|
||||
m.Selected = false;
|
||||
}
|
||||
if(middleback != null) {
|
||||
foreach(VisualMiddleBack m in middleback)
|
||||
m.Selected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ using CodeImp.DoomBuilder.Rendering;
|
|||
using CodeImp.DoomBuilder.Types;
|
||||
using CodeImp.DoomBuilder.VisualModes;
|
||||
using CodeImp.DoomBuilder.GZBuilder.Tools;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -94,7 +95,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
// Load texture
|
||||
base.Texture = General.Map.Data.GetTextureImage(Sidedef.LongHighTexture);
|
||||
if(base.Texture == null)
|
||||
if(base.Texture == null || base.Texture is UnknownImage)
|
||||
{
|
||||
base.Texture = General.Map.Data.UnknownTexture3D;
|
||||
setuponloadedtexture = Sidedef.LongHighTexture;
|
||||
|
|
Loading…
Reference in a new issue