Added warnings about possibly invalid resource configurations before starting to edit a map

This commit is contained in:
ZZYZX 2022-09-18 20:54:53 +03:00
parent 8808d5ce3c
commit 4fd97fec9c
34 changed files with 2584 additions and 1870 deletions

View file

@ -677,6 +677,7 @@
<Reference Include="TabControlEX, Version=0.0.3271.41578, Culture=neutral, PublicKeyToken=1db242dc828e4b4e"> <Reference Include="TabControlEX, Version=0.0.3271.41578, Culture=neutral, PublicKeyToken=1db242dc828e4b4e">
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Controls\CommandPaletteControl.resx"> <EmbeddedResource Include="Controls\CommandPaletteControl.resx">
@ -733,6 +734,9 @@
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None> </None>
<EmbeddedResource Include="Resources\display2d.shader" /> <EmbeddedResource Include="Resources\display2d.shader" />
<None Include="Resources\Loader.ani" />
<None Include="Resources\Loader1.ani" />
<None Include="Resources\Loader2.ani" />
<None Include="Resources\MissingTexture.png" /> <None Include="Resources\MissingTexture.png" />
<EmbeddedResource Include="Resources\things2d.shader" /> <EmbeddedResource Include="Resources\things2d.shader" />
<None Include="Resources\UnknownImage.png" /> <None Include="Resources\UnknownImage.png" />
@ -1372,6 +1376,7 @@
<None Include="Resources\MergeGeo.png" /> <None Include="Resources\MergeGeo.png" />
<None Include="Resources\MergeGeoClassic.png" /> <None Include="Resources\MergeGeoClassic.png" />
<None Include="Resources\MergeGeoRemoveLines.png" /> <None Include="Resources\MergeGeoRemoveLines.png" />
<None Include="Resources\Loader.gif" />
<Content Include="Resources\Model.png" /> <Content Include="Resources\Model.png" />
<None Include="Resources\ModelDisabled.png" /> <None Include="Resources\ModelDisabled.png" />
<None Include="Resources\ModelFiltered.png" /> <None Include="Resources\ModelFiltered.png" />

View file

@ -105,7 +105,7 @@ namespace CodeImp.DoomBuilder.Compilers
// Map SCRIPTS lump is empty. Abort the process without generating any warnings or errors. // Map SCRIPTS lump is empty. Abort the process without generating any warnings or errors.
if(SourceIsMapScriptsLump && stream.Length == 0) return false; if(SourceIsMapScriptsLump && stream.Length == 0) return false;
DataLocation dl = new DataLocation(DataLocation.RESOURCE_DIRECTORY, Path.GetDirectoryName(inputfilepath), false, false, false); DataLocation dl = new DataLocation(DataLocation.RESOURCE_DIRECTORY, Path.GetDirectoryName(inputfilepath), false, false, false, null);
//mxd. TextResourceData must point to temp path when compiling WAD lumps for lump to be recognized as map lump when reporting errors... //mxd. TextResourceData must point to temp path when compiling WAD lumps for lump to be recognized as map lump when reporting errors...
TextResourceData data = new TextResourceData(stream, dl, (SourceIsMapScriptsLump ? inputfile : sourcefile)); TextResourceData data = new TextResourceData(stream, dl, (SourceIsMapScriptsLump ? inputfile : sourcefile));
if(!parser.Parse(data, info.Files, true, AcsParserSE.IncludeType.NONE, false)) if(!parser.Parse(data, info.Files, true, AcsParserSE.IncludeType.NONE, false))

View file

@ -549,7 +549,7 @@ namespace CodeImp.DoomBuilder.Config
string classname = cfg.ReadSetting("requiredarchives." + cde.Key + "." + cde2.Key + ".class", (string)null); string classname = cfg.ReadSetting("requiredarchives." + cde.Key + "." + cde2.Key + ".class", (string)null);
reqEntries.Add(new RequiredArchiveEntry(classname, lumpname)); reqEntries.Add(new RequiredArchiveEntry(classname, lumpname));
} }
requiredarchives.Add(new RequiredArchive(filename, exclude, reqEntries)); requiredarchives.Add(new RequiredArchive((string)cde.Key, filename, exclude, reqEntries));
} }
// Things // Things

View file

@ -23,17 +23,20 @@ namespace CodeImp.DoomBuilder.Config
class RequiredArchive class RequiredArchive
{ {
private string id;
private string filename; private string filename;
private bool excludeFromTesting; private bool excludeFromTesting;
private List<RequiredArchiveEntry> entries; private List<RequiredArchiveEntry> entries;
public RequiredArchive(string filename, bool excludeFromTesting, List<RequiredArchiveEntry> entries) public RequiredArchive(string id, string filename, bool excludeFromTesting, List<RequiredArchiveEntry> entries)
{ {
this.id = id;
this.filename = filename; this.filename = filename;
this.excludeFromTesting = excludeFromTesting; this.excludeFromTesting = excludeFromTesting;
this.entries = entries; this.entries = entries;
} }
public string ID { get { return id; } }
public string FileName { get { return filename; } } public string FileName { get { return filename; } }
public bool ExcludeFromTesting { get { return excludeFromTesting; } } public bool ExcludeFromTesting { get { return excludeFromTesting; } }
public IReadOnlyCollection<RequiredArchiveEntry> Entries { get { return entries; } } public IReadOnlyCollection<RequiredArchiveEntry> Entries { get { return entries; } }

View file

@ -28,100 +28,69 @@ namespace CodeImp.DoomBuilder.Controls
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem(new string[] { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ResourceListEditor));
System.Windows.Forms.ListViewItem listViewItem4 = new System.Windows.Forms.ListViewItem(new string[] {
"C:\\Windows\\Doom\\Doom2.wad"}, 3, System.Drawing.SystemColors.GrayText, System.Drawing.SystemColors.Window, null); "C:\\Windows\\Doom\\Doom2.wad"}, 3, System.Drawing.SystemColors.GrayText, System.Drawing.SystemColors.Window, null);
System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem(new string[] { System.Windows.Forms.ListViewItem listViewItem5 = new System.Windows.Forms.ListViewItem(new string[] {
"C:\\My\\Little\\Textures\\"}, 2, System.Drawing.SystemColors.GrayText, System.Drawing.SystemColors.Window, null); "C:\\My\\Little\\Textures\\"}, 2, System.Drawing.SystemColors.GrayText, System.Drawing.SystemColors.Window, null);
System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem("C:\\My\\Little\\Pony.wad", 1); System.Windows.Forms.ListViewItem listViewItem6 = new System.Windows.Forms.ListViewItem("C:\\My\\Little\\Pony.wad", 1);
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ResourceListEditor)); this.editresource = new System.Windows.Forms.Button();
this.editresource = new System.Windows.Forms.Button(); this.deleteresources = new System.Windows.Forms.Button();
this.deleteresources = new System.Windows.Forms.Button(); this.addresource = new System.Windows.Forms.Button();
this.addresource = new System.Windows.Forms.Button(); this.copypastemenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.resourceitems = new CodeImp.DoomBuilder.Controls.ResourceListView(); this.copyresources = new System.Windows.Forms.ToolStripMenuItem();
this.column = new System.Windows.Forms.ColumnHeader(); this.cutresources = new System.Windows.Forms.ToolStripMenuItem();
this.copypastemenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.copyresources = new System.Windows.Forms.ToolStripMenuItem(); this.pasteresources = new System.Windows.Forms.ToolStripMenuItem();
this.cutresources = new System.Windows.Forms.ToolStripMenuItem(); this.replaceresources = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.pasteresources = new System.Windows.Forms.ToolStripMenuItem(); this.removeresources = new System.Windows.Forms.ToolStripMenuItem();
this.replaceresources = new System.Windows.Forms.ToolStripMenuItem(); this.images = new System.Windows.Forms.ImageList(this.components);
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.resourceitems = new CodeImp.DoomBuilder.Controls.ResourceListView();
this.removeresources = new System.Windows.Forms.ToolStripMenuItem(); this.column = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.images = new System.Windows.Forms.ImageList(this.components); this.copypastemenu.SuspendLayout();
this.copypastemenu.SuspendLayout(); this.SuspendLayout();
this.SuspendLayout(); //
// // editresource
// editresource //
// this.editresource.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
this.editresource.Enabled = false; | System.Windows.Forms.AnchorStyles.Right)));
this.editresource.Location = new System.Drawing.Point(122, 140); this.editresource.Enabled = false;
this.editresource.Name = "editresource"; this.editresource.Location = new System.Drawing.Point(122, 140);
this.editresource.Size = new System.Drawing.Size(136, 24); this.editresource.Name = "editresource";
this.editresource.TabIndex = 0; this.editresource.Size = new System.Drawing.Size(136, 24);
this.editresource.Text = "Resource options..."; this.editresource.TabIndex = 0;
this.editresource.UseVisualStyleBackColor = true; this.editresource.Text = "Resource options...";
this.editresource.Click += new System.EventHandler(this.editresource_Click); this.editresource.UseVisualStyleBackColor = true;
// this.editresource.Click += new System.EventHandler(this.editresource_Click);
// deleteresources //
// // deleteresources
this.deleteresources.Enabled = false; //
this.deleteresources.Location = new System.Drawing.Point(259, 140); this.deleteresources.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.deleteresources.Name = "deleteresources"; this.deleteresources.Enabled = false;
this.deleteresources.Size = new System.Drawing.Size(88, 24); this.deleteresources.Location = new System.Drawing.Point(259, 140);
this.deleteresources.TabIndex = 0; this.deleteresources.Name = "deleteresources";
this.deleteresources.Text = "Remove"; this.deleteresources.Size = new System.Drawing.Size(88, 24);
this.deleteresources.UseVisualStyleBackColor = true; this.deleteresources.TabIndex = 0;
this.deleteresources.Click += new System.EventHandler(this.deleteresources_Click); this.deleteresources.Text = "Remove";
// this.deleteresources.UseVisualStyleBackColor = true;
// addresource this.deleteresources.Click += new System.EventHandler(this.deleteresources_Click);
// //
this.addresource.Location = new System.Drawing.Point(3, 140); // addresource
this.addresource.Name = "addresource"; //
this.addresource.Size = new System.Drawing.Size(118, 24); this.addresource.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.addresource.TabIndex = 0; this.addresource.Location = new System.Drawing.Point(3, 140);
this.addresource.Text = "Add resource..."; this.addresource.Name = "addresource";
this.addresource.UseVisualStyleBackColor = true; this.addresource.Size = new System.Drawing.Size(118, 24);
this.addresource.Click += new System.EventHandler(this.addresource_Click); this.addresource.TabIndex = 0;
// this.addresource.Text = "Add resource...";
// resourceitems this.addresource.UseVisualStyleBackColor = true;
// this.addresource.Click += new System.EventHandler(this.addresource_Click);
this.resourceitems.AllowDrop = true; //
this.resourceitems.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { // copypastemenu
this.column}); //
this.resourceitems.ContextMenuStrip = this.copypastemenu; this.copypastemenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.resourceitems.FullRowSelect = true;
this.resourceitems.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
this.resourceitems.HideSelection = false;
this.resourceitems.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
listViewItem1,
listViewItem2,
listViewItem3});
this.resourceitems.Location = new System.Drawing.Point(0, 0);
this.resourceitems.Name = "resourceitems";
this.resourceitems.ShowGroups = false;
this.resourceitems.ShowItemToolTips = true;
this.resourceitems.Size = new System.Drawing.Size(350, 138);
this.resourceitems.SmallImageList = this.images;
this.resourceitems.TabIndex = 0;
this.resourceitems.UseCompatibleStateImageBehavior = false;
this.resourceitems.View = System.Windows.Forms.View.Details;
this.resourceitems.ClientSizeChanged += new System.EventHandler(this.resourceitems_ClientSizeChanged);
this.resourceitems.SizeChanged += new System.EventHandler(this.resources_SizeChanged);
this.resourceitems.DoubleClick += new System.EventHandler(this.resourceitems_DoubleClick);
this.resourceitems.DragDrop += new System.Windows.Forms.DragEventHandler(this.resourceitems_DragDrop);
this.resourceitems.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.resourceitems_ItemSelectionChanged);
this.resourceitems.KeyUp += new System.Windows.Forms.KeyEventHandler(this.resourceitems_KeyUp);
this.resourceitems.DragOver += new System.Windows.Forms.DragEventHandler(this.resourceitems_DragOver);
//
// column
//
this.column.Text = "Resource location";
this.column.Width = 200;
//
// copypastemenu
//
this.copypastemenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.copyresources, this.copyresources,
this.cutresources, this.cutresources,
this.toolStripSeparator1, this.toolStripSeparator1,
@ -129,85 +98,123 @@ namespace CodeImp.DoomBuilder.Controls
this.replaceresources, this.replaceresources,
this.toolStripSeparator2, this.toolStripSeparator2,
this.removeresources}); this.removeresources});
this.copypastemenu.Name = "copypastemenu"; this.copypastemenu.Name = "copypastemenu";
this.copypastemenu.Size = new System.Drawing.Size(118, 126); this.copypastemenu.Size = new System.Drawing.Size(118, 126);
this.copypastemenu.Opening += new System.ComponentModel.CancelEventHandler(this.copypastemenu_Opening); this.copypastemenu.Opening += new System.ComponentModel.CancelEventHandler(this.copypastemenu_Opening);
// //
// copyresources // copyresources
// //
this.copyresources.Image = global::CodeImp.DoomBuilder.Properties.Resources.Copy; this.copyresources.Image = global::CodeImp.DoomBuilder.Properties.Resources.Copy;
this.copyresources.Name = "copyresources"; this.copyresources.Name = "copyresources";
this.copyresources.Size = new System.Drawing.Size(117, 22); this.copyresources.Size = new System.Drawing.Size(117, 22);
this.copyresources.Text = "Copy"; this.copyresources.Text = "Copy";
this.copyresources.Click += new System.EventHandler(this.copyresources_Click); this.copyresources.Click += new System.EventHandler(this.copyresources_Click);
// //
// cutresources // cutresources
// //
this.cutresources.Image = global::CodeImp.DoomBuilder.Properties.Resources.Cut; this.cutresources.Image = global::CodeImp.DoomBuilder.Properties.Resources.Cut;
this.cutresources.Name = "cutresources"; this.cutresources.Name = "cutresources";
this.cutresources.Size = new System.Drawing.Size(117, 22); this.cutresources.Size = new System.Drawing.Size(117, 22);
this.cutresources.Text = "Cut"; this.cutresources.Text = "Cut";
this.cutresources.Click += new System.EventHandler(this.cutresources_Click); this.cutresources.Click += new System.EventHandler(this.cutresources_Click);
// //
// toolStripSeparator1 // toolStripSeparator1
// //
this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(114, 6); this.toolStripSeparator1.Size = new System.Drawing.Size(114, 6);
// //
// pasteresources // pasteresources
// //
this.pasteresources.Image = global::CodeImp.DoomBuilder.Properties.Resources.Paste; this.pasteresources.Image = global::CodeImp.DoomBuilder.Properties.Resources.Paste;
this.pasteresources.Name = "pasteresources"; this.pasteresources.Name = "pasteresources";
this.pasteresources.Size = new System.Drawing.Size(117, 22); this.pasteresources.Size = new System.Drawing.Size(117, 22);
this.pasteresources.Text = "Paste"; this.pasteresources.Text = "Paste";
this.pasteresources.Click += new System.EventHandler(this.pasteresources_Click); this.pasteresources.Click += new System.EventHandler(this.pasteresources_Click);
// //
// replaceresources // replaceresources
// //
this.replaceresources.Image = global::CodeImp.DoomBuilder.Properties.Resources.Replace; this.replaceresources.Image = global::CodeImp.DoomBuilder.Properties.Resources.Replace;
this.replaceresources.Name = "replaceresources"; this.replaceresources.Name = "replaceresources";
this.replaceresources.Size = new System.Drawing.Size(117, 22); this.replaceresources.Size = new System.Drawing.Size(117, 22);
this.replaceresources.Text = "Replace"; this.replaceresources.Text = "Replace";
this.replaceresources.Click += new System.EventHandler(this.replaceresources_Click); this.replaceresources.Click += new System.EventHandler(this.replaceresources_Click);
// //
// toolStripSeparator2 // toolStripSeparator2
// //
this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(114, 6); this.toolStripSeparator2.Size = new System.Drawing.Size(114, 6);
// //
// removeresources // removeresources
// //
this.removeresources.Image = global::CodeImp.DoomBuilder.Properties.Resources.SearchClear; this.removeresources.Image = global::CodeImp.DoomBuilder.Properties.Resources.SearchClear;
this.removeresources.Name = "removeresources"; this.removeresources.Name = "removeresources";
this.removeresources.Size = new System.Drawing.Size(117, 22); this.removeresources.Size = new System.Drawing.Size(117, 22);
this.removeresources.Text = "Remove"; this.removeresources.Text = "Remove";
this.removeresources.Click += new System.EventHandler(this.removeresources_Click); this.removeresources.Click += new System.EventHandler(this.removeresources_Click);
// //
// images // images
// //
this.images.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("images.ImageStream"))); this.images.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("images.ImageStream")));
this.images.TransparentColor = System.Drawing.Color.Transparent; this.images.TransparentColor = System.Drawing.Color.Transparent;
this.images.Images.SetKeyName(0, "Folder.ico"); this.images.Images.SetKeyName(0, "Folder.ico");
this.images.Images.SetKeyName(1, "File.ico"); this.images.Images.SetKeyName(1, "File.ico");
this.images.Images.SetKeyName(2, "PK3.ico"); this.images.Images.SetKeyName(2, "PK3.ico");
this.images.Images.SetKeyName(3, "FolderLocked.ico"); this.images.Images.SetKeyName(3, "FolderLocked.ico");
this.images.Images.SetKeyName(4, "FileLocked.ico"); this.images.Images.SetKeyName(4, "FileLocked.ico");
this.images.Images.SetKeyName(5, "PK3Locked.ico"); this.images.Images.SetKeyName(5, "PK3Locked.ico");
// this.images.Images.SetKeyName(6, "Loader.gif");
// ResourceListEditor //
// // resourceitems
this.AllowDrop = true; //
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.resourceitems.AllowDrop = true;
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.resourceitems.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
this.Controls.Add(this.resourceitems); | System.Windows.Forms.AnchorStyles.Left)
this.Controls.Add(this.addresource); | System.Windows.Forms.AnchorStyles.Right)));
this.Controls.Add(this.editresource); this.resourceitems.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.Controls.Add(this.deleteresources); this.column});
this.Name = "ResourceListEditor"; this.resourceitems.ContextMenuStrip = this.copypastemenu;
this.Size = new System.Drawing.Size(350, 166); this.resourceitems.FullRowSelect = true;
this.Resize += new System.EventHandler(this.ResourceListEditor_Resize); this.resourceitems.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
this.copypastemenu.ResumeLayout(false); this.resourceitems.HideSelection = false;
this.ResumeLayout(false); this.resourceitems.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
listViewItem4,
listViewItem5,
listViewItem6});
this.resourceitems.Location = new System.Drawing.Point(0, 0);
this.resourceitems.Name = "resourceitems";
this.resourceitems.ShowGroups = false;
this.resourceitems.ShowItemToolTips = true;
this.resourceitems.Size = new System.Drawing.Size(350, 138);
this.resourceitems.SmallImageList = this.images;
this.resourceitems.TabIndex = 0;
this.resourceitems.UseCompatibleStateImageBehavior = false;
this.resourceitems.View = System.Windows.Forms.View.Details;
this.resourceitems.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.resourceitems_ItemSelectionChanged);
this.resourceitems.ClientSizeChanged += new System.EventHandler(this.resourceitems_ClientSizeChanged);
this.resourceitems.SizeChanged += new System.EventHandler(this.resources_SizeChanged);
this.resourceitems.DragDrop += new System.Windows.Forms.DragEventHandler(this.resourceitems_DragDrop);
this.resourceitems.DragOver += new System.Windows.Forms.DragEventHandler(this.resourceitems_DragOver);
this.resourceitems.DoubleClick += new System.EventHandler(this.resourceitems_DoubleClick);
this.resourceitems.KeyUp += new System.Windows.Forms.KeyEventHandler(this.resourceitems_KeyUp);
//
// column
//
this.column.Text = "Resource location";
this.column.Width = 200;
//
// ResourceListEditor
//
this.AllowDrop = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.Controls.Add(this.resourceitems);
this.Controls.Add(this.addresource);
this.Controls.Add(this.editresource);
this.Controls.Add(this.deleteresources);
this.Name = "ResourceListEditor";
this.Size = new System.Drawing.Size(350, 166);
this.copypastemenu.ResumeLayout(false);
this.ResumeLayout(false);
} }

