mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-20 19:02:12 +00:00
more added.
This commit is contained in:
parent
8a7d13e9e8
commit
85ae983769
14 changed files with 582 additions and 65 deletions
|
@ -3,21 +3,254 @@ shortcuts
|
|||
{
|
||||
scrolleast = 39;
|
||||
scrollsouth = 40;
|
||||
zoomout = 65531;
|
||||
scrollnorth = 38;
|
||||
openmap = 131151;
|
||||
scrollwest = 37;
|
||||
newmap = 131150;
|
||||
zoomin = 65530;
|
||||
openmap = 131151;
|
||||
zoomout = 65531;
|
||||
}
|
||||
|
||||
|
||||
mainwindow
|
||||
{
|
||||
positionx = 150;
|
||||
windowstate = 2;
|
||||
positiony = 21;
|
||||
sizeheight = 572;
|
||||
positiony = 21;
|
||||
windowstate = 2;
|
||||
sizewidth = 739;
|
||||
}
|
||||
|
||||
|
||||
configurations
|
||||
{
|
||||
|
||||
strife
|
||||
{
|
||||
nodebuilder = "";
|
||||
buildonsave = true;
|
||||
|
||||
resources
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
zdoom_hexen
|
||||
{
|
||||
nodebuilder = "";
|
||||
buildonsave = true;
|
||||
|
||||
resources
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
eternity
|
||||
{
|
||||
nodebuilder = "";
|
||||
buildonsave = true;
|
||||
|
||||
resources
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
ultdoom
|
||||
{
|
||||
nodebuilder = "";
|
||||
buildonsave = true;
|
||||
|
||||
resources
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
zdoom_doom
|
||||
{
|
||||
nodebuilder = "";
|
||||
buildonsave = true;
|
||||
|
||||
resources
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
edge
|
||||
{
|
||||
nodebuilder = "";
|
||||
buildonsave = true;
|
||||
|
||||
resources
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
jdoom
|
||||
{
|
||||
nodebuilder = "";
|
||||
buildonsave = true;
|
||||
|
||||
resources
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
doom
|
||||
{
|
||||
nodebuilder = "";
|
||||
buildonsave = true;
|
||||
|
||||
resources
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
zdoom_doomhexen
|
||||
{
|
||||
nodebuilder = "";
|
||||
buildonsave = true;
|
||||
|
||||
resources
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
zdoom_heretichexen
|
||||
{
|
||||
nodebuilder = "";
|
||||
buildonsave = true;
|
||||
|
||||
resources
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
skulltag_doomhexen
|
||||
{
|
||||
nodebuilder = "";
|
||||
buildonsave = true;
|
||||
|
||||
resources
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
risen3d
|
||||
{
|
||||
nodebuilder = "";
|
||||
buildonsave = true;
|
||||
|
||||
resources
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
legacy
|
||||
{
|
||||
nodebuilder = "";
|
||||
buildonsave = true;
|
||||
|
||||
resources
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
doom2
|
||||
{
|
||||
nodebuilder = "";
|
||||
buildonsave = true;
|
||||
|
||||
resources
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
skulltag_doom
|
||||
{
|
||||
nodebuilder = "";
|
||||
buildonsave = true;
|
||||
|
||||
resources
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
zdoom_strifehexen
|
||||
{
|
||||
nodebuilder = "";
|
||||
buildonsave = true;
|
||||
|
||||
resources
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
boom
|
||||
{
|
||||
nodebuilder = "";
|
||||
buildonsave = true;
|
||||
|
||||
resources
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
hexen
|
||||
{
|
||||
nodebuilder = "";
|
||||
buildonsave = true;
|
||||
|
||||
resources
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
heretic
|
||||
{
|
||||
nodebuilder = "";
|
||||
buildonsave = true;
|
||||
|
||||
resources
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -21,30 +21,110 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using CodeImp.DoomBuilder.IO;
|
||||
using CodeImp.DoomBuilder.Images;
|
||||
using System.IO;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace CodeImp.DoomBuilder
|
||||
{
|
||||
internal struct ConfigurationInfo : IComparable<ConfigurationInfo>
|
||||
internal class ConfigurationInfo : IComparable<ConfigurationInfo>
|
||||
{
|
||||
// Members
|
||||
public string name;
|
||||
public string filename;
|
||||
|
||||
#region ================== Variables
|
||||
|
||||
private string name;
|
||||
private string filename;
|
||||
private string settingskey;
|
||||
private string nodebuilder;
|
||||
private bool buildonsave;
|
||||
private ResourceLocationList resources;
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Properties
|
||||
|
||||
public string Name { get { return name; } }
|
||||
public string Filename { get { return filename; } }
|
||||
public string Nodebuilder { get { return nodebuilder; } }
|
||||
public bool BuildOnSave { get { return buildonsave; } }
|
||||
public ResourceLocationList Resources { get { return resources; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Constructor / Disposer
|
||||
|
||||
// Constructor
|
||||
public ConfigurationInfo(string name, string filename)
|
||||
{
|
||||
// Initialize
|
||||
this.name = name;
|
||||
this.filename = filename;
|
||||
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 ResourceLocationList(General.Settings, "configurations." + settingskey + ".resources");
|
||||
}
|
||||
|
||||
// Constructor
|
||||
private ConfigurationInfo()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Methods
|
||||
|
||||
// This compares it to other ConfigurationInfo objects
|
||||
public int CompareTo(ConfigurationInfo other)
|
||||
{
|
||||
// Compare
|
||||
return name.CompareTo(other.name);
|
||||
}
|
||||
|
||||
// This saves the settings to program configuration
|
||||
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");
|
||||
}
|
||||
|
||||
// String representation
|
||||
public override string ToString()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
// This clones the object
|
||||
public ConfigurationInfo Clone()
|
||||
{
|
||||
ConfigurationInfo ci = new ConfigurationInfo();
|
||||
ci.name = this.name;
|
||||
ci.filename = this.filename;
|
||||
ci.settingskey = this.settingskey;
|
||||
ci.nodebuilder = this.nodebuilder;
|
||||
ci.buildonsave = this.buildonsave;
|
||||
ci.resources = new ResourceLocationList();
|
||||
ci.resources.AddRange(this.resources);
|
||||
return ci;
|
||||
}
|
||||
|
||||
// This applies settings from an object
|
||||
public void Apply(ConfigurationInfo ci)
|
||||
{
|
||||
this.name = ci.name;
|
||||
this.filename = ci.filename;
|
||||
this.settingskey = ci.settingskey;
|
||||
this.nodebuilder = ci.nodebuilder;
|
||||
this.buildonsave = ci.buildonsave;
|
||||
this.resources = new ResourceLocationList();
|
||||
this.resources.AddRange(ci.resources);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,6 +120,25 @@ namespace CodeImp.DoomBuilder
|
|||
|
||||
#region ================== Configurations
|
||||
|
||||
// This returns the game configuration info by filename
|
||||
public static ConfigurationInfo GetConfigurationInfo(string filename)
|
||||
{
|
||||
// Go for all config infos
|
||||
foreach(ConfigurationInfo ci in configs)
|
||||
{
|
||||
// Check if filename matches
|
||||
if(string.Compare(Path.GetFileNameWithoutExtension(ci.Filename),
|
||||
Path.GetFileNameWithoutExtension(filename), true) == 0)
|
||||
{
|
||||
// Return this info
|
||||
return ci;
|
||||
}
|
||||
}
|
||||
|
||||
// None found
|
||||
return null;
|
||||
}
|
||||
|
||||
// This loads and returns a game configuration
|
||||
public static Configuration LoadGameConfiguration(string filename)
|
||||
{
|
||||
|
@ -143,7 +162,7 @@ namespace CodeImp.DoomBuilder
|
|||
Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return null;
|
||||
}
|
||||
// Check if this is a Doom Builder 1 config
|
||||
// Check if this is a Doom Builder 2 config
|
||||
else if(cfg.ReadSetting("type", "") != "Doom Builder 2 Game Configuration")
|
||||
{
|
||||
// Old configuration
|
||||
|
@ -226,7 +245,7 @@ namespace CodeImp.DoomBuilder
|
|||
|
||||
// Load configuration
|
||||
if(!File.Exists(Path.Combine(apppath, SETTINGS_CONFIG_FILE))) throw (new FileNotFoundException("Unable to find the program configuration \"" + SETTINGS_CONFIG_FILE + "\"."));
|
||||
settings = new Configuration(Path.Combine(apppath, SETTINGS_CONFIG_FILE), false);
|
||||
settings = new Configuration(Path.Combine(apppath, SETTINGS_CONFIG_FILE), true);
|
||||
|
||||
// Create action manager
|
||||
actions = new ActionManager();
|
||||
|
@ -264,6 +283,9 @@ namespace CodeImp.DoomBuilder
|
|||
mainwindow.Dispose();
|
||||
actions.Dispose();
|
||||
|
||||
// Save game configuration settings
|
||||
foreach(ConfigurationInfo ci in configs) ci.SaveSettings();
|
||||
|
||||
// Save settings configuration
|
||||
settings.SaveConfiguration(Path.Combine(apppath, SETTINGS_CONFIG_FILE));
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@ namespace CodeImp.DoomBuilder
|
|||
private string filepathname;
|
||||
private MapSet data;
|
||||
private MapOptions options;
|
||||
private ConfigurationInfo configinfo;
|
||||
private Configuration config;
|
||||
private EditMode mode;
|
||||
private D3DGraphics graphics;
|
||||
|
@ -126,6 +127,7 @@ namespace CodeImp.DoomBuilder
|
|||
if(!graphics.Initialize()) return false;
|
||||
|
||||
// Load game configuration
|
||||
configinfo = General.GetConfigurationInfo(options.ConfigFile);
|
||||
config = General.LoadGameConfiguration(options.ConfigFile);
|
||||
|
||||
// Create map data
|
||||
|
|
|
@ -223,6 +223,58 @@ namespace CodeImp.DoomBuilder.IO
|
|||
#endregion
|
||||
|
||||
#region ================== Private Methods
|
||||
|
||||
// This is called by all the ReadSetting overloads to perform the read
|
||||
private bool CheckSetting(string setting, string pathseperator)
|
||||
{
|
||||
IDictionary cs = null;
|
||||
|
||||
// Split the path in an array
|
||||
string[] keys = setting.Split(pathseperator.ToCharArray());
|
||||
|
||||
// Get the root item
|
||||
object item = root;
|
||||
|
||||
// Go for each item
|
||||
for(int i = 0; i < keys.Length; i++)
|
||||
{
|
||||
// Check if the current item is of ConfigStruct type
|
||||
if(item is IDictionary)
|
||||
{
|
||||
// Check if the key is valid
|
||||
if(ValidateKey(null, keys[i].Trim(), -1) == true)
|
||||
{
|
||||
// Cast to ConfigStruct
|
||||
cs = (IDictionary)item;
|
||||
|
||||
// Check if the requested item exists
|
||||
if(cs.Contains(keys[i]) == true)
|
||||
{
|
||||
// Set the item to the next item
|
||||
item = cs[keys[i]];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Key not found
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Invalid key in path
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Unable to go any further
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Return result
|
||||
return true;
|
||||
}
|
||||
|
||||
// This is called by all the ReadSetting overloads to perform the read
|
||||
private object ReadAnySetting(string setting, object defaultsetting, string pathseperator)
|
||||
|
@ -1025,6 +1077,9 @@ namespace CodeImp.DoomBuilder.IO
|
|||
if(sorted) root = new ListDictionary(); else root = new Hashtable();
|
||||
}
|
||||
|
||||
// This checks if a given setting exists (disregards type)
|
||||
public bool SettingExists(string setting) { return CheckSetting(setting, DEFAULT_SEPERATOR); }
|
||||
public bool SettingExists(string setting, string pathseperator) { return CheckSetting(setting, pathseperator); }
|
||||
|
||||
// This can give a value of a key specified in a path form
|
||||
// also, this does not error when the setting does not exist,
|
||||
|
|
98
Source/Interface/ConfigForm.Designer.cs
generated
98
Source/Interface/ConfigForm.Designer.cs
generated
|
@ -30,33 +30,34 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
{
|
||||
System.Windows.Forms.Label label1;
|
||||
System.Windows.Forms.GroupBox groupBox1;
|
||||
System.Windows.Forms.Label label4;
|
||||
System.Windows.Forms.Label label3;
|
||||
System.Windows.Forms.Label label2;
|
||||
System.Windows.Forms.Label label3;
|
||||
this.configbuildonsave = new System.Windows.Forms.CheckBox();
|
||||
this.confignodebuilder = new System.Windows.Forms.ComboBox();
|
||||
this.tabs = new System.Windows.Forms.TabControl();
|
||||
this.tabinterface = new System.Windows.Forms.TabPage();
|
||||
this.tabediting = new System.Windows.Forms.TabPage();
|
||||
this.tabconfigs = new System.Windows.Forms.TabPage();
|
||||
this.panelres = new System.Windows.Forms.GroupBox();
|
||||
this.resourcelocations = 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();
|
||||
label1 = new System.Windows.Forms.Label();
|
||||
groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
label4 = new System.Windows.Forms.Label();
|
||||
label3 = new System.Windows.Forms.Label();
|
||||
label2 = new System.Windows.Forms.Label();
|
||||
label3 = new System.Windows.Forms.Label();
|
||||
groupBox1.SuspendLayout();
|
||||
this.tabs.SuspendLayout();
|
||||
this.tabconfigs.SuspendLayout();
|
||||
this.panelres.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.Location = new System.Drawing.Point(16, 25);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new System.Drawing.Size(303, 46);
|
||||
label1.Size = new System.Drawing.Size(320, 46);
|
||||
label1.TabIndex = 1;
|
||||
label1.Text = "Select the nodebuilder options to use with this configuration.\r\nThe nodebuilder i" +
|
||||
"s a compiler that builds geometry structures in your map when saved and when usi" +
|
||||
|
@ -64,39 +65,18 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
//
|
||||
// groupBox1
|
||||
//
|
||||
groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
groupBox1.Controls.Add(label4);
|
||||
groupBox1.Controls.Add(label3);
|
||||
groupBox1.Controls.Add(this.configbuildonsave);
|
||||
groupBox1.Controls.Add(label2);
|
||||
groupBox1.Controls.Add(this.confignodebuilder);
|
||||
groupBox1.Controls.Add(label1);
|
||||
groupBox1.Location = new System.Drawing.Point(205, 11);
|
||||
groupBox1.Location = new System.Drawing.Point(235, 11);
|
||||
groupBox1.Name = "groupBox1";
|
||||
groupBox1.Size = new System.Drawing.Size(343, 270);
|
||||
groupBox1.Size = new System.Drawing.Size(342, 144);
|
||||
groupBox1.TabIndex = 2;
|
||||
groupBox1.TabStop = false;
|
||||
groupBox1.Text = " Configuration Settings ";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
label4.AutoSize = true;
|
||||
label4.Location = new System.Drawing.Point(29, 201);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new System.Drawing.Size(79, 14);
|
||||
label4.TabIndex = 6;
|
||||
label4.Text = "IWAD wad file:";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.Location = new System.Drawing.Point(16, 144);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new System.Drawing.Size(303, 46);
|
||||
label3.TabIndex = 5;
|
||||
label3.Text = "Specify the IWAD wad file to use for this configuration.\r\nThe IWAD should contain" +
|
||||
" all default resources. such as textures and sprites, for the original game.";
|
||||
groupBox1.Text = " Nodebuilder";
|
||||
//
|
||||
// configbuildonsave
|
||||
//
|
||||
|
@ -119,12 +99,22 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
//
|
||||
// confignodebuilder
|
||||
//
|
||||
this.confignodebuilder.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.confignodebuilder.FormattingEnabled = true;
|
||||
this.confignodebuilder.Location = new System.Drawing.Point(102, 78);
|
||||
this.confignodebuilder.Name = "confignodebuilder";
|
||||
this.confignodebuilder.Size = new System.Drawing.Size(217, 22);
|
||||
this.confignodebuilder.TabIndex = 2;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
label3.Location = new System.Drawing.Point(14, 125);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new System.Drawing.Size(322, 22);
|
||||
label3.TabIndex = 17;
|
||||
label3.Text = "Drag items to change order (lower items override higher items).";
|
||||
//
|
||||
// tabs
|
||||
//
|
||||
this.tabs.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
|
@ -138,7 +128,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.tabs.Location = new System.Drawing.Point(12, 12);
|
||||
this.tabs.Name = "tabs";
|
||||
this.tabs.SelectedIndex = 0;
|
||||
this.tabs.Size = new System.Drawing.Size(566, 320);
|
||||
this.tabs.Size = new System.Drawing.Size(595, 351);
|
||||
this.tabs.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
|
||||
this.tabs.TabIndex = 0;
|
||||
//
|
||||
|
@ -148,7 +138,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
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(558, 293);
|
||||
this.tabinterface.Size = new System.Drawing.Size(587, 324);
|
||||
this.tabinterface.TabIndex = 0;
|
||||
this.tabinterface.Text = "Interface";
|
||||
this.tabinterface.UseVisualStyleBackColor = true;
|
||||
|
@ -159,39 +149,68 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.tabediting.Location = new System.Drawing.Point(4, 23);
|
||||
this.tabediting.Name = "tabediting";
|
||||
this.tabediting.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabediting.Size = new System.Drawing.Size(558, 293);
|
||||
this.tabediting.Size = new System.Drawing.Size(587, 324);
|
||||
this.tabediting.TabIndex = 1;
|
||||
this.tabediting.Text = "Editing";
|
||||
this.tabediting.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// tabconfigs
|
||||
//
|
||||
this.tabconfigs.Controls.Add(this.panelres);
|
||||
this.tabconfigs.Controls.Add(groupBox1);
|
||||
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.Name = "tabconfigs";
|
||||
this.tabconfigs.Size = new System.Drawing.Size(558, 293);
|
||||
this.tabconfigs.Size = new System.Drawing.Size(587, 324);
|
||||
this.tabconfigs.TabIndex = 2;
|
||||
this.tabconfigs.Text = "Configurations";
|
||||
this.tabconfigs.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// panelres
|
||||
//
|
||||
this.panelres.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.panelres.Controls.Add(this.resourcelocations);
|
||||
this.panelres.Controls.Add(label3);
|
||||
this.panelres.Location = new System.Drawing.Point(235, 161);
|
||||
this.panelres.Name = "panelres";
|
||||
this.panelres.Size = new System.Drawing.Size(342, 150);
|
||||
this.panelres.TabIndex = 12;
|
||||
this.panelres.TabStop = false;
|
||||
this.panelres.Text = " Resources ";
|
||||
//
|
||||
// resourcelocations
|
||||
//
|
||||
this.resourcelocations.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.resourcelocations.DialogOffset = new System.Drawing.Point(-120, -80);
|
||||
this.resourcelocations.Location = new System.Drawing.Point(14, 28);
|
||||
this.resourcelocations.Name = "resourcelocations";
|
||||
this.resourcelocations.Size = new System.Drawing.Size(313, 94);
|
||||
this.resourcelocations.TabIndex = 18;
|
||||
//
|
||||
// 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.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.listconfigs.FormattingEnabled = true;
|
||||
this.listconfigs.IntegralHeight = false;
|
||||
this.listconfigs.ItemHeight = 14;
|
||||
this.listconfigs.Location = new System.Drawing.Point(11, 11);
|
||||
this.listconfigs.Name = "listconfigs";
|
||||
this.listconfigs.Size = new System.Drawing.Size(181, 270);
|
||||
this.listconfigs.Size = new System.Drawing.Size(215, 300);
|
||||
this.listconfigs.Sorted = true;
|
||||
this.listconfigs.TabIndex = 0;
|
||||
//
|
||||
// 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(466, 346);
|
||||
this.cancel.Location = new System.Drawing.Point(495, 377);
|
||||
this.cancel.Name = "cancel";
|
||||
this.cancel.Size = new System.Drawing.Size(112, 25);
|
||||
this.cancel.TabIndex = 17;
|
||||
|
@ -201,7 +220,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(348, 346);
|
||||
this.apply.Location = new System.Drawing.Point(377, 377);
|
||||
this.apply.Name = "apply";
|
||||
this.apply.Size = new System.Drawing.Size(112, 25);
|
||||
this.apply.TabIndex = 16;
|
||||
|
@ -214,7 +233,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
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(590, 382);
|
||||
this.ClientSize = new System.Drawing.Size(619, 413);
|
||||
this.Controls.Add(this.cancel);
|
||||
this.Controls.Add(this.apply);
|
||||
this.Controls.Add(this.tabs);
|
||||
|
@ -230,6 +249,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
groupBox1.PerformLayout();
|
||||
this.tabs.ResumeLayout(false);
|
||||
this.tabconfigs.ResumeLayout(false);
|
||||
this.panelres.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
@ -245,5 +265,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
private System.Windows.Forms.ListBox listconfigs;
|
||||
private System.Windows.Forms.ComboBox confignodebuilder;
|
||||
private System.Windows.Forms.CheckBox configbuildonsave;
|
||||
private System.Windows.Forms.GroupBox panelres;
|
||||
private ResourceListEditor resourcelocations;
|
||||
}
|
||||
}
|
|
@ -36,6 +36,13 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
{
|
||||
// Initialize
|
||||
InitializeComponent();
|
||||
|
||||
// Fill list of configurations
|
||||
foreach(ConfigurationInfo ci in General.Configs)
|
||||
{
|
||||
// Add a copy
|
||||
listconfigs.Items.Add(ci.Clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -117,19 +117,64 @@
|
|||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="label1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label1.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="groupBox1.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label4.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
<metadata name="groupBox1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label3.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
<metadata name="configbuildonsave.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label2.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label2.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="confignodebuilder.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label3.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label3.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="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="tabediting.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="panelres.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="resourcelocations.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>
|
||||
</root>
|
21
Source/Interface/MainForm.Designer.cs
generated
21
Source/Interface/MainForm.Designer.cs
generated
|
@ -68,6 +68,8 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.panelinfo = new System.Windows.Forms.Panel();
|
||||
this.redrawtimer = new System.Windows.Forms.Timer(this.components);
|
||||
this.display = new System.Windows.Forms.Panel();
|
||||
this.menutools = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.configurationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator();
|
||||
|
@ -109,6 +111,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
//
|
||||
this.menumain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.menufile,
|
||||
this.menutools,
|
||||
this.menuhelp});
|
||||
this.menumain.Location = new System.Drawing.Point(0, 0);
|
||||
this.menumain.Name = "menumain";
|
||||
|
@ -415,6 +418,22 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
this.display.Paint += new System.Windows.Forms.PaintEventHandler(this.display_Paint);
|
||||
this.display.MouseUp += new System.Windows.Forms.MouseEventHandler(this.display_MouseUp);
|
||||
//
|
||||
// menutools
|
||||
//
|
||||
this.menutools.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.configurationToolStripMenuItem});
|
||||
this.menutools.Name = "menutools";
|
||||
this.menutools.Size = new System.Drawing.Size(44, 20);
|
||||
this.menutools.Text = "Tools";
|
||||
//
|
||||
// configurationToolStripMenuItem
|
||||
//
|
||||
this.configurationToolStripMenuItem.Name = "configurationToolStripMenuItem";
|
||||
this.configurationToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
|
||||
this.configurationToolStripMenuItem.Tag = "configuration";
|
||||
this.configurationToolStripMenuItem.Text = "Configuration...";
|
||||
this.configurationToolStripMenuItem.Click += new System.EventHandler(this.configurationToolStripMenuItem_Click);
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
|
@ -484,5 +503,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
private System.Windows.Forms.ToolStripMenuItem itemzoom25;
|
||||
private System.Windows.Forms.ToolStripMenuItem itemzoom10;
|
||||
private System.Windows.Forms.ToolStripMenuItem itemzoom5;
|
||||
private System.Windows.Forms.ToolStripMenuItem menutools;
|
||||
private System.Windows.Forms.ToolStripMenuItem configurationToolStripMenuItem;
|
||||
}
|
||||
}
|
|
@ -500,5 +500,18 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Tools Menu
|
||||
|
||||
// Configuration clicked
|
||||
private void configurationToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Show configuration dialog
|
||||
ConfigForm cfgform = new ConfigForm();
|
||||
cfgform.ShowDialog(this);
|
||||
cfgform.Dispose();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -50,10 +50,10 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
for(int i = 0; i < General.Configs.Count; i++)
|
||||
{
|
||||
// Add config name to list
|
||||
config.Items.Add(General.Configs[i].name);
|
||||
config.Items.Add(General.Configs[i].Name);
|
||||
|
||||
// Is this configuration currently selected?
|
||||
if(string.Compare(General.Configs[i].filename, options.ConfigFile, true) == 0)
|
||||
if(string.Compare(General.Configs[i].Filename, options.ConfigFile, true) == 0)
|
||||
{
|
||||
// Select this item
|
||||
config.SelectedIndex = config.Items.Count - 1;
|
||||
|
@ -90,7 +90,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
|
||||
// Apply changes
|
||||
options.ClearResources();
|
||||
options.ConfigFile = General.Configs[config.SelectedIndex].filename;
|
||||
options.ConfigFile = General.Configs[config.SelectedIndex].Filename;
|
||||
options.CurrentName = levelname.Text.Trim().ToUpper();
|
||||
options.CopyResources(resourcelocations.GetResources());
|
||||
|
||||
|
|
|
@ -91,10 +91,10 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
for(int i = 0; i < General.Configs.Count; i++)
|
||||
{
|
||||
// Add config name to list
|
||||
config.Items.Add(General.Configs[i].name);
|
||||
config.Items.Add(General.Configs[i].Name);
|
||||
|
||||
// This is the preferred game configuration?
|
||||
if(General.Configs[i].filename == gameconfig)
|
||||
if(General.Configs[i].Filename == gameconfig)
|
||||
{
|
||||
// Select this item
|
||||
config.SelectedIndex = i;
|
||||
|
@ -110,7 +110,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
// TODO: Check if an IWAD is set for this configuration
|
||||
|
||||
// Match the wad against this configuration
|
||||
if(MatchConfiguration(General.Configs[i].filename, wadfile))
|
||||
if(MatchConfiguration(General.Configs[i].Filename, wadfile))
|
||||
{
|
||||
// Select this item
|
||||
config.SelectedIndex = i;
|
||||
|
@ -192,7 +192,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
mapnames = new List<ListViewItem>();
|
||||
|
||||
// Load this configuration
|
||||
cfg = General.LoadGameConfiguration(General.Configs[config.SelectedIndex].filename);
|
||||
cfg = General.LoadGameConfiguration(General.Configs[config.SelectedIndex].Filename);
|
||||
|
||||
// Get the map lump names
|
||||
maplumpnames = cfg.ReadSetting("maplumpnames", new Hashtable());
|
||||
|
@ -273,7 +273,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
|
||||
// Apply changes
|
||||
options.ClearResources();
|
||||
options.ConfigFile = General.Configs[config.SelectedIndex].filename;
|
||||
options.ConfigFile = General.Configs[config.SelectedIndex].Filename;
|
||||
options.CurrentName = mapslist.SelectedItems[0].Text;
|
||||
options.CopyResources(resourcelocations.GetResources());
|
||||
|
||||
|
|
|
@ -13,6 +13,14 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
{
|
||||
#region ================== Variables
|
||||
|
||||
private Point dialogoffset = new Point(40, 20);
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Properties
|
||||
|
||||
public Point DialogOffset { get { return dialogoffset; } set { dialogoffset = value; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Constructor / Disposer
|
||||
|
@ -39,7 +47,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
resourceitems.BeginUpdate();
|
||||
|
||||
// Go for all items
|
||||
for(int i = resourceitems.Items.Count; i >= 0; i--)
|
||||
for(int i = resourceitems.Items.Count - 1; i >= 0; i--)
|
||||
{
|
||||
// Remove item if fixed
|
||||
if(resourceitems.Items[i].ForeColor != SystemColors.WindowText)
|
||||
|
@ -74,7 +82,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
resourceitems.BeginUpdate();
|
||||
|
||||
// Go for all items
|
||||
for(int i = resourceitems.Items.Count; i >= 0; i--)
|
||||
for(int i = resourceitems.Items.Count - 1; i >= 0; i--)
|
||||
{
|
||||
// Remove item unless fixed
|
||||
if(resourceitems.Items[i].ForeColor == SystemColors.WindowText)
|
||||
|
@ -141,7 +149,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
// Open resource options dialog
|
||||
resoptions = new ResourceOptionsForm(new ResourceLocation(), "Add Resource");
|
||||
resoptions.StartPosition = FormStartPosition.Manual;
|
||||
startposition = new Rectangle(40, 20, 1, 1);
|
||||
startposition = new Rectangle(dialogoffset.X, dialogoffset.Y, 1, 1);
|
||||
startposition = this.RectangleToScreen(startposition);
|
||||
resoptions.Location = startposition.Location;
|
||||
if(resoptions.ShowDialog(this) == DialogResult.OK)
|
||||
|
@ -168,7 +176,7 @@ namespace CodeImp.DoomBuilder.Interface
|
|||
// Open resource options dialog
|
||||
resoptions = new ResourceOptionsForm((ResourceLocation)selecteditem.Tag, "Resource Options");
|
||||
resoptions.StartPosition = FormStartPosition.Manual;
|
||||
startposition = new Rectangle(40, 20, 1, 1);
|
||||
startposition = new Rectangle(dialogoffset.X, dialogoffset.Y, 1, 1);
|
||||
startposition = this.RectangleToScreen(startposition);
|
||||
resoptions.Location = startposition.Location;
|
||||
if(resoptions.ShowDialog(this) == DialogResult.OK)
|
||||
|
|
|
@ -85,3 +85,12 @@ zoomout
|
|||
allowmouse = true;
|
||||
allowscroll = true;
|
||||
}
|
||||
|
||||
configuration
|
||||
{
|
||||
title = "Tools: Configuration";
|
||||
description = "Shows this program configuration dialog.";
|
||||
allowkeys = true;
|
||||
allowmouse = false;
|
||||
allowscroll = false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue