// Create the control from an existing linedef public ThreeDFloorHelperControl(ThreeDFloor threeDFloor) { InitializeComponent(); isnew = false; settingup = true; this.threeDFloor = threeDFloor; sectorBorderTexture.TextureName = threeDFloor.BorderTexture; sectorTopFlat.TextureName = threeDFloor.TopFlat; sectorBottomFlat.TextureName = threeDFloor.BottomFlat; sectorCeilingHeight.Text = threeDFloor.TopHeight.ToString(); sectorFloorHeight.Text = threeDFloor.BottomHeight.ToString(); typeArgument.Setup(General.Map.Config.LinedefActions[160].Args[1]); flagsArgument.Setup(General.Map.Config.LinedefActions[160].Args[2]); alphaArgument.Setup(General.Map.Config.LinedefActions[160].Args[3]); typeArgument.SetValue(threeDFloor.Type); flagsArgument.SetValue(threeDFloor.Flags); alphaArgument.SetValue(threeDFloor.Alpha); AddSectorCheckboxes(); sector = General.Map.Map.CreateSector(); if (threeDFloor.Sector != null) { threeDFloor.Sector.CopyPropertiesTo(sector); } settingup = false; }
// Create the control from an existing linedef public ThreeDFloorHelperControl(ThreeDFloor threeDFloor) { InitializeComponent(); Update(threeDFloor); settingup = false; }
// Create the control from an existing linedef public ThreeDFloorHelperControl(ThreeDFloor threeDFloor) { InitializeComponent(); sectorTopFlat.Initialize(); sectorBorderTexture.Initialize(); sectorBottomFlat.Initialize(); Update(threeDFloor); }
// Create a blank control for a new 3D floor public ThreeDFloorHelperControl() { InitializeComponent(); isnew = true; settingup = true; threeDFloor = new ThreeDFloor(); this.BackColor = Color.FromArgb(128, Color.Green); sectorBorderTexture.TextureName = General.Settings.DefaultTexture; sectorTopFlat.TextureName = General.Settings.DefaultCeilingTexture; sectorBottomFlat.TextureName = General.Settings.DefaultFloorTexture; sectorCeilingHeight.Text = General.Settings.DefaultCeilingHeight.ToString(); sectorFloorHeight.Text = General.Settings.DefaultFloorHeight.ToString(); typeArgument.Setup(General.Map.Config.LinedefActions[160].Args[1]); flagsArgument.Setup(General.Map.Config.LinedefActions[160].Args[2]); alphaArgument.Setup(General.Map.Config.LinedefActions[160].Args[3]); typeArgument.SetDefaultValue(); flagsArgument.SetDefaultValue(); alphaArgument.SetDefaultValue(); AddSectorCheckboxes(); for (int i = 0; i < checkedListBoxSectors.Items.Count; i++) { checkedListBoxSectors.SetItemChecked(i, true); } //When creating a NEW 3d sector, find the sector that is the tallest, and place the floor on top of it int FloorHeight = int.MinValue; foreach (Sector s in BuilderPlug.TDFEW.SelectedSectors) { if (s.FloorHeight > FloorHeight) { FloorHeight = s.FloorHeight; } } if (FloorHeight != int.MinValue) { int DefaultHeight = General.Settings.DefaultCeilingHeight - General.Settings.DefaultFloorHeight; sectorFloorHeight.Text = FloorHeight.ToString(); sectorCeilingHeight.Text = (FloorHeight + DefaultHeight).ToString(); } sector = General.Map.Map.CreateSector(); settingup = false; }
public void Update(ThreeDFloor threeDFloor) { isnew = false; settingup = true; this.threeDFloor = threeDFloor; sectorBorderTexture.TextureName = threeDFloor.BorderTexture; sectorTopFlat.TextureName = threeDFloor.TopFlat; sectorBottomFlat.TextureName = threeDFloor.BottomFlat; sectorCeilingHeight.Text = threeDFloor.TopHeight.ToString(); sectorFloorHeight.Text = threeDFloor.BottomHeight.ToString(); borderHeightLabel.Text = (threeDFloor.TopHeight - threeDFloor.BottomHeight).ToString(); typeArgument.Setup(General.Map.Config.LinedefActions[160].Args[1]); flagsArgument.Setup(General.Map.Config.LinedefActions[160].Args[2]); alphaArgument.Setup(General.Map.Config.LinedefActions[160].Args[3]); typeArgument.SetValue(threeDFloor.Type); flagsArgument.SetValue(threeDFloor.Flags); alphaArgument.SetValue(threeDFloor.Alpha); sectorBrightness.Text = threeDFloor.Brightness.ToString(); AddSectorCheckboxes(); if (sector == null || sector.IsDisposed) { sector = General.Map.Map.CreateSector(); } if (threeDFloor.Sector != null) { threeDFloor.Sector.CopyPropertiesTo(sector); tagsLabel.Text = String.Join(", ", sector.Tags.Select(o => o.ToString()).ToArray()); } if (sector != null && !sector.IsDisposed) { sector.Selected = false; } }
public void SetDefaults() { isnew = true; threeDFloor = new ThreeDFloor(); sectorBorderTexture.TextureName = General.Settings.DefaultTexture; sectorTopFlat.TextureName = General.Settings.DefaultCeilingTexture; sectorBottomFlat.TextureName = General.Settings.DefaultFloorTexture; sectorCeilingHeight.Text = General.Settings.DefaultCeilingHeight.ToString(); sectorFloorHeight.Text = General.Settings.DefaultFloorHeight.ToString(); typeArgument.Setup(General.Map.Config.LinedefActions[160].Args[1]); flagsArgument.Setup(General.Map.Config.LinedefActions[160].Args[2]); alphaArgument.Setup(General.Map.Config.LinedefActions[160].Args[3]); typeArgument.SetDefaultValue(); flagsArgument.SetDefaultValue(); alphaArgument.SetDefaultValue(); tagsLabel.Text = "0"; AddSectorCheckboxes(); for (int i = 0; i < checkedListBoxSectors.Items.Count; i++) { checkedListBoxSectors.SetItemChecked(i, true); } //When creating a NEW 3d sector, find information about what is selected to populate the defaults int FloorHeight = int.MinValue; int SectorDarkest = int.MaxValue; foreach (Sector s in BuilderPlug.TDFEW.SelectedSectors) { if (s.FloorHeight > FloorHeight) { FloorHeight = s.FloorHeight; } if (s.Brightness < SectorDarkest) { SectorDarkest = s.Brightness; } } //set the floor height to match the lowest sector selected, then offset the height by the configured default if (FloorHeight != int.MinValue) { int DefaultHeight = General.Settings.DefaultCeilingHeight - General.Settings.DefaultFloorHeight; sectorFloorHeight.Text = FloorHeight.ToString(); sectorCeilingHeight.Text = (FloorHeight + DefaultHeight).ToString(); } //set the brightness to match the darkest of all the selected sectors by default if (SectorDarkest != int.MaxValue) { sectorBrightness.Text = SectorDarkest.ToString(); } else { sectorBrightness.Text = General.Settings.DefaultBrightness.ToString(); } sector = General.Map.Map.CreateSector(); }
// Create the control from an existing linedef public ThreeDFloorHelperControl(ThreeDFloor threeDFloor) { InitializeComponent(); Update(threeDFloor); }