Removed: activating the same 2D mode repeatedly no longer toggles View modes.

Added "Next View Mode" and "Previous View Mode" actions.
Removed "Replace unused textures" checkboxes from Edit Linedefs window.
Fixed, SNDINFO parser: commented $ambient sound definitions were treated as editor comments (and still processed).
This commit is contained in:
MaxED 2016-06-05 22:06:56 +00:00 committed by spherallic
parent 47aeedc6e0
commit 8943dbc82e
8 changed files with 646 additions and 921 deletions

View File

@ -17,7 +17,9 @@
#region ================== Namespaces
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Actions;
using CodeImp.DoomBuilder.Geometry;
@ -943,6 +945,28 @@ namespace CodeImp.DoomBuilder.Editing
SetViewMode(ViewMode.CeilingTextures);
}
//mxd
[BeginAction("nextviewmode", BaseAction = true)]
protected virtual void NextViewMode()
{
List<ViewMode> vmodes = new List<ViewMode>(Enum.GetValues(typeof(ViewMode)).Cast<ViewMode>());
int curmode = vmodes.IndexOf(General.Map.Renderer2D.ViewMode);
curmode = (curmode == vmodes.Count - 1 ? 0 : ++curmode);
SetViewMode(vmodes[curmode]);
}
//mxd
[BeginAction("previousviewmode", BaseAction = true)]
protected virtual void PreviousViewMode()
{
List<ViewMode> vmodes = new List<ViewMode>(Enum.GetValues(typeof(ViewMode)).Cast<ViewMode>());
int curmode = vmodes.IndexOf(General.Map.Renderer2D.ViewMode);
curmode = (curmode == 0 ? vmodes.Count - 1 : --curmode);
SetViewMode(vmodes[curmode]);
}
//mxd
[BeginAction("centeroncoordinates", BaseAction = true)]
protected virtual void CenterOnCoordinates()

View File

@ -143,43 +143,34 @@ namespace CodeImp.DoomBuilder.Editing
}
}
// This switches to the mode by user command
// (when user presses shortcut key)
// This switches to the mode by user command (when user presses shortcut key)
public void UserSwitchToMode()
{
// Only when a map is opened
if(General.Map != null)
{
// Switching from volatile mode to volatile mode?
if((General.Editing.Mode != null) && General.Editing.Mode.Attributes.Volatile && this.attribs.Volatile)
//mxd. Not the same mode?
if(type != General.Editing.Mode.GetType())
{
// First cancel previous volatile mode
General.Editing.CancelVolatileMode();
// Switching from volatile mode to a different volatile mode?
if((General.Editing.Mode != null) && General.Editing.Mode.Attributes.Volatile && this.attribs.Volatile)
{
// First cancel previous volatile mode
General.Editing.CancelVolatileMode();
}
// Create instance
EditMode newmode = plugin.CreateObject<EditMode>(type);
//mxd. Switch mode?
if(newmode != null) General.Editing.ChangeMode(newmode);
}
// When in VisualMode and switching to the same VisualMode, then we switch back to the previous classic mode
if((General.Editing.Mode is VisualMode) && (type == General.Editing.Mode.GetType()))
// When in VisualMode and switching to the same VisualMode, switch back to the previous classic mode
else if(General.Editing.Mode is VisualMode)
{
// Switch back to last classic mode
General.Editing.ChangeMode(General.Editing.PreviousClassicMode.Name);
}
//mxd. The same mode? Switch view modes instead
else if(General.Editing.Mode is ClassicMode && General.Editing.Mode.GetType().FullName == type.FullName)
{
List<ViewMode> vmodes = new List<ViewMode>(Enum.GetValues(typeof(ViewMode)).Cast<ViewMode>());
int curmode = vmodes.IndexOf(General.Map.Renderer2D.ViewMode);
curmode = (curmode == vmodes.Count - 1 ? 0 : ++curmode);
ClassicMode.SetViewMode(vmodes[curmode]);
}
else
{
// Create instance
EditMode newmode = plugin.CreateObject<EditMode>(type);
//mxd. Switch mode?
if(newmode != null) General.Editing.ChangeMode(newmode);
}
}
}

View File