View file

@ -20,7 +20,11 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using System.Windows.Threading;
using CodeImp.DoomBuilder.Config;
using CodeImp.DoomBuilder.Data; using CodeImp.DoomBuilder.Data;
using CodeImp.DoomBuilder.Windows; using CodeImp.DoomBuilder.Windows;
@ -30,11 +34,30 @@ namespace CodeImp.DoomBuilder.Controls
{ {
internal partial class ResourceListEditor : UserControl internal partial class ResourceListEditor : UserControl
{ {
#region ================== Internal warning struct
class Warning
{
public Panel Wrapper;
public PictureBox Picture;
public Label Text;
public Warning(Panel wrapper, PictureBox picture, Label text)
{
Wrapper = wrapper;
Picture = picture;
Text = text;
}
}
#endregion
#region ================== Delegates / Events #region ================== Delegates / Events
public delegate void ContentChanged(); public delegate void ContentChanged();
public delegate void WarningsChanged(int size);
public event ContentChanged OnContentChanged; public event ContentChanged OnContentChanged;
public event WarningsChanged OnWarningsChanged;
public string StartPath; //mxd public string StartPath; //mxd
public bool IsMapControl = false;
#endregion #endregion
@ -47,12 +70,15 @@ namespace CodeImp.DoomBuilder.Controls
private readonly int pasteactionkey; private readonly int pasteactionkey;
private readonly int pastespecialactionkey; private readonly int pastespecialactionkey;
private readonly int deleteactionkey; private readonly int deleteactionkey;
private readonly Dictionary<string, CancellationTokenSource> loadingrequiredarchives;
private readonly List<Warning> warnings;
#endregion #endregion
#region ================== Properties #region ================== Properties
public Point DialogOffset { get { return dialogoffset; } set { dialogoffset = value; } } public Point DialogOffset { get { return dialogoffset; } set { dialogoffset = value; } }
public GameConfiguration GameConfiguration { get; set; }
#endregion #endregion
@ -64,8 +90,11 @@ namespace CodeImp.DoomBuilder.Controls
// Initialize // Initialize
InitializeComponent(); InitializeComponent();
ResizeColumnHeader(); ResizeColumnHeader();
if(General.Actions != null) loadingrequiredarchives = new Dictionary<string, CancellationTokenSource>();
warnings = new List<Warning>();
if (General.Actions != null)
{ {
// Get key shortcuts (mxd) // Get key shortcuts (mxd)
copyactionkey = General.Actions.GetActionByName("builder_copyselection").ShortcutKey; copyactionkey = General.Actions.GetActionByName("builder_copyselection").ShortcutKey;
@ -109,6 +138,266 @@ namespace CodeImp.DoomBuilder.Controls
default: return -1; default: return -1;
} }
} }
private List<string> RunCheckRequiredArchives(DataLocation loc, CancellationToken token)
{
return ResourceOptionsForm.CheckRequiredArchives(GameConfiguration, loc, token);
}
private void StartRequiredArchivesCheck(string location)
{
if (GameConfiguration == null) return;
DataLocation loc = new DataLocation();
bool found = false;
foreach (ListViewItem item in resourceitems.Items)
{
DataLocation dl = (DataLocation)item.Tag;
if (dl.location == location)
{
loc = dl;
found = true;
break;
}
}
if (!found) return;
var cancellation = new CancellationTokenSource();
General.WriteLogLine(string.Format("Resource check started for: {0}", loc.location));
loadingrequiredarchives.Add(location, cancellation);
RefreshLoading();
var dispatcher = Dispatcher.CurrentDispatcher;
Task.Run(() => RunCheckRequiredArchives(loc, cancellation.Token)).ContinueWith((t) =>
{
dispatcher.Invoke(() =>
{
try
{
if (!t.IsFaulted)
{
loc.requiredarchives = t.Result;
// in case of dir, option1/2 should be erased
if (loc.type == DataLocation.RESOURCE_DIRECTORY)
loc.option1 = loc.option2 = false;
// check if it has to be force-excluded from testing
foreach (var arc in GameConfiguration.RequiredArchives)
{
if (loc.requiredarchives.Contains(arc.ID) && arc.ExcludeFromTesting)
loc.notfortesting = true;
}
}
else loc.requiredarchives = new List<string>();
if (!t.IsCanceled)
{
foreach (ListViewItem item in resourceitems.Items)
{
if (((DataLocation)item.Tag).location == location)
{
item.Tag = loc;
if (OnContentChanged != null) OnContentChanged();
break;
}
}
}
}
catch (Exception e)
{
General.WriteLogLine(e.ToString());
}
cancellation.Dispose();
if (!t.IsCanceled && loadingrequiredarchives[location] == cancellation)
{
General.WriteLogLine(string.Format("Resource check completed for: {0} (Completed = {1}, Faulted = {2}, Canceled = {3}, Match = {4})", location, t.IsCompleted, t.IsFaulted, t.IsCanceled, loadingrequiredarchives[location] == cancellation));
loadingrequiredarchives.Remove(location);
RefreshLoading();
}
// if nothing is loading, update warnings if any
if (loadingrequiredarchives.Count == 0)
UpdateWarnings();
});
});
}
private void ShowWarning(string text, bool loading)
{
Panel p = new Panel();
Controls.Add(p);
// find offset
int lastTop = 0;
foreach (Warning w in warnings)
lastTop = Math.Max(lastTop, w.Wrapper.Bottom + 8);
p.Top = lastTop;
p.Left = 0;
p.Width = Width;
p.Height = 48;
p.BackColor = SystemColors.Info;
p.BorderStyle = BorderStyle.FixedSingle;
p.ForeColor = SystemColors.InfoText;
PictureBox pb = new PictureBox();
pb.Width = 16;
pb.Height = 16;
pb.Left = 8;
pb.Top = 8;
pb.Image = loading ? Properties.Resources.Loader: Properties.Resources.Warning;
p.Controls.Add(pb);
Label l = new Label();
l.Left = 8 + 16 + 8;
l.Top = 10;
l.MinimumSize = new Size(Width - 32 - 8, 0);
l.MaximumSize = new Size(Width - 32 - 8, 640);
l.Width = l.MinimumSize.Width;
l.Height = 48;
l.Text = text;
l.AutoSize = true;
p.Controls.Add(l);
// resize panel
p.Height = 22 + l.Height;
Controls.SetChildIndex(p, 0);
warnings.Add(new Warning(p, pb, l));
lastTop = p.Bottom + 8;
resourceitems.Height = Height - lastTop - 32;
resourceitems.Top = lastTop;
}
private int GetWarningsHeight()
{
int lastTop = 0;
foreach (Warning w in warnings)
lastTop = Math.Max(lastTop, w.Wrapper.Bottom + 8);
return lastTop;
}
private void UpdateWarnings()
{
int lastH = GetWarningsHeight();
foreach (Warning w in warnings)
w.Wrapper.Dispose();
warnings.Clear();
resourceitems.Height = Height - 32;
resourceitems.Top = 0;
List<string> requiredarchives = new List<string>();
foreach (ListViewItem item in resourceitems.Items)
{
DataLocation loc = (DataLocation)item.Tag;
if (loc.requiredarchives != null)
requiredarchives.AddRange(loc.requiredarchives);
}
// warning 1: you do not have a required file
if (GameConfiguration != null)
{
foreach (RequiredArchive arc in GameConfiguration.RequiredArchives)
{
if (!requiredarchives.Contains(arc.ID))
ShowWarning(string.Format("Warning: a resource archive is required for this game configuration, but not present:\n \"{0}\"\nWithout it, UDB will have severely limited capabilities.", arc.FileName), false);
}
}
// warning 2: map without any resources. this makes sense only on map open dialog and not game configurations dialog
if (IsMapControl)
{
if (resourceitems.Items.Count == 0)
ShowWarning("Warning: you are about to edit a map without any resources.\nTextures, flats and sprites may not be shown correctly or may not show up at all.", false);
}
// warning 3: multiple instances of the same required file
if (GameConfiguration != null)
{
for (int i = 0; i < requiredarchives.Count; i++)
{
if (requiredarchives.IndexOf(requiredarchives[i]) != i)
{
foreach (RequiredArchive arc in GameConfiguration.RequiredArchives)
{
if (arc.ID == requiredarchives[i])
ShowWarning(string.Format("Warning: required archive was added more than once:\n \"{0}\"\nThis will most likely not work.", arc.FileName), false);
}
}
}
}
int h = GetWarningsHeight();
if (lastH != h && OnWarningsChanged != null)
{
OnWarningsChanged(h);
// possibly recalculate size
resourceitems.Height = Height - h - 32;
resourceitems.Top = h;
}
}
private void RefreshLoading()
{
resourceitems.BeginUpdate();
bool anyLoading = false;
foreach (ListViewItem item in resourceitems.Items)
{
DataLocation dl = (DataLocation)item.Tag;
if (IsLoading(dl.location))
{
item.ImageIndex = GetLoaderIndex();
anyLoading |= true;
}
else item.ImageIndex = GetIconIndex(dl.type, item.ForeColor != SystemColors.WindowText);
}
resourceitems.EndUpdate();
if (anyLoading)
{
foreach (Warning w in warnings)
w.Picture.Image = Properties.Resources.Loader;
}
else
{
foreach (Warning w in warnings)
w.Picture.Image = Properties.Resources.Warning;
}
}
private void CancelLoading(string location)
{
General.WriteLogLine(string.Format("Resource check cancelled for: {0}", location));
if (loadingrequiredarchives.ContainsKey(location))
{
loadingrequiredarchives[location].Cancel();
loadingrequiredarchives.Remove(location);
}
}
private bool IsLoading(string location)
{
return loadingrequiredarchives.ContainsKey(location);
}
private int GetLoaderIndex()
{
return 6;
}
// This will show a fixed list // This will show a fixed list
public void FixedResourceLocationList(DataLocationList list) public void FixedResourceLocationList(DataLocationList list)
@ -123,8 +412,11 @@ namespace CodeImp.DoomBuilder.Controls
for(int i = resourceitems.Items.Count - 1; i >= 0; i--) for(int i = resourceitems.Items.Count - 1; i >= 0; i--)
{ {
// Remove item if not fixed // Remove item if not fixed
if(resourceitems.Items[i].ForeColor != SystemColors.WindowText) if (resourceitems.Items[i].ForeColor != SystemColors.WindowText)
{
CancelLoading(((DataLocation)resourceitems.Items[i].Tag).location);
resourceitems.Items.RemoveAt(i); resourceitems.Items.RemoveAt(i);
}
else else
currentitems.Add((DataLocation)resourceitems.Items[i].Tag); //mxd currentitems.Add((DataLocation)resourceitems.Items[i].Tag); //mxd
} }
@ -138,17 +430,25 @@ namespace CodeImp.DoomBuilder.Controls
// Add item as fixed // Add item as fixed
resourceitems.Items.Insert(0, new ListViewItem(list[i].location)); resourceitems.Items.Insert(0, new ListViewItem(list[i].location));
resourceitems.Items[0].Tag = list[i]; resourceitems.Items[0].Tag = list[i];
resourceitems.Items[0].ImageIndex = GetIconIndex(list[i].type, true); resourceitems.Items[0].ImageIndex = IsLoading(list[i].location) ? GetLoaderIndex() : GetIconIndex(list[i].type, true);
// Set disabled // Set disabled
resourceitems.Items[0].ForeColor = SystemColors.GrayText; resourceitems.Items[0].ForeColor = SystemColors.GrayText;
// Validate path (mxd) // Validate path (mxd)
resourceitems.Items[0].BackColor = (list[i].IsValid() ? resourceitems.BackColor : Color.MistyRose); resourceitems.Items[0].BackColor = (list[i].IsValid() ? resourceitems.BackColor : Color.MistyRose);
// Check if resource has no info about membership in Game configuration's requiredarchives
// This normally happens if it was imported from old DBS or drag-dropped
if (list[i].requiredarchives == null)
StartRequiredArchivesCheck(list[i].location);
} }
// Done // Done
resourceitems.EndUpdate(); resourceitems.EndUpdate();
if (loadingrequiredarchives.Count == 0)
UpdateWarnings();
} }
// This will edit the given list // This will edit the given list
@ -165,8 +465,11 @@ namespace CodeImp.DoomBuilder.Controls
for(int i = resourceitems.Items.Count - 1; i >= 0; i--) for(int i = resourceitems.Items.Count - 1; i >= 0; i--)
{ {
// Remove item unless fixed // Remove item unless fixed
if(resourceitems.Items[i].ForeColor == SystemColors.WindowText) if (resourceitems.Items[i].ForeColor == SystemColors.WindowText)
{
CancelLoading(((DataLocation)resourceitems.Items[i].Tag).location);
resourceitems.Items.RemoveAt(i); resourceitems.Items.RemoveAt(i);
}
} }
// Go for all items // Go for all items
@ -176,6 +479,9 @@ namespace CodeImp.DoomBuilder.Controls
AddItem(dl); AddItem(dl);
} }
if (loadingrequiredarchives.Count == 0)
UpdateWarnings();
// Done // Done
resourceitems.EndUpdate(); resourceitems.EndUpdate();
ResizeColumnHeader(); ResizeColumnHeader();
@ -208,7 +514,7 @@ namespace CodeImp.DoomBuilder.Controls
int index = resourceitems.Items.Count; int index = resourceitems.Items.Count;
resourceitems.Items.Add(new ListViewItem(rl.location)); resourceitems.Items.Add(new ListViewItem(rl.location));
resourceitems.Items[index].Tag = rl; resourceitems.Items[index].Tag = rl;
resourceitems.Items[index].ImageIndex = GetIconIndex(rl.type, false); resourceitems.Items[index].ImageIndex = IsLoading(rl.location) ? GetLoaderIndex() : GetIconIndex(rl.type, false);
// Set normal color // Set normal color
resourceitems.Items[index].ForeColor = SystemColors.WindowText; resourceitems.Items[index].ForeColor = SystemColors.WindowText;
@ -218,6 +524,12 @@ namespace CodeImp.DoomBuilder.Controls
// Done // Done
resourceitems.EndUpdate(); resourceitems.EndUpdate();
// Check if resource has no info about membership in Game configuration's requiredarchives
// This normally happens if it was imported from old DBS or drag-dropped
if (rl.requiredarchives == null)
StartRequiredArchivesCheck(rl.location);
return true; return true;
} }
@ -240,6 +552,7 @@ namespace CodeImp.DoomBuilder.Controls
{ {
// Open resource options dialog // Open resource options dialog
ResourceOptionsForm resoptions = new ResourceOptionsForm(new DataLocation(), "Add Resource", StartPath); ResourceOptionsForm resoptions = new ResourceOptionsForm(new DataLocation(), "Add Resource", StartPath);
resoptions.GameConfiguration = GameConfiguration;
resoptions.StartPosition = FormStartPosition.Manual; resoptions.StartPosition = FormStartPosition.Manual;
Rectangle startposition = new Rectangle(dialogoffset.X, dialogoffset.Y, 1, 1); Rectangle startposition = new Rectangle(dialogoffset.X, dialogoffset.Y, 1, 1);
startposition = this.RectangleToScreen(startposition); startposition = this.RectangleToScreen(startposition);
@ -257,6 +570,9 @@ namespace CodeImp.DoomBuilder.Controls
General.Interface.DisplayStatus(StatusType.Warning, "Resource already added!"); //mxd General.Interface.DisplayStatus(StatusType.Warning, "Resource already added!"); //mxd
return; //mxd return; //mxd
} }
if (loadingrequiredarchives.Count == 0)
UpdateWarnings();
} }
// Raise content changed event // Raise content changed event
@ -274,6 +590,7 @@ namespace CodeImp.DoomBuilder.Controls
// Open resource options dialog // Open resource options dialog
ResourceOptionsForm resoptions = new ResourceOptionsForm((DataLocation)selecteditem.Tag, "Resource Options", StartPath); ResourceOptionsForm resoptions = new ResourceOptionsForm((DataLocation)selecteditem.Tag, "Resource Options", StartPath);
resoptions.GameConfiguration = GameConfiguration;
resoptions.StartPosition = FormStartPosition.Manual; resoptions.StartPosition = FormStartPosition.Manual;
Rectangle startposition = new Rectangle(dialogoffset.X, dialogoffset.Y, 1, 1); Rectangle startposition = new Rectangle(dialogoffset.X, dialogoffset.Y, 1, 1);
startposition = this.RectangleToScreen(startposition); startposition = this.RectangleToScreen(startposition);
@ -292,13 +609,20 @@ namespace CodeImp.DoomBuilder.Controls
DataLocation rl = resoptions.ResourceLocation; DataLocation rl = resoptions.ResourceLocation;
selecteditem.Text = rl.location; selecteditem.Text = rl.location;
selecteditem.Tag = rl; selecteditem.Tag = rl;
selecteditem.ImageIndex = GetIconIndex(rl.type, false); selecteditem.ImageIndex = IsLoading(rl.location) ? GetLoaderIndex() : GetIconIndex(rl.type, false);
// Done // Done
resourceitems.EndUpdate(); resourceitems.EndUpdate();
// Check if resource has no info about membership in Game configuration's requiredarchives
// This normally happens if it was imported from old DBS or drag-dropped
if (rl.requiredarchives == null)
StartRequiredArchivesCheck(rl.location);
else if (loadingrequiredarchives.Count == 0)
UpdateWarnings();
// Raise content changed event // Raise content changed event
if(OnContentChanged != null) OnContentChanged(); if (OnContentChanged != null) OnContentChanged();
} }
} }
} }
@ -402,19 +726,19 @@ namespace CodeImp.DoomBuilder.Controls
{ {
case ".wad": case ".wad":
case ".iwad": case ".iwad":
if(AddItem(new DataLocation(DataLocation.RESOURCE_WAD, path, false, false, false))) addedfiles++; if(AddItem(new DataLocation(DataLocation.RESOURCE_WAD, path, false, false, false, null))) addedfiles++;
break; break;
case ".pk7": case ".pk7":
case ".pk3": case ".pk3":
case ".ipk3": case ".ipk3":
case ".ipk7": case ".ipk7":
if(AddItem(new DataLocation(DataLocation.RESOURCE_PK3, path, false, false, false))) addedfiles++; if(AddItem(new DataLocation(DataLocation.RESOURCE_PK3, path, false, false, false, null))) addedfiles++;
break; break;
} }
} }
else if(Directory.Exists(path)) else if(Directory.Exists(path))
{ {
if(AddItem(new DataLocation(DataLocation.RESOURCE_DIRECTORY, path, false, false, false))) addedfiles++; if(AddItem(new DataLocation(DataLocation.RESOURCE_DIRECTORY, path, false, false, false, null))) addedfiles++;
} }
} }
@ -424,9 +748,12 @@ namespace CodeImp.DoomBuilder.Controls
return; return;
} }
} }
if (loadingrequiredarchives.Count == 0)
UpdateWarnings();
// Raise content changed event // Raise content changed event
if(OnContentChanged != null) OnContentChanged(); if (OnContentChanged != null) OnContentChanged();
} }
// Client size changed // Client size changed
@ -469,8 +796,11 @@ namespace CodeImp.DoomBuilder.Controls
// Display notification // Display notification
General.Interface.DisplayStatus(StatusType.Info, pastedcount + " Resource" + (pastedcount > 1 ? "s" : "") + " Pasted"); General.Interface.DisplayStatus(StatusType.Info, pastedcount + " Resource" + (pastedcount > 1 ? "s" : "") + " Pasted");
if (loadingrequiredarchives.Count == 0)
UpdateWarnings();
// Raise content changed event // Raise content changed event
if(OnContentChanged != null) OnContentChanged(); if (OnContentChanged != null) OnContentChanged();
} }
} }
@ -500,8 +830,11 @@ namespace CodeImp.DoomBuilder.Controls
// Display notification // Display notification
General.Interface.DisplayStatus(StatusType.Info, pastedcount + " Resource" + (pastedcount > 1 ? "s" : "") + " Replaced"); General.Interface.DisplayStatus(StatusType.Info, pastedcount + " Resource" + (pastedcount > 1 ? "s" : "") + " Replaced");
if (loadingrequiredarchives.Count == 0)
UpdateWarnings();
// Raise content changed event // Raise content changed event
if(OnContentChanged != null) OnContentChanged(); if (OnContentChanged != null) OnContentChanged();
} }
} }
@ -519,8 +852,11 @@ namespace CodeImp.DoomBuilder.Controls
ResizeColumnHeader(); ResizeColumnHeader();
if (loadingrequiredarchives.Count == 0)
UpdateWarnings();
// Raise content changed event // Raise content changed event
if(OnContentChanged != null) OnContentChanged(); if (OnContentChanged != null) OnContentChanged();
} }
#endregion #endregion
@ -579,29 +915,5 @@ namespace CodeImp.DoomBuilder.Controls
} }
#endregion #endregion
}
#region ================== Events (mxd)
//mxd. Because anchor-based alignment fails when using high-Dpi settings...
private void ResourceListEditor_Resize(object sender, EventArgs e)
{
resourceitems.Width = this.Width;
resourceitems.Height = this.Height - addresource.Height - addresource.Margin.Top - addresource.Margin.Bottom;
addresource.Top = resourceitems.Bottom + addresource.Margin.Top;
editresource.Top = addresource.Top;
deleteresources.Top = addresource.Top;
int buttonwidth = (this.Width - addresource.Margin.Left * 2) / 3;
addresource.Width = buttonwidth;
editresource.Width = buttonwidth;
deleteresources.Width = buttonwidth;
addresource.Left = 0;
editresource.Left = addresource.Right + addresource.Margin.Left;
deleteresources.Left = editresource.Right + addresource.Margin.Left;
}
#endregion
}
} }

