mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 04:40:55 +00:00
improved the make door feature
This commit is contained in:
parent
5961702720
commit
f2c08e64a5
14 changed files with 533 additions and 100 deletions
|
@ -41,11 +41,11 @@ lowerunpeggedflag = "dontpegbottom";
|
|||
// Door making
|
||||
makedoortrack = "DOORTRAK";
|
||||
makedooraction = 202; // See linedeftypes
|
||||
makedoorarg1 = 0;
|
||||
makedoorarg2 = 16;
|
||||
makedoorarg3 = 0;
|
||||
makedoorarg4 = 3;
|
||||
makedoorarg5 = 0;
|
||||
makedoorarg0 = 0;
|
||||
makedoorarg1 = 16;
|
||||
makedoorarg2 = 0;
|
||||
makedoorarg3 = 3;
|
||||
makedoorarg4 = 0;
|
||||
|
||||
// Generalized actions
|
||||
generalizedlinedefs = true;
|
||||
|
|
|
@ -41,11 +41,11 @@ lowerunpeggedflag = 16;
|
|||
// Door making
|
||||
makedoortrack = "DOORTRAK";
|
||||
makedooraction = 11; // See linedeftypes
|
||||
makedoorarg1 = -1; // -1 can be used for a new sector tag here
|
||||
makedoorarg2 = 16;
|
||||
makedoorarg0= -1; // -1 can be used for a new sector tag here
|
||||
makedoorarg1 = 16;
|
||||
makedoorarg2 = 0;
|
||||
makedoorarg3 = 0;
|
||||
makedoorarg4 = 0;
|
||||
makedoorarg5 = 0;
|
||||
|
||||
// Generalized actions
|
||||
generalizedlinedefs = false;
|
||||
|
|
|
@ -41,11 +41,11 @@ lowerunpeggedflag = 16;
|
|||
// Door making
|
||||
makedoortrack = "DOORTRAK";
|
||||
makedooraction = 202; // See linedeftypes
|
||||
makedoorarg1 = 0;
|
||||
makedoorarg2 = 16;
|
||||
makedoorarg3 = 0;
|
||||
makedoorarg4 = 3;
|
||||
makedoorarg5 = 0;
|
||||
makedoorarg0 = 0;
|
||||
makedoorarg1 = 16;
|
||||
makedoorarg2 = 0;
|
||||
makedoorarg3 = 3;
|
||||
makedoorarg4 = 0;
|
||||
|
||||
// Generalized actions
|
||||
generalizedlinedefs = false;
|
||||
|
|
|
@ -42,11 +42,11 @@ lowerunpeggedflag = 16;
|
|||
// Door making
|
||||
makedoortrack = "DOORTRAK";
|
||||
makedooraction = 202; // See linedeftypes
|
||||
makedoorarg1 = 0;
|
||||
makedoorarg2 = 16;
|
||||
makedoorarg3 = 0;
|
||||
makedoorarg4 = 3;
|
||||
makedoorarg5 = 0;
|
||||
makedoorarg0 = 0;
|
||||
makedoorarg1 = 16;
|
||||
makedoorarg2 = 0;
|
||||
makedoorarg3 = 3;
|
||||
makedoorarg4 = 0;
|
||||
|
||||
// Generalized actions
|
||||
generalizedlinedefs = false;
|
||||
|
|
|
@ -42,11 +42,11 @@ lowerunpeggedflag = "dontpegbottom";
|
|||
// Door making
|
||||
makedoortrack = "DOORTRAK";
|
||||
makedooraction = 202; // See linedeftypes
|
||||
makedoorarg1 = 0;
|
||||
makedoorarg2 = 16;
|
||||
makedoorarg3 = 0;
|
||||
makedoorarg4 = 3;
|
||||
makedoorarg5 = 0;
|
||||
makedoorarg0 = 0;
|
||||
makedoorarg1 = 16;
|
||||
makedoorarg2 = 0;
|
||||
makedoorarg3 = 3;
|
||||
makedoorarg4 = 0;
|
||||
|
||||
// Generalized actions
|
||||
generalizedlinedefs = false;
|
||||
|
|
|
@ -41,11 +41,11 @@ lowerunpeggedflag = 16;
|
|||
// Door making
|
||||
makedoortrack = "DOORTRAK";
|
||||
makedooraction = 202; // See linedeftypes
|
||||
makedoorarg1 = 0;
|
||||
makedoorarg2 = 16;
|
||||
makedoorarg3 = 0;
|
||||
makedoorarg4 = 3;
|
||||
makedoorarg5 = 0;
|
||||
makedoorarg0 = 0;
|
||||
makedoorarg1 = 16;
|
||||
makedoorarg2 = 0;
|
||||
makedoorarg3 = 3;
|
||||
makedoorarg4 = 0;
|
||||
|
||||
// Generalized actions
|
||||
generalizedlinedefs = false;
|
||||
|
|
|
@ -41,11 +41,11 @@ lowerunpeggedflag = 16;
|
|||
// Door making
|
||||
makedoortrack = "DOORTRAK";
|
||||
makedooraction = 11; // See linedeftypes
|
||||
makedoorarg1 = -1; // -1 can be used for a new sector tag here
|
||||
makedoorarg2 = 16;
|
||||
makedoorarg0 = -1; // -1 can be used for a new sector tag here
|
||||
makedoorarg1 = 16;
|
||||
makedoorarg2 = 0;
|
||||
makedoorarg3 = 0;
|
||||
makedoorarg4 = 0;
|
||||
makedoorarg5 = 0;
|
||||
|
||||
// Generalized actions
|
||||
generalizedlinedefs = false;
|
||||
|
|
|
@ -41,11 +41,11 @@ lowerunpeggedflag = 16;
|
|||
// Door making
|
||||
makedoortrack = "DOORTRAK";
|
||||
makedooraction = 202; // See linedeftypes
|
||||
makedoorarg1 = 0;
|
||||
makedoorarg2 = 16;
|
||||
makedoorarg3 = 0;
|
||||
makedoorarg4 = 3;
|
||||
makedoorarg5 = 0;
|
||||
makedoorarg0 = 0;
|
||||
makedoorarg1 = 16;
|
||||
makedoorarg2 = 0;
|
||||
makedoorarg3 = 3;
|
||||
makedoorarg4 = 0;
|
||||
|
||||
// Generalized actions
|
||||
generalizedlinedefs = false;
|
||||
|
|
|
@ -73,3 +73,7 @@ Map statistics plugin
|
|||
- Button on toolbar for stats window (stats also shown in text format for copy/paste)
|
||||
- Command-line processing that saves text stats to file
|
||||
|
||||
===========================================================================================
|
||||
|
||||
So in a Hexen-format map, the default activation for a linedef special is "player walks over". Could DB2 be made smart enough to instead use "player presses use" for default activation method when the line is impassible?
|
||||
|
||||
|
|
|
@ -62,6 +62,12 @@
|
|||
<Compile Include="Interface\FindReplaceForm.Designer.cs">
|
||||
<DependentUpon>FindReplaceForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Interface\MakeDoorForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interface\MakeDoorForm.Designer.cs">
|
||||
<DependentUpon>MakeDoorForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Interface\MenusForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
@ -145,6 +151,10 @@
|
|||
<DependentUpon>FindReplaceForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Interface\MakeDoorForm.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>MakeDoorForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
|
|
|
@ -33,6 +33,7 @@ using CodeImp.DoomBuilder.Editing;
|
|||
using System.Drawing;
|
||||
using CodeImp.DoomBuilder.Actions;
|
||||
using CodeImp.DoomBuilder.Types;
|
||||
using CodeImp.DoomBuilder.BuilderModes.Interface;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -706,84 +707,105 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// Anything selected?
|
||||
if(orderedselection.Count > 0)
|
||||
{
|
||||
// Select a texture for the door
|
||||
string texture = General.Interface.BrowseTexture(General.Interface, "");
|
||||
string doortex = "";
|
||||
string floortex = null;
|
||||
string ceiltex = null;
|
||||
|
||||
// Create undo
|
||||
General.Map.UndoRedo.CreateUndo("Make door (" + texture + ")", UndoGroup.None, 0);
|
||||
|
||||
// Go for all selected sectors
|
||||
// Find ceiling and floor textures
|
||||
foreach(Sector s in orderedselection)
|
||||
{
|
||||
// Lower the ceiling down to the floor
|
||||
s.CeilHeight = s.FloorHeight;
|
||||
|
||||
// Make a unique tag (not sure if we need it yet, depends on the args)
|
||||
int tag = General.Map.Map.GetNewTag();
|
||||
if(floortex == null) floortex = s.FloorTexture; else if(floortex != s.FloorTexture) floortex = "";
|
||||
if(ceiltex == null) ceiltex = s.CeilTexture; else if(ceiltex != s.CeilTexture) ceiltex = "";
|
||||
}
|
||||
|
||||
// Show the dialog
|
||||
MakeDoorForm form = new MakeDoorForm();
|
||||
if(form.Show(General.Interface, doortex, ceiltex, floortex) == DialogResult.OK)
|
||||
{
|
||||
doortex = form.DoorTexture;
|
||||
ceiltex = form.CeilingTexture;
|
||||
floortex = form.FloorTexture;
|
||||
|
||||
// Go for all it's sidedefs
|
||||
foreach(Sidedef sd in s.Sidedefs)
|
||||
// Create undo
|
||||
General.Map.UndoRedo.CreateUndo("Make door (" + doortex + ")", UndoGroup.None, 0);
|
||||
|
||||
// Go for all selected sectors
|
||||
foreach(Sector s in orderedselection)
|
||||
{
|
||||
// Singlesided?
|
||||
if(sd.Other == null)
|
||||
{
|
||||
// Make this a doortrak
|
||||
sd.SetTextureHigh("-");
|
||||
sd.SetTextureMid(General.Map.Config.MakeDoorTrack);
|
||||
sd.SetTextureLow("-");
|
||||
|
||||
// Set upper/lower unpegged flags
|
||||
sd.Line.Flags[General.Map.Config.UpperUnpeggedFlag] = false;
|
||||
sd.Line.Flags[General.Map.Config.LowerUnpeggedFlag] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set texture
|
||||
if(texture.Length > 0)
|
||||
{
|
||||
if(sd.IsFront)
|
||||
sd.SetTextureHigh(texture);
|
||||
else
|
||||
sd.Other.SetTextureHigh(texture);
|
||||
}
|
||||
|
||||
// Get door linedef type from config
|
||||
sd.Line.Action = General.Map.Config.MakeDoorAction;
|
||||
// Lower the ceiling down to the floor
|
||||
s.CeilHeight = s.FloorHeight;
|
||||
|
||||
// Set the linedef args
|
||||
for(int i = 0; i < Linedef.NUM_ARGS; i++)
|
||||
// Make a unique tag (not sure if we need it yet, depends on the args)
|
||||
int tag = General.Map.Map.GetNewTag();
|
||||
|
||||
// Go for all it's sidedefs
|
||||
foreach(Sidedef sd in s.Sidedefs)
|
||||
{
|
||||
// Singlesided?
|
||||
if(sd.Other == null)
|
||||
{
|
||||
// A -1 arg indicates that the arg must be set to the new sector tag
|
||||
// and only in this case we set the tag on the sector, because only
|
||||
// then we know for sure that we need a tag.
|
||||
if(General.Map.Config.MakeDoorArgs[i] == -1)
|
||||
{
|
||||
sd.Line.Args[i] = tag;
|
||||
s.Tag = tag;
|
||||
}
|
||||
else
|
||||
{
|
||||
sd.Line.Args[i] = General.Map.Config.MakeDoorArgs[i];
|
||||
}
|
||||
// Make this a doortrak
|
||||
sd.SetTextureHigh("-");
|
||||
sd.SetTextureMid(General.Map.Config.MakeDoorTrack);
|
||||
sd.SetTextureLow("-");
|
||||
|
||||
// Set upper/lower unpegged flags
|
||||
sd.Line.Flags[General.Map.Config.UpperUnpeggedFlag] = false;
|
||||
sd.Line.Flags[General.Map.Config.LowerUnpeggedFlag] = true;
|
||||
}
|
||||
|
||||
// Make sure the line is facing outwards
|
||||
if(sd.IsFront)
|
||||
else
|
||||
{
|
||||
sd.Line.FlipVertices();
|
||||
sd.Line.FlipSidedefs();
|
||||
// Set textures
|
||||
if(floortex.Length > 0) s.SetFloorTexture(floortex);
|
||||
if(ceiltex.Length > 0) s.SetCeilTexture(ceiltex);
|
||||
if(doortex.Length > 0) sd.Other.SetTextureHigh(doortex);
|
||||
|
||||
// Set upper/lower unpegged flags
|
||||
sd.Line.Flags[General.Map.Config.UpperUnpeggedFlag] = false;
|
||||
sd.Line.Flags[General.Map.Config.LowerUnpeggedFlag] = false;
|
||||
|
||||
// Get door linedef type from config
|
||||
sd.Line.Action = General.Map.Config.MakeDoorAction;
|
||||
|
||||
// Set the linedef args
|
||||
for(int i = 0; i < Linedef.NUM_ARGS; i++)
|
||||
{
|
||||
// A -1 arg indicates that the arg must be set to the new sector tag
|
||||
// and only in this case we set the tag on the sector, because only
|
||||
// then we know for sure that we need a tag.
|
||||
if(General.Map.Config.MakeDoorArgs[i] == -1)
|
||||
{
|
||||
sd.Line.Args[i] = tag;
|
||||
s.Tag = tag;
|
||||
}
|
||||
else
|
||||
{
|
||||
sd.Line.Args[i] = General.Map.Config.MakeDoorArgs[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure the line is facing outwards
|
||||
if(sd.IsFront)
|
||||
{
|
||||
sd.Line.FlipVertices();
|
||||
sd.Line.FlipSidedefs();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// When a single sector was selected, deselect it now
|
||||
if(orderedselection.Count == 1)
|
||||
{
|
||||
orderedselection.Clear();
|
||||
General.Map.Map.ClearSelectedSectors();
|
||||
General.Map.Map.ClearSelectedLinedefs();
|
||||
}
|
||||
}
|
||||
|
||||
// When a single sector was selected, deselect it now
|
||||
if(orderedselection.Count == 1)
|
||||
{
|
||||
orderedselection.Clear();
|
||||
General.Map.Map.ClearSelectedSectors();
|
||||
General.Map.Map.ClearSelectedLinedefs();
|
||||
}
|
||||
// Done
|
||||
form.Dispose();
|
||||
General.Interface.RedrawDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
154
Source/BuilderModes/Interface/MakeDoorForm.Designer.cs
generated
Normal file
154
Source/BuilderModes/Interface/MakeDoorForm.Designer.cs
generated
Normal file
|
@ -0,0 +1,154 @@
|
|||
namespace CodeImp.DoomBuilder.BuilderModes.Interface
|
||||
{
|
||||
partial class MakeDoorForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if(disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.doortexture = new CodeImp.DoomBuilder.Controls.TextureSelectorControl();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.ceilingtexture = new CodeImp.DoomBuilder.Controls.FlatSelectorControl();
|
||||
this.floortexture = new CodeImp.DoomBuilder.Controls.FlatSelectorControl();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.cancel = new System.Windows.Forms.Button();
|
||||
this.apply = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// doortexture
|
||||
//
|
||||
this.doortexture.Location = new System.Drawing.Point(22, 34);
|
||||
this.doortexture.Name = "doortexture";
|
||||
this.doortexture.Required = false;
|
||||
this.doortexture.Size = new System.Drawing.Size(96, 115);
|
||||
this.doortexture.TabIndex = 0;
|
||||
this.doortexture.TextureName = "";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Location = new System.Drawing.Point(22, 15);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(96, 21);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Door Texture";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Location = new System.Drawing.Point(132, 15);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(99, 21);
|
||||
this.label2.TabIndex = 2;
|
||||
this.label2.Text = "Ceiling";
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
// ceilingtexture
|
||||
//
|
||||
this.ceilingtexture.Location = new System.Drawing.Point(135, 34);
|
||||
this.ceilingtexture.Name = "ceilingtexture";
|
||||
this.ceilingtexture.Size = new System.Drawing.Size(96, 115);
|
||||
this.ceilingtexture.TabIndex = 3;
|
||||
this.ceilingtexture.TextureName = "";
|
||||
//
|
||||
// floortexture
|
||||
//
|
||||
this.floortexture.Location = new System.Drawing.Point(248, 34);
|
||||
this.floortexture.Name = "floortexture";
|
||||
this.floortexture.Size = new System.Drawing.Size(96, 115);
|
||||
this.floortexture.TabIndex = 5;
|
||||
this.floortexture.TextureName = "";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Location = new System.Drawing.Point(245, 15);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(99, 21);
|
||||
this.label3.TabIndex = 4;
|
||||
this.label3.Text = "Floor";
|
||||
this.label3.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
// cancel
|
||||
//
|
||||
this.cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancel.Location = new System.Drawing.Point(187, 180);
|
||||
this.cancel.Name = "cancel";
|
||||
this.cancel.Size = new System.Drawing.Size(112, 25);
|
||||
this.cancel.TabIndex = 15;
|
||||
this.cancel.Text = "Cancel";
|
||||
this.cancel.UseVisualStyleBackColor = true;
|
||||
this.cancel.Click += new System.EventHandler(this.cancel_Click);
|
||||
//
|
||||
// apply
|
||||
//
|
||||
this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.apply.Location = new System.Drawing.Point(69, 180);
|
||||
this.apply.Name = "apply";
|
||||
this.apply.Size = new System.Drawing.Size(112, 25);
|
||||
this.apply.TabIndex = 14;
|
||||
this.apply.Text = "OK";
|
||||
this.apply.UseVisualStyleBackColor = true;
|
||||
this.apply.Click += new System.EventHandler(this.apply_Click);
|
||||
//
|
||||
// MakeDoorForm
|
||||
//
|
||||
this.AcceptButton = this.apply;
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.CancelButton = this.cancel;
|
||||
this.ClientSize = new System.Drawing.Size(368, 219);
|
||||
this.Controls.Add(this.cancel);
|
||||
this.Controls.Add(this.apply);
|
||||
this.Controls.Add(this.floortexture);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.ceilingtexture);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.doortexture);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "MakeDoorForm";
|
||||
this.Opacity = 0;
|
||||
this.ShowIcon = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Make Door";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private CodeImp.DoomBuilder.Controls.TextureSelectorControl doortexture;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private CodeImp.DoomBuilder.Controls.FlatSelectorControl ceilingtexture;
|
||||
private CodeImp.DoomBuilder.Controls.FlatSelectorControl floortexture;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Button cancel;
|
||||
private System.Windows.Forms.Button apply;
|
||||
}
|
||||
}
|
96
Source/BuilderModes/Interface/MakeDoorForm.cs
Normal file
96
Source/BuilderModes/Interface/MakeDoorForm.cs
Normal file
|
@ -0,0 +1,96 @@
|
|||
|
||||
#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.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Microsoft.Win32;
|
||||
using System.Diagnostics;
|
||||
using CodeImp.DoomBuilder.Actions;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
using CodeImp.DoomBuilder.Config;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.Controls;
|
||||
using CodeImp.DoomBuilder.Windows;
|
||||
using System.Reflection;
|
||||
using System.Globalization;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace CodeImp.DoomBuilder.BuilderModes.Interface
|
||||
{
|
||||
public partial class MakeDoorForm : DelayedForm
|
||||
{
|
||||
#region ================== Properties
|
||||
|
||||
public string DoorTexture { get { return doortexture.TextureName; } }
|
||||
public string CeilingTexture { get { return ceilingtexture.TextureName; } }
|
||||
public string FloorTexture { get { return floortexture.TextureName; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Constructor / Show
|
||||
|
||||
// Constructor
|
||||
public MakeDoorForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
// This sets the properties and shows the form
|
||||
public DialogResult Show(IWin32Window owner, string doortex, string ceilingtex, string floortex)
|
||||
{
|
||||
this.doortexture.TextureName = doortex;
|
||||
this.ceilingtexture.TextureName = ceilingtex;
|
||||
this.floortexture.TextureName = floortex;
|
||||
return this.ShowDialog(owner);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Events
|
||||
|
||||
// Cancel clicked
|
||||
private void cancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
// OK clicked
|
||||
private void apply_Click(object sender, EventArgs e)
|
||||
{
|
||||
// No door texture selected?
|
||||
if(doortexture.TextureName.Length == 0)
|
||||
{
|
||||
MessageBox.Show(this, "You have to select at least a texture for the door!", "Make Door", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
doortexture.Focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
147
Source/BuilderModes/Interface/MakeDoorForm.resx
Normal file
147
Source/BuilderModes/Interface/MakeDoorForm.resx
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="doortexture.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="label2.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ceilingtexture.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="floortexture.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label3.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>
|
||||
<metadata name="apply.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>
|
||||
</root>
|
Loading…
Reference in a new issue