@ -1520,7 +1520,7 @@ namespace CodeImp.DoomBuilder.Rendering
int i = 0;
int size = waypoints.Count;
int seqStart = 0;
TextLabel[] sequencelabels = new TextLabel[256];
ITextLabel[] sequencelabels = new ITextLabel[256];
while (i < size)
{
int iNext = i + 1;

View File

@ -1068,6 +1068,26 @@ viewmodeceilings
allowscroll = false;
}
nextviewmode //mxd
{
title = "Next View Mode";
category = "view";
description = "This switches to next view mode.";
allowkeys = true;
allowmouse = true;
allowscroll = false;
}
previousviewmode //mxd
{
title = "Previous View Mode";
category = "view";
description = "This switches to previous view mode.";
allowkeys = true;
allowmouse = true;
allowscroll = false;
}
togglecomments //mxd
{
title = "Toggle Comments";

File diff suppressed because it is too large Load Diff

View File

@ -151,12 +151,6 @@ namespace CodeImp.DoomBuilder.Windows
apply.Top = panel.Bottom + panel.Margin.Bottom + apply.Margin.Top;
cancel.Top = apply.Top;
//mxd. Apply texture replacement settings
preventchanges = true;
replaceunusedfronttextures.Checked = General.Settings.ReadSetting("editlinedefswindow.replaceunusedfronttextures", true);
replaceunusedbacktextures.Checked = General.Settings.ReadSetting("editlinedefswindow.replaceunusedbacktextures", true);
preventchanges = false;
// Update window height
this.Height = apply.Bottom + apply.Margin.Bottom * 2 + (this.Height - this.ClientRectangle.Height) + 1;
}
@ -603,10 +597,6 @@ namespace CodeImp.DoomBuilder.Windows
{
// Save location
location = this.Location;
// Save persistent settings
General.Settings.WriteSetting("editlinedefswindow.replaceunusedfronttextures", replaceunusedfronttextures.Checked);
General.Settings.WriteSetting("editlinedefswindow.replaceunusedbacktextures", replaceunusedbacktextures.Checked);
}
// Help!
@ -687,15 +677,9 @@ namespace CodeImp.DoomBuilder.Windows
// Update values
else
{
int i = 0;
foreach(Linedef l in lines)
{
if(l.Front != null
&& (replaceunusedfronttextures.Checked
|| (l.Front.HighRequired()
|| (linedefprops[i].Front != null && linedefprops[i].Front.HighTexture != "-"))))
l.Front.SetTextureHigh(fronthigh.GetResult(l.Front.HighTexture));
i++;
if(l.Front != null) l.Front.SetTextureHigh(fronthigh.GetResult(l.Front.HighTexture));
}
}
@ -724,15 +708,9 @@ namespace CodeImp.DoomBuilder.Windows
// Update values
else
{
int i = 0;
foreach(Linedef l in lines)
{
if(l.Front != null
&& (replaceunusedfronttextures.Checked
|| (l.Front.MiddleRequired()
|| (linedefprops[i].Front != null && linedefprops[i].Front.MiddleTexture != "-"))))
l.Front.SetTextureMid(frontmid.GetResult(l.Front.MiddleTexture));
i++;
if(l.Front != null) l.Front.SetTextureMid(frontmid.GetResult(l.Front.MiddleTexture));
}
}
@ -761,15 +739,9 @@ namespace CodeImp.DoomBuilder.Windows
// Update values
else
{
int i = 0;
foreach(Linedef l in lines)
{
if(l.Front != null
&& (replaceunusedfronttextures.Checked
|| (l.Front.LowRequired()
|| (linedefprops[i].Front != null && linedefprops[i].Front.LowTexture != "-"))))
l.Front.SetTextureLow(frontlow.GetResult(l.Front.LowTexture));
i++;
if(l.Front != null) l.Front.SetTextureLow(frontlow.GetResult(l.Front.LowTexture));
}
}
@ -798,15 +770,9 @@ namespace CodeImp.DoomBuilder.Windows
// Update values
else
{
int i = 0;
foreach(Linedef l in lines)
{
if(l.Back != null
&& (replaceunusedbacktextures.Checked
|| (l.Back.HighRequired()
|| (linedefprops[i].Back != null && linedefprops[i].Back.HighTexture != "-"))))
l.Back.SetTextureHigh(backhigh.GetResult(l.Back.HighTexture));
i++;
if(l.Back != null) l.Back.SetTextureHigh(backhigh.GetResult(l.Back.HighTexture));
}
}
@ -835,15 +801,9 @@ namespace CodeImp.DoomBuilder.Windows
// Update values
else
{
int i = 0;
foreach(Linedef l in lines)
{
if(l.Back != null
&& (replaceunusedbacktextures.Checked
|| (l.Back.MiddleRequired()
|| (linedefprops[i].Back != null && linedefprops[i].Back.MiddleTexture != "-"))))
l.Back.SetTextureMid(backmid.GetResult(l.Back.MiddleTexture));
i++;
if(l.Back != null) l.Back.SetTextureMid(backmid.GetResult(l.Back.MiddleTexture));
}
}
@ -872,15 +832,9 @@ namespace CodeImp.DoomBuilder.Windows
// Update values
else
{
int i = 0;
foreach(Linedef l in lines)
{
if(l.Back != null
&& (replaceunusedbacktextures.Checked
|| (l.Back.LowRequired()
|| (linedefprops[i].Back != null && linedefprops[i].Back.LowTexture != "-"))))
l.Back.SetTextureLow(backlow.GetResult(l.Back.LowTexture));
i++;
if(l.Back != null) l.Back.SetTextureLow(backlow.GetResult(l.Back.LowTexture));
}
}
@ -891,86 +845,6 @@ namespace CodeImp.DoomBuilder.Windows
if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
}
private void replaceunusedfronttextures_CheckedChanged(object sender, EventArgs e)
{
//Re-apply front textures
if(preventchanges) return;
MakeUndo();
// Set values
int i = 0;
foreach(Linedef l in lines)
{
if(l.Front == null) continue;
// Update top texture
if(!replaceunusedfronttextures.Checked || string.IsNullOrEmpty(fronthigh.TextureName))
l.Front.SetTextureHigh(linedefprops[i].Front != null ? linedefprops[i].Front.HighTexture : "-");
else
l.Front.SetTextureHigh(fronthigh.GetResult(l.Front.HighTexture));
// Update middle texture
if(!replaceunusedfronttextures.Checked || string.IsNullOrEmpty(frontmid.TextureName))
l.Front.SetTextureMid(linedefprops[i].Front != null ? linedefprops[i].Front.MiddleTexture : "-");
else
l.Front.SetTextureMid(frontmid.GetResult(l.Front.MiddleTexture));
// Update bottom texture
if(!replaceunusedfronttextures.Checked || string.IsNullOrEmpty(frontlow.TextureName))
l.Front.SetTextureLow(linedefprops[i].Front != null ? linedefprops[i].Front.LowTexture : "-");
else
l.Front.SetTextureLow(frontlow.GetResult(l.Front.LowTexture));
i++;
}
// Update the used textures
General.Map.Data.UpdateUsedTextures();
General.Map.IsChanged = true;
if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
}
private void replaceunusedbacktextures_CheckedChanged(object sender, EventArgs e)
{
//Re-apply back textures
if(preventchanges) return;
MakeUndo();
// Set values
int i = 0;
foreach(Linedef l in lines)
{
if(l.Back == null) continue;
// Update top texture
if(!replaceunusedbacktextures.Checked || string.IsNullOrEmpty(backhigh.TextureName))
l.Back.SetTextureHigh(linedefprops[i].Back != null ? linedefprops[i].Back.HighTexture : "-");
else
l.Back.SetTextureHigh(backhigh.GetResult(l.Back.HighTexture));
// Update middle texture
if(!replaceunusedbacktextures.Checked || string.IsNullOrEmpty(backmid.TextureName))
l.Back.SetTextureMid(linedefprops[i].Back != null ? linedefprops[i].Back.MiddleTexture : "-");
else
l.Back.SetTextureMid(backmid.GetResult(l.Back.MiddleTexture));
// Update bottom texture
if(!replaceunusedbacktextures.Checked || string.IsNullOrEmpty(backlow.TextureName))
l.Back.SetTextureLow(linedefprops[i].Back != null ? linedefprops[i].Back.LowTexture : "-");
else
l.Back.SetTextureLow(backlow.GetResult(l.Back.LowTexture));
i++;
}
// Update the used textures
General.Map.Data.UpdateUsedTextures();
General.Map.IsChanged = true;
if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
}
private void frontTextureOffset_OnValuesChanged(object sender, EventArgs e)
{
if(preventchanges) return;

View File

@ -60,7 +60,6 @@ namespace CodeImp.DoomBuilder.Windows
this.tabfront = new System.Windows.Forms.TabPage();
this.frontside = new System.Windows.Forms.CheckBox();
this.frontgroup = new System.Windows.Forms.GroupBox();
this.replaceunusedfronttextures = new System.Windows.Forms.CheckBox();
this.frontflagsgroup = new System.Windows.Forms.GroupBox();
this.flagsFront = new CodeImp.DoomBuilder.Controls.CheckboxArrayControl();
this.frontscalegroup = new System.Windows.Forms.GroupBox();
@ -91,7 +90,6 @@ namespace CodeImp.DoomBuilder.Windows
this.tabback = new System.Windows.Forms.TabPage();
this.backside = new System.Windows.Forms.CheckBox();
this.backgroup = new System.Windows.Forms.GroupBox();
this.replaceunusedbacktextures = new System.Windows.Forms.CheckBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.resetbacklight = new System.Windows.Forms.Button();
this.backsector = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
@ -498,7 +496,6 @@ namespace CodeImp.DoomBuilder.Windows
this.frontgroup.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.frontgroup.Controls.Add(this.replaceunusedfronttextures);
this.frontgroup.Controls.Add(this.frontflagsgroup);
this.frontgroup.Controls.Add(this.frontscalegroup);
this.frontgroup.Controls.Add(this.groupBox6);
@ -514,17 +511,6 @@ namespace CodeImp.DoomBuilder.Windows
this.frontgroup.TabStop = false;
this.frontgroup.Text = " ";
//
// replaceunusedfronttextures
//
this.replaceunusedfronttextures.AutoSize = true;
this.replaceunusedfronttextures.Location = new System.Drawing.Point(312, 15);
this.replaceunusedfronttextures.Name = "replaceunusedfronttextures";
this.replaceunusedfronttextures.Size = new System.Drawing.Size(144, 17);
this.replaceunusedfronttextures.TabIndex = 46;
this.replaceunusedfronttextures.Text = "Replace unused textures";
this.replaceunusedfronttextures.UseVisualStyleBackColor = true;
this.replaceunusedfronttextures.CheckedChanged += new System.EventHandler(this.replaceunusedfronttextures_CheckedChanged);
//
// frontflagsgroup
//
this.frontflagsgroup.Controls.Add(this.flagsFront);
@ -864,11 +850,11 @@ namespace CodeImp.DoomBuilder.Windows
//
// frontlow
//
this.frontlow.Location = new System.Drawing.Point(309, 415);
this.frontlow.Location = new System.Drawing.Point(309, 409);
this.frontlow.MultipleTextures = false;
this.frontlow.Name = "frontlow";
this.frontlow.Required = false;
this.frontlow.Size = new System.Drawing.Size(220, 184);
this.frontlow.Size = new System.Drawing.Size(220, 189);
this.frontlow.TabIndex = 6;
this.frontlow.TextureName = "";
this.frontlow.UsePreviews = false;
@ -876,11 +862,11 @@ namespace CodeImp.DoomBuilder.Windows
//
// frontmid
//
this.frontmid.Location = new System.Drawing.Point(309, 225);
this.frontmid.Location = new System.Drawing.Point(309, 214);
this.frontmid.MultipleTextures = false;
this.frontmid.Name = "frontmid";
this.frontmid.Required = false;
this.frontmid.Size = new System.Drawing.Size(220, 184);
this.frontmid.Size = new System.Drawing.Size(220, 189);
this.frontmid.TabIndex = 5;
this.frontmid.TextureName = "";
this.frontmid.UsePreviews = false;
@ -888,11 +874,11 @@ namespace CodeImp.DoomBuilder.Windows
//
// fronthigh
//
this.fronthigh.Location = new System.Drawing.Point(309, 35);
this.fronthigh.Location = new System.Drawing.Point(309, 19);
this.fronthigh.MultipleTextures = false;
this.fronthigh.Name = "fronthigh";
this.fronthigh.Required = false;
this.fronthigh.Size = new System.Drawing.Size(220, 184);
this.fronthigh.Size = new System.Drawing.Size(220, 189);
this.fronthigh.TabIndex = 4;
this.fronthigh.TextureName = "";
this.fronthigh.UsePreviews = false;
@ -928,7 +914,6 @@ namespace CodeImp.DoomBuilder.Windows
this.backgroup.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.backgroup.Controls.Add(this.replaceunusedbacktextures);
this.backgroup.Controls.Add(this.groupBox4);
this.backgroup.Controls.Add(this.backflagsgroup);
this.backgroup.Controls.Add(this.backscalegroup);
@ -944,17 +929,6 @@ namespace CodeImp.DoomBuilder.Windows
this.backgroup.TabStop = false;
this.backgroup.Text = " ";
//
// replaceunusedbacktextures
//
this.replaceunusedbacktextures.AutoSize = true;
this.replaceunusedbacktextures.Location = new System.Drawing.Point(312, 15);
this.replaceunusedbacktextures.Name = "replaceunusedbacktextures";
this.replaceunusedbacktextures.Size = new System.Drawing.Size(144, 17);
this.replaceunusedbacktextures.TabIndex = 47;
this.replaceunusedbacktextures.Text = "Replace unused textures";
this.replaceunusedbacktextures.UseVisualStyleBackColor = true;
this.replaceunusedbacktextures.CheckedChanged += new System.EventHandler(this.replaceunusedbacktextures_CheckedChanged);
//
// groupBox4
//
this.groupBox4.Controls.Add(this.resetbacklight);
@ -1304,11 +1278,11 @@ namespace CodeImp.DoomBuilder.Windows
//
// backlow
//
this.backlow.Location = new System.Drawing.Point(309, 415);
this.backlow.Location = new System.Drawing.Point(309, 409);
this.backlow.MultipleTextures = false;
this.backlow.Name = "backlow";
this.backlow.Required = false;
this.backlow.Size = new System.Drawing.Size(220, 184);
this.backlow.Size = new System.Drawing.Size(220, 189);
this.backlow.TabIndex = 6;
this.backlow.TextureName = "";
this.backlow.UsePreviews = false;
@ -1316,11 +1290,11 @@ namespace CodeImp.DoomBuilder.Windows
//
// backmid
//
this.backmid.Location = new System.Drawing.Point(309, 225);
this.backmid.Location = new System.Drawing.Point(309, 214);
this.backmid.MultipleTextures = false;
this.backmid.Name = "backmid";
this.backmid.Required = false;
this.backmid.Size = new System.Drawing.Size(220, 184);
this.backmid.Size = new System.Drawing.Size(220, 189);
this.backmid.TabIndex = 5;
this.backmid.TextureName = "";
this.backmid.UsePreviews = false;
@ -1328,11 +1302,11 @@ namespace CodeImp.DoomBuilder.Windows
//
// backhigh
//
this.backhigh.Location = new System.Drawing.Point(309, 35);
this.backhigh.Location = new System.Drawing.Point(309, 19);
this.backhigh.MultipleTextures = false;
this.backhigh.Name = "backhigh";
this.backhigh.Required = false;
this.backhigh.Size = new System.Drawing.Size(220, 184);
this.backhigh.Size = new System.Drawing.Size(220, 189);
this.backhigh.TabIndex = 4;
this.backhigh.TextureName = "";
this.backhigh.UsePreviews = false;
@ -1433,7 +1407,6 @@ namespace CodeImp.DoomBuilder.Windows
this.tabfront.ResumeLayout(false);
this.tabfront.PerformLayout();
this.frontgroup.ResumeLayout(false);
this.frontgroup.PerformLayout();
this.frontflagsgroup.ResumeLayout(false);
this.frontscalegroup.ResumeLayout(false);
this.groupBox6.ResumeLayout(false);
@ -1442,7 +1415,6 @@ namespace CodeImp.DoomBuilder.Windows
this.tabback.ResumeLayout(false);
this.tabback.PerformLayout();
this.backgroup.ResumeLayout(false);
this.backgroup.PerformLayout();
this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout();
this.backflagsgroup.ResumeLayout(false);
@ -1546,7 +1518,5 @@ namespace CodeImp.DoomBuilder.Windows
private CodeImp.DoomBuilder.GZBuilder.Controls.TagsSelector tagsselector;
private System.Windows.Forms.Button resetfrontlight;
private System.Windows.Forms.Button resetbacklight;
private System.Windows.Forms.CheckBox replaceunusedfronttextures;
private System.Windows.Forms.CheckBox replaceunusedbacktextures;
}
}