View file

@ -112,120 +112,142 @@
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="copypastemenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="copypastemenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>195, 17</value> <value>195, 17</value>
</metadata> </metadata>
<metadata name="images.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="images.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<data name="images.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="images.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
<value> <value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAi ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAs
FgAAAk1TRnQBSQFMAgEBBgEAAZwBAAGcAQABEAEAARABAA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BwHAASMBAAEHAQAB/wHAAQcBwAEjAQAB/wGBAf8BwAEHAYABAQGBA/8BwAEHAcABAQb/AeABAwL/
Cw==
</value> </value>
</data> </data>
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
</root> </root>

View file

@ -17,6 +17,7 @@
#region ================== Namespaces #region ================== Namespaces
using System; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
#endregion #endregion
@ -38,9 +39,10 @@ namespace CodeImp.DoomBuilder.Data
public bool option1; public bool option1;
public bool option2; public bool option2;
public bool notfortesting; public bool notfortesting;
public List<string> requiredarchives;
// Constructor // Constructor
public DataLocation(int type, string location, bool option1, bool option2, bool notfortesting) public DataLocation(int type, string location, bool option1, bool option2, bool notfortesting, List<string> requiredarchives)
{ {
// Initialize // Initialize
this.type = type; this.type = type;
@ -50,10 +52,11 @@ namespace CodeImp.DoomBuilder.Data
this.option2 = option2; this.option2 = option2;
this.notfortesting = notfortesting; this.notfortesting = notfortesting;
this.name = string.Empty; //mxd this.name = string.Empty; //mxd
this.requiredarchives = requiredarchives;
} }
//mxd. Constructor for WADs inside of PK3s //mxd. Constructor for WADs inside of PK3s
internal DataLocation(int type, string location, string initiallocation, bool option1, bool option2, bool notfortesting) internal DataLocation(int type, string location, string initiallocation, bool option1, bool option2, bool notfortesting, List<string> requiredarchives)
{ {
// Initialize // Initialize
this.type = type; this.type = type;
@ -62,7 +65,8 @@ namespace CodeImp.DoomBuilder.Data
this.option1 = option1; this.option1 = option1;
this.option2 = option2; this.option2 = option2;
this.notfortesting = notfortesting; this.notfortesting = notfortesting;
this.name = string.Empty; this.name = string.Empty;
this.requiredarchives = requiredarchives;
} }
// This displays the struct as string // This displays the struct as string

View file

@ -20,6 +20,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized; using System.Collections.Specialized;
using System.Globalization; using System.Globalization;
using System.Linq;
using CodeImp.DoomBuilder.IO; using CodeImp.DoomBuilder.IO;
#endregion #endregion
@ -61,6 +62,9 @@ namespace CodeImp.DoomBuilder.Data
if(rlinfo.Contains("option2") && (rlinfo["option2"] is int)) res.option2 = General.Int2Bool((int)rlinfo["option2"]); if(rlinfo.Contains("option2") && (rlinfo["option2"] is int)) res.option2 = General.Int2Bool((int)rlinfo["option2"]);
if(rlinfo.Contains("notfortesting") && (rlinfo["notfortesting"] is int)) res.notfortesting = General.Int2Bool((int)rlinfo["notfortesting"]); if(rlinfo.Contains("notfortesting") && (rlinfo["notfortesting"] is int)) res.notfortesting = General.Int2Bool((int)rlinfo["notfortesting"]);
if (rlinfo.Contains("requiredarchives") && rlinfo["requiredarchives"] is string) res.requiredarchives = ((string)rlinfo["requiredarchives"]).Split(',').ToList();
else res.requiredarchives = null;
// Add resource // Add resource
Add(res); Add(res);
} }
@ -101,6 +105,8 @@ namespace CodeImp.DoomBuilder.Data
rlinfo.Add("option2", General.Bool2Int(this[i].option2)); rlinfo.Add("option2", General.Bool2Int(this[i].option2));
rlinfo.Add("notfortesting", General.Bool2Int(this[i].notfortesting)); rlinfo.Add("notfortesting", General.Bool2Int(this[i].notfortesting));
if (this[i].requiredarchives != null) rlinfo.Add("requiredarchives", string.Join(",", this[i].requiredarchives.ToArray()));
// Add structure // Add structure
resinfo.Add("resource" + i.ToString(CultureInfo.InvariantCulture), rlinfo); resinfo.Add("resource" + i.ToString(CultureInfo.InvariantCulture), rlinfo);
} }

View file

@ -39,6 +39,7 @@ using CodeImp.DoomBuilder.ZDoom;
using Matrix = CodeImp.DoomBuilder.Rendering.Matrix; using Matrix = CodeImp.DoomBuilder.Rendering.Matrix;
using CodeImp.DoomBuilder.Controls; using CodeImp.DoomBuilder.Controls;
using CodeImp.DoomBuilder.Dehacked; using CodeImp.DoomBuilder.Dehacked;
using System.Diagnostics;
#endregion #endregion
@ -132,7 +133,6 @@ namespace CodeImp.DoomBuilder.Data
// Things combined with things created from Decorate // Things combined with things created from Decorate
private DecorateParser decorate; private DecorateParser decorate;
private ZScriptParser zscript; private ZScriptParser zscript;
private Dictionary<DataReader, ICollection<string>> classesbyarchive;
private Dictionary<string, ActorStructure> zdoomclasses; private Dictionary<string, ActorStructure> zdoomclasses;
private List<ThingCategory> thingcategories; private List<ThingCategory> thingcategories;
private Dictionary<int, ThingTypeInfo> thingtypes; private Dictionary<int, ThingTypeInfo> thingtypes;
@ -324,29 +324,6 @@ namespace CodeImp.DoomBuilder.Data
Load(configlistcopy, maplistcopy); Load(configlistcopy, maplistcopy);
} }
// This is used in Load to check for erroneous configuration
private bool MatchRequiredArchive(DataReader dr, RequiredArchive arc)
{
foreach (RequiredArchiveEntry e in arc.Entries)
{
if (e.Class != null && (!classesbyarchive.ContainsKey(dr) || !classesbyarchive[dr].Contains(e.Class.ToLowerInvariant())))
{
ICollection<string> coll = null;
classesbyarchive.TryGetValue(dr, out coll);
DebugConsole.WriteLine(string.Format("Class {0} does not exist in {1} (classes: {2})", e.Class, dr.GetTitle(), coll != null ? string.Join("; ", coll) : null));
return false;
}
if (e.Lump != null && !dr.FileExists(e.Lump))
{
DebugConsole.WriteLine(string.Format("File {0} does not exist in {1}", e.Lump, dr.GetTitle()));
return false;
}
}
return true;
}
// This loads all data resources // This loads all data resources
internal void Load(DataLocationList configlist, DataLocationList maplist) internal void Load(DataLocationList configlist, DataLocationList maplist)
{ {
@ -383,8 +360,6 @@ namespace CodeImp.DoomBuilder.Data
cvars = new CvarsCollection(); cvars = new CvarsCollection();
ambientsounds = new Dictionary<int, AmbientSoundInfo>(); ambientsounds = new Dictionary<int, AmbientSoundInfo>();
classesbyarchive = new Dictionary<DataReader, ICollection<string>>();
// Load texture sets // Load texture sets
foreach(DefinedTextureSet ts in General.Map.ConfigSettings.TextureSets) foreach(DefinedTextureSet ts in General.Map.ConfigSettings.TextureSets)
texturesets.Add(new MatchingTextureSet(ts)); texturesets.Add(new MatchingTextureSet(ts));
@ -413,7 +388,7 @@ namespace CodeImp.DoomBuilder.Data
try try
{ {
// Choose container type // Choose container type
switch(dl.type) switch (dl.type)
{ {
//mxd. Load resource in read-only mode if: //mxd. Load resource in read-only mode if:
// 1. UseResourcesInReadonlyMode map option is set. // 1. UseResourcesInReadonlyMode map option is set.
@ -423,10 +398,10 @@ namespace CodeImp.DoomBuilder.Data
// WAD file container // WAD file container
case DataLocation.RESOURCE_WAD: case DataLocation.RESOURCE_WAD:
c = new WADReader(dl, true); c = new WADReader(dl, General.Map.Config, true);
if(((WADReader)c).WadFile.IsOfficialIWAD) //mxd if (((WADReader)c).WadFile.IsOfficialIWAD) //mxd
{ {
if(!string.IsNullOrEmpty(prevofficialiwad)) if (!string.IsNullOrEmpty(prevofficialiwad))
General.ErrorLogger.Add(ErrorType.Warning, "Using more than one official IWAD as a resource is not recommended. Consider removing \"" + prevofficialiwad + "\" or \"" + dl.GetDisplayName() + "\"."); General.ErrorLogger.Add(ErrorType.Warning, "Using more than one official IWAD as a resource is not recommended. Consider removing \"" + prevofficialiwad + "\" or \"" + dl.GetDisplayName() + "\".");
prevofficialiwad = dl.GetDisplayName(); prevofficialiwad = dl.GetDisplayName();
} }
@ -434,22 +409,22 @@ namespace CodeImp.DoomBuilder.Data
// Directory container // Directory container
case DataLocation.RESOURCE_DIRECTORY: case DataLocation.RESOURCE_DIRECTORY:
c = new DirectoryReader(dl, true); c = new DirectoryReader(dl, General.Map.Config, true);
break; break;
// PK3 file container // PK3 file container
case DataLocation.RESOURCE_PK3: case DataLocation.RESOURCE_PK3:
c = new PK3Reader(dl, true); c = new PK3Reader(dl, General.Map.Config, true);
break; break;
} }
} }
catch(Exception e) catch (Exception e)
{ {
// Unable to load resource // Unable to load resource
General.ErrorLogger.Add(ErrorType.Error, "Unable to load resources from location \"" + dl.location + "\". Please make sure the location is accessible and not in use by another program. The resources will now be loaded with this location excluded. You may reload the resources to try again.\n" + e.GetType().Name + " when creating data reader: " + e.Message); General.ErrorLogger.Add(ErrorType.Error, "Unable to load resources from location \"" + dl.location + "\". Please make sure the location is accessible and not in use by another program. The resources will now be loaded with this location excluded. You may reload the resources to try again.\n" + e.GetType().Name + " when creating data reader: " + e.Message);
General.WriteLogLine(e.StackTrace); General.WriteLogLine(e.StackTrace);
continue; continue;
} }
// Add container // Add container
if(c != null) if(c != null)
@ -645,36 +620,6 @@ namespace CodeImp.DoomBuilder.Data
gldefsentries.Count + " dynamic light definitions, " + gldefsentries.Count + " dynamic light definitions, " +
glowingflats.Count + " glowing flat definitions, " + skyboxes.Count + " skybox definitions, " + glowingflats.Count + " glowing flat definitions, " + skyboxes.Count + " skybox definitions, " +
reverbs.Count + " sound environment definitions"); reverbs.Count + " sound environment definitions");
// [ZZ] Error out if a required archive is not present.
foreach (RequiredArchive arc in General.Map.Config.RequiredArchives)
{
bool found = false;
foreach (DataReader dr in containers)
{
if (MatchRequiredArchive(dr, arc))
{
found = true;
break;
}
}
#if !DEBUG
if (!found)
{
string err = string.Format("A file that is required for this game configuration ({0}) was not found. The map is loaded with limited functionality.\n\nPlease check that this file is in the resources list.", arc.FileName);
if (arc.ExcludeFromTesting)
err += "\n\nNOTE: This archive needs to be excluded from testing.";
MessageBox.Show(
err,
Application.ProductName,
MessageBoxButtons.OK, MessageBoxIcon.Warning
);
General.ErrorLogger.Add(ErrorType.Error, err);
}
#endif
}
} }
// This unloads all data // This unloads all data
@ -1782,33 +1727,32 @@ namespace CodeImp.DoomBuilder.Data
{ {
// Load Decorate info cumulatively (the last Decorate is added to the previous) // Load Decorate info cumulatively (the last Decorate is added to the previous)
// I'm not sure if this is the right thing to do though. // I'm not sure if this is the right thing to do though.
long t = DateTimeOffset.Now.ToUnixTimeMilliseconds(); Stopwatch t = new Stopwatch();
t.Start();
currentreader = dr; currentreader = dr;
IEnumerable<TextResourceData> streams = dr.GetDecorateData("ZSCRIPT"); foreach (TextResourceData data in dr.GetZScriptData("ZSCRIPT"))
foreach (TextResourceData data in streams)
{ {
// Parse the data // Parse the data
data.Stream.Seek(0, SeekOrigin.Begin); data.Stream.Seek(0, SeekOrigin.Begin);
zscript.Parse(data, true); zscript.Parse(data, true);
if (!classesbyarchive.ContainsKey(dr)) classesbyarchive[dr] = new HashSet<string>();
foreach (string cls in zscript.LastClasses)
classesbyarchive[dr].Add(cls);
//mxd. DECORATE lumps are interdepandable. Can't carry on... //mxd. DECORATE lumps are interdepandable. Can't carry on...
if (zscript.HasError) if (zscript.HasError)
{ {
zscript.LogError(); zscript.LogError();
break; break;
} }
} }
DebugConsole.WriteLine(string.Format("Loading ZScript lumps from {0} took {1}ms", DateTimeOffset.Now.ToUnixTimeMilliseconds() - t)); DebugConsole.WriteLine(string.Format("Loading ZScript lumps from {0} took {1}ms", dr.Location.location, t.ElapsedMilliseconds));
} }
Stopwatch t2 = new Stopwatch();
t2.Start();
zscript.Finalize(); zscript.Finalize();
if (zscript.HasError) DebugConsole.WriteLine(string.Format("Finalizing ZScript lumps took {0}ms", t2.ElapsedMilliseconds));
if (zscript.HasError)
zscript.LogError(); zscript.LogError();
//mxd. Add to text resources collection //mxd. Add to text resources collection
@ -1835,17 +1779,12 @@ namespace CodeImp.DoomBuilder.Data
// Load Decorate info cumulatively (the last Decorate is added to the previous) // Load Decorate info cumulatively (the last Decorate is added to the previous)
// I'm not sure if this is the right thing to do though. // I'm not sure if this is the right thing to do though.
currentreader = dr; currentreader = dr;
IEnumerable<TextResourceData> decostreams = dr.GetDecorateData("DECORATE"); foreach(TextResourceData data in dr.GetDecorateData("DECORATE"))
foreach(TextResourceData data in decostreams)
{ {
// Parse the data // Parse the data
data.Stream.Seek(0, SeekOrigin.Begin); data.Stream.Seek(0, SeekOrigin.Begin);
decorate.Parse(data, true); decorate.Parse(data, true);
if (!classesbyarchive.ContainsKey(dr)) classesbyarchive[dr] = new HashSet<string>();
foreach (string cls in decorate.LastClasses)
classesbyarchive[dr].Add(cls);
//mxd. DECORATE lumps are interdepandable. Can't carry on... //mxd. DECORATE lumps are interdepandable. Can't carry on...
if (decorate.HasError) if (decorate.HasError)
{ {

View file

@ -38,20 +38,20 @@ namespace CodeImp.DoomBuilder.Data
#region ================== Constructor / Disposer #region ================== Constructor / Disposer
// Constructor // Constructor
public DirectoryReader(DataLocation dl, bool asreadonly) : base(dl, asreadonly) public DirectoryReader(DataLocation dl, GameConfiguration config, bool asreadonly) : base(dl, asreadonly)
{ {
General.WriteLogLine("Opening directory resource \"" + location.location + "\""); General.WriteLogLine("Opening directory resource \"" + location.location + "\"");
// Initialize // Initialize
files = new DirectoryFilesList(dl.location, true); files = new DirectoryFilesList(dl.location, config, true);
Initialize(); Initialize(config);
// We have no destructor // We have no destructor
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
} }
//mxd. Don't move directory wads anywhere //mxd. Don't move directory wads anywhere
protected override void Initialize() protected override void Initialize(GameConfiguration config)
{ {
// Load all WAD files in the root as WAD resources // Load all WAD files in the root as WAD resources
string[] wadfiles = GetWadFiles(); string[] wadfiles = GetWadFiles();
@ -62,8 +62,8 @@ namespace CodeImp.DoomBuilder.Data
string wadfilepath = Path.Combine(location.location, wadfile); string wadfilepath = Path.Combine(location.location, wadfile);
if(General.Map.FilePathName != wadfilepath) if(General.Map.FilePathName != wadfilepath)
{ {
DataLocation wdl = new DataLocation(DataLocation.RESOURCE_WAD, wadfilepath, false, false, true); DataLocation wdl = new DataLocation(DataLocation.RESOURCE_WAD, wadfilepath, false, false, true, null);
wads.Add(new WADReader(wdl, isreadonly) { ParentResource = this } ); wads.Add(new WADReader(wdl, config, isreadonly) { ParentResource = this } );
} }
} }
} }
@ -146,7 +146,7 @@ namespace CodeImp.DoomBuilder.Data
} }
catch(Exception e) catch(Exception e)
{ {
General.ErrorLogger.Add(ErrorType.Error, e.GetType().Name + " while loading patch \"" + pname + "\" from directory: " + e.Message); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, e.GetType().Name + " while loading patch \"" + pname + "\" from directory: " + e.Message);
} }
// Nothing found // Nothing found
@ -197,7 +197,7 @@ namespace CodeImp.DoomBuilder.Data
} }
catch(Exception e) catch(Exception e)
{ {
General.ErrorLogger.Add(ErrorType.Error, e.GetType().Name + " while loading texture \"" + pname + "\" from directory: " + e.Message); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, e.GetType().Name + " while loading texture \"" + pname + "\" from directory: " + e.Message);
} }
// Nothing found // Nothing found
@ -230,7 +230,7 @@ namespace CodeImp.DoomBuilder.Data
} }
catch(Exception e) catch(Exception e)
{ {
General.ErrorLogger.Add(ErrorType.Error, e.GetType().Name + " while loading HiRes texture \"" + name + "\" from directory: " + e.Message); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, e.GetType().Name + " while loading HiRes texture \"" + name + "\" from directory: " + e.Message);
} }
// Nothing found // Nothing found
@ -263,7 +263,7 @@ namespace CodeImp.DoomBuilder.Data
} }
catch(Exception e) catch(Exception e)
{ {
General.ErrorLogger.Add(ErrorType.Error, e.GetType().Name + " while loading colormap \"" + pname + "\" from directory: " + e.Message); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, e.GetType().Name + " while loading colormap \"" + pname + "\" from directory: " + e.Message);
} }
// Nothing found // Nothing found
@ -300,7 +300,7 @@ namespace CodeImp.DoomBuilder.Data
} }
catch(Exception e) catch(Exception e)
{ {
General.ErrorLogger.Add(ErrorType.Error, e.GetType().Name + " while loading sprite \"" + pname + "\" from directory: " + e.Message); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, e.GetType().Name + " while loading sprite \"" + pname + "\" from directory: " + e.Message);
} }
// Nothing found // Nothing found
@ -331,7 +331,7 @@ namespace CodeImp.DoomBuilder.Data
} }
catch(Exception e) catch(Exception e)
{ {
General.ErrorLogger.Add(ErrorType.Error, e.GetType().Name + " while checking sprite \"" + pname + "\" existance in directory: " + e.Message); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, e.GetType().Name + " while checking sprite \"" + pname + "\" existance in directory: " + e.Message);
} }
// Nothing found // Nothing found
@ -368,7 +368,7 @@ namespace CodeImp.DoomBuilder.Data
} }
catch(Exception e) catch(Exception e)
{ {
General.ErrorLogger.Add(ErrorType.Error, e.GetType().Name + " while loading voxel \"" + name + "\" from directory: " + e.Message); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, e.GetType().Name + " while loading voxel \"" + name + "\" from directory: " + e.Message);
} }
// Nothing found // Nothing found
@ -471,7 +471,7 @@ namespace CodeImp.DoomBuilder.Data
if(casecorrectfilename == null) if(casecorrectfilename == null)
{ {
General.ErrorLogger.Add(ErrorType.Error, "Unable to load file " + filename + ": file doesn't exist"); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, "Unable to load file " + filename + ": file doesn't exist");
return null; return null;
} }
@ -484,7 +484,7 @@ namespace CodeImp.DoomBuilder.Data
} }
catch(Exception e) catch(Exception e)
{ {
General.ErrorLogger.Add(ErrorType.Error, "Unable to load file: " + e.Message); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, "Unable to load file: " + e.Message);
} }
return s; return s;
} }
@ -504,7 +504,7 @@ namespace CodeImp.DoomBuilder.Data
} }
catch(Exception e) catch(Exception e)
{ {
General.ErrorLogger.Add(ErrorType.Error, "Unable to save file: " + e.Message); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, "Unable to save file: " + e.Message);
return false; return false;
} }

