split up the game configurations and preferences, also now supporting 3 seperate nodebuilder configs

This commit is contained in:
codeimp 2007-10-09 20:47:08 +00:00
parent b955fd0601
commit 426e1223f7
12 changed files with 1388 additions and 746 deletions

View file

@ -100,6 +100,12 @@
<Compile Include="Interface\OpenMapOptionsForm.Designer.cs">
<DependentUpon>OpenMapOptionsForm.cs</DependentUpon>
</Compile>
<Compile Include="Interface\PreferencesForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Interface\PreferencesForm.Designer.cs">
<DependentUpon>PreferencesForm.cs</DependentUpon>
</Compile>
<Compile Include="Interface\ResourceListView.cs">
<SubType>Component</SubType>
</Compile>
@ -202,6 +208,10 @@
<SubType>Designer</SubType>
<DependentUpon>DelayedForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Interface\PreferencesForm.resx">
<SubType>Designer</SubType>
<DependentUpon>PreferencesForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Interface\ResourceListEditor.resx">
<SubType>Designer</SubType>
<DependentUpon>ResourceListEditor.cs</DependentUpon>

View file

@ -44,6 +44,7 @@ namespace CodeImp.DoomBuilder.Controls
public const string ZOOMIN = "zoomin";
public const string ZOOMOUT = "zoomout";
public const string CONFIGURATION = "configuration";
public const string PREFERENCES = "preferences";
#endregion

View file

@ -36,8 +36,9 @@ namespace CodeImp.DoomBuilder
private string name;
private string filename;
private string settingskey;
private string nodebuilder;
private bool buildonsave;
private string nodebuildersave;
private string nodebuildertest;
private string nodebuilder3d;
private DataLocationList resources;
private string testprogram;
private string testparameters;
@ -48,8 +49,9 @@ namespace CodeImp.DoomBuilder
public string Name { get { return name; } }
public string Filename { get { return filename; } }
public string Nodebuilder { get { return nodebuilder; } set { nodebuilder = value; } }
public bool BuildOnSave { get { return buildonsave; } set { buildonsave = value; } }
public string NodebuilderSave { get { return nodebuildersave; } set { nodebuildersave = value; } }
public string NodebuilderTest { get { return nodebuildertest; } set { nodebuildertest = value; } }
public string Nodebuilder3D { get { return nodebuilder3d; } set { nodebuilder3d = value; } }
public DataLocationList Resources { get { return resources; } }
public string TestProgram { get { return testprogram; } set { testprogram = value; } }
public string TestParameters { get { return testparameters; } set { testparameters = value; } }
@ -67,11 +69,12 @@ namespace CodeImp.DoomBuilder
this.settingskey = Path.GetFileNameWithoutExtension(filename).ToLower();
// Load settings from program configuration
this.nodebuilder = General.Settings.ReadSetting("configurations." + settingskey + ".nodebuilder", "");
this.buildonsave = General.Settings.ReadSetting("configurations." + settingskey + ".buildonsave", true);
this.resources = new DataLocationList(General.Settings, "configurations." + settingskey + ".resources");
this.nodebuildersave = General.Settings.ReadSetting("configurations." + settingskey + ".nodebuildersave", "");
this.nodebuildertest = General.Settings.ReadSetting("configurations." + settingskey + ".nodebuildertest", "");
this.nodebuilder3d = General.Settings.ReadSetting("configurations." + settingskey + ".nodebuilder3d", "");
this.testprogram = General.Settings.ReadSetting("configurations." + settingskey + ".testprogram", "");
this.testparameters = General.Settings.ReadSetting("configurations." + settingskey + ".testparameters", "");
this.resources = new DataLocationList(General.Settings, "configurations." + settingskey + ".resources");
}
// Constructor
@ -94,11 +97,12 @@ namespace CodeImp.DoomBuilder
public void SaveSettings()
{
// Write to configuration
General.Settings.WriteSetting("configurations." + settingskey + ".nodebuilder", nodebuilder);
General.Settings.WriteSetting("configurations." + settingskey + ".buildonsave", buildonsave);
resources.WriteToConfig(General.Settings, "configurations." + settingskey + ".resources");
General.Settings.WriteSetting("configurations." + settingskey + ".nodebuildersave", nodebuildersave);
General.Settings.WriteSetting("configurations." + settingskey + ".nodebuildertest", nodebuildertest);
General.Settings.WriteSetting("configurations." + settingskey + ".nodebuilder3d", nodebuilder3d);
General.Settings.WriteSetting("configurations." + settingskey + ".testprogram", testprogram);
General.Settings.WriteSetting("configurations." + settingskey + ".testparameters", testparameters);
resources.WriteToConfig(General.Settings, "configurations." + settingskey + ".resources");
}
// String representation
@ -114,8 +118,9 @@ namespace CodeImp.DoomBuilder
ci.name = this.name;
ci.filename = this.filename;
ci.settingskey = this.settingskey;
ci.nodebuilder = this.nodebuilder;
ci.buildonsave = this.buildonsave;
ci.nodebuildersave = this.nodebuildersave;
ci.nodebuildertest = this.nodebuildertest;
ci.nodebuilder3d = this.nodebuilder3d;
ci.resources = new DataLocationList();
ci.resources.AddRange(this.resources);
ci.testprogram = this.testprogram;
@ -129,8 +134,9 @@ namespace CodeImp.DoomBuilder
this.name = ci.name;
this.filename = ci.filename;
this.settingskey = ci.settingskey;
this.nodebuilder = ci.nodebuilder;
this.buildonsave = ci.buildonsave;
this.nodebuildersave = ci.nodebuildersave;
this.nodebuildertest = ci.nodebuildertest;
this.nodebuilder3d = ci.nodebuilder3d;
this.resources = new DataLocationList();
this.resources.AddRange(ci.resources);
this.testprogram = ci.testprogram;

View file

