added configuration support for generalized sector effects

This commit is contained in:
codeimp 2008-02-21 06:47:43 +00:00
parent 9bfaae721e
commit 2e741f7c8e
14 changed files with 457 additions and 263 deletions

View file

@ -43,10 +43,11 @@
</Target>
-->
<ItemGroup>
<Compile Include="Config\GeneralActionBit.cs" />
<Compile Include="Config\GeneralActionOption.cs" />
<Compile Include="Config\SectorEffectInfo.cs" />
<Compile Include="Config\GeneralizedBit.cs" />
<Compile Include="Config\GeneralizedOption.cs" />
<Compile Include="Config\GameConfiguration.cs" />
<Compile Include="Config\GeneralActionCategory.cs" />
<Compile Include="Config\GeneralizedCategory.cs" />
<Compile Include="Config\INumberedTitle.cs" />
<Compile Include="Config\LinedefActionCategory.cs" />
<Compile Include="Config\LinedefActionInfo.cs" />

View file

@ -114,7 +114,11 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
if(!cancelled)
{
// If only a single sector was selected, deselect it now
if(selectedsectors.Count == 1) General.Map.Map.ClearSelectedSectors();
if(selectedsectors.Count == 1)
{
General.Map.Map.ClearSelectedSectors();
General.Map.Map.ClearSelectedLinedefs();
}
}
}

View file

@ -255,8 +255,8 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
public override void MouseDown(MouseEventArgs e)
{
base.MouseDown(e);
// Which button is used?
// Select button?
if(e.Button == EditMode.SELECT_BUTTON)
{
// Item highlighted?
@ -265,6 +265,31 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
// Flip selection
SelectSector(highlighted, !highlighted.Selected);
// Update display
if(renderer.Start(false, false))
{
// Redraw highlight to show selection
renderer.RenderSector(highlighted);
renderer.Finish();
}
}
}
// Edit button?
else if(e.Button == EditMode.EDIT_BUTTON)
{
// Item highlighted?
if((highlighted != null) && !highlighted.IsDisposed)
{
// Highlighted item not selected?
if(!highlighted.Selected)
{
// Make this the only selection
General.Map.Map.ClearSelectedSectors();
General.Map.Map.ClearSelectedLinedefs();
SelectSector(highlighted, true);
General.Interface.RedrawDisplay();
}
// Update display
if(renderer.Start(false, false))
{
@ -279,6 +304,8 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
// Mouse released
public override void MouseUp(MouseEventArgs e)
{
ICollection<Sector> selected;
base.MouseUp(e);
// Item highlighted?
@ -291,6 +318,28 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
renderer.RenderSector(highlighted, General.Colors.Highlight);
renderer.Finish();
}
// Edit button?
if(e.Button == EditMode.EDIT_BUTTON)
{
// Anything selected?
selected = General.Map.Map.GetSectorsSelection(true);
if(selected.Count > 0)
{
// Show sector edit dialog
General.Interface.ShowEditSectors(selected);
// When a single sector was selected, deselect it now
if(selected.Count == 1)
{
General.Map.Map.ClearSelectedSectors();
General.Map.Map.ClearSelectedLinedefs();
}
// Update entire display
General.Interface.RedrawDisplay();
}
}
}
}

View file

@ -72,8 +72,13 @@ namespace CodeImp.DoomBuilder.Config
private List<LinedefActionInfo> sortedlinedefactions;
private List<LinedefActionCategory> actioncategories;
private List<LinedefActivateInfo> linedefactivates;
private List<GeneralActionCategory> genactioncategories;
private List<GeneralizedCategory> genactioncategories;
// Sectors
private Dictionary<int, SectorEffectInfo> sectoreffects;
private List<SectorEffectInfo> sortedsectoreffects;
private List<GeneralizedCategory> geneffectcategories;
// Universal fields
private List<UniversalFieldInfo> linedeffields;
@ -111,7 +116,12 @@ namespace CodeImp.DoomBuilder.Config
public List<LinedefActionInfo> SortedLinedefActions { get { return sortedlinedefactions; } }
public List<LinedefActionCategory> ActionCategories { get { return actioncategories; } }
public List<LinedefActivateInfo> LinedefActivates { get { return linedefactivates; } }
public List<GeneralActionCategory> GenActionCategories { get { return genactioncategories; } }
public List<GeneralizedCategory> GenActionCategories { get { return genactioncategories; } }
// Sectors
public IDictionary<int, SectorEffectInfo> SectorEffects { get { return sectoreffects; } }
public List<SectorEffectInfo> SortedSectorEffects { get { return sortedsectoreffects; } }
public List<GeneralizedCategory> GenEffectCategories { get { return genactioncategories; } }
// Universal fields
public List<UniversalFieldInfo> LinedefFields { get { return linedeffields; } }
@ -132,7 +142,10 @@ namespace CodeImp.DoomBuilder.Config
this.actioncategories = new List<LinedefActionCategory>();
this.sortedlinedefactions = new List<LinedefActionInfo>();
this.linedefactivates = new List<LinedefActivateInfo>();
this.genactioncategories = new List<GeneralActionCategory>();
this.genactioncategories = new List<GeneralizedCategory>();
this.sectoreffects = new Dictionary<int, SectorEffectInfo>();
this.sortedsectoreffects = new List<SectorEffectInfo>();
this.geneffectcategories = new List<GeneralizedCategory>();
// Read general settings
defaulttexturescale = cfg.ReadSetting("defaulttexturescale", 1f);
@ -161,8 +174,12 @@ namespace CodeImp.DoomBuilder.Config
LoadLinedefFlags();
LoadLinedefActions();
LoadLinedefActivations();
LoadLinedefGeneralizedAction();
LoadLinedefGeneralizedActions();
// Sectors
LoadSectorEffects();
LoadSectorGeneralizedEffects();
// Universal fields
linedeffields = LoadUniversalFields("linedefs");
}
@ -345,7 +362,7 @@ namespace CodeImp.DoomBuilder.Config
}
// Linedef generalized actions
private void LoadLinedefGeneralizedAction()
private void LoadLinedefGeneralizedActions()
{
IDictionary dic;
@ -357,7 +374,7 @@ namespace CodeImp.DoomBuilder.Config
if(de.Value is IDictionary)
{
// Add category
genactioncategories.Add(new GeneralActionCategory(de.Key.ToString(), cfg));
genactioncategories.Add(new GeneralizedCategory("gen_linedeftypes", de.Key.ToString(), cfg));
}
else
{
@ -365,6 +382,61 @@ namespace CodeImp.DoomBuilder.Config
}
}
}
// Sector effects
private void LoadSectorEffects()
{
IDictionary dic;
SectorEffectInfo si;
int actionnumber;
// Get sector effects
dic = cfg.ReadSetting("sectortypes", new Hashtable());
foreach(DictionaryEntry de in dic)
{
// Try paring the action number
if(int.TryParse(de.Key.ToString(),
NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite,
CultureInfo.InvariantCulture, out actionnumber))
{
// Make effects
si = new SectorEffectInfo(actionnumber, de.Value.ToString());
// Add action to category and sorted list
sortedsectoreffects.Add(si);
sectoreffects.Add(actionnumber, si);
}
else
{
General.WriteLogLine("WARNING: Structure 'sectortypes' contains invalid keys!");
}
}
// Sort the actions list
sortedsectoreffects.Sort();
}
// Sector generalized effects
private void LoadSectorGeneralizedEffects()
{
IDictionary dic;
// Get linedef activations
dic = cfg.ReadSetting("gen_sectortypes", new Hashtable());
foreach(DictionaryEntry de in dic)
{
// Check for valid structure
if(de.Value is IDictionary)
{
// Add category
geneffectcategories.Add(new GeneralizedCategory("gen_sectortypes", de.Key.ToString(), cfg));
}
else
{
General.WriteLogLine("WARNING: Structure 'gen_sectortypes' contains invalid entries!");
}
}
}
#endregion
@ -403,7 +475,7 @@ namespace CodeImp.DoomBuilder.Config
if(action > 0)
{
// Go for all categories
foreach(GeneralActionCategory ac in genactioncategories)
foreach(GeneralizedCategory ac in genactioncategories)
{
// Check if the action is within range of this category
if((action >= ac.Offset) && (action < (ac.Offset + ac.Length))) return true;
@ -415,13 +487,13 @@ namespace CodeImp.DoomBuilder.Config
}
// This gets the generalized action category from action number
public GeneralActionCategory GetGeneralizedActionCategory(int action)
public GeneralizedCategory GetGeneralizedActionCategory(int action)
{
// Only actions above 0
if(action > 0)
{
// Go for all categories
foreach(GeneralActionCategory ac in genactioncategories)
foreach(GeneralizedCategory ac in genactioncategories)
{
// Check if the action is within range of this category
if((action >= ac.Offset) && (action < (ac.Offset + ac.Length))) return ac;

View file

@ -6,7 +6,7 @@ using System.Text;
namespace CodeImp.DoomBuilder.Config
{
public class GeneralActionBit : INumberedTitle, IComparable<GeneralActionBit>
public class GeneralizedBit : INumberedTitle, IComparable<GeneralizedBit>
{
#region ================== Constants
@ -30,7 +30,7 @@ namespace CodeImp.DoomBuilder.Config
#region ================== Constructor / Disposer
// Constructor
internal GeneralActionBit(int index, string title)
internal GeneralizedBit(int index, string title)
{
// Initialize
this.index = index;
@ -51,7 +51,7 @@ namespace CodeImp.DoomBuilder.Config
}
// This compares against another
public int CompareTo(GeneralActionBit other)
public int CompareTo(GeneralizedBit other)
{
if(this.index < other.index) return -1;
else if(this.index > other.index) return 1;

View file

@ -7,7 +7,7 @@ using CodeImp.DoomBuilder.IO;
namespace CodeImp.DoomBuilder.Config
{
public class GeneralActionCategory
public class GeneralizedCategory
{
#region ================== Constants
@ -19,7 +19,7 @@ namespace CodeImp.DoomBuilder.Config
private string title;
private int offset;
private int length;
private List<GeneralActionOption> options;
private List<GeneralizedOption> options;
// Disposing
private bool isdisposed = false;
@ -31,7 +31,7 @@ namespace CodeImp.DoomBuilder.Config
public string Title { get { return title; } }
public int Offset { get { return offset; } }
public int Length { get { return length; } }
public List<GeneralActionOption> Options { get { return options; } }
public List<GeneralizedOption> Options { get { return options; } }
public bool IsDisposed { get { return isdisposed; } }
#endregion
@ -39,27 +39,27 @@ namespace CodeImp.DoomBuilder.Config
#region ================== Constructor / Disposer
// Constructor
internal GeneralActionCategory(string name, Configuration cfg)
internal GeneralizedCategory(string structure, string name, Configuration cfg)
{
IDictionary opts;
// Initialize
this.options = new List<GeneralActionOption>();
this.options = new List<GeneralizedOption>();
// Read properties
this.title = cfg.ReadSetting("gen_linedeftypes." + name + ".title", "");
this.offset = cfg.ReadSetting("gen_linedeftypes." + name + ".offset", 0);
this.length = cfg.ReadSetting("gen_linedeftypes." + name + ".length", 0);
this.title = cfg.ReadSetting(structure + "." + name + ".title", "");
this.offset = cfg.ReadSetting(structure + "." + name + ".offset", 0);
this.length = cfg.ReadSetting(structure + "." + name + ".length", 0);
// Read the options
opts = cfg.ReadSetting("gen_linedeftypes." + name, new Hashtable());
opts = cfg.ReadSetting(structure + "." + name, new Hashtable());
foreach(DictionaryEntry de in opts)
{
// Is this an option and not just some value?
if(de.Value is IDictionary)
{
// Add the option
this.options.Add(new GeneralActionOption(name, de.Key.ToString(), (IDictionary)de.Value));
this.options.Add(new GeneralizedOption(structure, name, de.Key.ToString(), (IDictionary)de.Value));
}
}

View file

@ -32,7 +32,7 @@ using CodeImp.DoomBuilder.Map;
namespace CodeImp.DoomBuilder.Config
{
public class GeneralActionOption
public class GeneralizedOption
{
#region ================== Constants
@ -42,27 +42,27 @@ namespace CodeImp.DoomBuilder.Config
// Properties
private string name;
private List<GeneralActionBit> bits;
private List<GeneralizedBit> bits;
#endregion
#region ================== Properties
public string Name { get { return name; } }
public List<GeneralActionBit> Bits { get { return bits; } }
public List<GeneralizedBit> Bits { get { return bits; } }
#endregion
#region ================== Constructor / Disposer
// Constructor
internal GeneralActionOption(string cat, string name, IDictionary bitslist)
internal GeneralizedOption(string structure, string cat, string name, IDictionary bitslist)
{
int index;
// Initialize
this.name = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(name);
this.bits = new List<GeneralActionBit>();
this.bits = new List<GeneralizedBit>();
// Go for all bits
foreach(DictionaryEntry de in bitslist)
@ -71,11 +71,11 @@ namespace CodeImp.DoomBuilder.Config
if(int.TryParse(de.Key.ToString(), NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite, CultureInfo.InvariantCulture, out index))
{
// Add to list
this.bits.Add(new GeneralActionBit(index, de.Value.ToString()));
this.bits.Add(new GeneralizedBit(index, de.Value.ToString()));
}
else
{
General.WriteLogLine("WARNING: Structure 'gen_linedefflags." + cat + "." + name + "' contains invalid entries!");
General.WriteLogLine("WARNING: Structure '" + structure + "." + cat + "." + name + "' contains invalid entries!");
}
}

View file

@ -0,0 +1,89 @@
#region ================== Copyright (c) 2007 Pascal vd Heiden
/*
* Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com
* This program is released under GNU General Public License
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#endregion
#region ================== Namespaces
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using CodeImp.DoomBuilder.IO;
using CodeImp.DoomBuilder.Data;
using System.IO;
using System.Diagnostics;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Map;
#endregion
namespace CodeImp.DoomBuilder.Config
{
public class SectorEffectInfo : INumberedTitle, IComparable<SectorEffectInfo>
{
#region ================== Constants
#endregion
#region ================== Variables
// Properties
private int index;
private string title;
#endregion
#region ================== Properties
public int Index { get { return index; } }
public string Title { get { return title; } }
#endregion
#region ================== Constructor / Disposer
// Constructor
internal SectorEffectInfo(int index, string title)
{
// Initialize
this.index = index;
this.title = title;
// We have no destructor
GC.SuppressFinalize(this);
}
#endregion
#region ================== Methods
// This presents the item as string
public override string ToString()
{
return index + " - " + title;
}
// This compares against another action info
public int CompareTo(SectorEffectInfo other)
{
if(this.index < other.index) return -1;
else if(this.index > other.index) return 1;
else return 0;
}
#endregion
}
}

View file

@ -51,7 +51,7 @@ namespace CodeImp.DoomBuilder.Interface
public ActionBrowserForm(int action)
{
TreeNode cn, n;
GeneralActionCategory sc;
GeneralizedCategory sc;
int actionbits;
// Initialize
@ -120,14 +120,14 @@ namespace CodeImp.DoomBuilder.Interface
tabs.SelectedTab = tabgeneralized;
// Select category
foreach(GeneralActionCategory ac in category.Items)
foreach(GeneralizedCategory ac in category.Items)
if((action >= ac.Offset) && (action < (ac.Offset + ac.Length))) category.SelectedItem = ac;
// Anything selected?
if(category.SelectedIndex > -1)
{
// Go for all options in selected category
sc = category.SelectedItem as GeneralActionCategory;
sc = category.SelectedItem as GeneralizedCategory;
actionbits = action - sc.Offset;
for(int i = 0; i < MAX_OPTIONS; i++)
{
@ -135,7 +135,7 @@ namespace CodeImp.DoomBuilder.Interface
if(i < sc.Options.Count)
{
// Go for all bits
foreach(GeneralActionBit ab in sc.Options[i].Bits)
foreach(GeneralizedBit ab in sc.Options[i].Bits)
{
// Select this setting if matches
if((actionbits & ab.Index) == ab.Index) options[i].SelectedItem = ab;
@ -165,7 +165,7 @@ namespace CodeImp.DoomBuilder.Interface
// OK clicked
private void apply_Click(object sender, EventArgs e)
{
GeneralActionCategory sc;
GeneralizedCategory sc;
// Presume no result
selectedaction = 0;
@ -187,7 +187,7 @@ namespace CodeImp.DoomBuilder.Interface
if(category.SelectedIndex > -1)
{
// Add category bits and go for all options
sc = category.SelectedItem as GeneralActionCategory;
sc = category.SelectedItem as GeneralizedCategory;
selectedaction = sc.Offset;
for(int i = 0; i < MAX_OPTIONS; i++)
{
@ -196,7 +196,7 @@ namespace CodeImp.DoomBuilder.Interface
{
// Add selected bits
if(options[i].SelectedIndex > -1)
selectedaction += (options[i].SelectedItem as GeneralActionBit).Index;
selectedaction += (options[i].SelectedItem as GeneralizedBit).Index;
}
}
}
@ -218,13 +218,13 @@ namespace CodeImp.DoomBuilder.Interface
// Generalized category selected
private void category_SelectedIndexChanged(object sender, EventArgs e)
{
GeneralActionCategory ac;
GeneralizedCategory ac;
// Category selected?
if(category.SelectedIndex > -1)
{
// Get the category
ac = category.SelectedItem as GeneralActionCategory;
ac = category.SelectedItem as GeneralizedCategory;
// Go for all options
for(int i = 0; i < MAX_OPTIONS; i++)

View file

@ -54,6 +54,7 @@ namespace CodeImp.DoomBuilder.Interface
void DisplayStatus(string status);
void RedrawDisplay();
void ShowEditLinedefs(ICollection<Linedef> lines);
void ShowEditSectors(ICollection<Sector> sectors);
void ShowLinedefInfo(Linedef l);
void ShowSectorInfo(Sector s);
void ShowThingInfo(Thing t);

View file

@ -1145,6 +1145,16 @@ namespace CodeImp.DoomBuilder.Interface
f.Dispose();
}
// This shows the dialog to edit sectors
public void ShowEditSectors(ICollection<Sector> sectors)
{
// Show line edit dialog
SectorEditForm f = new SectorEditForm();
f.Setup(sectors);
f.ShowDialog(this);
f.Dispose();
}
#endregion
#region ================== Processor

View file

@ -31,16 +31,23 @@ namespace CodeImp.DoomBuilder.Interface
System.Windows.Forms.Label label1;
System.Windows.Forms.Label label3;
System.Windows.Forms.GroupBox groupaction;
System.Windows.Forms.Label taglabel;
System.Windows.Forms.GroupBox groupeffect;
System.Windows.Forms.Label label9;
System.Windows.Forms.Label label8;
System.Windows.Forms.GroupBox groupfloorceiling;
System.Windows.Forms.Label label7;
System.Windows.Forms.Label label6;
System.Windows.Forms.Label label5;
System.Windows.Forms.Label label2;
System.Windows.Forms.Label label4;
System.Windows.Forms.Label label5;
System.Windows.Forms.Label label6;
System.Windows.Forms.Label label7;
System.Windows.Forms.Label label8;
System.Windows.Forms.Label label9;
System.Windows.Forms.Label taglabel;
this.tag = new CodeImp.DoomBuilder.Interface.NumericTextbox();
this.newtag = new System.Windows.Forms.Button();
this.brightness = new CodeImp.DoomBuilder.Interface.NumericTextbox();
this.effect = new CodeImp.DoomBuilder.Interface.ActionSelectorControl();
this.sectorheight = new System.Windows.Forms.Label();
this.ceilingheight = new CodeImp.DoomBuilder.Interface.NumericTextbox();
this.floorheight = new CodeImp.DoomBuilder.Interface.NumericTextbox();
this.floortex = new CodeImp.DoomBuilder.Interface.FlatSelectorControl();
this.ceilingtex = new CodeImp.DoomBuilder.Interface.FlatSelectorControl();
this.cancel = new System.Windows.Forms.Button();
@ -48,29 +55,22 @@ namespace CodeImp.DoomBuilder.Interface
this.tabs = new System.Windows.Forms.TabControl();
this.tabproperties = new System.Windows.Forms.TabPage();
this.tabcustom = new System.Windows.Forms.TabPage();
this.fieldslist = new CodeImp.DoomBuilder.Interface.FieldsEditorControl();
this.flatSelectorControl2 = new CodeImp.DoomBuilder.Interface.FlatSelectorControl();
this.flatSelectorControl1 = new CodeImp.DoomBuilder.Interface.FlatSelectorControl();
this.fieldslist = new CodeImp.DoomBuilder.Interface.FieldsEditorControl();
this.floorheight = new CodeImp.DoomBuilder.Interface.NumericTextbox();
this.ceilingheight = new CodeImp.DoomBuilder.Interface.NumericTextbox();
this.sectorheight = new System.Windows.Forms.Label();
this.effect = new CodeImp.DoomBuilder.Interface.ActionSelectorControl();
this.brightness = new CodeImp.DoomBuilder.Interface.NumericTextbox();
this.tag = new CodeImp.DoomBuilder.Interface.NumericTextbox();
this.newtag = new System.Windows.Forms.Button();
label1 = new System.Windows.Forms.Label();
label3 = new System.Windows.Forms.Label();
groupaction = new System.Windows.Forms.GroupBox();
taglabel = new System.Windows.Forms.Label();
groupeffect = new System.Windows.Forms.GroupBox();
label9 = new System.Windows.Forms.Label();
label8 = new System.Windows.Forms.Label();
groupfloorceiling = new System.Windows.Forms.GroupBox();
label7 = new System.Windows.Forms.Label();
label6 = new System.Windows.Forms.Label();
label5 = new System.Windows.Forms.Label();
label2 = new System.Windows.Forms.Label();
label4 = new System.Windows.Forms.Label();
label5 = new System.Windows.Forms.Label();
label6 = new System.Windows.Forms.Label();
label7 = new System.Windows.Forms.Label();
label8 = new System.Windows.Forms.Label();
label9 = new System.Windows.Forms.Label();
taglabel = new System.Windows.Forms.Label();
groupaction.SuspendLayout();
groupeffect.SuspendLayout();
groupfloorceiling.SuspendLayout();
@ -111,6 +111,35 @@ namespace CodeImp.DoomBuilder.Interface
groupaction.TabStop = false;
groupaction.Text = " Action ";
//
// tag
//
this.tag.AllowNegative = false;
this.tag.AllowRelative = true;
this.tag.ImeMode = System.Windows.Forms.ImeMode.Off;
this.tag.Location = new System.Drawing.Point(89, 28);
this.tag.Name = "tag";
this.tag.Size = new System.Drawing.Size(53, 20);
this.tag.TabIndex = 10;
//
// taglabel
//
taglabel.AutoSize = true;
taglabel.Location = new System.Drawing.Point(55, 31);
taglabel.Name = "taglabel";
taglabel.Size = new System.Drawing.Size(28, 14);
taglabel.TabIndex = 9;
taglabel.Text = "Tag:";
//
// newtag
//
this.newtag.Location = new System.Drawing.Point(148, 27);
this.newtag.Name = "newtag";
this.newtag.Size = new System.Drawing.Size(76, 23);
this.newtag.TabIndex = 11;
this.newtag.Text = "New Tag";
this.newtag.UseVisualStyleBackColor = true;
this.newtag.Click += new System.EventHandler(this.newtag_Click);
//
// groupeffect
//
groupeffect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@ -124,7 +153,46 @@ namespace CodeImp.DoomBuilder.Interface
groupeffect.Size = new System.Drawing.Size(436, 105);
groupeffect.TabIndex = 4;
groupeffect.TabStop = false;
groupeffect.Text = " Effect ";
groupeffect.Text = " Effects ";
//
// brightness
//
this.brightness.AllowNegative = false;
this.brightness.AllowRelative = true;
this.brightness.ImeMode = System.Windows.Forms.ImeMode.Off;
this.brightness.Location = new System.Drawing.Point(89, 63);
this.brightness.Name = "brightness";
this.brightness.Size = new System.Drawing.Size(53, 20);
this.brightness.TabIndex = 17;
//
// label9
//
label9.AutoSize = true;
label9.Location = new System.Drawing.Point(21, 66);
label9.Name = "label9";
label9.Size = new System.Drawing.Size(62, 14);
label9.TabIndex = 2;
label9.Text = "Brightness:";
//
// effect
//
this.effect.BackColor = System.Drawing.SystemColors.Control;
this.effect.Cursor = System.Windows.Forms.Cursors.Default;
this.effect.Empty = false;
this.effect.Location = new System.Drawing.Point(89, 28);
this.effect.Name = "effect";
this.effect.Size = new System.Drawing.Size(326, 21);
this.effect.TabIndex = 1;
this.effect.Value = 402;
//
// label8
//
label8.AutoSize = true;
label8.Location = new System.Drawing.Point(38, 31);
label8.Name = "label8";
label8.Size = new System.Drawing.Size(45, 14);
label8.TabIndex = 0;
label8.Text = "Special:";
//
// groupfloorceiling
//
@ -147,6 +215,65 @@ namespace CodeImp.DoomBuilder.Interface
groupfloorceiling.TabStop = false;
groupfloorceiling.Text = "Floor and Ceiling ";
//
// sectorheight
//
this.sectorheight.AutoSize = true;
this.sectorheight.Location = new System.Drawing.Point(113, 99);
this.sectorheight.Name = "sectorheight";
this.sectorheight.Size = new System.Drawing.Size(13, 14);
this.sectorheight.TabIndex = 21;
this.sectorheight.Text = "0";
//
// label7
//
label7.AutoSize = true;
label7.Location = new System.Drawing.Point(32, 99);
label7.Name = "label7";
label7.Size = new System.Drawing.Size(74, 14);
label7.TabIndex = 20;
label7.Text = "Sector height:";
label7.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// label6
//
label6.AutoSize = true;
label6.Location = new System.Drawing.Point(33, 69);
label6.Name = "label6";
label6.Size = new System.Drawing.Size(73, 14);
label6.TabIndex = 19;
label6.Text = "Ceiling height:";
label6.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// ceilingheight
//
this.ceilingheight.AllowNegative = true;
this.ceilingheight.AllowRelative = true;
this.ceilingheight.ImeMode = System.Windows.Forms.ImeMode.Off;
this.ceilingheight.Location = new System.Drawing.Point(112, 66);
this.ceilingheight.Name = "ceilingheight";
this.ceilingheight.Size = new System.Drawing.Size(68, 20);
this.ceilingheight.TabIndex = 18;
//
// label5
//
label5.AutoSize = true;
label5.Location = new System.Drawing.Point(40, 40);
label5.Name = "label5";
label5.Size = new System.Drawing.Size(66, 14);
label5.TabIndex = 17;
label5.Text = "Floor height:";
label5.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// floorheight
//
this.floorheight.AllowNegative = true;
this.floorheight.AllowRelative = true;
this.floorheight.ImeMode = System.Windows.Forms.ImeMode.Off;
this.floorheight.Location = new System.Drawing.Point(112, 37);
this.floorheight.Name = "floorheight";
this.floorheight.Size = new System.Drawing.Size(68, 20);
this.floorheight.TabIndex = 16;
//
// label2
//
label2.Location = new System.Drawing.Point(237, 18);
@ -191,6 +318,7 @@ namespace CodeImp.DoomBuilder.Interface
this.cancel.TabIndex = 19;
this.cancel.Text = "Cancel";
this.cancel.UseVisualStyleBackColor = true;
this.cancel.Click += new System.EventHandler(this.cancel_Click);
//
// apply
//
@ -244,6 +372,17 @@ namespace CodeImp.DoomBuilder.Interface
this.tabcustom.Text = "Custom";
this.tabcustom.UseVisualStyleBackColor = true;
//
// fieldslist
//
this.fieldslist.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.fieldslist.Location = new System.Drawing.Point(11, 11);
this.fieldslist.Margin = new System.Windows.Forms.Padding(8);
this.fieldslist.Name = "fieldslist";
this.fieldslist.Size = new System.Drawing.Size(427, 347);
this.fieldslist.TabIndex = 1;
//
// flatSelectorControl2
//
this.flatSelectorControl2.Location = new System.Drawing.Point(271, 37);
@ -260,143 +399,6 @@ namespace CodeImp.DoomBuilder.Interface
this.flatSelectorControl1.TabIndex = 12;
this.flatSelectorControl1.TextureName = "";
//
// fieldslist
//
this.fieldslist.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.fieldslist.Location = new System.Drawing.Point(11, 11);
this.fieldslist.Margin = new System.Windows.Forms.Padding(8);
this.fieldslist.Name = "fieldslist";
this.fieldslist.Size = new System.Drawing.Size(427, 347);
this.fieldslist.TabIndex = 1;
//
// floorheight
//
this.floorheight.AllowNegative = false;
this.floorheight.AllowRelative = false;
this.floorheight.ImeMode = System.Windows.Forms.ImeMode.Off;
this.floorheight.Location = new System.Drawing.Point(112, 37);
this.floorheight.Name = "floorheight";
this.floorheight.Size = new System.Drawing.Size(68, 20);
this.floorheight.TabIndex = 16;
//
// label5
//
label5.AutoSize = true;
label5.Location = new System.Drawing.Point(40, 40);
label5.Name = "label5";
label5.Size = new System.Drawing.Size(66, 14);
label5.TabIndex = 17;
label5.Text = "Floor height:";
label5.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// ceilingheight
//
this.ceilingheight.AllowNegative = false;
this.ceilingheight.AllowRelative = false;
this.ceilingheight.ImeMode = System.Windows.Forms.ImeMode.Off;
this.ceilingheight.Location = new System.Drawing.Point(112, 66);
this.ceilingheight.Name = "ceilingheight";
this.ceilingheight.Size = new System.Drawing.Size(68, 20);
this.ceilingheight.TabIndex = 18;
//
// label6
//
label6.AutoSize = true;
label6.Location = new System.Drawing.Point(33, 69);
label6.Name = "label6";
label6.Size = new System.Drawing.Size(73, 14);
label6.TabIndex = 19;
label6.Text = "Ceiling height:";
label6.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// label7
//
label7.AutoSize = true;
label7.Location = new System.Drawing.Point(32, 99);
label7.Name = "label7";
label7.Size = new System.Drawing.Size(74, 14);
label7.TabIndex = 20;
label7.Text = "Sector height:";
label7.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// sectorheight
//
this.sectorheight.AutoSize = true;
this.sectorheight.Location = new System.Drawing.Point(113, 99);
this.sectorheight.Name = "sectorheight";
this.sectorheight.Size = new System.Drawing.Size(13, 14);
this.sectorheight.TabIndex = 21;
this.sectorheight.Text = "0";
//
// label8
//
label8.AutoSize = true;
label8.Location = new System.Drawing.Point(44, 32);
label8.Name = "label8";
label8.Size = new System.Drawing.Size(39, 14);
label8.TabIndex = 0;
label8.Text = "Effect:";
//
// effect
//
this.effect.BackColor = System.Drawing.SystemColors.Control;
this.effect.Cursor = System.Windows.Forms.Cursors.Default;
this.effect.Empty = false;
this.effect.Location = new System.Drawing.Point(89, 28);
this.effect.Name = "effect";
this.effect.Size = new System.Drawing.Size(326, 21);
this.effect.TabIndex = 1;
this.effect.Value = 402;
//
// label9
//
label9.AutoSize = true;
label9.Location = new System.Drawing.Point(21, 66);
label9.Name = "label9";
label9.Size = new System.Drawing.Size(62, 14);
label9.TabIndex = 2;
label9.Text = "Brightness:";
//
// brightness
//
this.brightness.AllowNegative = false;
this.brightness.AllowRelative = false;
this.brightness.ImeMode = System.Windows.Forms.ImeMode.Off;
this.brightness.Location = new System.Drawing.Point(89, 63);
this.brightness.Name = "brightness";
this.brightness.Size = new System.Drawing.Size(53, 20);
this.brightness.TabIndex = 17;
//
// tag
//
this.tag.AllowNegative = false;
this.tag.AllowRelative = true;
this.tag.ImeMode = System.Windows.Forms.ImeMode.Off;
this.tag.Location = new System.Drawing.Point(89, 28);
this.tag.Name = "tag";
this.tag.Size = new System.Drawing.Size(53, 20);
this.tag.TabIndex = 10;
//
// taglabel
//
taglabel.AutoSize = true;
taglabel.Location = new System.Drawing.Point(55, 31);
taglabel.Name = "taglabel";
taglabel.Size = new System.Drawing.Size(28, 14);
taglabel.TabIndex = 9;
taglabel.Text = "Tag:";
//
// newtag
//
this.newtag.Location = new System.Drawing.Point(148, 27);
this.newtag.Name = "newtag";
this.newtag.Size = new System.Drawing.Size(76, 23);
this.newtag.TabIndex = 11;
this.newtag.Text = "New Tag";
this.newtag.UseVisualStyleBackColor = true;
//
// SectorEditForm
//
this.AcceptButton = this.apply;

View file

@ -33,13 +33,39 @@ using CodeImp.DoomBuilder.Editing;
namespace CodeImp.DoomBuilder.Interface
{
public partial class SectorEditForm : DelayedForm
internal partial class SectorEditForm : DelayedForm
{
// Variables
private ICollection<Sector> sectors;
// Constructor
public SectorEditForm()
{
// Initialize
InitializeComponent();
}
// This sets up the form to edit the given sectors
public void Setup(ICollection<Sector> sectors)
{
// Keep this list
this.sectors = sectors;
if(sectors.Count > 1) this.Text = "Edit Sectors (" + sectors.Count + ")";
}
// Cancel clicked
private void cancel_Click(object sender, EventArgs e)
{
// Be gone
this.DialogResult = DialogResult.Cancel;
this.Close();
}
// This finds a new (unused) tag
private void newtag_Click(object sender, EventArgs e)
{
tag.Text = General.Map.Map.GetNewTag().ToString();
}
}
}

View file

@ -222,24 +222,6 @@
<metadata name="ceilingtex.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label2.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label2.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="label4.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label4.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="floortex.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ceilingtex.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="cancel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@ -264,48 +246,6 @@
<metadata name="flatSelectorControl1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="fieldslist.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="floorheight.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label5.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label5.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="ceilingheight.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label6.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label6.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="label7.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label7.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="sectorheight.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="tag.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="taglabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="taglabel.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="newtag.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>