mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-25 13:21:28 +00:00
new map options
This commit is contained in:
parent
e2b3f464f3
commit
8d424e3fba
10 changed files with 334 additions and 110 deletions
|
@ -148,4 +148,7 @@
|
|||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Editing\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -150,6 +150,7 @@ namespace CodeImp.DoomBuilder
|
|||
#region ================== Startup
|
||||
|
||||
// Main program entry
|
||||
[STAThread]
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
// Find application path
|
||||
|
@ -208,7 +209,6 @@ namespace CodeImp.DoomBuilder
|
|||
{
|
||||
MapOptions newoptions;
|
||||
MapOptionsForm optionswindow;
|
||||
DialogResult result;
|
||||
|
||||
// Empty options
|
||||
newoptions = new MapOptions();
|
||||
|
@ -217,30 +217,50 @@ namespace CodeImp.DoomBuilder
|
|||
optionswindow = new MapOptionsForm(newoptions);
|
||||
if(optionswindow.ShowDialog(mainwindow) == DialogResult.OK)
|
||||
{
|
||||
// Map open and not saved?
|
||||
if((map != null) && map.IsChanged)
|
||||
// Ask to save the map if not saved yet
|
||||
if(AskSaveMap())
|
||||
{
|
||||
// Ask to save changes
|
||||
result = MessageBox.Show(mainwindow, "Do you want to save changes to " + map.FileTitle + " (" + map.Options.CurrentName + ")?", Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
|
||||
if(result == DialogResult.Yes)
|
||||
{
|
||||
// TODO: Save map
|
||||
// Display status
|
||||
mainwindow.DisplayStatus("Creating new map...");
|
||||
|
||||
}
|
||||
else if(result == DialogResult.Cancel)
|
||||
{
|
||||
// Abort
|
||||
return false;
|
||||
}
|
||||
// Clear the display
|
||||
mainwindow.ClearDisplay();
|
||||
|
||||
// Trash the current map, if any
|
||||
if(map != null) map.Dispose();
|
||||
|
||||
// Create map manager with given options
|
||||
map = new MapManager(newoptions);
|
||||
|
||||
// Done
|
||||
mainwindow.UpdateMenus();
|
||||
mainwindow.DisplayReady();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Cancelled
|
||||
return false;
|
||||
}
|
||||
|
||||
// This closes the current map
|
||||
public static bool CloseMap()
|
||||
{
|
||||
// Ask to save the map if not saved yet
|
||||
if(AskSaveMap())
|
||||
{
|
||||
// Display status
|
||||
mainwindow.DisplayStatus("Creating new map...");
|
||||
mainwindow.DisplayStatus("Closing map...");
|
||||
|
||||
// Create map manager with these options
|
||||
map = new MapManager(newoptions);
|
||||
// Trash the current map
|
||||
if(map != null) map.Dispose();
|
||||
map = null;
|
||||
|
||||
// Show splash logo on display
|
||||
mainwindow.ShowSplashDisplay();
|
||||
|
||||
// Done
|
||||
mainwindow.UpdateMenus();
|
||||
mainwindow.DisplayReady();
|
||||
return true;
|
||||
}
|
||||
|
@ -250,7 +270,34 @@ namespace CodeImp.DoomBuilder
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// This asks to save the map if needed
|
||||
// Returns false when action was cancelled
|
||||
private static bool AskSaveMap()
|
||||
{
|
||||
DialogResult result;
|
||||
|
||||
// Map open and not saved?
|
||||
if((map != null) && map.IsChanged)
|
||||
{
|
||||
// Ask to save changes
|
||||
result = MessageBox.Show(mainwindow, "Do you want to save changes to " + map.FileTitle + " (" + map.Options.CurrentName + ")?", Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
|
||||
if(result == DialogResult.Yes)
|
||||
{
|
||||
// TODO: Save map
|
||||
|
||||
}
|
||||
else if(result == DialogResult.Cancel)
|
||||
{
|
||||
// Abort
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Continue
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
13
Source/Interface/MainForm.Designer.cs
generated
13
Source/Interface/MainForm.Designer.cs
generated
|
@ -33,6 +33,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.menufile = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.itemnewmap = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.itemopenmap = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.itemclosemap = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.itemsavemap = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.itemsavemapas = new System.Windows.Forms.ToolStripMenuItem();
|
||||
|
@ -64,6 +65,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.menufile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.itemnewmap,
|
||||
this.itemopenmap,
|
||||
this.itemclosemap,
|
||||
this.toolStripMenuItem1,
|
||||
this.itemsavemap,
|
||||
this.itemsavemapas,
|
||||
|
@ -78,7 +80,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
//
|
||||
this.itemnewmap.Name = "itemnewmap";
|
||||
this.itemnewmap.Size = new System.Drawing.Size(167, 22);
|
||||
this.itemnewmap.Text = "New Map...";
|
||||
this.itemnewmap.Text = "New Map";
|
||||
this.itemnewmap.Click += new System.EventHandler(this.itemnewmap_Click);
|
||||
//
|
||||
// itemopenmap
|
||||
|
@ -87,6 +89,13 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.itemopenmap.Size = new System.Drawing.Size(167, 22);
|
||||
this.itemopenmap.Text = "Open Map...";
|
||||
//
|
||||
// itemclosemap
|
||||
//
|
||||
this.itemclosemap.Name = "itemclosemap";
|
||||
this.itemclosemap.Size = new System.Drawing.Size(167, 22);
|
||||
this.itemclosemap.Text = "Close Map";
|
||||
this.itemclosemap.Click += new System.EventHandler(this.itemclosemap_Click);
|
||||
//
|
||||
// toolStripMenuItem1
|
||||
//
|
||||
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
|
||||
|
@ -120,6 +129,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.itemexit.Name = "itemexit";
|
||||
this.itemexit.Size = new System.Drawing.Size(167, 22);
|
||||
this.itemexit.Text = "Exit";
|
||||
this.itemexit.Click += new System.EventHandler(this.itemexit_Click);
|
||||
//
|
||||
// toolbar
|
||||
//
|
||||
|
@ -220,5 +230,6 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2;
|
||||
private System.Windows.Forms.ToolStripMenuItem itemexit;
|
||||
private System.Windows.Forms.ToolStripStatusLabel statuslabel;
|
||||
private System.Windows.Forms.ToolStripMenuItem itemclosemap;
|
||||
}
|
||||
}
|
|
@ -42,7 +42,13 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
private Size lastsize;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region ================== Properties
|
||||
|
||||
public PictureBox Display { get { return display; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Constructor / Disposer
|
||||
|
||||
// Constructor
|
||||
|
@ -149,11 +155,60 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
|
||||
#endregion
|
||||
|
||||
#region ================== Display
|
||||
|
||||
// This shows the splash screen on display
|
||||
public void ShowSplashDisplay()
|
||||
{
|
||||
// Change display to show splash logo
|
||||
display.BackColor = System.Drawing.SystemColors.AppWorkspace;
|
||||
display.BackgroundImage = global::CodeImp.DoomBuilder.Properties.Resources.Splash2;
|
||||
display.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
|
||||
}
|
||||
|
||||
// This clears the display
|
||||
public void ClearDisplay()
|
||||
{
|
||||
// Clear the display
|
||||
display.BackColor = Color.Black;
|
||||
display.BackgroundImage = null;
|
||||
display.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Tile;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Menus
|
||||
|
||||
// This updates all menus for the current status
|
||||
public void UpdateMenus()
|
||||
{
|
||||
// Update them all
|
||||
UpdateFileMenu();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== File Menu
|
||||
|
||||
// New map clicked
|
||||
private void itemnewmap_Click(object sender, EventArgs e) { General.NewMap(); }
|
||||
|
||||
// Close map clicked
|
||||
private void itemclosemap_Click(object sender, EventArgs e) { General.CloseMap(); }
|
||||
|
||||
// Exit clicked
|
||||
private void itemexit_Click(object sender, EventArgs e) { this.Close(); }
|
||||
|
||||
// This sets up the file menu
|
||||
private void UpdateFileMenu()
|
||||
{
|
||||
// Enable/disable items
|
||||
itemclosemap.Enabled = (General.Map != null);
|
||||
itemsavemap.Enabled = (General.Map != null);
|
||||
itemsavemapas.Enabled = (General.Map != null);
|
||||
itemsavemapinto.Enabled = (General.Map != null);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
150
Source/Interface/MapOptionsForm.Designer.cs
generated
150
Source/Interface/MapOptionsForm.Designer.cs
generated
|
@ -28,44 +28,28 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.Windows.Forms.GroupBox groupBox1;
|
||||
System.Windows.Forms.Label label3;
|
||||
System.Windows.Forms.Label label2;
|
||||
System.Windows.Forms.Label label1;
|
||||
System.Windows.Forms.GroupBox groupBox2;
|
||||
System.Windows.Forms.GroupBox panelsettings;
|
||||
System.Windows.Forms.GroupBox panelres;
|
||||
this.levelname = new System.Windows.Forms.TextBox();
|
||||
this.config = new System.Windows.Forms.ComboBox();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.deleteresource = new System.Windows.Forms.Button();
|
||||
this.editresource = new System.Windows.Forms.Button();
|
||||
this.addresource = new System.Windows.Forms.Button();
|
||||
this.resources = new System.Windows.Forms.ListBox();
|
||||
this.apply = new System.Windows.Forms.Button();
|
||||
this.cancel = new System.Windows.Forms.Button();
|
||||
groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
label3 = new System.Windows.Forms.Label();
|
||||
label2 = new System.Windows.Forms.Label();
|
||||
label1 = new System.Windows.Forms.Label();
|
||||
groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
groupBox1.SuspendLayout();
|
||||
groupBox2.SuspendLayout();
|
||||
panelsettings = new System.Windows.Forms.GroupBox();
|
||||
panelres = new System.Windows.Forms.GroupBox();
|
||||
panelsettings.SuspendLayout();
|
||||
panelres.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
groupBox1.Controls.Add(label3);
|
||||
groupBox1.Controls.Add(this.levelname);
|
||||
groupBox1.Controls.Add(label2);
|
||||
groupBox1.Controls.Add(this.config);
|
||||
groupBox1.Controls.Add(label1);
|
||||
groupBox1.Location = new System.Drawing.Point(12, 12);
|
||||
groupBox1.Name = "groupBox1";
|
||||
groupBox1.Size = new System.Drawing.Size(365, 118);
|
||||
groupBox1.TabIndex = 10;
|
||||
groupBox1.TabStop = false;
|
||||
groupBox1.Text = " Settings ";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
|
@ -75,13 +59,6 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
label3.TabIndex = 9;
|
||||
label3.Text = "example: MAP01";
|
||||
//
|
||||
// levelname
|
||||
//
|
||||
this.levelname.Location = new System.Drawing.Point(129, 73);
|
||||
this.levelname.Name = "levelname";
|
||||
this.levelname.Size = new System.Drawing.Size(94, 20);
|
||||
this.levelname.TabIndex = 8;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
|
@ -91,15 +68,6 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
label2.TabIndex = 7;
|
||||
label2.Text = "Level name:";
|
||||
//
|
||||
// config
|
||||
//
|
||||
this.config.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.config.FormattingEnabled = true;
|
||||
this.config.Location = new System.Drawing.Point(129, 31);
|
||||
this.config.Name = "config";
|
||||
this.config.Size = new System.Drawing.Size(213, 22);
|
||||
this.config.TabIndex = 6;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
|
@ -109,36 +77,72 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
label1.TabIndex = 5;
|
||||
label1.Text = "Game Configuration:";
|
||||
//
|
||||
// groupBox2
|
||||
// panelsettings
|
||||
//
|
||||
groupBox2.Controls.Add(this.button2);
|
||||
groupBox2.Controls.Add(this.button1);
|
||||
groupBox2.Controls.Add(this.addresource);
|
||||
groupBox2.Controls.Add(this.resources);
|
||||
groupBox2.Location = new System.Drawing.Point(12, 145);
|
||||
groupBox2.Name = "groupBox2";
|
||||
groupBox2.Size = new System.Drawing.Size(365, 165);
|
||||
groupBox2.TabIndex = 11;
|
||||
groupBox2.TabStop = false;
|
||||
groupBox2.Text = " Custom Resources ";
|
||||
panelsettings.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
panelsettings.Controls.Add(label3);
|
||||
panelsettings.Controls.Add(this.levelname);
|
||||
panelsettings.Controls.Add(label2);
|
||||
panelsettings.Controls.Add(this.config);
|
||||
panelsettings.Controls.Add(label1);
|
||||
panelsettings.Location = new System.Drawing.Point(12, 12);
|
||||
panelsettings.Name = "panelsettings";
|
||||
panelsettings.Size = new System.Drawing.Size(365, 118);
|
||||
panelsettings.TabIndex = 10;
|
||||
panelsettings.TabStop = false;
|
||||
panelsettings.Text = " Settings ";
|
||||
//
|
||||
// button2
|
||||
// levelname
|
||||
//
|
||||
this.button2.Location = new System.Drawing.Point(268, 125);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(74, 25);
|
||||
this.button2.TabIndex = 13;
|
||||
this.button2.Text = "Remove";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.levelname.Location = new System.Drawing.Point(129, 73);
|
||||
this.levelname.Name = "levelname";
|
||||
this.levelname.Size = new System.Drawing.Size(94, 20);
|
||||
this.levelname.TabIndex = 8;
|
||||
//
|
||||
// button1
|
||||
// config
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(139, 125);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(123, 25);
|
||||
this.button1.TabIndex = 12;
|
||||
this.button1.Text = "Resource Options...";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.config.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.config.FormattingEnabled = true;
|
||||
this.config.Location = new System.Drawing.Point(129, 31);
|
||||
this.config.Name = "config";
|
||||
this.config.Size = new System.Drawing.Size(213, 22);
|
||||
this.config.TabIndex = 6;
|
||||
//
|
||||
// panelres
|
||||
//
|
||||
panelres.Controls.Add(this.deleteresource);
|
||||
panelres.Controls.Add(this.editresource);
|
||||
panelres.Controls.Add(this.addresource);
|
||||
panelres.Controls.Add(this.resources);
|
||||
panelres.Location = new System.Drawing.Point(12, 145);
|
||||
panelres.Name = "panelres";
|
||||
panelres.Size = new System.Drawing.Size(365, 165);
|
||||
panelres.TabIndex = 11;
|
||||
panelres.TabStop = false;
|
||||
panelres.Text = " Custom Resources ";
|
||||
//
|
||||
// deleteresource
|
||||
//
|
||||
this.deleteresource.Enabled = false;
|
||||
this.deleteresource.Location = new System.Drawing.Point(268, 125);
|
||||
this.deleteresource.Name = "deleteresource";
|
||||
this.deleteresource.Size = new System.Drawing.Size(74, 25);
|
||||
this.deleteresource.TabIndex = 13;
|
||||
this.deleteresource.Text = "Remove";
|
||||
this.deleteresource.UseVisualStyleBackColor = true;
|
||||
this.deleteresource.Click += new System.EventHandler(this.deleteresource_Click);
|
||||
//
|
||||
// editresource
|
||||
//
|
||||
this.editresource.Enabled = false;
|
||||
this.editresource.Location = new System.Drawing.Point(139, 125);
|
||||
this.editresource.Name = "editresource";
|
||||
this.editresource.Size = new System.Drawing.Size(123, 25);
|
||||
this.editresource.TabIndex = 12;
|
||||
this.editresource.Text = "Resource Options...";
|
||||
this.editresource.UseVisualStyleBackColor = true;
|
||||
this.editresource.Click += new System.EventHandler(this.editresource_Click);
|
||||
//
|
||||
// addresource
|
||||
//
|
||||
|
@ -148,6 +152,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.addresource.TabIndex = 11;
|
||||
this.addresource.Text = "Add Resource...";
|
||||
this.addresource.UseVisualStyleBackColor = true;
|
||||
this.addresource.Click += new System.EventHandler(this.addresource_Click);
|
||||
//
|
||||
// resources
|
||||
//
|
||||
|
@ -159,6 +164,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.resources.Name = "resources";
|
||||
this.resources.Size = new System.Drawing.Size(321, 88);
|
||||
this.resources.TabIndex = 10;
|
||||
this.resources.SelectedIndexChanged += new System.EventHandler(this.resources_SelectedIndexChanged);
|
||||
//
|
||||
// apply
|
||||
//
|
||||
|
@ -190,8 +196,8 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.ClientSize = new System.Drawing.Size(389, 367);
|
||||
this.Controls.Add(this.cancel);
|
||||
this.Controls.Add(this.apply);
|
||||
this.Controls.Add(groupBox2);
|
||||
this.Controls.Add(groupBox1);
|
||||
this.Controls.Add(panelres);
|
||||
this.Controls.Add(panelsettings);
|
||||
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;
|
||||
|
@ -201,9 +207,9 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Map Options";
|
||||
groupBox1.ResumeLayout(false);
|
||||
groupBox1.PerformLayout();
|
||||
groupBox2.ResumeLayout(false);
|
||||
panelsettings.ResumeLayout(false);
|
||||
panelsettings.PerformLayout();
|
||||
panelres.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
@ -212,8 +218,8 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
|
||||
private System.Windows.Forms.TextBox levelname;
|
||||
private System.Windows.Forms.ComboBox config;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Button deleteresource;
|
||||
private System.Windows.Forms.Button editresource;
|
||||
private System.Windows.Forms.Button addresource;
|
||||
private System.Windows.Forms.ListBox resources;
|
||||
private System.Windows.Forms.Button apply;
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
|
||||
// Properties
|
||||
public MapOptions Options { get { return options; } }
|
||||
|
||||
|
||||
// Constructor
|
||||
public MapOptionsForm(MapOptions options)
|
||||
{
|
||||
|
@ -86,5 +86,56 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.DialogResult = DialogResult.Cancel;
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
// Add Resource clicked
|
||||
private void addresource_Click(object sender, EventArgs e)
|
||||
{
|
||||
ResourceOptionsForm resoptions;
|
||||
|
||||
// Open resource options dialog
|
||||
resoptions = new ResourceOptionsForm(new ResourceLocation(), "Add Resource");
|
||||
if(resoptions.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
// Add resource
|
||||
resources.Items.Add(resoptions.ResourceLocation);
|
||||
}
|
||||
}
|
||||
|
||||
// Resource Options clicked
|
||||
private void editresource_Click(object sender, EventArgs e)
|
||||
{
|
||||
ResourceOptionsForm resoptions;
|
||||
|
||||
// Anything selected?
|
||||
if(resources.SelectedIndex > -1)
|
||||
{
|
||||
// Open resource options dialog
|
||||
resoptions = new ResourceOptionsForm((ResourceLocation)resources.SelectedItem, "Resource Options");
|
||||
if(resoptions.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
// Replace resource
|
||||
resources.Items[resources.SelectedIndex] = resoptions.ResourceLocation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove resource clicked
|
||||
private void deleteresource_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Anything selected?
|
||||
if(resources.SelectedIndex > -1)
|
||||
{
|
||||
// Remove it
|
||||
resources.Items.RemoveAt(resources.SelectedIndex);
|
||||
}
|
||||
}
|
||||
|
||||
// Resource selection changes
|
||||
private void resources_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// Enable/disable buttons
|
||||
editresource.Enabled = (resources.SelectedIndex > -1);
|
||||
deleteresource.Enabled = (resources.SelectedIndex > -1);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -117,46 +117,46 @@
|
|||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="groupBox1.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="groupBox1.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="label3.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="levelname.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="config.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label1.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="groupBox2.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="panelsettings.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="groupBox2.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="panelsettings.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="button2.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="levelname.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="button1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="config.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="panelres.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="panelres.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="deleteresource.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="editresource.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="addresource.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
|
|
17
Source/Interface/ResourceOptionsForm.Designer.cs
generated
17
Source/Interface/ResourceOptionsForm.Designer.cs
generated
|
@ -41,6 +41,8 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.dirlocation = new System.Windows.Forms.TextBox();
|
||||
this.cancel = new System.Windows.Forms.Button();
|
||||
this.apply = new System.Windows.Forms.Button();
|
||||
this.wadfiledialog = new System.Windows.Forms.OpenFileDialog();
|
||||
this.dirdialog = new System.Windows.Forms.FolderBrowserDialog();
|
||||
label1 = new System.Windows.Forms.Label();
|
||||
label2 = new System.Windows.Forms.Label();
|
||||
this.tabs.SuspendLayout();
|
||||
|
@ -104,6 +106,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.browsewad.TabIndex = 2;
|
||||
this.browsewad.Text = "...";
|
||||
this.browsewad.UseVisualStyleBackColor = true;
|
||||
this.browsewad.Click += new System.EventHandler(this.browsewad_Click);
|
||||
//
|
||||
// wadlocation
|
||||
//
|
||||
|
@ -158,6 +161,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.browsedir.TabIndex = 5;
|
||||
this.browsedir.Text = "...";
|
||||
this.browsedir.UseVisualStyleBackColor = true;
|
||||
this.browsedir.Click += new System.EventHandler(this.browsedir_Click);
|
||||
//
|
||||
// dirlocation
|
||||
//
|
||||
|
@ -171,6 +175,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
// 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(253, 189);
|
||||
this.cancel.Name = "cancel";
|
||||
this.cancel.Size = new System.Drawing.Size(112, 25);
|
||||
|
@ -190,6 +195,15 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.apply.UseVisualStyleBackColor = true;
|
||||
this.apply.Click += new System.EventHandler(this.apply_Click);
|
||||
//
|
||||
// wadfiledialog
|
||||
//
|
||||
this.wadfiledialog.Filter = "Doom WAD Files|*.wad";
|
||||
this.wadfiledialog.Title = "Browse WAD File";
|
||||
//
|
||||
// dirdialog
|
||||
//
|
||||
this.dirdialog.Description = "Please select a directory from which to load images when editing your map...";
|
||||
//
|
||||
// ResourceOptionsForm
|
||||
//
|
||||
this.AcceptButton = this.apply;
|
||||
|
@ -200,6 +214,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.Controls.Add(this.cancel);
|
||||
this.Controls.Add(this.apply);
|
||||
this.Controls.Add(this.tabs);
|
||||
this.DoubleBuffered = true;
|
||||
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;
|
||||
|
@ -231,5 +246,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
private System.Windows.Forms.TextBox dirlocation;
|
||||
private System.Windows.Forms.CheckBox dir_flats;
|
||||
private System.Windows.Forms.CheckBox dir_textures;
|
||||
private System.Windows.Forms.OpenFileDialog wadfiledialog;
|
||||
private System.Windows.Forms.FolderBrowserDialog dirdialog;
|
||||
}
|
||||
}
|
|
@ -18,11 +18,14 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
public ResourceLocation ResourceLocation { get { return res; } }
|
||||
|
||||
// Constructor
|
||||
public ResourceOptionsForm(ResourceLocation settings)
|
||||
public ResourceOptionsForm(ResourceLocation settings, string caption)
|
||||
{
|
||||
// Initialize
|
||||
InitializeComponent();
|
||||
|
||||
// Set caption
|
||||
this.Text = caption;
|
||||
|
||||
// Apply settings from ResourceLocation
|
||||
this.res = settings;
|
||||
switch(res.type)
|
||||
|
@ -41,6 +44,9 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
dir_flats.Checked = res.flats;
|
||||
break;
|
||||
}
|
||||
|
||||
// Select appropriate tab
|
||||
tabs.SelectedIndex = res.type;
|
||||
}
|
||||
|
||||
// OK clicked
|
||||
|
@ -92,7 +98,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
else
|
||||
{
|
||||
// Apply settings
|
||||
res.type = ResourceLocation.RESOURCE_WAD;
|
||||
res.type = ResourceLocation.RESOURCE_DIRECTORY;
|
||||
res.location = dirlocation.Text;
|
||||
res.textures = dir_textures.Checked;
|
||||
res.flats = dir_flats.Checked;
|
||||
|
@ -112,5 +118,27 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.DialogResult = DialogResult.Cancel;
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
// Browse WAD File clicked
|
||||
private void browsewad_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Browse for WAD File
|
||||
if(wadfiledialog.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
// Use this file
|
||||
wadlocation.Text = wadfiledialog.FileName;
|
||||
}
|
||||
}
|
||||
|
||||
// Browse Directory clicked
|
||||
private void browsedir_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Browse for Directory
|
||||
if(dirdialog.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
// Use this directory
|
||||
dirlocation.Text = dirdialog.SelectedPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -162,6 +162,12 @@
|
|||
<metadata name="apply.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="wadfiledialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="dirdialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>133, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
|
Loading…
Reference in a new issue