@ -28,416 +28,157 @@ namespace CodeImp.DoomBuilder.Interface
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.Label label2;
System.Windows.Forms.Label label5;
System.Windows.Forms.Label label6;
System.Windows.Forms.Label label3;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConfigForm));
System.Windows.Forms.Label label2;
System.Windows.Forms.Label label7;
System.Windows.Forms.Label label8;
System.Windows.Forms.Label label9;
System.Windows.Forms.Label label4;
System.Windows.Forms.Label label1;
System.Windows.Forms.Label label6;
System.Windows.Forms.Label label7;
System.Windows.Forms.Label label5;
this.panelnodebuilder = new System.Windows.Forms.GroupBox();
this.configbuildonsave = new System.Windows.Forms.CheckBox();
this.confignodebuilder = new System.Windows.Forms.ComboBox();
this.paneltesting = new System.Windows.Forms.GroupBox();
System.Windows.Forms.Label label10;
this.cancel = new System.Windows.Forms.Button();
this.apply = new System.Windows.Forms.Button();
this.tabs = new System.Windows.Forms.TabControl();
this.tabresources = new System.Windows.Forms.TabPage();
this.configdata = new CodeImp.DoomBuilder.Interface.ResourceListEditor();
this.tabnodebuilder = new System.Windows.Forms.TabPage();
this.nodebuilder3d = new System.Windows.Forms.ComboBox();
this.nodebuildertest = new System.Windows.Forms.ComboBox();
this.nodebuildersave = new System.Windows.Forms.ComboBox();
this.tabtesting = new System.Windows.Forms.TabPage();
this.testresult = new System.Windows.Forms.TextBox();
this.labelresult = new System.Windows.Forms.Label();
this.testparameters = new System.Windows.Forms.TextBox();
this.browsewad = new System.Windows.Forms.Button();
this.testapplication = new System.Windows.Forms.TextBox();
this.tabs = new System.Windows.Forms.TabControl();
this.tabinterface = new System.Windows.Forms.TabPage();
this.tabkeys = new System.Windows.Forms.TabPage();
this.listactions = new System.Windows.Forms.ListView();
this.columncontrolaction = new System.Windows.Forms.ColumnHeader();
this.columncontrolkey = new System.Windows.Forms.ColumnHeader();
this.actioncontrolpanel = new System.Windows.Forms.GroupBox();
this.actioncontrol = new System.Windows.Forms.ComboBox();
this.actiontitle = new System.Windows.Forms.Label();
this.actioncontrolclear = new System.Windows.Forms.Button();
this.actionkey = new System.Windows.Forms.TextBox();
this.actiondescription = new System.Windows.Forms.Label();
this.tabconfigs = new System.Windows.Forms.TabPage();
this.panelresources = new System.Windows.Forms.GroupBox();
this.configdata = new CodeImp.DoomBuilder.Interface.ResourceListEditor();
this.listconfigs = new System.Windows.Forms.ListBox();
this.cancel = new System.Windows.Forms.Button();
this.apply = new System.Windows.Forms.Button();
label2 = new System.Windows.Forms.Label();
this.listconfigs = new System.Windows.Forms.ListView();
this.columnname = new System.Windows.Forms.ColumnHeader();
label5 = new System.Windows.Forms.Label();
label6 = new System.Windows.Forms.Label();
label3 = new System.Windows.Forms.Label();
label2 = new System.Windows.Forms.Label();
label7 = new System.Windows.Forms.Label();
label8 = new System.Windows.Forms.Label();
label9 = new System.Windows.Forms.Label();
label4 = new System.Windows.Forms.Label();
label1 = new System.Windows.Forms.Label();
label6 = new System.Windows.Forms.Label();
label7 = new System.Windows.Forms.Label();
label5 = new System.Windows.Forms.Label();
this.panelnodebuilder.SuspendLayout();
this.paneltesting.SuspendLayout();
label10 = new System.Windows.Forms.Label();
this.tabs.SuspendLayout();
this.tabkeys.SuspendLayout();
this.actioncontrolpanel.SuspendLayout();
this.tabconfigs.SuspendLayout();
this.panelresources.SuspendLayout();
this.tabresources.SuspendLayout();
this.tabnodebuilder.SuspendLayout();
this.tabtesting.SuspendLayout();
this.SuspendLayout();
//
// label5
//
label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
label5.AutoSize = true;
label5.Location = new System.Drawing.Point(12, 288);
label5.Name = "label5";
label5.Size = new System.Drawing.Size(312, 14);
label5.TabIndex = 19;
label5.Text = "Drag items to change order (lower items override higher items).";
//
// label6
//
label6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
label6.AutoEllipsis = true;
label6.Location = new System.Drawing.Point(12, 15);
label6.Name = "label6";
label6.Size = new System.Drawing.Size(384, 37);
label6.TabIndex = 21;
label6.Text = "These are the resources that will be loaded when this configuration is chosen for" +
" editing. Usually you add your IWAD (like doom.wad or doom2.wad) here.";
//
// label3
//
label3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
label3.AutoEllipsis = true;
label3.Location = new System.Drawing.Point(12, 15);
label3.Name = "label3";
label3.Size = new System.Drawing.Size(384, 54);
label3.TabIndex = 22;
label3.Text = resources.GetString("label3.Text");
//
// label2
//
label2.AutoSize = true;
label2.Location = new System.Drawing.Point(25, 31);
label2.Location = new System.Drawing.Point(12, 80);
label2.Name = "label2";
label2.Size = new System.Drawing.Size(74, 14);
label2.TabIndex = 3;
label2.Text = "Configuration:";
label2.Size = new System.Drawing.Size(149, 14);
label2.TabIndex = 24;
label2.Text = "Configuration for saving map:";
//
// label3
// label7
//
label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
label3.AutoSize = true;
label3.Location = new System.Drawing.Point(11, 115);
label3.Name = "label3";
label3.Size = new System.Drawing.Size(312, 14);
label3.TabIndex = 17;
label3.Text = "Drag items to change order (lower items override higher items).";
label7.AutoSize = true;
label7.Location = new System.Drawing.Point(35, 125);
label7.Name = "label7";
label7.Size = new System.Drawing.Size(126, 14);
label7.TabIndex = 26;
label7.Text = "Configuration for testing:";
//
// label8
//
label8.AutoSize = true;
label8.Location = new System.Drawing.Point(25, 170);
label8.Name = "label8";
label8.Size = new System.Drawing.Size(136, 14);
label8.TabIndex = 28;
label8.Text = "Configuration for 3D mode:";
//
// label9
//
label9.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
label9.AutoEllipsis = true;
label9.Location = new System.Drawing.Point(12, 15);
label9.Name = "label9";
label9.Size = new System.Drawing.Size(393, 54);
label9.TabIndex = 23;
label9.Text = "Here you can specify the program settings to use for launching a game engine when" +
" testing the map. Use the placeholders as listed below where you want automatic " +
"names and numbers inserted.";
//
// label4
//
label4.AutoSize = true;
label4.Location = new System.Drawing.Point(23, 67);
label4.Location = new System.Drawing.Point(15, 121);
label4.Name = "label4";
label4.Size = new System.Drawing.Size(65, 14);
label4.TabIndex = 7;
label4.TabIndex = 27;
label4.Text = "Parameters:";
//
// label1
//
label1.AutoSize = true;
label1.Location = new System.Drawing.Point(25, 32);
label1.Location = new System.Drawing.Point(15, 80);
label1.Name = "label1";
label1.Size = new System.Drawing.Size(63, 14);
label1.TabIndex = 4;
label1.TabIndex = 24;
label1.Text = "Application:";
//
// label6
// label10
//
label6.AutoSize = true;
label6.Location = new System.Drawing.Point(20, 28);
label6.Name = "label6";
label6.Size = new System.Drawing.Size(41, 14);
label6.TabIndex = 2;
label6.Text = "Action:";
//
// label7
//
label7.AutoSize = true;
label7.Location = new System.Drawing.Point(20, 170);
label7.Name = "label7";
label7.Size = new System.Drawing.Size(187, 14);
label7.TabIndex = 7;
label7.Text = "Or select a special input control here:";
//
// label5
//
label5.AutoSize = true;
label5.Location = new System.Drawing.Point(20, 113);
label5.Name = "label5";
label5.Size = new System.Drawing.Size(200, 14);
label5.TabIndex = 4;
label5.Text = "Press the desired key combination here:";
//
// panelnodebuilder
//
this.panelnodebuilder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
label10.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panelnodebuilder.Controls.Add(this.configbuildonsave);
this.panelnodebuilder.Controls.Add(label2);
this.panelnodebuilder.Controls.Add(this.confignodebuilder);
this.panelnodebuilder.Enabled = false;
this.panelnodebuilder.Location = new System.Drawing.Point(237, 154);
this.panelnodebuilder.Margin = new System.Windows.Forms.Padding(6);
this.panelnodebuilder.Name = "panelnodebuilder";
this.panelnodebuilder.Size = new System.Drawing.Size(345, 97);
this.panelnodebuilder.TabIndex = 2;
this.panelnodebuilder.TabStop = false;
this.panelnodebuilder.Text = " Nodebuilder";
//
// configbuildonsave
//
this.configbuildonsave.AutoSize = true;
this.configbuildonsave.Location = new System.Drawing.Point(49, 62);
this.configbuildonsave.Name = "configbuildonsave";
this.configbuildonsave.Size = new System.Drawing.Size(242, 18);
this.configbuildonsave.TabIndex = 4;
this.configbuildonsave.Text = "Build nodes every time when saving the map";
this.configbuildonsave.UseVisualStyleBackColor = true;
this.configbuildonsave.CheckedChanged += new System.EventHandler(this.configbuildonsave_CheckedChanged);
//
// confignodebuilder
//
this.confignodebuilder.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.confignodebuilder.FormattingEnabled = true;
this.confignodebuilder.Location = new System.Drawing.Point(105, 28);
this.confignodebuilder.Name = "confignodebuilder";
this.confignodebuilder.Size = new System.Drawing.Size(186, 22);
this.confignodebuilder.Sorted = true;
this.confignodebuilder.TabIndex = 2;
this.confignodebuilder.SelectedIndexChanged += new System.EventHandler(this.confignodebuilder_SelectedIndexChanged);
//
// paneltesting
//
this.paneltesting.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.paneltesting.Controls.Add(this.testparameters);
this.paneltesting.Controls.Add(label4);
this.paneltesting.Controls.Add(this.browsewad);
this.paneltesting.Controls.Add(this.testapplication);
this.paneltesting.Controls.Add(label1);
this.paneltesting.Enabled = false;
this.paneltesting.Location = new System.Drawing.Point(237, 257);
this.paneltesting.Margin = new System.Windows.Forms.Padding(6);
this.paneltesting.Name = "paneltesting";
this.paneltesting.Size = new System.Drawing.Size(345, 107);
this.paneltesting.TabIndex = 13;
this.paneltesting.TabStop = false;
this.paneltesting.Text = " Testing ";
//
// testparameters
//
this.testparameters.Location = new System.Drawing.Point(94, 64);
this.testparameters.Name = "testparameters";
this.testparameters.Size = new System.Drawing.Size(197, 20);
this.testparameters.TabIndex = 8;
this.testparameters.TextChanged += new System.EventHandler(this.testparameters_TextChanged);
//
// browsewad
//
this.browsewad.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.browsewad.Location = new System.Drawing.Point(297, 28);
this.browsewad.Name = "browsewad";
this.browsewad.Size = new System.Drawing.Size(30, 23);
this.browsewad.TabIndex = 6;
this.browsewad.Text = "...";
this.browsewad.UseVisualStyleBackColor = true;
//
// testapplication
//
this.testapplication.Location = new System.Drawing.Point(94, 29);
this.testapplication.Name = "testapplication";
this.testapplication.ReadOnly = true;
this.testapplication.Size = new System.Drawing.Size(197, 20);
this.testapplication.TabIndex = 5;
this.testapplication.TextChanged += new System.EventHandler(this.testapplication_TextChanged);
//
// tabs
//
this.tabs.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.tabs.Controls.Add(this.tabinterface);
this.tabs.Controls.Add(this.tabkeys);
this.tabs.Controls.Add(this.tabconfigs);
this.tabs.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabs.ItemSize = new System.Drawing.Size(110, 19);
this.tabs.Location = new System.Drawing.Point(10, 12);
this.tabs.Name = "tabs";
this.tabs.SelectedIndex = 0;
this.tabs.Size = new System.Drawing.Size(599, 402);
this.tabs.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
this.tabs.TabIndex = 0;
//
// tabinterface
//
this.tabinterface.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabinterface.Location = new System.Drawing.Point(4, 23);
this.tabinterface.Name = "tabinterface";
this.tabinterface.Padding = new System.Windows.Forms.Padding(3);
this.tabinterface.Size = new System.Drawing.Size(591, 375);
this.tabinterface.TabIndex = 0;
this.tabinterface.Text = "Interface";
this.tabinterface.UseVisualStyleBackColor = true;
//
// tabkeys
//
this.tabkeys.Controls.Add(this.listactions);
this.tabkeys.Controls.Add(this.actioncontrolpanel);
this.tabkeys.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabkeys.Location = new System.Drawing.Point(4, 23);
this.tabkeys.Name = "tabkeys";
this.tabkeys.Padding = new System.Windows.Forms.Padding(3);
this.tabkeys.Size = new System.Drawing.Size(591, 375);
this.tabkeys.TabIndex = 1;
this.tabkeys.Text = "Controls";
this.tabkeys.UseVisualStyleBackColor = true;
//
// listactions
//
this.listactions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.listactions.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columncontrolaction,
this.columncontrolkey});
this.listactions.FullRowSelect = true;
this.listactions.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.listactions.HideSelection = false;
this.listactions.Location = new System.Drawing.Point(11, 11);
this.listactions.Margin = new System.Windows.Forms.Padding(8);
this.listactions.MultiSelect = false;
this.listactions.Name = "listactions";
this.listactions.ShowGroups = false;
this.listactions.Size = new System.Drawing.Size(275, 353);
this.listactions.Sorting = System.Windows.Forms.SortOrder.Ascending;
this.listactions.TabIndex = 0;
this.listactions.TabStop = false;
this.listactions.UseCompatibleStateImageBehavior = false;
this.listactions.View = System.Windows.Forms.View.Details;
this.listactions.MouseUp += new System.Windows.Forms.MouseEventHandler(this.listactions_MouseUp);
this.listactions.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.listactions_ItemSelectionChanged);
this.listactions.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listactions_KeyUp);
//
// columncontrolaction
//
this.columncontrolaction.Text = "Action";
this.columncontrolaction.Width = 150;
//
// columncontrolkey
//
this.columncontrolkey.Text = "Key";
this.columncontrolkey.Width = 100;
//
// actioncontrolpanel
//
this.actioncontrolpanel.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.actioncontrolpanel.Controls.Add(this.actioncontrol);
this.actioncontrolpanel.Controls.Add(label7);
this.actioncontrolpanel.Controls.Add(this.actiontitle);
this.actioncontrolpanel.Controls.Add(this.actioncontrolclear);
this.actioncontrolpanel.Controls.Add(label6);
this.actioncontrolpanel.Controls.Add(this.actionkey);
this.actioncontrolpanel.Controls.Add(this.actiondescription);
this.actioncontrolpanel.Controls.Add(label5);
this.actioncontrolpanel.Enabled = false;
this.actioncontrolpanel.Location = new System.Drawing.Point(300, 11);
this.actioncontrolpanel.Margin = new System.Windows.Forms.Padding(6);
this.actioncontrolpanel.Name = "actioncontrolpanel";
this.actioncontrolpanel.Size = new System.Drawing.Size(282, 353);
this.actioncontrolpanel.TabIndex = 9;
this.actioncontrolpanel.TabStop = false;
this.actioncontrolpanel.Text = " Action control ";
//
// actioncontrol
//
this.actioncontrol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.actioncontrol.FormattingEnabled = true;
this.actioncontrol.Location = new System.Drawing.Point(23, 189);
this.actioncontrol.Name = "actioncontrol";
this.actioncontrol.Size = new System.Drawing.Size(197, 22);
this.actioncontrol.TabIndex = 8;
this.actioncontrol.TabStop = false;
this.actioncontrol.SelectedIndexChanged += new System.EventHandler(this.actioncontrol_SelectedIndexChanged);
//
// actiontitle
//
this.actiontitle.AutoSize = true;
this.actiontitle.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.actiontitle.Location = new System.Drawing.Point(67, 28);
this.actiontitle.Name = "actiontitle";
this.actiontitle.Size = new System.Drawing.Size(172, 14);
this.actiontitle.TabIndex = 1;
this.actiontitle.Text = "(select an action from the list)";
this.actiontitle.UseMnemonic = false;
//
// actioncontrolclear
//
this.actioncontrolclear.Location = new System.Drawing.Point(193, 130);
this.actioncontrolclear.Name = "actioncontrolclear";
this.actioncontrolclear.Size = new System.Drawing.Size(63, 25);
this.actioncontrolclear.TabIndex = 6;
this.actioncontrolclear.TabStop = false;
this.actioncontrolclear.Text = "Clear";
this.actioncontrolclear.UseVisualStyleBackColor = true;
this.actioncontrolclear.Click += new System.EventHandler(this.actioncontrolclear_Click);
//
// actionkey
//
this.actionkey.Location = new System.Drawing.Point(23, 132);
this.actionkey.Name = "actionkey";
this.actionkey.Size = new System.Drawing.Size(163, 20);
this.actionkey.TabIndex = 5;
this.actionkey.TabStop = false;
this.actionkey.TextChanged += new System.EventHandler(this.actionkey_TextChanged);
this.actionkey.KeyDown += new System.Windows.Forms.KeyEventHandler(this.actionkey_KeyDown);
//
// actiondescription
//
this.actiondescription.AutoEllipsis = true;
this.actiondescription.Location = new System.Drawing.Point(20, 48);
this.actiondescription.Name = "actiondescription";
this.actiondescription.Size = new System.Drawing.Size(245, 65);
this.actiondescription.TabIndex = 3;
this.actiondescription.UseMnemonic = false;
//
// tabconfigs
//
this.tabconfigs.Controls.Add(this.paneltesting);
this.tabconfigs.Controls.Add(this.panelresources);
this.tabconfigs.Controls.Add(this.panelnodebuilder);
this.tabconfigs.Controls.Add(this.listconfigs);
this.tabconfigs.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabconfigs.Location = new System.Drawing.Point(4, 23);
this.tabconfigs.Margin = new System.Windows.Forms.Padding(8);
this.tabconfigs.Name = "tabconfigs";
this.tabconfigs.Padding = new System.Windows.Forms.Padding(3);
this.tabconfigs.Size = new System.Drawing.Size(591, 375);
this.tabconfigs.TabIndex = 2;
this.tabconfigs.Text = "Configurations";
this.tabconfigs.UseVisualStyleBackColor = true;
//
// panelresources
//
this.panelresources.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.panelresources.Controls.Add(this.configdata);
this.panelresources.Controls.Add(label3);
this.panelresources.Enabled = false;
this.panelresources.Location = new System.Drawing.Point(237, 11);
this.panelresources.Margin = new System.Windows.Forms.Padding(6);
this.panelresources.Name = "panelresources";
this.panelresources.Size = new System.Drawing.Size(345, 137);
this.panelresources.TabIndex = 12;
this.panelresources.TabStop = false;
this.panelresources.Text = " Resources ";
//
// configdata
//
this.configdata.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.configdata.DialogOffset = new System.Drawing.Point(-120, 10);
this.configdata.Location = new System.Drawing.Point(11, 25);
this.configdata.Name = "configdata";
this.configdata.Size = new System.Drawing.Size(322, 87);
this.configdata.TabIndex = 18;
this.configdata.OnContentChanged += new CodeImp.DoomBuilder.Interface.ResourceListEditor.ContentChanged(this.resourcelocations_OnContentChanged);
//
// listconfigs
//
this.listconfigs.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.listconfigs.FormattingEnabled = true;
this.listconfigs.IntegralHeight = false;
this.listconfigs.ItemHeight = 14;
this.listconfigs.Location = new System.Drawing.Point(11, 11);
this.listconfigs.Margin = new System.Windows.Forms.Padding(8);
this.listconfigs.Name = "listconfigs";
this.listconfigs.ScrollAlwaysVisible = true;
this.listconfigs.Size = new System.Drawing.Size(212, 353);
this.listconfigs.Sorted = true;
this.listconfigs.TabIndex = 0;
this.listconfigs.SelectedIndexChanged += new System.EventHandler(this.listconfigs_SelectedIndexChanged);
label10.AutoEllipsis = true;
label10.Location = new System.Drawing.Point(41, 151);
label10.Name = "label10";
label10.Size = new System.Drawing.Size(352, 122);
label10.TabIndex = 29;
label10.Text = resources.GetString("label10.Text");
//
// 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(497, 426);
this.cancel.Location = new System.Drawing.Point(573, 381);
this.cancel.Name = "cancel";
this.cancel.Size = new System.Drawing.Size(112, 25);
this.cancel.TabIndex = 17;
@ -448,7 +189,7 @@ namespace CodeImp.DoomBuilder.Interface
// 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(379, 426);
this.apply.Location = new System.Drawing.Point(455, 381);
this.apply.Name = "apply";
this.apply.Size = new System.Drawing.Size(112, 25);
this.apply.TabIndex = 16;
@ -456,63 +197,249 @@ namespace CodeImp.DoomBuilder.Interface
this.apply.UseVisualStyleBackColor = true;
this.apply.Click += new System.EventHandler(this.apply_Click);
//
// tabs
//
this.tabs.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.tabs.Controls.Add(this.tabresources);
this.tabs.Controls.Add(this.tabnodebuilder);
this.tabs.Controls.Add(this.tabtesting);
this.tabs.Enabled = false;
this.tabs.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabs.ItemSize = new System.Drawing.Size(110, 19);
this.tabs.Location = new System.Drawing.Point(263, 17);
this.tabs.Name = "tabs";
this.tabs.SelectedIndex = 0;
this.tabs.Size = new System.Drawing.Size(422, 345);
this.tabs.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
this.tabs.TabIndex = 18;
//
// tabresources
//
this.tabresources.Controls.Add(label6);
this.tabresources.Controls.Add(this.configdata);
this.tabresources.Controls.Add(label5);
this.tabresources.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabresources.Location = new System.Drawing.Point(4, 23);
this.tabresources.Name = "tabresources";
this.tabresources.Padding = new System.Windows.Forms.Padding(6);
this.tabresources.Size = new System.Drawing.Size(414, 318);
this.tabresources.TabIndex = 0;
this.tabresources.Text = "Resources";
this.tabresources.UseVisualStyleBackColor = true;
//
// configdata
//
this.configdata.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.configdata.DialogOffset = new System.Drawing.Point(-120, 10);
this.configdata.Location = new System.Drawing.Point(15, 55);
this.configdata.Name = "configdata";
this.configdata.Size = new System.Drawing.Size(381, 220);
this.configdata.TabIndex = 20;
this.configdata.OnContentChanged += new CodeImp.DoomBuilder.Interface.ResourceListEditor.ContentChanged(this.resourcelocations_OnContentChanged);
//
// tabnodebuilder
//
this.tabnodebuilder.Controls.Add(label8);
this.tabnodebuilder.Controls.Add(this.nodebuilder3d);
this.tabnodebuilder.Controls.Add(label7);
this.tabnodebuilder.Controls.Add(this.nodebuildertest);
this.tabnodebuilder.Controls.Add(label2);
this.tabnodebuilder.Controls.Add(this.nodebuildersave);
this.tabnodebuilder.Controls.Add(label3);
this.tabnodebuilder.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabnodebuilder.Location = new System.Drawing.Point(4, 23);
this.tabnodebuilder.Name = "tabnodebuilder";
this.tabnodebuilder.Padding = new System.Windows.Forms.Padding(6);
this.tabnodebuilder.Size = new System.Drawing.Size(414, 318);
this.tabnodebuilder.TabIndex = 1;
this.tabnodebuilder.Text = "Nodebuilder";
this.tabnodebuilder.UseVisualStyleBackColor = true;
//
// nodebuilder3d
//
this.nodebuilder3d.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.nodebuilder3d.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.nodebuilder3d.FormattingEnabled = true;
this.nodebuilder3d.Location = new System.Drawing.Point(167, 167);
this.nodebuilder3d.Name = "nodebuilder3d";
this.nodebuilder3d.Size = new System.Drawing.Size(229, 22);
this.nodebuilder3d.Sorted = true;
this.nodebuilder3d.TabIndex = 27;
this.nodebuilder3d.SelectedIndexChanged += new System.EventHandler(this.nodebuilder3d_SelectedIndexChanged);
//
// nodebuildertest
//
this.nodebuildertest.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.nodebuildertest.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.nodebuildertest.FormattingEnabled = true;
this.nodebuildertest.Location = new System.Drawing.Point(167, 122);
this.nodebuildertest.Name = "nodebuildertest";
this.nodebuildertest.Size = new System.Drawing.Size(229, 22);
this.nodebuildertest.Sorted = true;
this.nodebuildertest.TabIndex = 25;
this.nodebuildertest.SelectedIndexChanged += new System.EventHandler(this.nodebuildertest_SelectedIndexChanged);
//
// nodebuildersave
//
this.nodebuildersave.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.nodebuildersave.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.nodebuildersave.FormattingEnabled = true;
this.nodebuildersave.Location = new System.Drawing.Point(167, 77);
this.nodebuildersave.Name = "nodebuildersave";
this.nodebuildersave.Size = new System.Drawing.Size(229, 22);
this.nodebuildersave.Sorted = true;
this.nodebuildersave.TabIndex = 23;
this.nodebuildersave.SelectedIndexChanged += new System.EventHandler(this.nodebuildersave_SelectedIndexChanged);
//
// tabtesting
//
this.tabtesting.Controls.Add(this.testresult);
this.tabtesting.Controls.Add(this.labelresult);
this.tabtesting.Controls.Add(label10);
this.tabtesting.Controls.Add(this.testparameters);
this.tabtesting.Controls.Add(label4);
this.tabtesting.Controls.Add(this.browsewad);
this.tabtesting.Controls.Add(this.testapplication);
this.tabtesting.Controls.Add(label1);
this.tabtesting.Controls.Add(label9);
this.tabtesting.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabtesting.Location = new System.Drawing.Point(4, 23);
this.tabtesting.Name = "tabtesting";
this.tabtesting.Padding = new System.Windows.Forms.Padding(6);
this.tabtesting.Size = new System.Drawing.Size(414, 318);
this.tabtesting.TabIndex = 2;
this.tabtesting.Text = "Testing";
this.tabtesting.UseVisualStyleBackColor = true;
//
// testresult
//
this.testresult.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.testresult.BackColor = System.Drawing.SystemColors.Control;
this.testresult.Location = new System.Drawing.Point(86, 276);
this.testresult.Name = "testresult";
this.testresult.Size = new System.Drawing.Size(307, 20);
this.testresult.TabIndex = 31;
//
// labelresult
//
this.labelresult.AutoSize = true;
this.labelresult.Location = new System.Drawing.Point(38, 279);
this.labelresult.Name = "labelresult";
this.labelresult.Size = new System.Drawing.Size(40, 14);
this.labelresult.TabIndex = 30;
this.labelresult.Text = "Result:";
//
// testparameters
//
this.testparameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.testparameters.Location = new System.Drawing.Point(86, 118);
this.testparameters.Name = "testparameters";
this.testparameters.Size = new System.Drawing.Size(307, 20);
this.testparameters.TabIndex = 28;
//
// browsewad
//
this.browsewad.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.browsewad.Location = new System.Drawing.Point(312, 75);
this.browsewad.Name = "browsewad";
this.browsewad.Size = new System.Drawing.Size(81, 24);
this.browsewad.TabIndex = 26;
this.browsewad.Text = "Browse...";
this.browsewad.UseVisualStyleBackColor = true;
this.browsewad.Click += new System.EventHandler(this.browsewad_Click);
//
// testapplication
//
this.testapplication.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.testapplication.Location = new System.Drawing.Point(86, 77);
this.testapplication.Name = "testapplication";
this.testapplication.ReadOnly = true;
this.testapplication.Size = new System.Drawing.Size(220, 20);
this.testapplication.TabIndex = 25;
//
// listconfigs
//
this.listconfigs.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnname});
this.listconfigs.FullRowSelect = true;
this.listconfigs.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
this.listconfigs.HideSelection = false;
this.listconfigs.Location = new System.Drawing.Point(17, 17);
this.listconfigs.MultiSelect = false;
this.listconfigs.Name = "listconfigs";
this.listconfigs.ShowGroups = false;
this.listconfigs.Size = new System.Drawing.Size(230, 345);
this.listconfigs.Sorting = System.Windows.Forms.SortOrder.Ascending;
this.listconfigs.TabIndex = 19;
this.listconfigs.UseCompatibleStateImageBehavior = false;
this.listconfigs.View = System.Windows.Forms.View.Details;
this.listconfigs.SelectedIndexChanged += new System.EventHandler(this.listconfigs_SelectedIndexChanged);
this.listconfigs.MouseUp += new System.Windows.Forms.MouseEventHandler(this.listconfigs_MouseUp);
this.listconfigs.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listconfigs_KeyUp);
//
// columnname
//
this.columnname.Text = "Configuration";
this.columnname.Width = 200;
//
// ConfigForm
//
this.AcceptButton = this.apply;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 14F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(619, 461);
this.CancelButton = this.cancel;
this.ClientSize = new System.Drawing.Size(697, 416);
this.Controls.Add(this.listconfigs);
this.Controls.Add(this.tabs);
this.Controls.Add(this.cancel);
this.Controls.Add(this.apply);
this.Controls.Add(this.tabs);
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 = "ConfigForm";
this.Opacity = 0;
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Configuration";
this.panelnodebuilder.ResumeLayout(false);
this.panelnodebuilder.PerformLayout();
this.paneltesting.ResumeLayout(false);
this.paneltesting.PerformLayout();
this.Text = "Game Configurations";
this.tabs.ResumeLayout(false);
this.tabkeys.ResumeLayout(false);
this.actioncontrolpanel.ResumeLayout(false);
this.actioncontrolpanel.PerformLayout();
this.tabconfigs.ResumeLayout(false);
this.panelresources.ResumeLayout(false);
this.panelresources.PerformLayout();
this.tabresources.ResumeLayout(false);
this.tabresources.PerformLayout();
this.tabnodebuilder.ResumeLayout(false);
this.tabnodebuilder.PerformLayout();
this.tabtesting.ResumeLayout(false);
this.tabtesting.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControl tabs;
private System.Windows.Forms.TabPage tabinterface;
private System.Windows.Forms.TabPage tabkeys;
private System.Windows.Forms.TabPage tabconfigs;
private System.Windows.Forms.Button cancel;
private System.Windows.Forms.Button apply;
private System.Windows.Forms.ListBox listconfigs;
private System.Windows.Forms.ComboBox confignodebuilder;
private System.Windows.Forms.CheckBox configbuildonsave;
private System.Windows.Forms.GroupBox panelresources;
private System.Windows.Forms.TabControl tabs;
private System.Windows.Forms.TabPage tabresources;
private System.Windows.Forms.TabPage tabnodebuilder;
private System.Windows.Forms.TabPage tabtesting;
private ResourceListEditor configdata;
private System.Windows.Forms.ComboBox nodebuildertest;
private System.Windows.Forms.ComboBox nodebuildersave;
private System.Windows.Forms.ComboBox nodebuilder3d;
private System.Windows.Forms.TextBox testparameters;
private System.Windows.Forms.Button browsewad;
private System.Windows.Forms.TextBox testapplication;
private System.Windows.Forms.TextBox testparameters;
private System.Windows.Forms.GroupBox panelnodebuilder;
private System.Windows.Forms.GroupBox paneltesting;
private System.Windows.Forms.ListView listactions;
private System.Windows.Forms.ColumnHeader columncontrolaction;
private System.Windows.Forms.ColumnHeader columncontrolkey;
private System.Windows.Forms.Label actiondescription;
private System.Windows.Forms.Label actiontitle;
private System.Windows.Forms.ComboBox actioncontrol;
private System.Windows.Forms.Button actioncontrolclear;
private System.Windows.Forms.TextBox actionkey;
private System.Windows.Forms.GroupBox actioncontrolpanel;
private System.Windows.Forms.TextBox testresult;
private System.Windows.Forms.Label labelresult;
private System.Windows.Forms.ListView listconfigs;
private System.Windows.Forms.ColumnHeader columnname;
}
}

View file

@ -25,6 +25,7 @@ using System.Windows.Forms;
using Microsoft.Win32;
using System.Diagnostics;
using CodeImp.DoomBuilder.Controls;
using CodeImp.DoomBuilder.Data;
#endregion
@ -32,242 +33,33 @@ namespace CodeImp.DoomBuilder.Interface
{
public partial class ConfigForm : DelayedForm
{
#region ================== Variables
private bool allowapplycontrol = false;
#endregion
#region ================== Constructor
// Constructor
public ConfigForm()
{
Action[] actions;
ListViewItem item;
ListViewItem lvi;
// Initialize
InitializeComponent();
// Fill list of actions
actions = General.Actions.GetAllActions();
foreach(Action a in actions)
{
// Create item
item = listactions.Items.Add(a.Name, a.Title, 0);
item.SubItems.Add(Action.GetShortcutKeyDesc(a.ShortcutKey));
item.SubItems[1].Tag = a.ShortcutKey;
}
// Fill combobox with special controls
actioncontrol.Items.Add(new KeyControl(Keys.LButton, "LButton"));
actioncontrol.Items.Add(new KeyControl(Keys.MButton, "MButton"));
actioncontrol.Items.Add(new KeyControl(Keys.RButton, "RButton"));
actioncontrol.Items.Add(new KeyControl(Keys.XButton1, "XButton1"));
actioncontrol.Items.Add(new KeyControl(Keys.XButton2, "XButton2"));
actioncontrol.Items.Add(new KeyControl(SpecialKeys.MScrollUp, "ScrollUp"));
actioncontrol.Items.Add(new KeyControl(SpecialKeys.MScrollDown, "ScrollDown"));
actioncontrol.Items.Add(new KeyControl(Keys.LButton | Keys.Shift, "Shift+LButton"));
actioncontrol.Items.Add(new KeyControl(Keys.MButton | Keys.Shift, "Shift+MButton"));
actioncontrol.Items.Add(new KeyControl(Keys.RButton | Keys.Shift, "Shift+RButton"));
actioncontrol.Items.Add(new KeyControl(Keys.XButton1 | Keys.Shift, "Shift+XButton1"));
actioncontrol.Items.Add(new KeyControl(Keys.XButton2 | Keys.Shift, "Shift+XButton2"));
actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollUp | (int)Keys.Shift, "Shift+ScrollUp"));
actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollDown | (int)Keys.Shift, "Shift+ScrollDown"));
actioncontrol.Items.Add(new KeyControl(Keys.LButton | Keys.Control, "Ctrl+LButton"));
actioncontrol.Items.Add(new KeyControl(Keys.MButton | Keys.Control, "Ctrl+MButton"));
actioncontrol.Items.Add(new KeyControl(Keys.RButton | Keys.Control, "Ctrl+RButton"));
actioncontrol.Items.Add(new KeyControl(Keys.XButton1 | Keys.Control, "Ctrl+XButton1"));
actioncontrol.Items.Add(new KeyControl(Keys.XButton2 | Keys.Control, "Ctrl+XButton2"));
actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollUp | (int)Keys.Control, "Ctrl+ScrollUp"));
actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollDown | (int)Keys.Control, "Ctrl+ScrollDown"));
actioncontrol.Items.Add(new KeyControl(Keys.LButton | Keys.Shift | Keys.Control, "Ctrl+Shift+LButton"));
actioncontrol.Items.Add(new KeyControl(Keys.MButton | Keys.Shift | Keys.Control, "Ctrl+Shift+MButton"));
actioncontrol.Items.Add(new KeyControl(Keys.RButton | Keys.Shift | Keys.Control, "Ctrl+Shift+RButton"));
actioncontrol.Items.Add(new KeyControl(Keys.XButton1 | Keys.Shift | Keys.Control, "Ctrl+Shift+XButton1"));
actioncontrol.Items.Add(new KeyControl(Keys.XButton2 | Keys.Shift | Keys.Control, "Ctrl+Shift+XButton2"));
actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollUp | (int)Keys.Shift | (int)Keys.Control, "Ctrl+Shift+ScrollUp"));
actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollDown | (int)Keys.Shift | (int)Keys.Control, "Ctrl+Shift+ScrollDown"));
// Make list column header full width
columnname.Width = listconfigs.ClientRectangle.Width - SystemInformation.VerticalScrollBarWidth - 2;
// Fill list of configurations
foreach(ConfigurationInfo ci in General.Configs)
{
// Add a copy
listconfigs.Items.Add(ci.Clone());
lvi = listconfigs.Items.Add(ci.Name);
lvi.Tag = ci.Clone();
}
// Fill combobox with nodebuilders
confignodebuilder.Items.AddRange(General.Nodebuilders.ToArray());
// Done
allowapplycontrol = true;
}
#endregion
#region ================== Controls Panel
// Item selected
private void listactions_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
{
Action action;
KeyControl keycontrol;
int key;
// TODO: Save and test nodebuilders are allowed to be empty
// Anything selected?
if(listactions.SelectedItems.Count > 0)
{
// Begin updating
allowapplycontrol = false;
// Get the selected action
action = General.Actions[listactions.SelectedItems[0].Name];
key = (int)listactions.SelectedItems[0].SubItems[1].Tag;
// Enable panel
actioncontrolpanel.Enabled = true;
actiontitle.Text = action.Title;
actiondescription.Text = action.Description;
actioncontrol.SelectedIndex = -1;
actionkey.Text = "";
// See if the key is in the combobox
for(int i = 0; i < actioncontrol.Items.Count; i++)
{
// Select it when the key is found here
keycontrol = (KeyControl)actioncontrol.Items[i];
if(keycontrol.key == key) actioncontrol.SelectedIndex = i;
}
// Otherwise display the key in the textbox
if(actioncontrol.SelectedIndex == -1)
actionkey.Text = Action.GetShortcutKeyDesc(key);
// Focus to the input box
actionkey.Focus();
// Done
allowapplycontrol = true;
}
// Fill comboboxes with nodebuilders
nodebuildersave.Items.AddRange(General.Nodebuilders.ToArray());
nodebuildertest.Items.AddRange(General.Nodebuilders.ToArray());
nodebuilder3d.Items.AddRange(General.Nodebuilders.ToArray());
}
// Key released
private void listactions_KeyUp(object sender, KeyEventArgs e)
{
// Nothing selected?
if(listactions.SelectedItems.Count == 0)
{
// Disable panel
actioncontrolpanel.Enabled = false;
actiontitle.Text = "(select an action from the list)";
actiondescription.Text = "";
actionkey.Text = "";
actioncontrol.SelectedIndex = -1;
}
}
// Mouse released
private void listactions_MouseUp(object sender, MouseEventArgs e)
{
listactions_KeyUp(sender, new KeyEventArgs(Keys.None));
// Focus to the input box
actionkey.Focus();
}
// Key combination pressed
private void actionkey_KeyDown(object sender, KeyEventArgs e)
{
int key = (int)e.KeyData;
e.SuppressKeyPress = true;
// Leave when not allowed to update
if(!allowapplycontrol) return;
// Anything selected?
if(listactions.SelectedItems.Count > 0)
{
// Begin updating
allowapplycontrol = false;
// Deselect anything from the combobox
actioncontrol.SelectedIndex = -1;
// Apply the key combination
listactions.SelectedItems[0].SubItems[1].Text = Action.GetShortcutKeyDesc(key);
listactions.SelectedItems[0].SubItems[1].Tag = key;
actionkey.Text = Action.GetShortcutKeyDesc(key);
// Done
allowapplycontrol = true;
}
}
// Key combination displayed
private void actionkey_TextChanged(object sender, EventArgs e)
{
// Cursor to the end
actionkey.SelectionStart = actionkey.Text.Length;
actionkey.SelectionLength = 0;
}
// Special key selected
private void actioncontrol_SelectedIndexChanged(object sender, EventArgs e)
{
KeyControl key;
// Leave when not allowed to update
if(!allowapplycontrol) return;
// Anything selected?
if((actioncontrol.SelectedIndex > -1) && (listactions.SelectedItems.Count > 0))
{
// Begin updating
allowapplycontrol = false;
// Remove text from textbox
actionkey.Text = "";
// Get the key control
key = (KeyControl)actioncontrol.SelectedItem;
// Apply the key combination
listactions.SelectedItems[0].SubItems[1].Text = Action.GetShortcutKeyDesc(key.key);
listactions.SelectedItems[0].SubItems[1].Tag = key.key;
// Focus to the input box
actionkey.Focus();
// Done
allowapplycontrol = true;
}
}
// Clear clicked
private void actioncontrolclear_Click(object sender, EventArgs e)
{
// Begin updating
allowapplycontrol = false;
// Clear textbox and combobox
actionkey.Text = "";
actioncontrol.SelectedIndex = -1;
// Apply the key combination
listactions.SelectedItems[0].SubItems[1].Text = "";
listactions.SelectedItems[0].SubItems[1].Tag = (int)0;
// Focus to the input box
actionkey.Focus();
// Done
allowapplycontrol = true;
}
#endregion
#region ================== Configuration Panel
// Configuration item selected
private void listconfigs_SelectedIndexChanged(object sender, EventArgs e)
{
@ -275,90 +67,161 @@ namespace CodeImp.DoomBuilder.Interface
NodebuilderInfo ni;
// Item selected?
if(listconfigs.SelectedIndex > -1)
if(listconfigs.SelectedItems.Count > 0)
{
// Enable panels
panelresources.Enabled = true;
panelnodebuilder.Enabled = true;
paneltesting.Enabled = true;
tabs.Enabled = true;
// Get config info of selected item
ci = listconfigs.SelectedItem as ConfigurationInfo;
ci = listconfigs.SelectedItems[0].Tag as ConfigurationInfo;
// Fill resources list
configdata.EditResourceLocationList(ci.Resources);
// Go for all nodebuilder items
confignodebuilder.SelectedIndex = -1;
for(int i = 0; i < confignodebuilder.Items.Count; i++)
// Go for all nodebuilder save items
nodebuildersave.SelectedIndex = -1;
for(int i = 0; i < nodebuildersave.Items.Count; i++)
{
// Get item
ni = confignodebuilder.Items[i] as NodebuilderInfo;
ni = nodebuildersave.Items[i] as NodebuilderInfo;
// Item matches configuration setting?
if(string.Compare(ni.Filename, ci.Nodebuilder, false) == 0)
if(string.Compare(ni.Filename, ci.NodebuilderSave, false) == 0)
{
// Select this item
confignodebuilder.SelectedIndex = i;
nodebuildersave.SelectedIndex = i;
break;
}
}
// Go for all nodebuilder save items
nodebuildertest.SelectedIndex = -1;
for(int i = 0; i < nodebuildertest.Items.Count; i++)
{
// Get item
ni = nodebuildertest.Items[i] as NodebuilderInfo;
// Item matches configuration setting?
if(string.Compare(ni.Filename, ci.NodebuilderTest, false) == 0)
{
// Select this item
nodebuildertest.SelectedIndex = i;
break;
}
}
// Go for all nodebuilder 3d items
nodebuilder3d.SelectedIndex = -1;
for(int i = 0; i < nodebuilder3d.Items.Count; i++)
{
// Get item
ni = nodebuilder3d.Items[i] as NodebuilderInfo;
// Item matches configuration setting?
if(string.Compare(ni.Filename, ci.Nodebuilder3D, false) == 0)
{
// Select this item
nodebuilder3d.SelectedIndex = i;
break;
}
}
// Nodebuilder settings
configbuildonsave.Checked = ci.BuildOnSave;
// Set test application and parameters
testapplication.Text = ci.TestProgram;
testparameters.Text = ci.TestParameters;
}
else
}
// Key released
private void listconfigs_KeyUp(object sender, KeyEventArgs e)
{
// Nothing selected?
if(listconfigs.SelectedItems.Count == 0)
{
// Disable panels
panelresources.Enabled = false;
panelnodebuilder.Enabled = false;
paneltesting.Enabled = false;
configdata.FixedResourceLocationList(new DataLocationList());
configdata.EditResourceLocationList(new DataLocationList());
nodebuildersave.SelectedIndex = -1;
nodebuildertest.SelectedIndex = -1;
nodebuilder3d.SelectedIndex = -1;
testapplication.Text = "";
testparameters.Text = "";
tabs.Enabled = false;
}
}
// Mouse released
private void listconfigs_MouseUp(object sender, MouseEventArgs e)
{
listconfigs_KeyUp(sender, new KeyEventArgs(Keys.None));
}
// Resource locations changed
private void resourcelocations_OnContentChanged()
{
ConfigurationInfo ci;
// Leave when no configuration selected
if(listconfigs.SelectedItems.Count == 0) return;
// Apply to selected configuration
ci = listconfigs.SelectedItem as ConfigurationInfo;
ci = listconfigs.SelectedItems[0].Tag as ConfigurationInfo;
ci.Resources.Clear();
ci.Resources.AddRange(configdata.GetResources());
}
// Nodebuilder selection changed
private void confignodebuilder_SelectedIndexChanged(object sender, EventArgs e)
private void nodebuildersave_SelectedIndexChanged(object sender, EventArgs e)
{
ConfigurationInfo ci;
// Leave when no configuration selected
if(listconfigs.SelectedItems.Count == 0) return;
// Apply to selected configuration
ci = listconfigs.SelectedItem as ConfigurationInfo;
if(confignodebuilder.SelectedItem != null)
ci.Nodebuilder = (confignodebuilder.SelectedItem as NodebuilderInfo).Filename;
ci = listconfigs.SelectedItems[0].Tag as ConfigurationInfo;
if(nodebuildersave.SelectedItem != null)
ci.NodebuilderSave = (nodebuildersave.SelectedItem as NodebuilderInfo).Filename;
}
// Build on save selection changed
private void configbuildonsave_CheckedChanged(object sender, EventArgs e)
// Nodebuilder selection changed
private void nodebuildertest_SelectedIndexChanged(object sender, EventArgs e)
{
ConfigurationInfo ci;
// Leave when no configuration selected
if(listconfigs.SelectedItems.Count == 0) return;
// Apply to selected configuration
ci = listconfigs.SelectedItem as ConfigurationInfo;
ci.BuildOnSave = configbuildonsave.Checked;
ci = listconfigs.SelectedItems[0].Tag as ConfigurationInfo;
if(nodebuildertest.SelectedItem != null)
ci.NodebuilderTest = (nodebuildertest.SelectedItem as NodebuilderInfo).Filename;
}
// Nodebuilder selection changed
private void nodebuilder3d_SelectedIndexChanged(object sender, EventArgs e)
{
ConfigurationInfo ci;
// Leave when no configuration selected
if(listconfigs.SelectedItems.Count == 0) return;
// Apply to selected configuration
ci = listconfigs.SelectedItems[0].Tag as ConfigurationInfo;
if(nodebuilder3d.SelectedItem != null)
ci.Nodebuilder3D = (nodebuilder3d.SelectedItem as NodebuilderInfo).Filename;
}
// Test application changed
private void testapplication_TextChanged(object sender, EventArgs e)
{
ConfigurationInfo ci;
// Leave when no configuration selected
if(listconfigs.SelectedItems.Count == 0) return;
// Apply to selected configuration
ci = listconfigs.SelectedItem as ConfigurationInfo;
ci = listconfigs.SelectedItems[0].Tag as ConfigurationInfo;
ci.TestProgram = testapplication.Text;
}
@ -367,25 +230,25 @@ namespace CodeImp.DoomBuilder.Interface
{
ConfigurationInfo ci;
// Leave when no configuration selected
if(listconfigs.SelectedItems.Count == 0) return;
// Apply to selected configuration
ci = listconfigs.SelectedItem as ConfigurationInfo;
ci = listconfigs.SelectedItems[0].Tag as ConfigurationInfo;
ci.TestParameters = testparameters.Text;
}
#endregion
#region ================== OK / Cancel
// OK clicked
private void apply_Click(object sender, EventArgs e)
{
// Apply control keys to actions
foreach(ListViewItem item in listactions.Items)
General.Actions[item.Name].SetShortcutKey((int)item.SubItems[1].Tag);
ConfigurationInfo ci;
// Apply configuration items
foreach(ConfigurationInfo ci in listconfigs.Items)
foreach(ListViewItem lvi in listconfigs.Items)
{
// Get configuration item
ci = lvi.Tag as ConfigurationInfo;
// Find same configuration info in originals
foreach(ConfigurationInfo oci in General.Configs)
{
@ -407,6 +270,10 @@ namespace CodeImp.DoomBuilder.Interface
this.Hide();
}
#endregion
// Browse clicked
private void browsewad_Click(object sender, EventArgs e)
{
}
}
}