View file

@ -68,17 +68,18 @@ namespace CodeImp.DoomBuilder.Data
#region ================== Constructor / Disposer #region ================== Constructor / Disposer
// Constructor // Constructor
public PK3Reader(DataLocation dl, bool asreadonly) : base(dl, asreadonly) public PK3Reader(DataLocation dl, GameConfiguration config, bool asreadonly) : base(dl, asreadonly)
{ {
LoadFrom(dl, asreadonly); LoadFrom(dl, config, asreadonly);
} }
private void LoadFrom(DataLocation dl, bool asreadonly) private void LoadFrom(DataLocation dl, GameConfiguration config, bool asreadonly)
{ {
FileAccess access; FileAccess access;
FileShare share; FileShare share;
isreadonly = asreadonly; isreadonly = asreadonly;
config = config;
// Determine if opening for read only // Determine if opening for read only
if (isreadonly) if (isreadonly)
@ -143,10 +144,10 @@ namespace CodeImp.DoomBuilder.Data
filestream = null; filestream = null;
// Make files list // Make files list
files = new DirectoryFilesList(dl.GetDisplayName(), fileentries); files = new DirectoryFilesList(dl.GetDisplayName(), config, Silent, fileentries);
// Initialize without path (because we use paths relative to the PK3 file) // Initialize without path (because we use paths relative to the PK3 file)
Initialize(); Initialize(config);
// We have no destructor // We have no destructor
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
@ -589,7 +590,7 @@ namespace CodeImp.DoomBuilder.Data
catch(SharpCompress.Compressors.Deflate.ZlibException) catch(SharpCompress.Compressors.Deflate.ZlibException)
{ {
// This happens when the PK3 was modified externally and the resources were not reloaded // This happens when the PK3 was modified externally and the resources were not reloaded
General.ErrorLogger.Add(ErrorType.Error, "Cannot load the file \"" + filename + "\" from archive \"" + location.GetDisplayName() + "\". Did you modify the archive without reloading the resouces?"); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, "Cannot load the file \"" + filename + "\" from archive \"" + location.GetDisplayName() + "\". Did you modify the archive without reloading the resouces?");
filedata.Dispose(); filedata.Dispose();
filedata = null; filedata = null;
@ -598,7 +599,7 @@ namespace CodeImp.DoomBuilder.Data
} }
catch(NotSupportedException e) catch(NotSupportedException e)
{ {
General.ErrorLogger.Add(ErrorType.Error, "Cannot load the file \"" + filename + "\" from archive \"" + location.GetDisplayName() + "\". " + e.Message); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, "Cannot load the file \"" + filename + "\" from archive \"" + location.GetDisplayName() + "\". " + e.Message);
filedata.Dispose(); filedata.Dispose();
filedata = null; filedata = null;
@ -618,7 +619,7 @@ namespace CodeImp.DoomBuilder.Data
if(filedata == null) if(filedata == null)
{ {
//mxd //mxd
General.ErrorLogger.Add(ErrorType.Error, "Cannot find the file \"" + filename + "\" in archive \"" + location.GetDisplayName() + "\"."); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, "Cannot find the file \"" + filename + "\" in archive \"" + location.GetDisplayName() + "\".");
return null; return null;
} }
@ -656,7 +657,7 @@ namespace CodeImp.DoomBuilder.Data
+ ", started at " + checkresult.Processes[0].StartTime + ")."; + ", started at " + checkresult.Processes[0].StartTime + ").";
} }
General.ErrorLogger.Add(ErrorType.Error, errmsg); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, errmsg);
return false; return false;
} }
@ -667,7 +668,7 @@ namespace CodeImp.DoomBuilder.Data
if(za == null) if(za == null)
{ {
string errmsg = "Unable to save file \"" + filename + "\" into archive \"" + location.GetDisplayName() + "\". Unable to open target file as a zip archive."; string errmsg = "Unable to save file \"" + filename + "\" into archive \"" + location.GetDisplayName() + "\". Unable to open target file as a zip archive.";
General.ErrorLogger.Add(ErrorType.Error, errmsg); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, errmsg);
return false; return false;
} }
@ -720,7 +721,7 @@ namespace CodeImp.DoomBuilder.Data
case 60: case 60:
case 62: case 62:
case 124: case 124:
General.ErrorLogger.Add(ErrorType.Error, "Error in \"" + location.GetDisplayName() + "\": unsupported character \"" + c + "\" in path \"" + path + "\". File loading was skipped."); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, "Error in \"" + location.GetDisplayName() + "\": unsupported character \"" + c + "\" in path \"" + path + "\". File loading was skipped.");
return false; return false;
default: default:

View file

@ -38,11 +38,14 @@ namespace CodeImp.DoomBuilder.Data
protected const string COLORMAPS_DIR = "colormaps"; protected const string COLORMAPS_DIR = "colormaps";
protected const string GRAPHICS_DIR = "graphics"; //mxd protected const string GRAPHICS_DIR = "graphics"; //mxd
protected const string VOXELS_DIR = "voxels"; //mxd protected const string VOXELS_DIR = "voxels"; //mxd
#endregion #endregion
#region ================== Variables #region ================== Variables
// Optional setting
public bool Silent = false;
// Source // Source
protected readonly bool roottextures; protected readonly bool roottextures;
protected readonly bool rootflats; protected readonly bool rootflats;
@ -70,7 +73,7 @@ namespace CodeImp.DoomBuilder.Data
} }
// Call this to initialize this class // Call this to initialize this class
protected virtual void Initialize() protected virtual void Initialize(GameConfiguration config)
{ {
// [ZZ] we can have wad files already. dispose if any. // [ZZ] we can have wad files already. dispose if any.
if (wads != null) foreach (WADReader wr in wads) wr.Dispose(); if (wads != null) foreach (WADReader wr in wads) wr.Dispose();
@ -80,8 +83,8 @@ namespace CodeImp.DoomBuilder.Data
foreach(string w in wadfiles) foreach(string w in wadfiles)
{ {
string tempfile = CreateTempFile(w); string tempfile = CreateTempFile(w);
DataLocation wdl = new DataLocation(DataLocation.RESOURCE_WAD, tempfile, Path.Combine(location.GetDisplayName(), Path.GetFileName(w)), false, false, true); DataLocation wdl = new DataLocation(DataLocation.RESOURCE_WAD, tempfile, Path.Combine(location.GetDisplayName(), Path.GetFileName(w)), false, false, true, new List<string>());
wads.Add(new WADReader(wdl, location.type != DataLocation.RESOURCE_DIRECTORY) { ParentResource = this } ); wads.Add(new WADReader(wdl, config, location.type != DataLocation.RESOURCE_DIRECTORY) { ParentResource = this } );
} }
} }
@ -144,7 +147,7 @@ namespace CodeImp.DoomBuilder.Data
if(stream.Length > 767) //mxd if(stream.Length > 767) //mxd
palette = new Playpal(stream); palette = new Playpal(stream);
else else
General.ErrorLogger.Add(ErrorType.Warning, "Warning: invalid palette \"" + foundfile + "\""); if (!Silent) General.ErrorLogger.Add(ErrorType.Warning, "Warning: invalid palette \"" + foundfile + "\"");
stream.Dispose(); stream.Dispose();
} }
@ -175,7 +178,7 @@ namespace CodeImp.DoomBuilder.Data
if(stream.Length >= 256) //mxd if(stream.Length >= 256) //mxd
colormap = new ColorMap(stream, palette); colormap = new ColorMap(stream, palette);
else else
General.ErrorLogger.Add(ErrorType.Warning, "Warning: invalid colormap \"" + foundfile + "\""); if (!Silent) General.ErrorLogger.Add(ErrorType.Warning, "Warning: invalid colormap \"" + foundfile + "\"");
stream.Dispose(); stream.Dispose();
} }
@ -217,7 +220,7 @@ namespace CodeImp.DoomBuilder.Data
if((texture1file != null) && FileExists(texture1file)) if((texture1file != null) && FileExists(texture1file))
{ {
MemoryStream filedata = LoadFile(texture1file); MemoryStream filedata = LoadFile(texture1file);
WADReader.LoadTextureSet("TEXTURE1", filedata, ref imgset, pnames); WADReader.LoadTextureSet("TEXTURE1", filedata, ref imgset, pnames, Silent);
filedata.Dispose(); filedata.Dispose();
} }
@ -226,7 +229,7 @@ namespace CodeImp.DoomBuilder.Data
if((texture2file != null) && FileExists(texture2file)) if((texture2file != null) && FileExists(texture2file))
{ {
MemoryStream filedata = LoadFile(texture2file); MemoryStream filedata = LoadFile(texture2file);
WADReader.LoadTextureSet("TEXTURE2", filedata, ref imgset, pnames); WADReader.LoadTextureSet("TEXTURE2", filedata, ref imgset, pnames, Silent);
filedata.Dispose(); filedata.Dispose();
} }
@ -282,7 +285,7 @@ namespace CodeImp.DoomBuilder.Data
if(string.IsNullOrEmpty(Path.GetFileNameWithoutExtension(f))) if(string.IsNullOrEmpty(Path.GetFileNameWithoutExtension(f)))
{ {
// Can't load image without name // Can't load image without name
General.ErrorLogger.Add(ErrorType.Error, "Can't load an unnamed HiRes texture from \"" + Path.Combine(this.location.GetDisplayName(), HIRES_DIR) + "\". Please consider giving names to your resources."); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, "Can't load an unnamed HiRes texture from \"" + Path.Combine(this.location.GetDisplayName(), HIRES_DIR) + "\". Please consider giving names to your resources.");
} }
else else
{ {
@ -813,7 +816,7 @@ namespace CodeImp.DoomBuilder.Data
if(string.IsNullOrEmpty(Path.GetFileNameWithoutExtension(f))) if(string.IsNullOrEmpty(Path.GetFileNameWithoutExtension(f)))
{ {
// Can't load image without name // Can't load image without name
General.ErrorLogger.Add(ErrorType.Error, "Can't load an unnamed texture from \"" + path + "\". Please consider giving names to your resources."); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, "Can't load an unnamed texture from \"" + path + "\". Please consider giving names to your resources.");
} }
else else
{ {
@ -843,7 +846,7 @@ namespace CodeImp.DoomBuilder.Data
} }
else else
{ {
General.ErrorLogger.Add(ErrorType.Warning, "Unable to load " + type + " file \"" + fullname + "\""); if (!Silent) General.ErrorLogger.Add(ErrorType.Warning, "Unable to load " + type + " file \"" + fullname + "\"");
return new string[0]; return new string[0];
} }
} }

View file

@ -25,7 +25,7 @@ namespace CodeImp.DoomBuilder.Data.Scripting
target.Items.Clear(); target.Items.Clear();
AcsParserSE parser = new AcsParserSE { AddArgumentsToScriptNames = true, IsMapScriptsLump = tab is ScriptLumpDocumentTab, IgnoreErrors = true }; AcsParserSE parser = new AcsParserSE { AddArgumentsToScriptNames = true, IsMapScriptsLump = tab is ScriptLumpDocumentTab, IgnoreErrors = true };
DataLocation dl = new DataLocation(DataLocation.RESOURCE_DIRECTORY, Path.GetDirectoryName(string.IsNullOrEmpty(tab.Filename)? tab.Title : tab.Filename), false, false, false); DataLocation dl = new DataLocation(DataLocation.RESOURCE_DIRECTORY, Path.GetDirectoryName(string.IsNullOrEmpty(tab.Filename)? tab.Title : tab.Filename), false, false, false, null);
TextResourceData data = new TextResourceData(stream, dl, (parser.IsMapScriptsLump ? "?SCRIPTS" : tab.Filename)); TextResourceData data = new TextResourceData(stream, dl, (parser.IsMapScriptsLump ? "?SCRIPTS" : tab.Filename));
if(parser.Parse(data, false)) if(parser.Parse(data, false))

View file