View File

@ -232,12 +232,6 @@ namespace CodeImp.DoomBuilder.Windows
pfcBackScaleTop.LinkValues = linkBackTopScale;
pfcBackScaleMid.LinkValues = linkBackMidScale;
pfcBackScaleBottom.LinkValues = linkBackBottomScale;
// Apply texture replacement settings
preventchanges = true;
replaceunusedfronttextures.Checked = General.Settings.ReadSetting("editlinedefswindow.replaceunusedfronttextures", true);
replaceunusedbacktextures.Checked = General.Settings.ReadSetting("editlinedefswindow.replaceunusedbacktextures", true);
preventchanges = false;
}
#endregion
@ -841,10 +835,6 @@ namespace CodeImp.DoomBuilder.Windows
// Save location and active tab
location = this.Location;
activetab = tabs.SelectedIndex;
// Save persistent settings
General.Settings.WriteSetting("editlinedefswindow.replaceunusedfronttextures", replaceunusedfronttextures.Checked);
General.Settings.WriteSetting("editlinedefswindow.replaceunusedbacktextures", replaceunusedbacktextures.Checked);
}
// Help!
@ -1081,15 +1071,9 @@ namespace CodeImp.DoomBuilder.Windows
// Update values
else
{
int i = 0;
foreach(Linedef l in lines)
{
if(l.Front != null
&& (replaceunusedfronttextures.Checked
|| (l.Front.HighRequired()
|| (linedefprops[i].Front != null && linedefprops[i].Front.HighTexture != "-"))))
l.Front.SetTextureHigh(fronthigh.GetResult(l.Front.HighTexture));
i++;
if(l.Front != null) l.Front.SetTextureHigh(fronthigh.GetResult(l.Front.HighTexture));
}
}
@ -1118,15 +1102,9 @@ namespace CodeImp.DoomBuilder.Windows
// Update values
else
{
int i = 0;
foreach(Linedef l in lines)
{
if(l.Front != null
&& (replaceunusedfronttextures.Checked
|| (l.Front.MiddleRequired()
|| (linedefprops[i].Front != null && linedefprops[i].Front.MiddleTexture != "-"))))
l.Front.SetTextureMid(frontmid.GetResult(l.Front.MiddleTexture));
i++;
if(l.Front != null) l.Front.SetTextureMid(frontmid.GetResult(l.Front.MiddleTexture));
}
}
@ -1155,15 +1133,9 @@ namespace CodeImp.DoomBuilder.Windows
// Update values
else
{
int i = 0;
foreach(Linedef l in lines)
{
if(l.Front != null
&& (replaceunusedfronttextures.Checked
|| (l.Front.LowRequired()
|| (linedefprops[i].Front != null && linedefprops[i].Front.LowTexture != "-"))))
l.Front.SetTextureLow(frontlow.GetResult(l.Front.LowTexture));
i++;
if(l.Front != null) l.Front.SetTextureLow(frontlow.GetResult(l.Front.LowTexture));
}
}
@ -1192,15 +1164,9 @@ namespace CodeImp.DoomBuilder.Windows
// Update values
else
{
int i = 0;
foreach(Linedef l in lines)
{
if(l.Back != null
&& (replaceunusedbacktextures.Checked
|| (l.Back.HighRequired()
|| (linedefprops[i].Back != null && linedefprops[i].Back.HighTexture != "-"))))
l.Back.SetTextureHigh(backhigh.GetResult(l.Back.HighTexture));
i++;
if(l.Back != null) l.Back.SetTextureHigh(backhigh.GetResult(l.Back.HighTexture));
}
}
@ -1229,15 +1195,9 @@ namespace CodeImp.DoomBuilder.Windows
// Update values
else
{
int i = 0;
foreach(Linedef l in lines)
{
if(l.Back != null
&& (replaceunusedbacktextures.Checked
|| (l.Back.MiddleRequired()
|| (linedefprops[i].Back != null && linedefprops[i].Back.MiddleTexture != "-"))))
l.Back.SetTextureMid(backmid.GetResult(l.Back.MiddleTexture));
i++;
if(l.Back != null) l.Back.SetTextureMid(backmid.GetResult(l.Back.MiddleTexture));
}
}
@ -1266,15 +1226,9 @@ namespace CodeImp.DoomBuilder.Windows
// Update values
else
{
int i = 0;
foreach(Linedef l in lines)
{
if(l.Back != null
&& (replaceunusedbacktextures.Checked
|| (l.Back.LowRequired()
|| (linedefprops[i].Back != null && linedefprops[i].Back.LowTexture != "-"))))
l.Back.SetTextureLow(backlow.GetResult(l.Back.LowTexture));
i++;
if(l.Back != null) l.Back.SetTextureLow(backlow.GetResult(l.Back.LowTexture));
}
}
@ -1285,86 +1239,6 @@ namespace CodeImp.DoomBuilder.Windows
if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
}
private void replaceunusedfronttextures_CheckedChanged(object sender, EventArgs e)
{
//Re-apply front textures
if(preventchanges) return;
MakeUndo();
// Set values
int i = 0;
foreach(Linedef l in lines)
{
if(l.Front == null) continue;
// Update top texture
if(!replaceunusedfronttextures.Checked || string.IsNullOrEmpty(fronthigh.TextureName))
l.Front.SetTextureHigh(linedefprops[i].Front != null ? linedefprops[i].Front.HighTexture : "-");
else
l.Front.SetTextureHigh(fronthigh.GetResult(l.Front.HighTexture));
// Update middle texture
if(!replaceunusedfronttextures.Checked || string.IsNullOrEmpty(frontmid.TextureName))
l.Front.SetTextureMid(linedefprops[i].Front != null ? linedefprops[i].Front.MiddleTexture : "-");
else
l.Front.SetTextureMid(frontmid.GetResult(l.Front.MiddleTexture));
// Update bottom texture
if(!replaceunusedfronttextures.Checked || string.IsNullOrEmpty(frontlow.TextureName))
l.Front.SetTextureLow(linedefprops[i].Front != null ? linedefprops[i].Front.LowTexture : "-");
else
l.Front.SetTextureLow(frontlow.GetResult(l.Front.LowTexture));
i++;
}
// Update the used textures
General.Map.Data.UpdateUsedTextures();
General.Map.IsChanged = true;
if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
}
private void replaceunusedbacktextures_CheckedChanged(object sender, EventArgs e)
{
//Re-apply back textures
if(preventchanges) return;
MakeUndo();
// Set values
int i = 0;
foreach(Linedef l in lines)
{
if(l.Back == null) continue;
// Update top texture
if(!replaceunusedbacktextures.Checked || string.IsNullOrEmpty(backhigh.TextureName))
l.Back.SetTextureHigh(linedefprops[i].Back != null ? linedefprops[i].Back.HighTexture : "-");
else
l.Back.SetTextureHigh(backhigh.GetResult(l.Back.HighTexture));
// Update middle texture
if(!replaceunusedbacktextures.Checked || string.IsNullOrEmpty(backmid.TextureName))
l.Back.SetTextureMid(linedefprops[i].Back != null ? linedefprops[i].Back.MiddleTexture : "-");
else
l.Back.SetTextureMid(backmid.GetResult(l.Back.MiddleTexture));
// Update bottom texture
if(!replaceunusedbacktextures.Checked || string.IsNullOrEmpty(backlow.TextureName))
l.Back.SetTextureLow(linedefprops[i].Back != null ? linedefprops[i].Back.LowTexture : "-");
else
l.Back.SetTextureLow(backlow.GetResult(l.Back.LowTexture));
i++;
}
// Update the used textures
General.Map.Data.UpdateUsedTextures();
General.Map.IsChanged = true;
if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
}
#endregion
#region Brightness changed