View file

@ -117,10 +117,16 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="label2.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="label5.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">
<metadata name="label5.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</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="label3.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@ -129,6 +135,33 @@
<metadata name="label3.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<data name="label3.Text" xml:space="preserve">
<value>The nodebuilder is a compiler which builds geometry structures for your map. You needs these structures both for playing and 3D mode. For each purpose you can choose the desired nodebuilder configuration here.</value>
</data>
<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="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="label8.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label8.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="label9.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label9.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>
@ -141,34 +174,56 @@
<metadata name="label1.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="label6.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="label10.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">
<metadata name="label10.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">
<data name="label10.Text" xml:space="preserve">
<value>%F indicates the edited PWAD file to be tested.
%WP indicates the IWAD resource files to be used (paths included).
%WF indicates the IWAD resource files to be used (without paths).
%L indicates the map lump name as is set in the map options.
%AP indicates the additional resources (if any, paths included).
%AF indicates the additional resources (if any, without paths).
%E indicates the Episode number from E#M# map name.
%M indicates the Map number from E#M# or MAP## map name.</value>
</data>
<metadata name="cancel.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="label5.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="apply.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="panelnodebuilder.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="tabs.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="configbuildonsave.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="tabresources.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="confignodebuilder.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="configdata.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="paneltesting.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="tabnodebuilder.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="nodebuilder3d.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="nodebuildertest.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="nodebuildersave.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="tabtesting.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="testresult.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="labelresult.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="testparameters.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@ -180,54 +235,9 @@
<metadata name="testapplication.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="tabs.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="tabinterface.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="tabkeys.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="listactions.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="actioncontrolpanel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="actioncontrol.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="actiontitle.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="actioncontrolclear.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="actionkey.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="actiondescription.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="tabconfigs.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="panelresources.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="configdata.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="listconfigs.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>