@ -61,6 +61,9 @@ namespace CodeImp.DoomBuilder.Data
#region ================== Variables #region ================== Variables
// Optional setting
public bool Silent = false;
// Source // Source
private WAD file; private WAD file;
private bool is_iwad; private bool is_iwad;
@ -89,7 +92,7 @@ namespace CodeImp.DoomBuilder.Data
#region ================== Constructor / Disposer #region ================== Constructor / Disposer
// Constructor // Constructor
public WADReader(DataLocation dl, bool asreadonly) : base(dl, asreadonly) public WADReader(DataLocation dl, GameConfiguration config, bool asreadonly) : base(dl, asreadonly)
{ {
General.WriteLogLine("Opening WAD resource \"" + location.location + "\""); General.WriteLogLine("Opening WAD resource \"" + location.location + "\"");
@ -99,14 +102,14 @@ namespace CodeImp.DoomBuilder.Data
// Initialize // Initialize
file = new WAD(location.location, asreadonly); file = new WAD(location.location, asreadonly);
strictpatches = dl.option1; strictpatches = dl.option1;
Initialize(); //mxd Initialize(config); //mxd
// We have no destructor // We have no destructor
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
} }
//mxd. Constructor for temporary WAD files //mxd. Constructor for temporary WAD files
internal WADReader(DataLocation dl, bool asreadonly, bool create) : base(dl, asreadonly) internal WADReader(DataLocation dl, GameConfiguration config, bool asreadonly, bool create) : base(dl, asreadonly)
{ {
if(!create) if(!create)
{ {
@ -119,14 +122,14 @@ namespace CodeImp.DoomBuilder.Data
// Initialize // Initialize
file = new WAD(location.location, asreadonly); file = new WAD(location.location, asreadonly);
strictpatches = dl.option1; strictpatches = dl.option1;
Initialize(); Initialize(config);
// We have no destructor // We have no destructor
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
} }
//mxd //mxd
private void Initialize() private void Initialize(GameConfiguration config)
{ {
is_iwad = file.IsIWAD; is_iwad = file.IsIWAD;
isreadonly |= file.IsReadOnly; // Just in case... isreadonly |= file.IsReadOnly; // Just in case...
@ -141,13 +144,13 @@ namespace CodeImp.DoomBuilder.Data
voxelranges = new List<LumpRange>(); //mxd voxelranges = new List<LumpRange>(); //mxd
// Find ranges // Find ranges
FindRanges(patchranges, General.Map.Config.PatchRanges, "patches", "Patch"); FindRanges(config, patchranges, config.PatchRanges, "patches", "Patch");
FindRanges(spriteranges, General.Map.Config.SpriteRanges, "sprites", "Sprite"); FindRanges(config, spriteranges, config.SpriteRanges, "sprites", "Sprite");
FindRanges(flatranges, General.Map.Config.FlatRanges, "flats", "Flat"); FindRanges(config, flatranges, config.FlatRanges, "flats", "Flat");
FindRanges(textureranges, General.Map.Config.TextureRanges, "textures", "Texture"); FindRanges(config, textureranges, config.TextureRanges, "textures", "Texture");
FindRanges(hiresranges, General.Map.Config.HiResRanges, "hires", "HiRes texture"); FindRanges(config, hiresranges, config.HiResRanges, "hires", "HiRes texture");
FindRanges(colormapranges, General.Map.Config.ColormapRanges, "colormaps", "Colormap"); FindRanges(config, colormapranges, config.ColormapRanges, "colormaps", "Colormap");
FindRanges(voxelranges, General.Map.Config.VoxelRanges, "voxels", "Voxel"); FindRanges(config, voxelranges, config.VoxelRanges, "voxels", "Voxel");
//mxd //mxd
invertedflatranges = new List<LumpRange>(); invertedflatranges = new List<LumpRange>();
@ -225,7 +228,7 @@ namespace CodeImp.DoomBuilder.Data
} }
// This fills a ranges list // This fills a ranges list
private void FindRanges(List<LumpRange> ranges, IDictionary rangeinfos, string rangename, string elementname) private void FindRanges(GameConfiguration config, List<LumpRange> ranges, IDictionary rangeinfos, string rangename, string elementname)
{ {
Dictionary<LumpRange, KeyValuePair<string, string>> failedranges = new Dictionary<LumpRange, KeyValuePair<string, string>>(); //mxd Dictionary<LumpRange, KeyValuePair<string, string>> failedranges = new Dictionary<LumpRange, KeyValuePair<string, string>>(); //mxd
Dictionary<int, bool> successfulrangestarts = new Dictionary<int, bool>(); //mxd Dictionary<int, bool> successfulrangestarts = new Dictionary<int, bool>(); //mxd
@ -234,8 +237,8 @@ namespace CodeImp.DoomBuilder.Data
foreach(DictionaryEntry r in rangeinfos) foreach(DictionaryEntry r in rangeinfos)
{ {
// Read start and end // Read start and end
string rangestart = General.Map.Config.ReadSetting(rangename + "." + r.Key + ".start", ""); string rangestart = config.ReadSetting(rangename + "." + r.Key + ".start", "");
string rangeend = General.Map.Config.ReadSetting(rangename + "." + r.Key + ".end", ""); string rangeend = config.ReadSetting(rangename + "." + r.Key + ".end", "");
if((rangestart.Length > 0) && (rangeend.Length > 0)) if((rangestart.Length > 0) && (rangeend.Length > 0))
{ {
// Find ranges // Find ranges
@ -271,7 +274,7 @@ namespace CodeImp.DoomBuilder.Data
foreach(KeyValuePair<LumpRange, KeyValuePair<string, string>> group in failedranges) foreach(KeyValuePair<LumpRange, KeyValuePair<string, string>> group in failedranges)
{ {
if(successfulrangestarts.ContainsKey(group.Key.start)) continue; if(successfulrangestarts.ContainsKey(group.Key.start)) continue;
General.ErrorLogger.Add(ErrorType.Warning, "\"" + group.Value.Key + "\" range at index " + group.Key.start + " is not closed in resource \"" + location.GetDisplayName() + "\" (\"" + group.Value.Value + "\" marker is missing)."); if (!Silent) General.ErrorLogger.Add(ErrorType.Warning, "\"" + group.Value.Key + "\" range at index " + group.Key.start + " is not closed in resource \"" + location.GetDisplayName() + "\" (\"" + group.Value.Value + "\" marker is missing).");
} }
//mxd. Check duplicates //mxd. Check duplicates
@ -280,8 +283,10 @@ namespace CodeImp.DoomBuilder.Data
HashSet<string> names = new HashSet<string>(StringComparer.OrdinalIgnoreCase); HashSet<string> names = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
for(int i = range.start + 1; i < range.end; i++) for(int i = range.start + 1; i < range.end; i++)
{ {
if(names.Contains(file.Lumps[i].Name)) if (names.Contains(file.Lumps[i].Name))
General.ErrorLogger.Add(ErrorType.Warning, elementname + " \"" + file.Lumps[i].Name + "\", index " + i + " is double defined in resource \"" + location.GetDisplayName() + "\"."); {
if (!Silent) General.ErrorLogger.Add(ErrorType.Warning, elementname + " \"" + file.Lumps[i].Name + "\", index " + i + " is double defined in resource \"" + location.GetDisplayName() + "\".");
}
else else
names.Add(file.Lumps[i].Name); names.Add(file.Lumps[i].Name);
} }
@ -430,11 +435,11 @@ namespace CodeImp.DoomBuilder.Data
Lump lump = file.FindLump("TEXTURE1"); Lump lump = file.FindLump("TEXTURE1");
if(lump != null) if(lump != null)
{ {
LoadTextureSet("TEXTURE1", lump.GetSafeStream(), ref images, pnames); LoadTextureSet("TEXTURE1", lump.GetSafeStream(), ref images, pnames, Silent);
if(images.Count > 0) images.RemoveAt(0); //mxd. The first TEXTURE1 texture cannot be used. Let's remove it here if(images.Count > 0) images.RemoveAt(0); //mxd. The first TEXTURE1 texture cannot be used. Let's remove it here
} }
lump = file.FindLump("TEXTURE2"); lump = file.FindLump("TEXTURE2");
if(lump != null) LoadTextureSet("TEXTURE2", lump.GetSafeStream(), ref images, pnames); if(lump != null) LoadTextureSet("TEXTURE2", lump.GetSafeStream(), ref images, pnames, Silent);
// Read ranges from configuration // Read ranges from configuration
foreach(LumpRange range in textureranges) foreach(LumpRange range in textureranges)
@ -454,7 +459,7 @@ namespace CodeImp.DoomBuilder.Data
else else
{ {
// Can't load image without size // Can't load image without size
General.ErrorLogger.Add(ErrorType.Error, "Can't load texture \"" + file.Lumps[i].Name + "\" from \"" + location.GetDisplayName() + "\" because it doesn't contain any data."); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, "Can't load texture \"" + file.Lumps[i].Name + "\" from \"" + location.GetDisplayName() + "\" because it doesn't contain any data.");
} }
} }
} }
@ -512,7 +517,7 @@ namespace CodeImp.DoomBuilder.Data
else else
{ {
// Can't load image without size // Can't load image without size
General.ErrorLogger.Add(ErrorType.Error, "Can't load HiRes texture \"" + file.Lumps[i].Name + "\" from \"" + location.GetDisplayName() + "\" because it doesn't contain any data."); if (!Silent) General.ErrorLogger.Add(ErrorType.Error, "Can't load HiRes texture \"" + file.Lumps[i].Name + "\" from \"" + location.GetDisplayName() + "\" because it doesn't contain any data.");
} }
} }
} }
@ -547,7 +552,7 @@ namespace CodeImp.DoomBuilder.Data
} }
// This loads a set of textures // This loads a set of textures
public static void LoadTextureSet(string sourcename, Stream texturedata, ref List<ImageData> images, PatchNames pnames) public static void LoadTextureSet(string sourcename, Stream texturedata, ref List<ImageData> images, PatchNames pnames, bool silent)
{ {
if(texturedata.Length == 0) return; if(texturedata.Length == 0) return;
BinaryReader reader = new BinaryReader(texturedata); BinaryReader reader = new BinaryReader(texturedata);
@ -608,7 +613,7 @@ namespace CodeImp.DoomBuilder.Data
else else
{ {
// Can't load image without name // Can't load image without name
General.ErrorLogger.Add(ErrorType.Error, "Can't load an unnamed texture from \"" + sourcename + "\". Please consider giving names to your resources."); if (!silent) General.ErrorLogger.Add(ErrorType.Error, "Can't load an unnamed texture from \"" + sourcename + "\". Please consider giving names to your resources.");
} }
// Go for all patches in texture // Go for all patches in texture
@ -631,7 +636,7 @@ namespace CodeImp.DoomBuilder.Data
else else
{ {
// Can't load image without name // Can't load image without name
General.ErrorLogger.Add(ErrorType.Error, "Can't use an unnamed patch referenced in \"" + sourcename + "\". Please consider giving names to your resources."); if (!silent) General.ErrorLogger.Add(ErrorType.Error, "Can't use an unnamed patch referenced in \"" + sourcename + "\". Please consider giving names to your resources.");
} }
} }
} }

View file

@ -149,7 +149,7 @@ namespace CodeImp.DoomBuilder
//mxd. General.Map.FilePathName will be empty when a newly created map was not saved yet. //mxd. General.Map.FilePathName will be empty when a newly created map was not saved yet.
if(!string.IsNullOrEmpty(General.Map.FilePathName)) if(!string.IsNullOrEmpty(General.Map.FilePathName))
{ {
DataLocation maplocation = new DataLocation(DataLocation.RESOURCE_WAD, General.Map.FilePathName, false, false, false); DataLocation maplocation = new DataLocation(DataLocation.RESOURCE_WAD, General.Map.FilePathName, false, false, false, null);
locations.Remove(maplocation); //If maplocation was already added as a resource, make sure it's singular and is last in the list locations.Remove(maplocation); //If maplocation was already added as a resource, make sure it's singular and is last in the list
locations.Add(maplocation); locations.Add(maplocation);
} }

View file

@ -295,12 +295,12 @@ namespace CodeImp.DoomBuilder
map = new MapSet(); map = new MapSet();
// Create temp wadfile // Create temp wadfile
DataLocation templocation = new DataLocation(DataLocation.RESOURCE_WAD, General.MakeTempFilename(temppath), false, false, false); //mxd DataLocation templocation = new DataLocation(DataLocation.RESOURCE_WAD, General.MakeTempFilename(temppath), false, false, false, null); //mxd
General.WriteLogLine("Creating temporary file: " + templocation.location); General.WriteLogLine("Creating temporary file: " + templocation.location);
#if DEBUG #if DEBUG
tempwadreader = new WADReader(templocation, false, true); tempwadreader = new WADReader(templocation, General.Map.Config, false, true);
#else #else
try { tempwadreader = new WADReader(templocation, false, true); } try { tempwadreader = new WADReader(templocation, General.Map.Config, false, true); }
catch(Exception e) catch(Exception e)
{ {
General.ShowErrorMessage("Error while creating a temporary wad file:\n" + e.GetType().Name + ": " + e.Message, MessageBoxButtons.OK); General.ShowErrorMessage("Error while creating a temporary wad file:\n" + e.GetType().Name + ": " + e.Message, MessageBoxButtons.OK);
@ -389,12 +389,12 @@ namespace CodeImp.DoomBuilder
map = new MapSet(); map = new MapSet();
// Create temp wadfile // Create temp wadfile
DataLocation templocation = new DataLocation(DataLocation.RESOURCE_WAD, General.MakeTempFilename(temppath), false, false, false); //mxd DataLocation templocation = new DataLocation(DataLocation.RESOURCE_WAD, General.MakeTempFilename(temppath), false, false, false, null); //mxd
General.WriteLogLine("Creating temporary file: " + templocation.location); General.WriteLogLine("Creating temporary file: " + templocation.location);
#if DEBUG #if DEBUG
tempwadreader = new WADReader(templocation, false, true); tempwadreader = new WADReader(templocation, General.Map.Config, false, true);
#else #else
try { tempwadreader = new WADReader(templocation, false, true); } catch(Exception e) try { tempwadreader = new WADReader(templocation, General.Map.Config, false, true); } catch(Exception e)
{ {
General.ShowErrorMessage("Error while creating a temporary wad file:\n" + e.GetType().Name + ": " + e.Message, MessageBoxButtons.OK); General.ShowErrorMessage("Error while creating a temporary wad file:\n" + e.GetType().Name + ": " + e.Message, MessageBoxButtons.OK);
return false; return false;
@ -427,7 +427,7 @@ namespace CodeImp.DoomBuilder
// Load data manager // Load data manager
General.WriteLogLine("Loading data resources..."); General.WriteLogLine("Loading data resources...");
data = new DataManager(); data = new DataManager();
DataLocation maplocation = new DataLocation(DataLocation.RESOURCE_WAD, filepathname, options.StrictPatches, false, false); DataLocation maplocation = new DataLocation(DataLocation.RESOURCE_WAD, filepathname, options.StrictPatches, false, false, null);
data.Load(configinfo.Resources, options.Resources, maplocation); data.Load(configinfo.Resources, options.Resources, maplocation);
// Remove unused sectors // Remove unused sectors
@ -486,14 +486,14 @@ namespace CodeImp.DoomBuilder
WAD mapwad; WAD mapwad;
// Create temp wadfile // Create temp wadfile
DataLocation templocation = new DataLocation(DataLocation.RESOURCE_WAD, General.MakeTempFilename(temppath), false, false, false); //mxd DataLocation templocation = new DataLocation(DataLocation.RESOURCE_WAD, General.MakeTempFilename(temppath), false, false, false, null); //mxd
General.WriteLogLine("Creating temporary file: " + templocation.location); General.WriteLogLine("Creating temporary file: " + templocation.location);
if(tempwadreader != null) tempwadreader.Dispose(); if(tempwadreader != null) tempwadreader.Dispose();
#if DEBUG #if DEBUG
tempwadreader = new WADReader(templocation, false, true); tempwadreader = new WADReader(templocation, General.Map.Config, false, true);
#else #else
try { tempwadreader = new WADReader(templocation, false, true); } catch(Exception e) try { tempwadreader = new WADReader(templocation, General.Map.Config, false, true); } catch(Exception e)
{ {
General.ShowErrorMessage("Error while creating a temporary wad file:\n" + e.GetType().Name + ": " + e.Message, MessageBoxButtons.OK); General.ShowErrorMessage("Error while creating a temporary wad file:\n" + e.GetType().Name + ": " + e.Message, MessageBoxButtons.OK);
return false; return false;
@ -2370,7 +2370,7 @@ namespace CodeImp.DoomBuilder
data = new DataManager(); data = new DataManager();
if(!string.IsNullOrEmpty(filepathname)) if(!string.IsNullOrEmpty(filepathname))
{ {
DataLocation maplocation = new DataLocation(DataLocation.RESOURCE_WAD, filepathname, options.StrictPatches, false, false); DataLocation maplocation = new DataLocation(DataLocation.RESOURCE_WAD, filepathname, options.StrictPatches, false, false, null);
data.Load(configinfo.Resources, options.Resources, maplocation); data.Load(configinfo.Resources, options.Resources, maplocation);
} }
else else

View file

@ -19,6 +19,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using CodeImp.DoomBuilder.Config;
using CodeImp.DoomBuilder.Data; using CodeImp.DoomBuilder.Data;
#endregion #endregion
@ -68,7 +69,7 @@ namespace CodeImp.DoomBuilder.IO
#region ================== Constructor / Disposer #region ================== Constructor / Disposer
// Constructor to fill list from directory and optionally subdirectories // Constructor to fill list from directory and optionally subdirectories
public DirectoryFilesList(string path, bool subdirectories) public DirectoryFilesList(string path, GameConfiguration config, bool subdirectories)
{ {
path = Path.GetFullPath(path); path = Path.GetFullPath(path);
string[] files = Directory.GetFiles(path, "*", subdirectories ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly); string[] files = Directory.GetFiles(path, "*", subdirectories ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
@ -85,25 +86,28 @@ namespace CodeImp.DoomBuilder.IO
continue; continue;
} }
if(General.Map.Config.IgnoredFileExtensions.Contains(e.extension)) continue; if (config != null)
bool skipfolder = false;
foreach(string ef in General.Map.Config.IgnoredDirectoryNames)
{ {
if(e.path.StartsWith(ef + Path.DirectorySeparatorChar)) if (config.IgnoredFileExtensions.Contains(e.extension)) continue;
bool skipfolder = false;
foreach (string ef in config.IgnoredDirectoryNames)
{ {
skipfolder = true; if (e.path.StartsWith(ef + Path.DirectorySeparatorChar))
break; {
skipfolder = true;
break;
}
} }
if (skipfolder) continue;
} }
if(skipfolder) continue;
AddOrReplaceEntry(e); AddOrReplaceEntry(e);
} }
} }
// Constructor for custom list // Constructor for custom list
public DirectoryFilesList(string resourcename, ICollection<DirectoryFileEntry> sourceentries) public DirectoryFilesList(string resourcename, GameConfiguration config, bool silent, ICollection<DirectoryFileEntry> sourceentries)
{ {
entries = new Dictionary<string, DirectoryFileEntry>(sourceentries.Count, new PathEqualityComparer()); entries = new Dictionary<string, DirectoryFileEntry>(sourceentries.Count, new PathEqualityComparer());
wadentries = new List<string>(); wadentries = new List<string>();
@ -115,22 +119,25 @@ namespace CodeImp.DoomBuilder.IO
continue; continue;
} }
if(General.Map.Config.IgnoredFileExtensions.Contains(e.extension)) continue; if (config != null)
bool skipfolder = false;
foreach(string ef in General.Map.Config.IgnoredDirectoryNames)
{ {
if(e.path.StartsWith(ef + Path.DirectorySeparatorChar)) if (config.IgnoredFileExtensions.Contains(e.extension)) continue;
bool skipfolder = false;
foreach (string ef in config.IgnoredDirectoryNames)
{ {
skipfolder = true; if (e.path.StartsWith(ef + Path.DirectorySeparatorChar))
break; {
skipfolder = true;
break;
}
} }
if (skipfolder) continue;
} }
if(skipfolder) continue;
if(entries.ContainsKey(e.filepathname)) if(entries.ContainsKey(e.filepathname))
{ {
General.ErrorLogger.Add(ErrorType.Warning, "Resource \"" + resourcename + "\" contains multiple files with the same filename. See: \"" + e.filepathname + "\""); if (!silent) General.ErrorLogger.Add(ErrorType.Warning, "Resource \"" + resourcename + "\" contains multiple files with the same filename. See: \"" + e.filepathname + "\"");
continue; continue;
} }

View file

@ -19,7 +19,7 @@ namespace CodeImp.DoomBuilder.Properties {
// class via a tool like ResGen or Visual Studio. // class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {
@ -810,6 +810,16 @@ namespace CodeImp.DoomBuilder.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Loader {
get {
object obj = ResourceManager.GetObject("Loader", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>

View file

@ -622,4 +622,7 @@
<data name="UDB2" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="UDB2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\UDB2.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\UDB2.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="Loader" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Loader.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

File diff suppressed because it is too large Load diff

View file

@ -41,6 +41,7 @@ namespace CodeImp.DoomBuilder.Windows
private List<DefinedTextureSet> copiedsets; private List<DefinedTextureSet> copiedsets;
private bool preventchanges; private bool preventchanges;
private bool reloadresources; private bool reloadresources;
private readonly int initialformheight;
//mxd. "Copy/Paste" stuff //mxd. "Copy/Paste" stuff
private ConfigurationInfo configinfocopy; private ConfigurationInfo configinfocopy;
@ -109,6 +110,9 @@ namespace CodeImp.DoomBuilder.Windows
//mxd. Trigger change to update the right panel... //mxd. Trigger change to update the right panel...
listconfigs_MouseUp(this, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0)); listconfigs_MouseUp(this, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0));
//
initialformheight = Height;
} }
// This shows a specific page // This shows a specific page
@ -140,8 +144,9 @@ namespace CodeImp.DoomBuilder.Windows
// Set defaults // Set defaults
configinfo.ApplyDefaults(gameconfig); configinfo.ApplyDefaults(gameconfig);
// Fill resources list // Fill resources list
configdata.GameConfiguration = gameconfig;
configdata.EditResourceLocationList(configinfo.Resources); configdata.EditResourceLocationList(configinfo.Resources);
// Go for all nodebuilder save items // Go for all nodebuilder save items
@ -1125,6 +1130,12 @@ namespace CodeImp.DoomBuilder.Windows
General.Interface.DisplayStatus(StatusType.Info, "Pasted color presets from \"" + configinfocopy.Name + "\""); General.Interface.DisplayStatus(StatusType.Info, "Pasted color presets from \"" + configinfocopy.Name + "\"");
} }
#endregion #endregion
}
private void configdata_OnWarningsChanged(int size)
{
Height = initialformheight + size;
Refresh();
}
}
} }

View file

@ -223,7 +223,7 @@
AAEAAAD/////AQAAAAAAAAAMA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ucBAAGQAakBrQIAAf8BMwMA

View file

@ -28,255 +28,266 @@ namespace CodeImp.DoomBuilder.Windows
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.Windows.Forms.Label label3; System.Windows.Forms.Label label3;
System.Windows.Forms.Label label2; System.Windows.Forms.Label label2;
System.Windows.Forms.Label label1; System.Windows.Forms.Label label1;
System.Windows.Forms.GroupBox panelsettings; System.Windows.Forms.GroupBox panelsettings;
System.Windows.Forms.Label label4; System.Windows.Forms.Label label4;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MapOptionsForm)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MapOptionsForm));
this.examplelabel = new System.Windows.Forms.Label(); this.examplelabel = new System.Windows.Forms.Label();
this.scriptcompiler = new System.Windows.Forms.ComboBox(); this.scriptcompiler = new System.Windows.Forms.ComboBox();
this.scriptcompilerlabel = new System.Windows.Forms.Label(); this.scriptcompilerlabel = new System.Windows.Forms.Label();
this.levelname = new System.Windows.Forms.TextBox(); this.levelname = new System.Windows.Forms.TextBox();
this.config = new System.Windows.Forms.ComboBox(); this.config = new System.Windows.Forms.ComboBox();
this.apply = new System.Windows.Forms.Button(); this.apply = new System.Windows.Forms.Button();
this.cancel = new System.Windows.Forms.Button(); this.cancel = new System.Windows.Forms.Button();
this.panelres = new System.Windows.Forms.GroupBox(); this.panelres = new System.Windows.Forms.GroupBox();
this.longtexturenames = new System.Windows.Forms.CheckBox(); this.longtexturenames = new System.Windows.Forms.CheckBox();
this.strictpatches = new System.Windows.Forms.CheckBox(); this.strictpatches = new System.Windows.Forms.CheckBox();
this.datalocations = new CodeImp.DoomBuilder.Controls.ResourceListEditor(); this.datalocations = new CodeImp.DoomBuilder.Controls.ResourceListEditor();
this.tooltip = new System.Windows.Forms.ToolTip(this.components); this.tooltip = new System.Windows.Forms.ToolTip(this.components);
this.label5 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label();
this.prepostcommands = new System.Windows.Forms.Button(); this.prepostcommands = new System.Windows.Forms.Button();
label3 = new System.Windows.Forms.Label(); label3 = new System.Windows.Forms.Label();
label2 = new System.Windows.Forms.Label(); label2 = new System.Windows.Forms.Label();
label1 = new System.Windows.Forms.Label(); label1 = new System.Windows.Forms.Label();
panelsettings = new System.Windows.Forms.GroupBox(); panelsettings = new System.Windows.Forms.GroupBox();
label4 = new System.Windows.Forms.Label(); label4 = new System.Windows.Forms.Label();
panelsettings.SuspendLayout(); panelsettings.SuspendLayout();
this.panelres.SuspendLayout(); this.panelres.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// label3 // label3
// //
label3.AutoSize = true; label3.AutoSize = true;
label3.Location = new System.Drawing.Point(239, 83); label3.Location = new System.Drawing.Point(239, 83);
label3.Name = "label3"; label3.Name = "label3";
label3.Size = new System.Drawing.Size(52, 13); label3.Size = new System.Drawing.Size(52, 13);
label3.TabIndex = 9; label3.TabIndex = 9;
label3.Text = "example: "; label3.Text = "example: ";
// //
// label2 // label2
// //
label2.AutoSize = true; label2.AutoSize = true;
label2.Location = new System.Drawing.Point(58, 83); label2.Location = new System.Drawing.Point(58, 83);
label2.Name = "label2"; label2.Name = "label2";
label2.Size = new System.Drawing.Size(65, 13); label2.Size = new System.Drawing.Size(65, 13);
label2.TabIndex = 7; label2.TabIndex = 7;
label2.Text = "Level name:"; label2.Text = "Level name:";
// //
// label1 // label1
// //
label1.Location = new System.Drawing.Point(13, 27); label1.Location = new System.Drawing.Point(13, 27);
label1.Name = "label1"; label1.Name = "label1";
label1.Size = new System.Drawing.Size(110, 14); label1.Size = new System.Drawing.Size(110, 14);
label1.TabIndex = 5; label1.TabIndex = 5;
label1.Text = "Game Configuration:"; label1.Text = "Game Configuration:";
label1.TextAlign = System.Drawing.ContentAlignment.TopRight; label1.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// panelsettings // panelsettings
// //
panelsettings.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) panelsettings.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
panelsettings.Controls.Add(this.examplelabel); panelsettings.Controls.Add(this.examplelabel);
panelsettings.Controls.Add(this.scriptcompiler); panelsettings.Controls.Add(this.scriptcompiler);
panelsettings.Controls.Add(this.scriptcompilerlabel); panelsettings.Controls.Add(this.scriptcompilerlabel);
panelsettings.Controls.Add(label3); panelsettings.Controls.Add(label3);
panelsettings.Controls.Add(this.levelname); panelsettings.Controls.Add(this.levelname);
panelsettings.Controls.Add(label2); panelsettings.Controls.Add(label2);
panelsettings.Controls.Add(this.config); panelsettings.Controls.Add(this.config);
panelsettings.Controls.Add(label1); panelsettings.Controls.Add(label1);
panelsettings.Location = new System.Drawing.Point(12, 12); panelsettings.Location = new System.Drawing.Point(12, 12);
panelsettings.Name = "panelsettings"; panelsettings.Name = "panelsettings";
panelsettings.Size = new System.Drawing.Size(397, 112); panelsettings.Size = new System.Drawing.Size(397, 112);
panelsettings.TabIndex = 0; panelsettings.TabIndex = 0;
panelsettings.TabStop = false; panelsettings.TabStop = false;
panelsettings.Text = " Settings "; panelsettings.Text = " Settings ";
// //
// examplelabel // examplelabel
// //
this.examplelabel.AutoSize = true; this.examplelabel.AutoSize = true;
this.examplelabel.Location = new System.Drawing.Point(288, 83); this.examplelabel.Location = new System.Drawing.Point(288, 83);
this.examplelabel.Name = "examplelabel"; this.examplelabel.Name = "examplelabel";
this.examplelabel.Size = new System.Drawing.Size(42, 13); this.examplelabel.Size = new System.Drawing.Size(42, 13);
this.examplelabel.TabIndex = 12; this.examplelabel.TabIndex = 12;
this.examplelabel.Text = "MAP01"; this.examplelabel.Text = "MAP01";
// //
// scriptcompiler // scriptcompiler
// //
this.scriptcompiler.DropDownHeight = 206; this.scriptcompiler.DropDownHeight = 206;
this.scriptcompiler.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.scriptcompiler.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.scriptcompiler.FormattingEnabled = true; this.scriptcompiler.FormattingEnabled = true;
this.scriptcompiler.IntegralHeight = false; this.scriptcompiler.IntegralHeight = false;
this.scriptcompiler.Location = new System.Drawing.Point(129, 52); this.scriptcompiler.Location = new System.Drawing.Point(129, 52);
this.scriptcompiler.Name = "scriptcompiler"; this.scriptcompiler.Name = "scriptcompiler";
this.scriptcompiler.Size = new System.Drawing.Size(254, 21); this.scriptcompiler.Size = new System.Drawing.Size(254, 21);
this.scriptcompiler.TabIndex = 10; this.scriptcompiler.TabIndex = 10;
// //
// scriptcompilerlabel // scriptcompilerlabel
// //
this.scriptcompilerlabel.Location = new System.Drawing.Point(13, 55); this.scriptcompilerlabel.Location = new System.Drawing.Point(13, 55);
this.scriptcompilerlabel.Name = "scriptcompilerlabel"; this.scriptcompilerlabel.Name = "scriptcompilerlabel";
this.scriptcompilerlabel.Size = new System.Drawing.Size(110, 14); this.scriptcompilerlabel.Size = new System.Drawing.Size(110, 14);
this.scriptcompilerlabel.TabIndex = 11; this.scriptcompilerlabel.TabIndex = 11;
this.scriptcompilerlabel.Text = "Script Type:"; this.scriptcompilerlabel.Text = "Script Type:";
this.scriptcompilerlabel.TextAlign = System.Drawing.ContentAlignment.TopRight; this.scriptcompilerlabel.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// levelname // levelname
// //
this.levelname.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; this.levelname.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.levelname.Location = new System.Drawing.Point(129, 80); this.levelname.Location = new System.Drawing.Point(129, 80);
this.levelname.MaxLength = 8; this.levelname.MaxLength = 8;
this.levelname.Name = "levelname"; this.levelname.Name = "levelname";
this.levelname.Size = new System.Drawing.Size(94, 20); this.levelname.Size = new System.Drawing.Size(94, 20);
this.levelname.TabIndex = 1; this.levelname.TabIndex = 1;
this.levelname.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.levelname_KeyPress); this.levelname.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.levelname_KeyPress);
// //
// config // config
// //
this.config.DropDownHeight = 206; this.config.DropDownHeight = 206;
this.config.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.config.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.config.FormattingEnabled = true; this.config.FormattingEnabled = true;
this.config.IntegralHeight = false; this.config.IntegralHeight = false;
this.config.Location = new System.Drawing.Point(129, 24); this.config.Location = new System.Drawing.Point(129, 24);
this.config.Name = "config"; this.config.Name = "config";
this.config.Size = new System.Drawing.Size(254, 21); this.config.Size = new System.Drawing.Size(254, 21);
this.config.TabIndex = 0; this.config.TabIndex = 0;
this.config.SelectedIndexChanged += new System.EventHandler(this.config_SelectedIndexChanged); this.config.SelectedIndexChanged += new System.EventHandler(this.config_SelectedIndexChanged);
// //
// label4 // label4
// //
label4.AutoSize = true; label4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
label4.Location = new System.Drawing.Point(13, 198);
label4.Name = "label4";
label4.Size = new System.Drawing.Size(299, 52);
label4.TabIndex = 17;
label4.Text = resources.GetString("label4.Text");
//
// 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(179, 429);
this.apply.Name = "apply";
this.apply.Size = new System.Drawing.Size(112, 25);
this.apply.TabIndex = 2;
this.apply.Text = "OK";
this.apply.UseVisualStyleBackColor = true;
this.apply.Click += new System.EventHandler(this.apply_Click);
//
// 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(297, 429);
this.cancel.Name = "cancel";
this.cancel.Size = new System.Drawing.Size(112, 25);
this.cancel.TabIndex = 3;
this.cancel.Text = "Cancel";
this.cancel.UseVisualStyleBackColor = true;
this.cancel.Click += new System.EventHandler(this.cancel_Click);
//
// panelres
//
this.panelres.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.panelres.Controls.Add(this.longtexturenames); label4.AutoSize = true;
this.panelres.Controls.Add(this.strictpatches); label4.Location = new System.Drawing.Point(13, 198);
this.panelres.Controls.Add(this.datalocations); label4.Name = "label4";
this.panelres.Controls.Add(label4); label4.Size = new System.Drawing.Size(299, 52);
this.panelres.Location = new System.Drawing.Point(12, 130); label4.TabIndex = 17;
this.panelres.Name = "panelres"; label4.Text = resources.GetString("label4.Text");
this.panelres.Size = new System.Drawing.Size(397, 259); //
this.panelres.TabIndex = 1; // apply
this.panelres.TabStop = false; //
this.panelres.Text = " Resources "; this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
// this.apply.Location = new System.Drawing.Point(179, 429);
// longtexturenames this.apply.Name = "apply";
// this.apply.Size = new System.Drawing.Size(112, 25);
this.longtexturenames.AutoSize = true; this.apply.TabIndex = 2;
this.longtexturenames.Location = new System.Drawing.Point(14, 45); this.apply.Text = "OK";
this.longtexturenames.Name = "longtexturenames"; this.apply.UseVisualStyleBackColor = true;
this.longtexturenames.Size = new System.Drawing.Size(137, 17); this.apply.Click += new System.EventHandler(this.apply_Click);
this.longtexturenames.TabIndex = 21; //
this.longtexturenames.Text = "Use long texture names"; // cancel
this.longtexturenames.UseVisualStyleBackColor = true; //
// this.cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
// strictpatches this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
// this.cancel.Location = new System.Drawing.Point(297, 429);
this.strictpatches.AutoSize = true; this.cancel.Name = "cancel";
this.strictpatches.Location = new System.Drawing.Point(14, 21); this.cancel.Size = new System.Drawing.Size(112, 25);
this.strictpatches.Name = "strictpatches"; this.cancel.TabIndex = 3;
this.strictpatches.Size = new System.Drawing.Size(349, 17); this.cancel.Text = "Cancel";
this.strictpatches.TabIndex = 20; this.cancel.UseVisualStyleBackColor = true;
this.strictpatches.Text = "Strictly load patches between P_START and P_END only for this file"; this.cancel.Click += new System.EventHandler(this.cancel_Click);
this.strictpatches.UseVisualStyleBackColor = true; //
// // panelres
// datalocations //
// this.panelres.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
this.datalocations.AllowDrop = true; | System.Windows.Forms.AnchorStyles.Left)
this.datalocations.DialogOffset = new System.Drawing.Point(40, 20); | System.Windows.Forms.AnchorStyles.Right)));
this.datalocations.Location = new System.Drawing.Point(14, 68); this.panelres.Controls.Add(this.longtexturenames);
this.datalocations.Name = "datalocations"; this.panelres.Controls.Add(this.strictpatches);
this.datalocations.Size = new System.Drawing.Size(368, 127); this.panelres.Controls.Add(this.datalocations);
this.datalocations.TabIndex = 0; this.panelres.Controls.Add(label4);
// this.panelres.Location = new System.Drawing.Point(12, 130);
// label5 this.panelres.Name = "panelres";
// this.panelres.Size = new System.Drawing.Size(397, 259);
this.label5.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.panelres.TabIndex = 1;
this.label5.Location = new System.Drawing.Point(13, 423); this.panelres.TabStop = false;
this.label5.Name = "label5"; this.panelres.Text = " Resources ";
this.label5.Size = new System.Drawing.Size(396, 2); //
this.label5.TabIndex = 21; // longtexturenames
// //
// prepostcommands this.longtexturenames.AutoSize = true;
// this.longtexturenames.Location = new System.Drawing.Point(14, 45);
this.prepostcommands.Location = new System.Drawing.Point(247, 395); this.longtexturenames.Name = "longtexturenames";
this.prepostcommands.Name = "prepostcommands"; this.longtexturenames.Size = new System.Drawing.Size(137, 17);
this.prepostcommands.Size = new System.Drawing.Size(162, 25); this.longtexturenames.TabIndex = 21;
this.prepostcommands.TabIndex = 20; this.longtexturenames.Text = "Use long texture names";
this.prepostcommands.Text = "Edit pre and post commands"; this.longtexturenames.UseVisualStyleBackColor = true;
this.prepostcommands.UseVisualStyleBackColor = true; //
this.prepostcommands.Click += new System.EventHandler(this.prepostcommands_Click); // strictpatches
// //
// MapOptionsForm this.strictpatches.AutoSize = true;
// this.strictpatches.Location = new System.Drawing.Point(14, 21);
this.AcceptButton = this.apply; this.strictpatches.Name = "strictpatches";
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.strictpatches.Size = new System.Drawing.Size(349, 17);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.strictpatches.TabIndex = 20;
this.CancelButton = this.cancel; this.strictpatches.Text = "Strictly load patches between P_START and P_END only for this file";
this.ClientSize = new System.Drawing.Size(421, 466); this.strictpatches.UseVisualStyleBackColor = true;
this.Controls.Add(this.label5); //
this.Controls.Add(this.prepostcommands); // datalocations
this.Controls.Add(this.panelres); //
this.Controls.Add(this.cancel); this.datalocations.AllowDrop = true;
this.Controls.Add(this.apply); this.datalocations.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
this.Controls.Add(panelsettings); | System.Windows.Forms.AnchorStyles.Left)
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; | System.Windows.Forms.AnchorStyles.Right)));
this.MaximizeBox = false; this.datalocations.DialogOffset = new System.Drawing.Point(40, 20);
this.MinimizeBox = false; this.datalocations.GameConfiguration = null;
this.Name = "MapOptionsForm"; this.datalocations.Location = new System.Drawing.Point(14, 68);
this.Opacity = 0D; this.datalocations.Name = "datalocations";
this.ShowIcon = false; this.datalocations.Size = new System.Drawing.Size(368, 127);
this.ShowInTaskbar = false; this.datalocations.TabIndex = 0;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.datalocations.OnWarningsChanged += new CodeImp.DoomBuilder.Controls.ResourceListEditor.WarningsChanged(this.datalocations_OnWarningsChanged);
this.Text = "Map Options"; //
this.HelpRequested += new System.Windows.Forms.HelpEventHandler(this.MapOptionsForm_HelpRequested); // label5
panelsettings.ResumeLayout(false); //
panelsettings.PerformLayout(); this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
this.panelres.ResumeLayout(false); | System.Windows.Forms.AnchorStyles.Right)));
this.panelres.PerformLayout(); this.label5.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.ResumeLayout(false); this.label5.Location = new System.Drawing.Point(13, 423);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(396, 2);
this.label5.TabIndex = 21;
//
// prepostcommands
//
this.prepostcommands.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.prepostcommands.Location = new System.Drawing.Point(247, 395);
this.prepostcommands.Name = "prepostcommands";
this.prepostcommands.Size = new System.Drawing.Size(162, 25);
this.prepostcommands.TabIndex = 20;
this.prepostcommands.Text = "Edit pre and post commands";
this.prepostcommands.UseVisualStyleBackColor = true;
this.prepostcommands.Click += new System.EventHandler(this.prepostcommands_Click);
//
// MapOptionsForm
//
this.AcceptButton = this.apply;
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancel;
this.ClientSize = new System.Drawing.Size(421, 466);
this.Controls.Add(this.label5);
this.Controls.Add(this.prepostcommands);
this.Controls.Add(this.panelres);
this.Controls.Add(this.cancel);
this.Controls.Add(this.apply);
this.Controls.Add(panelsettings);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "MapOptionsForm";
this.Opacity = 0D;
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Map Options";
this.HelpRequested += new System.Windows.Forms.HelpEventHandler(this.MapOptionsForm_HelpRequested);
panelsettings.ResumeLayout(false);
panelsettings.PerformLayout();
this.panelres.ResumeLayout(false);
this.panelres.PerformLayout();
this.ResumeLayout(false);
} }

View file

@ -39,6 +39,7 @@ namespace CodeImp.DoomBuilder.Windows
private ExternalCommandSettings testprecommand; private ExternalCommandSettings testprecommand;
private ExternalCommandSettings testpostcommand; private ExternalCommandSettings testpostcommand;
private bool prepostcommandsmodified; private bool prepostcommandsmodified;
private readonly int initialformheight;
// Properties // Properties
public MapOptions Options { get { return options; } } public MapOptions Options { get { return options; } }
@ -110,6 +111,8 @@ namespace CodeImp.DoomBuilder.Windows
//mxd. Still better than nothing :) //mxd. Still better than nothing :)
if(config.SelectedIndex == -1 && config.Items.Count > 0) config.SelectedIndex = 0; if(config.SelectedIndex == -1 && config.Items.Count > 0) config.SelectedIndex = 0;
// Find whatever was selected after the previous step
//mxd //mxd
if(General.Map != null) datalocations.StartPath = General.Map.FilePathName; if(General.Map != null) datalocations.StartPath = General.Map.FilePathName;
@ -120,11 +123,22 @@ namespace CodeImp.DoomBuilder.Windows
strictpatches.Checked = options.StrictPatches; strictpatches.Checked = options.StrictPatches;
// Fill the resources list // Fill the resources list
datalocations.IsMapControl = true;
datalocations.GameConfiguration = GetGameConfiguration();
datalocations.EditResourceLocationList(options.Resources); datalocations.EditResourceLocationList(options.Resources);
//reloadresourceprecmd.Text = options.ReloadResourcePreCommand; //reloadresourceprecmd.Text = options.ReloadResourcePreCommand;
this.initialformheight = Height;
} }
private GameConfiguration GetGameConfiguration()
{
if (config.Items.Count == 0 || config.SelectedIndex < 0) return null;
return new GameConfiguration((config.SelectedItem as ConfigurationInfo).Configuration);
}
// OK clicked // OK clicked
private void apply_Click(object sender, EventArgs e) private void apply_Click(object sender, EventArgs e)
{ {
@ -176,20 +190,6 @@ namespace CodeImp.DoomBuilder.Windows
return; return;
} }
// When making a new map, check if we should warn the user for missing resources
if(newmap)
{
General.Settings.LastUsedConfigName = configinfo.Name; //mxd
if((locations.Count == 0) && (configinfo.Resources.Count == 0) &&
MessageBox.Show(this, "You are about to make a map without selecting any resources. Textures, flats and " +
"sprites may not be shown correctly or may not show up at all. Do you want to continue?", Application.ProductName,
MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.No)
{
return;
}
}
// Next checks are only for maps that are already opened // Next checks are only for maps that are already opened
if(!newmap) if(!newmap)
{ {
@ -242,6 +242,7 @@ namespace CodeImp.DoomBuilder.Windows
{ {
// Select this item // Select this item
config.SelectedIndex = i; config.SelectedIndex = i;
datalocations.GameConfiguration = GetGameConfiguration();
} }
} }
return; return;
@ -345,6 +346,7 @@ namespace CodeImp.DoomBuilder.Windows
} }
// Show resources // Show resources
datalocations.GameConfiguration = GetGameConfiguration();
datalocations.FixedResourceLocationList(info.Resources); datalocations.FixedResourceLocationList(info.Resources);
// Update long texture names checkbox (mxd) // Update long texture names checkbox (mxd)
@ -388,5 +390,11 @@ namespace CodeImp.DoomBuilder.Windows
prepostcommandsmodified = true; prepostcommandsmodified = true;
} }
} }
}
private void datalocations_OnWarningsChanged(int size)
{
Height = initialformheight + size;
Refresh();
}
}
} }

View file