View file

@ -47,6 +47,7 @@ namespace CodeImp.DoomBuilder.Interface
this.itemexit = new System.Windows.Forms.ToolStripMenuItem();
this.menutools = new System.Windows.Forms.ToolStripMenuItem();
this.configurationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.preferencesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuhelp = new System.Windows.Forms.ToolStripMenuItem();
this.itemhelpabout = new System.Windows.Forms.ToolStripMenuItem();
this.toolbar = new System.Windows.Forms.ToolStrip();
@ -200,7 +201,8 @@ namespace CodeImp.DoomBuilder.Interface
// menutools
//
this.menutools.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.configurationToolStripMenuItem});
this.configurationToolStripMenuItem,
this.preferencesToolStripMenuItem});
this.menutools.Name = "menutools";
this.menutools.Size = new System.Drawing.Size(44, 20);
this.menutools.Text = "Tools";
@ -208,11 +210,19 @@ namespace CodeImp.DoomBuilder.Interface
// configurationToolStripMenuItem
//
this.configurationToolStripMenuItem.Name = "configurationToolStripMenuItem";
this.configurationToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
this.configurationToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
this.configurationToolStripMenuItem.Tag = "configuration";
this.configurationToolStripMenuItem.Text = "Configuration...";
this.configurationToolStripMenuItem.Text = "Game Configurations...";
this.configurationToolStripMenuItem.Click += new System.EventHandler(this.configurationToolStripMenuItem_Click);
//
// preferencesToolStripMenuItem
//
this.preferencesToolStripMenuItem.Name = "preferencesToolStripMenuItem";
this.preferencesToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
this.preferencesToolStripMenuItem.Tag = "preferences";
this.preferencesToolStripMenuItem.Text = "Preferences...";
this.preferencesToolStripMenuItem.Click += new System.EventHandler(this.preferencesToolStripMenuItem_Click);
//
// menuhelp
//
this.menuhelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -505,5 +515,6 @@ namespace CodeImp.DoomBuilder.Interface
private System.Windows.Forms.ToolStripMenuItem itemzoom5;
private System.Windows.Forms.ToolStripMenuItem menutools;
private System.Windows.Forms.ToolStripMenuItem configurationToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem preferencesToolStripMenuItem;
}
}

View file

@ -508,28 +508,49 @@ namespace CodeImp.DoomBuilder.Interface
#region ================== Tools Menu
// Configuration action
// Game Configuration action
[Action(Action.CONFIGURATION)]
public void ShowConfiguration()
{
// Show configuration dialog
ConfigForm cfgform = new ConfigForm();
if(cfgform.ShowDialog(this) == DialogResult.OK)
{
// TODO: Reload resources if a map is open
}
// Done
cfgform.Dispose();
}
// Preferences action
[Action(Action.PREFERENCES)]
public void ShowPreferences()
{
// Show preferences dialog
PreferencesForm prefform = new PreferencesForm();
if(prefform.ShowDialog(this) == DialogResult.OK)
{
// Update shortcut keys in menus
ApplyShortcutKeys();
}
// Done
cfgform.Dispose();
prefform.Dispose();
}
// Configuration clicked
// Game Configuration clicked
public void configurationToolStripMenuItem_Click(object sender, EventArgs e)
{
ShowConfiguration();
}
// Preferences clciked
private void preferencesToolStripMenuItem_Click(object sender, EventArgs e)
{
ShowPreferences();
}
#endregion
}
}

View file

@ -0,0 +1,293 @@
namespace CodeImp.DoomBuilder.Interface
{
partial class PreferencesForm
{
/// <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()
{
System.Windows.Forms.Label label7;
System.Windows.Forms.Label label6;
System.Windows.Forms.Label label5;
this.cancel = new System.Windows.Forms.Button();
this.apply = new System.Windows.Forms.Button();
this.tabs = new System.Windows.Forms.TabControl();
this.tabinterface = new System.Windows.Forms.TabPage();
this.tabkeys = new System.Windows.Forms.TabPage();
this.listactions = new System.Windows.Forms.ListView();
this.columncontrolaction = new System.Windows.Forms.ColumnHeader();
this.columncontrolkey = new System.Windows.Forms.ColumnHeader();
this.actioncontrolpanel = new System.Windows.Forms.GroupBox();
this.actioncontrol = new System.Windows.Forms.ComboBox();
this.actiontitle = new System.Windows.Forms.Label();
this.actioncontrolclear = new System.Windows.Forms.Button();
this.actionkey = new System.Windows.Forms.TextBox();
this.actiondescription = new System.Windows.Forms.Label();
label7 = new System.Windows.Forms.Label();
label6 = new System.Windows.Forms.Label();
label5 = new System.Windows.Forms.Label();
this.tabs.SuspendLayout();
this.tabkeys.SuspendLayout();
this.actioncontrolpanel.SuspendLayout();
this.SuspendLayout();
//
// label7
//
label7.AutoSize = true;
label7.Location = new System.Drawing.Point(20, 183);
label7.Name = "label7";
label7.Size = new System.Drawing.Size(187, 14);
label7.TabIndex = 7;
label7.Text = "Or select a special input control here:";
//
// label6
//
label6.AutoSize = true;
label6.Location = new System.Drawing.Point(20, 30);
label6.Name = "label6";
label6.Size = new System.Drawing.Size(41, 14);
label6.TabIndex = 2;
label6.Text = "Action:";
//
// label5
//
label5.AutoSize = true;
label5.Location = new System.Drawing.Point(20, 122);
label5.Name = "label5";
label5.Size = new System.Drawing.Size(200, 14);
label5.TabIndex = 4;
label5.Text = "Press the desired key combination here:";
//
// cancel
//
this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancel.Location = new System.Drawing.Point(497, 406);
this.cancel.Name = "cancel";
this.cancel.Size = new System.Drawing.Size(112, 27);
this.cancel.TabIndex = 20;
this.cancel.Text = "Cancel";
this.cancel.UseVisualStyleBackColor = true;
this.cancel.Click += new System.EventHandler(this.cancel_Click);
//
// apply
//
this.apply.Location = new System.Drawing.Point(379, 406);
this.apply.Name = "apply";
this.apply.Size = new System.Drawing.Size(112, 27);
this.apply.TabIndex = 19;
this.apply.Text = "OK";
this.apply.UseVisualStyleBackColor = true;
this.apply.Click += new System.EventHandler(this.apply_Click);
//
// tabs
//
this.tabs.Controls.Add(this.tabinterface);
this.tabs.Controls.Add(this.tabkeys);
this.tabs.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabs.ItemSize = new System.Drawing.Size(110, 19);
this.tabs.Location = new System.Drawing.Point(11, 13);
this.tabs.Name = "tabs";
this.tabs.SelectedIndex = 0;
this.tabs.Size = new System.Drawing.Size(598, 379);
this.tabs.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
this.tabs.TabIndex = 18;
//
// tabinterface
//
this.tabinterface.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabinterface.Location = new System.Drawing.Point(4, 23);
this.tabinterface.Name = "tabinterface";
this.tabinterface.Padding = new System.Windows.Forms.Padding(3);
this.tabinterface.Size = new System.Drawing.Size(590, 352);
this.tabinterface.TabIndex = 0;
this.tabinterface.Text = "Interface";
this.tabinterface.UseVisualStyleBackColor = true;
//
// tabkeys
//
this.tabkeys.Controls.Add(this.listactions);
this.tabkeys.Controls.Add(this.actioncontrolpanel);
this.tabkeys.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabkeys.Location = new System.Drawing.Point(4, 23);
this.tabkeys.Name = "tabkeys";
this.tabkeys.Padding = new System.Windows.Forms.Padding(3);
this.tabkeys.Size = new System.Drawing.Size(590, 352);
this.tabkeys.TabIndex = 1;
this.tabkeys.Text = "Controls";
this.tabkeys.UseVisualStyleBackColor = true;
//
// listactions
//
this.listactions.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.listactions.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columncontrolaction,
this.columncontrolkey});
this.listactions.FullRowSelect = true;
this.listactions.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.listactions.HideSelection = false;
this.listactions.Location = new System.Drawing.Point(11, 12);
this.listactions.Margin = new System.Windows.Forms.Padding(8, 9, 8, 9);
this.listactions.MultiSelect = false;
this.listactions.Name = "listactions";
this.listactions.ShowGroups = false;
this.listactions.Size = new System.Drawing.Size(274, 326);
this.listactions.Sorting = System.Windows.Forms.SortOrder.Ascending;
this.listactions.TabIndex = 0;
this.listactions.TabStop = false;
this.listactions.UseCompatibleStateImageBehavior = false;
this.listactions.View = System.Windows.Forms.View.Details;
this.listactions.MouseUp += new System.Windows.Forms.MouseEventHandler(this.listactions_MouseUp);
this.listactions.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.listactions_ItemSelectionChanged);
this.listactions.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listactions_KeyUp);
//
// columncontrolaction
//
this.columncontrolaction.Text = "Action";
this.columncontrolaction.Width = 150;
//
// columncontrolkey
//
this.columncontrolkey.Text = "Key";
this.columncontrolkey.Width = 100;
//
// actioncontrolpanel
//
this.actioncontrolpanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.actioncontrolpanel.Controls.Add(this.actioncontrol);
this.actioncontrolpanel.Controls.Add(label7);
this.actioncontrolpanel.Controls.Add(this.actiontitle);
this.actioncontrolpanel.Controls.Add(this.actioncontrolclear);
this.actioncontrolpanel.Controls.Add(label6);
this.actioncontrolpanel.Controls.Add(this.actionkey);
this.actioncontrolpanel.Controls.Add(this.actiondescription);
this.actioncontrolpanel.Controls.Add(label5);
this.actioncontrolpanel.Enabled = false;
this.actioncontrolpanel.Location = new System.Drawing.Point(299, 12);
this.actioncontrolpanel.Margin = new System.Windows.Forms.Padding(6);
this.actioncontrolpanel.Name = "actioncontrolpanel";
this.actioncontrolpanel.Size = new System.Drawing.Size(282, 326);
this.actioncontrolpanel.TabIndex = 9;
this.actioncontrolpanel.TabStop = false;
this.actioncontrolpanel.Text = " Action control ";
//
// actioncontrol
//
this.actioncontrol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.actioncontrol.FormattingEnabled = true;
this.actioncontrol.Location = new System.Drawing.Point(23, 204);
this.actioncontrol.Name = "actioncontrol";
this.actioncontrol.Size = new System.Drawing.Size(197, 22);
this.actioncontrol.TabIndex = 8;
this.actioncontrol.TabStop = false;
this.actioncontrol.SelectedIndexChanged += new System.EventHandler(this.actioncontrol_SelectedIndexChanged);
//
// actiontitle
//
this.actiontitle.AutoSize = true;
this.actiontitle.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.actiontitle.Location = new System.Drawing.Point(67, 30);
this.actiontitle.Name = "actiontitle";
this.actiontitle.Size = new System.Drawing.Size(172, 14);
this.actiontitle.TabIndex = 1;
this.actiontitle.Text = "(select an action from the list)";
this.actiontitle.UseMnemonic = false;
//
// actioncontrolclear
//
this.actioncontrolclear.Location = new System.Drawing.Point(193, 140);
this.actioncontrolclear.Name = "actioncontrolclear";
this.actioncontrolclear.Size = new System.Drawing.Size(63, 27);
this.actioncontrolclear.TabIndex = 6;
this.actioncontrolclear.TabStop = false;
this.actioncontrolclear.Text = "Clear";
this.actioncontrolclear.UseVisualStyleBackColor = true;
this.actioncontrolclear.Click += new System.EventHandler(this.actioncontrolclear_Click);
//
// actionkey
//
this.actionkey.Location = new System.Drawing.Point(23, 142);
this.actionkey.Name = "actionkey";
this.actionkey.Size = new System.Drawing.Size(163, 20);
this.actionkey.TabIndex = 5;
this.actionkey.TabStop = false;
this.actionkey.KeyDown += new System.Windows.Forms.KeyEventHandler(this.actionkey_KeyDown);
//
// actiondescription
//
this.actiondescription.AutoEllipsis = true;
this.actiondescription.Location = new System.Drawing.Point(20, 52);
this.actiondescription.Name = "actiondescription";
this.actiondescription.Size = new System.Drawing.Size(245, 70);
this.actiondescription.TabIndex = 3;
this.actiondescription.UseMnemonic = false;
//
// PreferencesForm
//
this.AcceptButton = this.apply;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 14F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancel;
this.ClientSize = new System.Drawing.Size(619, 442);
this.Controls.Add(this.cancel);
this.Controls.Add(this.apply);
this.Controls.Add(this.tabs);
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 = "PreferencesForm";
this.Opacity = 0;
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Preferences";
this.tabs.ResumeLayout(false);
this.tabkeys.ResumeLayout(false);
this.actioncontrolpanel.ResumeLayout(false);
this.actioncontrolpanel.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button cancel;
private System.Windows.Forms.Button apply;
private System.Windows.Forms.TabControl tabs;
private System.Windows.Forms.TabPage tabinterface;
private System.Windows.Forms.TabPage tabkeys;
private System.Windows.Forms.ListView listactions;
private System.Windows.Forms.ColumnHeader columncontrolaction;
private System.Windows.Forms.ColumnHeader columncontrolkey;
private System.Windows.Forms.GroupBox actioncontrolpanel;
private System.Windows.Forms.ComboBox actioncontrol;
private System.Windows.Forms.Label actiontitle;
private System.Windows.Forms.Button actioncontrolclear;
private System.Windows.Forms.TextBox actionkey;
private System.Windows.Forms.Label actiondescription;
}
}