@ -28,217 +28,225 @@ namespace CodeImp.DoomBuilder.Windows
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.Windows.Forms.ColumnHeader columnHeader1; System.Windows.Forms.ColumnHeader columnHeader1;
System.Windows.Forms.Label label1; System.Windows.Forms.Label label1;
System.Windows.Forms.Label label2; System.Windows.Forms.Label label2;
System.Windows.Forms.Label label3; System.Windows.Forms.Label label3;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OpenMapOptionsForm)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OpenMapOptionsForm));
this.panelres = new System.Windows.Forms.GroupBox(); this.panelres = new System.Windows.Forms.GroupBox();
this.longtexturenames = new System.Windows.Forms.CheckBox(); this.longtexturenames = new System.Windows.Forms.CheckBox();
this.strictpatches = new System.Windows.Forms.CheckBox(); this.strictpatches = new System.Windows.Forms.CheckBox();
this.datalocations = new CodeImp.DoomBuilder.Controls.ResourceListEditor(); this.datalocations = new CodeImp.DoomBuilder.Controls.ResourceListEditor();
this.apply = new System.Windows.Forms.Button(); this.apply = new System.Windows.Forms.Button();
this.cancel = new System.Windows.Forms.Button(); this.cancel = new System.Windows.Forms.Button();
this.config = new System.Windows.Forms.ComboBox(); this.config = new System.Windows.Forms.ComboBox();
this.mapslist = new System.Windows.Forms.ListView(); this.mapslist = new System.Windows.Forms.ListView();
this.scriptcompiler = new System.Windows.Forms.ComboBox(); this.scriptcompiler = new System.Windows.Forms.ComboBox();
this.scriptcompilerlabel = new System.Windows.Forms.Label(); this.scriptcompilerlabel = new System.Windows.Forms.Label();
this.tooltip = new System.Windows.Forms.ToolTip(this.components); this.tooltip = new System.Windows.Forms.ToolTip(this.components);
columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
label1 = new System.Windows.Forms.Label(); label1 = new System.Windows.Forms.Label();
label2 = new System.Windows.Forms.Label(); label2 = new System.Windows.Forms.Label();
label3 = new System.Windows.Forms.Label(); label3 = new System.Windows.Forms.Label();
this.panelres.SuspendLayout(); this.panelres.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// columnHeader1 // columnHeader1
// //
columnHeader1.Text = "Map name"; columnHeader1.Text = "Map name";
columnHeader1.Width = -1; columnHeader1.Width = -1;
// //
// label1 // label1
// //
label1.Location = new System.Drawing.Point(15, 24); label1.Location = new System.Drawing.Point(15, 24);
label1.Name = "label1"; label1.Name = "label1";
label1.Size = new System.Drawing.Size(120, 14); label1.Size = new System.Drawing.Size(120, 14);
label1.TabIndex = 14; label1.TabIndex = 14;
label1.Text = "Game Configuration:"; label1.Text = "Game Configuration:";
label1.TextAlign = System.Drawing.ContentAlignment.TopRight; label1.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// label2 // label2
// //
label2.AutoSize = true; label2.AutoSize = true;
label2.Location = new System.Drawing.Point(12, 89); label2.Location = new System.Drawing.Point(12, 89);
label2.Name = "label2"; label2.Name = "label2";
label2.Size = new System.Drawing.Size(360, 26); label2.Size = new System.Drawing.Size(360, 26);
label2.TabIndex = 16; label2.TabIndex = 16;
label2.Text = "With the above selected configuration, the maps shown below were found \r\nin the c" + label2.Text = "With the above selected configuration, the maps shown below were found \r\nin the c" +
"hosen WAD file. Please select the map to load for editing."; "hosen WAD file. Please select the map to load for editing.";
// //
// label3 // label3
// //
label3.AutoSize = true; label3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
label3.Location = new System.Drawing.Point(11, 198);
label3.Name = "label3";
label3.Size = new System.Drawing.Size(299, 52);
label3.TabIndex = 17;
label3.Text = resources.GetString("label3.Text");
//
// panelres
//
this.panelres.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.panelres.Controls.Add(this.longtexturenames); label3.AutoSize = true;
this.panelres.Controls.Add(this.strictpatches); label3.Location = new System.Drawing.Point(11, 195);
this.panelres.Controls.Add(this.datalocations); label3.Name = "label3";
this.panelres.Controls.Add(label3); label3.Size = new System.Drawing.Size(299, 52);
this.panelres.Location = new System.Drawing.Point(12, 246); label3.TabIndex = 17;
this.panelres.Name = "panelres"; label3.Text = resources.GetString("label3.Text");
this.panelres.Size = new System.Drawing.Size(396, 259); //
this.panelres.TabIndex = 2; // panelres
this.panelres.TabStop = false; //
this.panelres.Text = " Resources "; this.panelres.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
// | System.Windows.Forms.AnchorStyles.Left)
// longtexturenames
//
this.longtexturenames.AutoSize = true;
this.longtexturenames.Location = new System.Drawing.Point(14, 45);
this.longtexturenames.Name = "longtexturenames";
this.longtexturenames.Size = new System.Drawing.Size(137, 17);
this.longtexturenames.TabIndex = 20;
this.longtexturenames.Text = "Use long texture names";
this.longtexturenames.UseVisualStyleBackColor = true;
//
// strictpatches
//
this.strictpatches.AutoSize = true;
this.strictpatches.Location = new System.Drawing.Point(14, 21);
this.strictpatches.Name = "strictpatches";
this.strictpatches.Size = new System.Drawing.Size(349, 17);
this.strictpatches.TabIndex = 19;
this.strictpatches.Text = "Strictly load patches between P_START and P_END only for this file";
this.strictpatches.UseVisualStyleBackColor = true;
//
// datalocations
//
this.datalocations.AllowDrop = true;
this.datalocations.DialogOffset = new System.Drawing.Point(40, 20);
this.datalocations.Location = new System.Drawing.Point(14, 68);
this.datalocations.Name = "datalocations";
this.datalocations.Size = new System.Drawing.Size(368, 127);
this.datalocations.TabIndex = 0;
//
// 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(178, 510);
this.apply.Name = "apply";
this.apply.Size = new System.Drawing.Size(112, 25);
this.apply.TabIndex = 3;
this.apply.Text = "OK";
this.apply.UseVisualStyleBackColor = true;
this.apply.Click += new System.EventHandler(this.apply_Click);
//
// 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(296, 510);
this.cancel.Name = "cancel";
this.cancel.Size = new System.Drawing.Size(112, 25);
this.cancel.TabIndex = 4;
this.cancel.Text = "Cancel";
this.cancel.UseVisualStyleBackColor = true;
this.cancel.Click += new System.EventHandler(this.cancel_Click);
//
// config
//
this.config.DropDownHeight = 206;
this.config.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.config.FormattingEnabled = true;
this.config.IntegralHeight = false;
this.config.Location = new System.Drawing.Point(141, 21);
this.config.Name = "config";
this.config.Size = new System.Drawing.Size(267, 21);
this.config.TabIndex = 0;
this.config.SelectedIndexChanged += new System.EventHandler(this.config_SelectedIndexChanged);
//
// mapslist
//
this.mapslist.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.mapslist.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.panelres.Controls.Add(this.longtexturenames);
this.panelres.Controls.Add(this.strictpatches);
this.panelres.Controls.Add(this.datalocations);
this.panelres.Controls.Add(label3);
this.panelres.Location = new System.Drawing.Point(12, 246);
this.panelres.Name = "panelres";
this.panelres.Size = new System.Drawing.Size(396, 259);
this.panelres.TabIndex = 2;
this.panelres.TabStop = false;
this.panelres.Text = " Resources ";
//
// longtexturenames
//
this.longtexturenames.AutoSize = true;
this.longtexturenames.Location = new System.Drawing.Point(14, 45);
this.longtexturenames.Name = "longtexturenames";
this.longtexturenames.Size = new System.Drawing.Size(137, 17);
this.longtexturenames.TabIndex = 20;
this.longtexturenames.Text = "Use long texture names";
this.longtexturenames.UseVisualStyleBackColor = true;
//
// strictpatches
//
this.strictpatches.AutoSize = true;
this.strictpatches.Location = new System.Drawing.Point(14, 21);
this.strictpatches.Name = "strictpatches";
this.strictpatches.Size = new System.Drawing.Size(349, 17);
this.strictpatches.TabIndex = 19;
this.strictpatches.Text = "Strictly load patches between P_START and P_END only for this file";
this.strictpatches.UseVisualStyleBackColor = true;
//
// datalocations
//
this.datalocations.AllowDrop = true;
this.datalocations.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.datalocations.DialogOffset = new System.Drawing.Point(40, 20);
this.datalocations.GameConfiguration = null;
this.datalocations.Location = new System.Drawing.Point(14, 68);
this.datalocations.Name = "datalocations";
this.datalocations.Size = new System.Drawing.Size(367, 124);
this.datalocations.TabIndex = 0;
this.datalocations.OnWarningsChanged += new CodeImp.DoomBuilder.Controls.ResourceListEditor.WarningsChanged(this.datalocations_OnWarningsChanged);
//
// 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(178, 510);
this.apply.Name = "apply";
this.apply.Size = new System.Drawing.Size(112, 25);
this.apply.TabIndex = 3;
this.apply.Text = "OK";
this.apply.UseVisualStyleBackColor = true;
this.apply.Click += new System.EventHandler(this.apply_Click);
//
// 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(296, 510);
this.cancel.Name = "cancel";
this.cancel.Size = new System.Drawing.Size(112, 25);
this.cancel.TabIndex = 4;
this.cancel.Text = "Cancel";
this.cancel.UseVisualStyleBackColor = true;
this.cancel.Click += new System.EventHandler(this.cancel_Click);
//
// config
//
this.config.DropDownHeight = 206;
this.config.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.config.FormattingEnabled = true;
this.config.IntegralHeight = false;
this.config.Location = new System.Drawing.Point(141, 21);
this.config.Name = "config";
this.config.Size = new System.Drawing.Size(267, 21);
this.config.TabIndex = 0;
this.config.SelectedIndexChanged += new System.EventHandler(this.config_SelectedIndexChanged);
//
// mapslist
//
this.mapslist.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.mapslist.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
columnHeader1}); columnHeader1});
this.mapslist.FullRowSelect = true; this.mapslist.FullRowSelect = true;
this.mapslist.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; this.mapslist.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
this.mapslist.HideSelection = false; this.mapslist.HideSelection = false;
this.mapslist.LabelWrap = false; this.mapslist.LabelWrap = false;
this.mapslist.Location = new System.Drawing.Point(12, 122); this.mapslist.Location = new System.Drawing.Point(12, 122);
this.mapslist.MultiSelect = false; this.mapslist.MultiSelect = false;
this.mapslist.Name = "mapslist"; this.mapslist.Name = "mapslist";
this.mapslist.ShowGroups = false; this.mapslist.ShowGroups = false;
this.mapslist.Size = new System.Drawing.Size(396, 118); this.mapslist.Size = new System.Drawing.Size(396, 118);
this.mapslist.Sorting = System.Windows.Forms.SortOrder.Ascending; this.mapslist.Sorting = System.Windows.Forms.SortOrder.Ascending;
this.mapslist.TabIndex = 1; this.mapslist.TabIndex = 1;
this.mapslist.UseCompatibleStateImageBehavior = false; this.mapslist.UseCompatibleStateImageBehavior = false;
this.mapslist.View = System.Windows.Forms.View.List; this.mapslist.View = System.Windows.Forms.View.List;
this.mapslist.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.mapslist_ItemSelectionChanged); this.mapslist.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.mapslist_ItemSelectionChanged);
this.mapslist.DoubleClick += new System.EventHandler(this.mapslist_DoubleClick); this.mapslist.DoubleClick += new System.EventHandler(this.mapslist_DoubleClick);
// //
// scriptcompiler // scriptcompiler
// //
this.scriptcompiler.DropDownHeight = 206; this.scriptcompiler.DropDownHeight = 206;
this.scriptcompiler.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.scriptcompiler.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.scriptcompiler.Enabled = false; this.scriptcompiler.Enabled = false;
this.scriptcompiler.FormattingEnabled = true; this.scriptcompiler.FormattingEnabled = true;
this.scriptcompiler.IntegralHeight = false; this.scriptcompiler.IntegralHeight = false;
this.scriptcompiler.Location = new System.Drawing.Point(141, 49); this.scriptcompiler.Location = new System.Drawing.Point(141, 49);
this.scriptcompiler.Name = "scriptcompiler"; this.scriptcompiler.Name = "scriptcompiler";
this.scriptcompiler.Size = new System.Drawing.Size(267, 21); this.scriptcompiler.Size = new System.Drawing.Size(267, 21);
this.scriptcompiler.TabIndex = 17; this.scriptcompiler.TabIndex = 17;
// //
// scriptcompilerlabel // scriptcompilerlabel
// //
this.scriptcompilerlabel.Enabled = false; this.scriptcompilerlabel.Enabled = false;
this.scriptcompilerlabel.Location = new System.Drawing.Point(15, 52); this.scriptcompilerlabel.Location = new System.Drawing.Point(15, 52);
this.scriptcompilerlabel.Name = "scriptcompilerlabel"; this.scriptcompilerlabel.Name = "scriptcompilerlabel";
this.scriptcompilerlabel.Size = new System.Drawing.Size(120, 14); this.scriptcompilerlabel.Size = new System.Drawing.Size(120, 14);
this.scriptcompilerlabel.TabIndex = 18; this.scriptcompilerlabel.TabIndex = 18;
this.scriptcompilerlabel.Text = "Script Type:"; this.scriptcompilerlabel.Text = "Script Type:";
this.scriptcompilerlabel.TextAlign = System.Drawing.ContentAlignment.TopRight; this.scriptcompilerlabel.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// OpenMapOptionsForm // OpenMapOptionsForm
// //
this.AcceptButton = this.apply; this.AcceptButton = this.apply;
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancel; this.CancelButton = this.cancel;
this.ClientSize = new System.Drawing.Size(420, 541); this.ClientSize = new System.Drawing.Size(420, 541);
this.Controls.Add(this.scriptcompiler); this.Controls.Add(this.scriptcompiler);
this.Controls.Add(this.scriptcompilerlabel); this.Controls.Add(this.scriptcompilerlabel);
this.Controls.Add(this.mapslist); this.Controls.Add(this.mapslist);
this.Controls.Add(label2); this.Controls.Add(label2);
this.Controls.Add(this.config); this.Controls.Add(this.config);
this.Controls.Add(label1); this.Controls.Add(label1);
this.Controls.Add(this.cancel); this.Controls.Add(this.cancel);
this.Controls.Add(this.apply); this.Controls.Add(this.apply);
this.Controls.Add(this.panelres); this.Controls.Add(this.panelres);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "OpenMapOptionsForm"; this.Name = "OpenMapOptionsForm";
this.Opacity = 0D; this.Opacity = 0D;
this.ShowIcon = false; this.ShowIcon = false;
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Open Map Options"; this.Text = "Open Map Options";
this.Shown += new System.EventHandler(this.OpenMapOptionsForm_Shown); this.Shown += new System.EventHandler(this.OpenMapOptionsForm_Shown);
this.HelpRequested += new System.Windows.Forms.HelpEventHandler(this.OpenMapOptionsForm_HelpRequested); this.HelpRequested += new System.Windows.Forms.HelpEventHandler(this.OpenMapOptionsForm_HelpRequested);
this.panelres.ResumeLayout(false); this.panelres.ResumeLayout(false);
this.panelres.PerformLayout(); this.panelres.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }

View file

@ -41,6 +41,7 @@ namespace CodeImp.DoomBuilder.Windows
private string selectedmapname; private string selectedmapname;
private static readonly Regex episodemapregex = new Regex("^E[1-9]M[1-9]$"); private static readonly Regex episodemapregex = new Regex("^E[1-9]M[1-9]$");
private static readonly Regex noepisodemapregex = new Regex("^MAP[0-9][0-9]$"); private static readonly Regex noepisodemapregex = new Regex("^MAP[0-9][0-9]$");
private readonly int initialformsize;
// Properties // Properties
//public string FilePathName { get { return filepathname; } } //public string FilePathName { get { return filepathname; } }
@ -51,11 +52,13 @@ namespace CodeImp.DoomBuilder.Windows
{ {
// Initialize // Initialize
InitializeComponent(); InitializeComponent();
CodeImp.DoomBuilder.General.ApplyMonoListViewFix(mapslist); General.ApplyMonoListViewFix(mapslist);
this.Text = "Open Map from " + Path.GetFileName(filepathname); this.Text = "Open Map from " + Path.GetFileName(filepathname);
this.filepathname = filepathname; this.filepathname = filepathname;
datalocations.StartPath = filepathname; //mxd datalocations.StartPath = filepathname; //mxd
datalocations.IsMapControl = true;
this.options = null; this.options = null;
this.initialformsize = Height;
} }
// Constructor // Constructor
@ -63,12 +66,20 @@ namespace CodeImp.DoomBuilder.Windows
{ {
// Initialize // Initialize
InitializeComponent(); InitializeComponent();
CodeImp.DoomBuilder.General.ApplyMonoListViewFix(mapslist); General.ApplyMonoListViewFix(mapslist);
this.Text = "Open Map from " + Path.GetFileName(filepathname); this.Text = "Open Map from " + Path.GetFileName(filepathname);
this.filepathname = filepathname; this.filepathname = filepathname;
this.options = options; this.options = options;
datalocations.StartPath = filepathname; //mxd datalocations.StartPath = filepathname; //mxd
datalocations.EditResourceLocationList(options.Resources); datalocations.IsMapControl = true;
this.initialformsize = Height;
}
private GameConfiguration GetGameConfiguration()
{
if (config.Items.Count == 0 || config.SelectedIndex < 0) return null;
return new GameConfiguration((config.SelectedItem as ConfigurationInfo).Configuration);
} }
// This loads the settings and attempt to find a suitable config // This loads the settings and attempt to find a suitable config
@ -230,6 +241,7 @@ namespace CodeImp.DoomBuilder.Windows
{ {
// Show the window // Show the window
this.Opacity = 1; this.Opacity = 1;
datalocations.GameConfiguration = GetGameConfiguration();
} }
// Done // Done
@ -311,6 +323,9 @@ namespace CodeImp.DoomBuilder.Windows
// Configuration is selected // Configuration is selected
private void config_SelectedIndexChanged(object sender, EventArgs e) private void config_SelectedIndexChanged(object sender, EventArgs e)
{ {
//
datalocations.GameConfiguration = GetGameConfiguration();
// Anything selected? // Anything selected?
if(config.SelectedIndex < 0) return; if(config.SelectedIndex < 0) return;
@ -528,6 +543,10 @@ namespace CodeImp.DoomBuilder.Windows
// Load settings // Load settings
LoadSettings(); LoadSettings();
// Show
if (options != null)
datalocations.EditResourceLocationList(options.Resources);
} }
// Map name doubleclicked // Map name doubleclicked
@ -540,7 +559,10 @@ namespace CodeImp.DoomBuilder.Windows
// Map name selected // Map name selected
private void mapslist_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e) private void mapslist_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
{ {
if(!e.IsSelected) return; //mxd. Don't want to trigger this twice //
datalocations.GameConfiguration = GetGameConfiguration();
if (!e.IsSelected) return; //mxd. Don't want to trigger this twice
DataLocationList locations; DataLocationList locations;
DataLocationList listedlocations; DataLocationList listedlocations;
@ -618,5 +640,11 @@ namespace CodeImp.DoomBuilder.Windows
General.ShowHelp("w_openmapoptions.html"); General.ShowHelp("w_openmapoptions.html");
hlpevent.Handled = true; hlpevent.Handled = true;
} }
}
private void datalocations_OnWarningsChanged(int size)
{
Height = initialformsize + size;
Refresh();
}
}
} }

View file