View file

@ -0,0 +1,283 @@
#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.Controls;
#endregion
namespace CodeImp.DoomBuilder.Interface
{
public partial class PreferencesForm : DelayedForm
{
#region ================== Variables
private bool allowapplycontrol = false;
#endregion
#region ================== Constructor
// Constructor
public PreferencesForm()
{
Action[] actions;
ListViewItem item;
// Initialize
InitializeComponent();
// Fill list of actions
actions = General.Actions.GetAllActions();
foreach(Action a in actions)
{
// Create item
item = listactions.Items.Add(a.Name, a.Title, 0);
item.SubItems.Add(Action.GetShortcutKeyDesc(a.ShortcutKey));
item.SubItems[1].Tag = a.ShortcutKey;
}
// Fill combobox with special controls
actioncontrol.Items.Add(new KeyControl(Keys.LButton, "LButton"));
actioncontrol.Items.Add(new KeyControl(Keys.MButton, "MButton"));
actioncontrol.Items.Add(new KeyControl(Keys.RButton, "RButton"));
actioncontrol.Items.Add(new KeyControl(Keys.XButton1, "XButton1"));
actioncontrol.Items.Add(new KeyControl(Keys.XButton2, "XButton2"));
actioncontrol.Items.Add(new KeyControl(SpecialKeys.MScrollUp, "ScrollUp"));
actioncontrol.Items.Add(new KeyControl(SpecialKeys.MScrollDown, "ScrollDown"));
actioncontrol.Items.Add(new KeyControl(Keys.LButton | Keys.Shift, "Shift+LButton"));
actioncontrol.Items.Add(new KeyControl(Keys.MButton | Keys.Shift, "Shift+MButton"));
actioncontrol.Items.Add(new KeyControl(Keys.RButton | Keys.Shift, "Shift+RButton"));
actioncontrol.Items.Add(new KeyControl(Keys.XButton1 | Keys.Shift, "Shift+XButton1"));
actioncontrol.Items.Add(new KeyControl(Keys.XButton2 | Keys.Shift, "Shift+XButton2"));
actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollUp | (int)Keys.Shift, "Shift+ScrollUp"));
actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollDown | (int)Keys.Shift, "Shift+ScrollDown"));
actioncontrol.Items.Add(new KeyControl(Keys.LButton | Keys.Control, "Ctrl+LButton"));
actioncontrol.Items.Add(new KeyControl(Keys.MButton | Keys.Control, "Ctrl+MButton"));
actioncontrol.Items.Add(new KeyControl(Keys.RButton | Keys.Control, "Ctrl+RButton"));
actioncontrol.Items.Add(new KeyControl(Keys.XButton1 | Keys.Control, "Ctrl+XButton1"));
actioncontrol.Items.Add(new KeyControl(Keys.XButton2 | Keys.Control, "Ctrl+XButton2"));
actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollUp | (int)Keys.Control, "Ctrl+ScrollUp"));
actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollDown | (int)Keys.Control, "Ctrl+ScrollDown"));
actioncontrol.Items.Add(new KeyControl(Keys.LButton | Keys.Shift | Keys.Control, "Ctrl+Shift+LButton"));
actioncontrol.Items.Add(new KeyControl(Keys.MButton | Keys.Shift | Keys.Control, "Ctrl+Shift+MButton"));
actioncontrol.Items.Add(new KeyControl(Keys.RButton | Keys.Shift | Keys.Control, "Ctrl+Shift+RButton"));
actioncontrol.Items.Add(new KeyControl(Keys.XButton1 | Keys.Shift | Keys.Control, "Ctrl+Shift+XButton1"));
actioncontrol.Items.Add(new KeyControl(Keys.XButton2 | Keys.Shift | Keys.Control, "Ctrl+Shift+XButton2"));
actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollUp | (int)Keys.Shift | (int)Keys.Control, "Ctrl+Shift+ScrollUp"));
actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollDown | (int)Keys.Shift | (int)Keys.Control, "Ctrl+Shift+ScrollDown"));
// Done
allowapplycontrol = true;
}
#endregion
#region ================== Controls Panel
// Item selected
private void listactions_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
{
Action action;
KeyControl keycontrol;
int key;
// Anything selected?
if(listactions.SelectedItems.Count > 0)
{
// Begin updating
allowapplycontrol = false;
// Get the selected action
action = General.Actions[listactions.SelectedItems[0].Name];
key = (int)listactions.SelectedItems[0].SubItems[1].Tag;
// Enable panel
actioncontrolpanel.Enabled = true;
actiontitle.Text = action.Title;
actiondescription.Text = action.Description;
actioncontrol.SelectedIndex = -1;
actionkey.Text = "";
// See if the key is in the combobox
for(int i = 0; i < actioncontrol.Items.Count; i++)
{
// Select it when the key is found here
keycontrol = (KeyControl)actioncontrol.Items[i];
if(keycontrol.key == key) actioncontrol.SelectedIndex = i;
}
// Otherwise display the key in the textbox
if(actioncontrol.SelectedIndex == -1)
actionkey.Text = Action.GetShortcutKeyDesc(key);
// Focus to the input box
actionkey.Focus();
// Done
allowapplycontrol = true;
}
}
// Key released
private void listactions_KeyUp(object sender, KeyEventArgs e)
{
// Nothing selected?
if(listactions.SelectedItems.Count == 0)
{
// Disable panel
actioncontrolpanel.Enabled = false;
actiontitle.Text = "(select an action from the list)";
actiondescription.Text = "";
actionkey.Text = "";
actioncontrol.SelectedIndex = -1;
}
}
// Mouse released
private void listactions_MouseUp(object sender, MouseEventArgs e)
{
listactions_KeyUp(sender, new KeyEventArgs(Keys.None));
// Focus to the input box
actionkey.Focus();
}
// Key combination pressed
private void actionkey_KeyDown(object sender, KeyEventArgs e)
{
int key = (int)e.KeyData;
e.SuppressKeyPress = true;
// Leave when not allowed to update
if(!allowapplycontrol) return;
// Anything selected?
if(listactions.SelectedItems.Count > 0)
{
// Begin updating
allowapplycontrol = false;
// Deselect anything from the combobox
actioncontrol.SelectedIndex = -1;
// Apply the key combination
listactions.SelectedItems[0].SubItems[1].Text = Action.GetShortcutKeyDesc(key);
listactions.SelectedItems[0].SubItems[1].Tag = key;
actionkey.Text = Action.GetShortcutKeyDesc(key);
// Done
allowapplycontrol = true;
}
}
// Key combination displayed
private void actionkey_TextChanged(object sender, EventArgs e)
{
// Cursor to the end
actionkey.SelectionStart = actionkey.Text.Length;
actionkey.SelectionLength = 0;
}
// Special key selected
private void actioncontrol_SelectedIndexChanged(object sender, EventArgs e)
{
KeyControl key;
// Leave when not allowed to update
if(!allowapplycontrol) return;
// Anything selected?
if((actioncontrol.SelectedIndex > -1) && (listactions.SelectedItems.Count > 0))
{
// Begin updating
allowapplycontrol = false;
// Remove text from textbox
actionkey.Text = "";
// Get the key control
key = (KeyControl)actioncontrol.SelectedItem;
// Apply the key combination
listactions.SelectedItems[0].SubItems[1].Text = Action.GetShortcutKeyDesc(key.key);
listactions.SelectedItems[0].SubItems[1].Tag = key.key;
// Focus to the input box
actionkey.Focus();
// Done
allowapplycontrol = true;
}
}
// Clear clicked
private void actioncontrolclear_Click(object sender, EventArgs e)
{
// Begin updating
allowapplycontrol = false;
// Clear textbox and combobox
actionkey.Text = "";
actioncontrol.SelectedIndex = -1;
// Apply the key combination
listactions.SelectedItems[0].SubItems[1].Text = "";
listactions.SelectedItems[0].SubItems[1].Tag = (int)0;
// Focus to the input box
actionkey.Focus();
// Done
allowapplycontrol = true;
}
#endregion
#region ================== OK / Cancel
// OK clicked
private void apply_Click(object sender, EventArgs e)
{
// Apply control keys to actions
foreach(ListViewItem item in listactions.Items)
General.Actions[item.Name].SetShortcutKey((int)item.SubItems[1].Tag);
// Close
this.DialogResult = DialogResult.OK;
this.Hide();
}
// Cancel clicked
private void cancel_Click(object sender, EventArgs e)
{
// Close
this.DialogResult = DialogResult.Cancel;
this.Hide();
}
#endregion
}
}

View file

@ -0,0 +1,204 @@
<?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="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="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="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="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="tabs.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="tabinterface.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="tabkeys.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="tabinterface.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="tabkeys.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="listactions.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="actioncontrolpanel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="listactions.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="actioncontrolpanel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="actioncontrol.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="actiontitle.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="actioncontrolclear.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="actionkey.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="actiondescription.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="actioncontrol.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="actiontitle.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="actioncontrolclear.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="actionkey.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="actiondescription.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>

View file

@ -88,8 +88,17 @@ zoomout
configuration
{
title = "Tools: Configuration";
description = "Shows this program configuration dialog.";
title = "Tools: Game Configurations";
description = "Shows the game configurations dialog.";
allowkeys = true;
allowmouse = false;
allowscroll = false;
}
preferences
{
title = "Tools: Preferences";
description = "Shows this preferences dialog.";
allowkeys = true;
allowmouse = false;
allowscroll = false;