@ -53,6 +53,9 @@ namespace CodeImp.DoomBuilder.Windows
this.wadfiledialog = new System.Windows.Forms.OpenFileDialog(); this.wadfiledialog = new System.Windows.Forms.OpenFileDialog();
this.pk3filedialog = new System.Windows.Forms.OpenFileDialog(); this.pk3filedialog = new System.Windows.Forms.OpenFileDialog();
this.notfortesting = new System.Windows.Forms.CheckBox(); this.notfortesting = new System.Windows.Forms.CheckBox();
this.checkingloader = new System.Windows.Forms.Panel();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.label4 = new System.Windows.Forms.Label();
label1 = new System.Windows.Forms.Label(); label1 = new System.Windows.Forms.Label();
label2 = new System.Windows.Forms.Label(); label2 = new System.Windows.Forms.Label();
label3 = new System.Windows.Forms.Label(); label3 = new System.Windows.Forms.Label();
@ -60,6 +63,8 @@ namespace CodeImp.DoomBuilder.Windows
this.wadfiletab.SuspendLayout(); this.wadfiletab.SuspendLayout();
this.directorytab.SuspendLayout(); this.directorytab.SuspendLayout();
this.pk3filetab.SuspendLayout(); this.pk3filetab.SuspendLayout();
this.checkingloader.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// label1 // label1
@ -280,7 +285,7 @@ namespace CodeImp.DoomBuilder.Windows
// //
this.cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 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.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancel.Location = new System.Drawing.Point(262, 260); this.cancel.Location = new System.Drawing.Point(262, 304);
this.cancel.Name = "cancel"; this.cancel.Name = "cancel";
this.cancel.Size = new System.Drawing.Size(112, 25); this.cancel.Size = new System.Drawing.Size(112, 25);
this.cancel.TabIndex = 2; this.cancel.TabIndex = 2;
@ -291,7 +296,7 @@ namespace CodeImp.DoomBuilder.Windows
// apply // apply
// //
this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.apply.Location = new System.Drawing.Point(144, 260); this.apply.Location = new System.Drawing.Point(144, 304);
this.apply.Name = "apply"; this.apply.Name = "apply";
this.apply.Size = new System.Drawing.Size(112, 25); this.apply.Size = new System.Drawing.Size(112, 25);
this.apply.TabIndex = 1; this.apply.TabIndex = 1;
@ -313,20 +318,56 @@ namespace CodeImp.DoomBuilder.Windows
// //
this.notfortesting.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.notfortesting.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.notfortesting.AutoSize = true; this.notfortesting.AutoSize = true;
this.notfortesting.Location = new System.Drawing.Point(12, 232); this.notfortesting.Location = new System.Drawing.Point(12, 233);
this.notfortesting.Name = "notfortesting"; this.notfortesting.Name = "notfortesting";
this.notfortesting.Size = new System.Drawing.Size(239, 17); this.notfortesting.Size = new System.Drawing.Size(239, 17);
this.notfortesting.TabIndex = 3; this.notfortesting.TabIndex = 3;
this.notfortesting.Text = "Exclude this resource from testing parameters"; this.notfortesting.Text = "Exclude this resource from testing parameters";
this.notfortesting.UseVisualStyleBackColor = true; this.notfortesting.UseVisualStyleBackColor = true;
// //
// checkingloader
//
this.checkingloader.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.checkingloader.BackColor = System.Drawing.SystemColors.Info;
this.checkingloader.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.checkingloader.Controls.Add(this.pictureBox1);
this.checkingloader.Controls.Add(this.label4);
this.checkingloader.Cursor = System.Windows.Forms.Cursors.AppStarting;
this.checkingloader.ForeColor = System.Drawing.SystemColors.InfoText;
this.checkingloader.Location = new System.Drawing.Point(12, 263);
this.checkingloader.Name = "checkingloader";
this.checkingloader.Size = new System.Drawing.Size(362, 32);
this.checkingloader.TabIndex = 4;
this.checkingloader.Visible = false;
//
// pictureBox1
//
this.pictureBox1.Image = global::CodeImp.DoomBuilder.Properties.Resources.Loader;
this.pictureBox1.InitialImage = global::CodeImp.DoomBuilder.Properties.Resources.Loader;
this.pictureBox1.Location = new System.Drawing.Point(8, 7);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(16, 16);
this.pictureBox1.TabIndex = 2;
this.pictureBox1.TabStop = false;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(29, 8);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(176, 13);
this.label4.TabIndex = 0;
this.label4.Text = "Please wait, checking the archive...";
//
// ResourceOptionsForm // ResourceOptionsForm
// //
this.AcceptButton = this.apply; this.AcceptButton = this.apply;
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancel; this.CancelButton = this.cancel;
this.ClientSize = new System.Drawing.Size(386, 293); this.ClientSize = new System.Drawing.Size(386, 337);
this.Controls.Add(this.checkingloader);
this.Controls.Add(this.notfortesting); this.Controls.Add(this.notfortesting);
this.Controls.Add(this.cancel); this.Controls.Add(this.cancel);
this.Controls.Add(this.apply); this.Controls.Add(this.apply);
@ -348,6 +389,9 @@ namespace CodeImp.DoomBuilder.Windows
this.directorytab.PerformLayout(); this.directorytab.PerformLayout();
this.pk3filetab.ResumeLayout(false); this.pk3filetab.ResumeLayout(false);
this.pk3filetab.PerformLayout(); this.pk3filetab.PerformLayout();
this.checkingloader.ResumeLayout(false);
this.checkingloader.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -376,5 +420,8 @@ namespace CodeImp.DoomBuilder.Windows
private System.Windows.Forms.CheckBox strictpatches; private System.Windows.Forms.CheckBox strictpatches;
private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label6;
private System.Windows.Forms.CheckBox notfortesting; private System.Windows.Forms.CheckBox notfortesting;
} private System.Windows.Forms.Panel checkingloader;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.PictureBox pictureBox1;
}
} }

View file

@ -20,6 +20,13 @@ using System;
using System.Windows.Forms; using System.Windows.Forms;
using System.IO; using System.IO;
using CodeImp.DoomBuilder.Data; using CodeImp.DoomBuilder.Data;
using CodeImp.DoomBuilder.Config;
using System.Collections.Generic;
using System.ComponentModel;
using System.Threading.Tasks;
using CodeImp.DoomBuilder.ZDoom;
using System.Threading;
using System.Windows.Threading;
#endregion #endregion
@ -31,10 +38,46 @@ namespace CodeImp.DoomBuilder.Windows
private DataLocation res; private DataLocation res;
private string startPath; private string startPath;
private Controls.FolderSelectDialog dirdialog; private Controls.FolderSelectDialog dirdialog;
private List<string> requiredarchives;
// Properties // Properties
public DataLocation ResourceLocation { get { return res; } } public DataLocation ResourceLocation { get { return res; } }
public GameConfiguration GameConfiguration { get; set; }
//
private bool _ischeckingrequiredarchives = false;
private bool IsCheckingRequiredArchives
{
get
{
return _ischeckingrequiredarchives;
}
set
{
if (value)
{
apply.Enabled = false;
cancel.Enabled = false;
notfortesting.Enabled = false;
dir_textures.Enabled = false;
dir_flats.Enabled = false;
ControlBox = false;
checkingloader.Visible = true;
}
else
{
apply.Enabled = true;
cancel.Enabled = true;
notfortesting.Enabled = true;
dir_textures.Enabled = true;
dir_flats.Enabled = true;
ControlBox = true;
checkingloader.Visible = false;
}
_ischeckingrequiredarchives = value;
}
}
// Constructor // Constructor
public ResourceOptionsForm(DataLocation settings, string caption, string startPath) //mxd. added startPath public ResourceOptionsForm(DataLocation settings, string caption, string startPath) //mxd. added startPath
{ {
@ -43,7 +86,10 @@ namespace CodeImp.DoomBuilder.Windows
// Set caption // Set caption
this.Text = caption; this.Text = caption;
//
this.requiredarchives = new List<string>();
// Apply settings from ResourceLocation // Apply settings from ResourceLocation
this.res = settings; this.res = settings;
switch(res.type) switch(res.type)
@ -75,22 +121,209 @@ namespace CodeImp.DoomBuilder.Windows
this.startPath = startPath; this.startPath = startPath;
} }
// OK clicked protected override void OnClosing(CancelEventArgs e)
private void apply_Click(object sender, EventArgs e) {
{ base.OnClosing(e);
if (IsCheckingRequiredArchives) e.Cancel = true;
}
public static List<string> CheckRequiredArchives(GameConfiguration config, DataLocation loc, CancellationToken token)
{
if (config == null)
return new List<string>();
try
{
DataReader dr = null;
List<string> requiredarchives = new List<string>();
HashSet<string> classes = null;
switch (loc.type)
{
case DataLocation.RESOURCE_WAD:
dr = new WADReader(loc, config, true) { Silent = true };
break;
case DataLocation.RESOURCE_DIRECTORY:
dr = new DirectoryReader(loc, config, true) { Silent = true };
break;
case DataLocation.RESOURCE_PK3:
dr = new PK3Reader(loc, config, true) { Silent = true };
break;
}
token.ThrowIfCancellationRequested();
foreach (var arc in config.RequiredArchives)
{
bool found = true;
token.ThrowIfCancellationRequested();
foreach (RequiredArchiveEntry e in arc.Entries)
{
token.ThrowIfCancellationRequested();
if (e.Class != null)
{
if (classes == null)
{
classes = new HashSet<string>();
// load ZScript
var zscript = new ZScriptParser {
NoWarnings = true,
OnInclude = (parser, location) => {
IEnumerable<TextResourceData> includeStreams = dr.GetZScriptData(location);
foreach (TextResourceData data in includeStreams)
{
// Parse this data
parser.Parse(data, false);
//mxd. DECORATE lumps are interdepandable. Can't carry on...
if (parser.HasError)
break;
}
}
};
foreach (TextResourceData data in dr.GetZScriptData("ZSCRIPT"))
{
// Parse the data
data.Stream.Seek(0, SeekOrigin.Begin);
zscript.Parse(data, true);
if (zscript.HasError)
break;
foreach (string cls in zscript.LastClasses)
classes.Add(cls.ToLowerInvariant());
}
// load DECORATE
var decorate = new DecorateParser(zscript.AllActorsByClass) {
NoWarnings = true,
OnInclude = (parser, location) => {
IEnumerable<TextResourceData> includeStreams = dr.GetDecorateData(location);
foreach (TextResourceData data in includeStreams)
{
// Parse this data
parser.Parse(data, false);
//mxd. DECORATE lumps are interdepandable. Can't carry on...
if (parser.HasError)
break;
}
}
};
foreach (TextResourceData data in dr.GetDecorateData("DECORATE"))
{
// Parse the data
data.Stream.Seek(0, SeekOrigin.Begin);
decorate.Parse(data, true);
if (decorate.HasError)
break;
foreach (string cls in decorate.LastClasses)
classes.Add(cls.ToLowerInvariant());
}
}
if (!classes.Contains(e.Class.ToLowerInvariant()))
{
found = false;
break;
}
}
if (e.Lump != null && !dr.FileExists(e.Lump))
{
found = false;
break;
}
}
if (found)
{
requiredarchives.Add(arc.ID);
}
}
dr.Dispose();
return requiredarchives;
}
catch (OperationCanceledException)
{
throw;
}
catch (Exception e)
{
General.WriteLogLine(e.ToString());
return new List<string>();
}
}
private List<string> RunCheckRequiredArchives()
{
// thanks ms for making this a struct
CancellationTokenSource dummySource = new CancellationTokenSource();
List<string> output = CheckRequiredArchives(GameConfiguration, ToDataLocation(), dummySource.Token);
dummySource.Dispose();
return output;
}
private void StartRequiredArchivesCheck()
{
IsCheckingRequiredArchives = true;
var dispatcher = Dispatcher.CurrentDispatcher;
Task.Run(RunCheckRequiredArchives).ContinueWith((t) =>
{
dispatcher.Invoke(() =>
{
if (!t.IsFaulted && !t.IsCanceled)
requiredarchives = t.Result;
else requiredarchives = new List<string>();
ApplyDefaultRequiredArchivesSetting();
IsCheckingRequiredArchives = false;
});
});
}
private void ApplyDefaultRequiredArchivesSetting()
{
dir_textures.Checked = false;
dir_flats.Checked = false;
notfortesting.Checked = false;
// if any of the detected required archives implies "not for testing" — disable it by default
foreach (var arc in GameConfiguration.RequiredArchives)
{
if (requiredarchives.Contains(arc.ID) && arc.ExcludeFromTesting)
notfortesting.Checked = true;
}
}
private DataLocation ToDataLocation()
{
DataLocation res = new DataLocation();
res.location = "";
res.requiredarchives = requiredarchives;
// Apply settings to ResourceLocation // Apply settings to ResourceLocation
switch(tabs.SelectedIndex) switch (tabs.SelectedIndex)
{ {
// Setup WAD File // Setup WAD File
case DataLocation.RESOURCE_WAD: case DataLocation.RESOURCE_WAD:
// Check if file is specified // Check if file is specified
if((wadlocation.Text.Length == 0) || if ((wadlocation.Text.Length == 0) ||
(!File.Exists(wadlocation.Text))) (!File.Exists(wadlocation.Text)))
{ {
// No valid wad file specified break;
MessageBox.Show(this, "Please select a valid WAD File resource.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
} }
else else
{ {
@ -100,10 +333,6 @@ namespace CodeImp.DoomBuilder.Windows
res.option1 = strictpatches.Checked; res.option1 = strictpatches.Checked;
res.option2 = false; res.option2 = false;
res.notfortesting = notfortesting.Checked; res.notfortesting = notfortesting.Checked;
// Done
this.DialogResult = DialogResult.OK;
this.Close();
} }
break; break;
@ -111,11 +340,10 @@ namespace CodeImp.DoomBuilder.Windows
case DataLocation.RESOURCE_DIRECTORY: case DataLocation.RESOURCE_DIRECTORY:
// Check if directory is specified // Check if directory is specified
if((dirlocation.Text.Length == 0) || if ((dirlocation.Text.Length == 0) ||
(!Directory.Exists(dirlocation.Text))) (!Directory.Exists(dirlocation.Text)))
{ {
// No valid directory specified break;
MessageBox.Show(this, "Please select a valid directory resource.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
} }
else else
{ {
@ -125,22 +353,17 @@ namespace CodeImp.DoomBuilder.Windows
res.option1 = dir_textures.Checked; res.option1 = dir_textures.Checked;
res.option2 = dir_flats.Checked; res.option2 = dir_flats.Checked;
res.notfortesting = notfortesting.Checked; res.notfortesting = notfortesting.Checked;
// Done
this.DialogResult = DialogResult.OK;
this.Close();
} }
break; break;
// Setup PK3 File // Setup PK3 File
case DataLocation.RESOURCE_PK3: case DataLocation.RESOURCE_PK3:
// Check if file is specified // Check if file is specified
if((pk3location.Text.Length == 0) || if ((pk3location.Text.Length == 0) ||
(!File.Exists(pk3location.Text))) (!File.Exists(pk3location.Text)))
{ {
// No valid pk3 file specified break;
MessageBox.Show(this, "Please select a valid PK3 or PK7 File resource.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
} }
else else
{ {
@ -150,13 +373,39 @@ namespace CodeImp.DoomBuilder.Windows
res.option1 = false; res.option1 = false;
res.option2 = false; res.option2 = false;
res.notfortesting = notfortesting.Checked; res.notfortesting = notfortesting.Checked;
// Done
this.DialogResult = DialogResult.OK;
this.Close();
} }
break; break;
} }
return res;
}
// OK clicked
private void apply_Click(object sender, EventArgs e)
{
res = ToDataLocation();
if (res.location == "")
{
switch (tabs.SelectedIndex)
{
case DataLocation.RESOURCE_WAD:
MessageBox.Show(this, "Please select a valid WAD File resource.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
break;
case DataLocation.RESOURCE_PK3:
MessageBox.Show(this, "Please select a valid PK3 or PK7 File resource.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
break;
case DataLocation.RESOURCE_DIRECTORY:
MessageBox.Show(this, "Please select a valid directory resource.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
break;
}
}
else
{
this.DialogResult = DialogResult.OK;
this.Close();
}
} }
// Cancel clicked // Cancel clicked
@ -175,6 +424,7 @@ namespace CodeImp.DoomBuilder.Windows
{ {
// Use this file // Use this file
wadlocation.Text = wadfiledialog.FileName; wadlocation.Text = wadfiledialog.FileName;
StartRequiredArchivesCheck();
} }
} }
@ -203,6 +453,7 @@ namespace CodeImp.DoomBuilder.Windows
{ {
// Use this directory // Use this directory
dirlocation.Text = dirdialog.FileName; dirlocation.Text = dirdialog.FileName;
StartRequiredArchivesCheck();
dirdialog = null; dirdialog = null;
} }
} }
@ -215,6 +466,7 @@ namespace CodeImp.DoomBuilder.Windows
{ {
// Use this file // Use this file
pk3location.Text = pk3filedialog.FileName; pk3location.Text = pk3filedialog.FileName;
StartRequiredArchivesCheck();
} }
} }
@ -230,5 +482,5 @@ namespace CodeImp.DoomBuilder.Windows
General.ShowHelp("w_resourceoptions.html"); General.ShowHelp("w_resourceoptions.html");
hlpevent.Handled = true; hlpevent.Handled = true;
} }
} }
} }

View file

@ -201,7 +201,4 @@
<metadata name="pk3filedialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="pk3filedialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>227, 17</value> <value>227, 17</value>
</metadata> </metadata>
<metadata name="notfortesting.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root> </root>

View file

@ -35,7 +35,7 @@ namespace CodeImp.DoomBuilder.ZDoom
public delegate void IncludeDelegate(DecorateParser parser, string includefile); public delegate void IncludeDelegate(DecorateParser parser, string includefile);
public IncludeDelegate OnInclude; public IncludeDelegate OnInclude;
#endregion #endregion
#region ================== Constants #region ================== Constants
@ -64,11 +64,14 @@ namespace CodeImp.DoomBuilder.ZDoom
//mxd. Disposing. Is that really needed?.. //mxd. Disposing. Is that really needed?..
private bool isdisposed; private bool isdisposed;
//
public bool NoWarnings = false;
#endregion #endregion
#region ================== Properties #region ================== Properties
/// <summary> /// <summary>
/// All actors that are supported by the current game. /// All actors that are supported by the current game.
/// </summary> /// </summary>
@ -129,11 +132,18 @@ namespace CodeImp.DoomBuilder.ZDoom
isdisposed = true; isdisposed = true;
} }
} }
#endregion #endregion
#region ================== Parsing #region ================== Parsing
protected internal override void LogWarning(string message, int linenumber)
{
if (NoWarnings)
return;
base.LogWarning(message, linenumber);
}
// This parses the given decorate stream // This parses the given decorate stream
// Returns false on errors // Returns false on errors
public override bool Parse(TextResourceData data, bool clearerrors) public override bool Parse(TextResourceData data, bool clearerrors)

View file

@ -708,7 +708,7 @@ namespace CodeImp.DoomBuilder.ZDoom
//mxd. This adds a warning to the ErrorLogger //mxd. This adds a warning to the ErrorLogger
protected internal void LogWarning(string message) { LogWarning(message, CompilerError.NO_LINE_NUMBER); } protected internal void LogWarning(string message) { LogWarning(message, CompilerError.NO_LINE_NUMBER); }
protected internal void LogWarning(string message, int linenumber) protected internal virtual void LogWarning(string message, int linenumber)
{ {
// Add a warning // Add a warning
int errline = (linenumber != CompilerError.NO_LINE_NUMBER int errline = (linenumber != CompilerError.NO_LINE_NUMBER

View file

@ -193,6 +193,9 @@ namespace CodeImp.DoomBuilder.ZDoom
// [ZZ] custom tokenizer class // [ZZ] custom tokenizer class
internal ZScriptTokenizer tokenizer; internal ZScriptTokenizer tokenizer;
//
public bool NoWarnings = false;
#endregion #endregion
#region ================== Properties #region ================== Properties
@ -346,6 +349,13 @@ namespace CodeImp.DoomBuilder.ZDoom
return true; return true;
} }
protected internal override void LogWarning(string message, int linenumber)
{
if (NoWarnings)
return;
base.LogWarning(message, linenumber);
}
// read in an expression as a token list. // read in an expression as a token list.
internal List<ZScriptToken> ParseExpression(bool betweenparen = false) internal List<ZScriptToken> ParseExpression(bool betweenparen = false)
{ {