mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-29 15:11:56 +00:00
Added warnings about possibly invalid resource configurations before starting to edit a map
This commit is contained in:
parent
8808d5ce3c
commit
4fd97fec9c
34 changed files with 2584 additions and 1870 deletions
|
@ -677,6 +677,7 @@
|
|||
<Reference Include="TabControlEX, Version=0.0.3271.41578, Culture=neutral, PublicKeyToken=1db242dc828e4b4e">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Controls\CommandPaletteControl.resx">
|
||||
|
@ -733,6 +734,9 @@
|
|||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<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" />
|
||||
<EmbeddedResource Include="Resources\things2d.shader" />
|
||||
<None Include="Resources\UnknownImage.png" />
|
||||
|
@ -1372,6 +1376,7 @@
|
|||
<None Include="Resources\MergeGeo.png" />
|
||||
<None Include="Resources\MergeGeoClassic.png" />
|
||||
<None Include="Resources\MergeGeoRemoveLines.png" />
|
||||
<None Include="Resources\Loader.gif" />
|
||||
<Content Include="Resources\Model.png" />
|
||||
<None Include="Resources\ModelDisabled.png" />
|
||||
<None Include="Resources\ModelFiltered.png" />
|
||||
|
|
|
@ -105,7 +105,7 @@ namespace CodeImp.DoomBuilder.Compilers
|
|||
// Map SCRIPTS lump is empty. Abort the process without generating any warnings or errors.
|
||||
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...
|
||||
TextResourceData data = new TextResourceData(stream, dl, (SourceIsMapScriptsLump ? inputfile : sourcefile));
|
||||
if(!parser.Parse(data, info.Files, true, AcsParserSE.IncludeType.NONE, false))
|
||||
|
|
|
@ -549,7 +549,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
string classname = cfg.ReadSetting("requiredarchives." + cde.Key + "." + cde2.Key + ".class", (string)null);
|
||||
reqEntries.Add(new RequiredArchiveEntry(classname, lumpname));
|
||||
}
|
||||
requiredarchives.Add(new RequiredArchive(filename, exclude, reqEntries));
|
||||
requiredarchives.Add(new RequiredArchive((string)cde.Key, filename, exclude, reqEntries));
|
||||
}
|
||||
|
||||
// Things
|
||||
|
|
|
@ -23,17 +23,20 @@ namespace CodeImp.DoomBuilder.Config
|
|||
|
||||
class RequiredArchive
|
||||
{
|
||||
private string id;
|
||||
private string filename;
|
||||
private bool excludeFromTesting;
|
||||
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.excludeFromTesting = excludeFromTesting;
|
||||
this.entries = entries;
|
||||
}
|
||||
|
||||
public string ID { get { return id; } }
|
||||
public string FileName { get { return filename; } }
|
||||
public bool ExcludeFromTesting { get { return excludeFromTesting; } }
|
||||
public IReadOnlyCollection<RequiredArchiveEntry> Entries { get { return entries; } }
|
||||
|
|
93
Source/Core/Controls/ResourceListEditor.Designer.cs
generated
93
Source/Core/Controls/ResourceListEditor.Designer.cs
generated
|
@ -29,17 +29,15 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem(new string[] {
|
||||
"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[] {
|
||||
"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.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);
|
||||
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);
|
||||
System.Windows.Forms.ListViewItem listViewItem6 = new System.Windows.Forms.ListViewItem("C:\\My\\Little\\Pony.wad", 1);
|
||||
this.editresource = new System.Windows.Forms.Button();
|
||||
this.deleteresources = new System.Windows.Forms.Button();
|
||||
this.addresource = new System.Windows.Forms.Button();
|
||||
this.resourceitems = new CodeImp.DoomBuilder.Controls.ResourceListView();
|
||||
this.column = new System.Windows.Forms.ColumnHeader();
|
||||
this.copypastemenu = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.copyresources = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.cutresources = new System.Windows.Forms.ToolStripMenuItem();
|
||||
|
@ -49,11 +47,15 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.removeresources = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.images = new System.Windows.Forms.ImageList(this.components);
|
||||
this.resourceitems = new CodeImp.DoomBuilder.Controls.ResourceListView();
|
||||
this.column = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.copypastemenu.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// editresource
|
||||
//
|
||||
this.editresource.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.editresource.Enabled = false;
|
||||
this.editresource.Location = new System.Drawing.Point(122, 140);
|
||||
this.editresource.Name = "editresource";
|
||||
|
@ -65,6 +67,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
//
|
||||
// deleteresources
|
||||
//
|
||||
this.deleteresources.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.deleteresources.Enabled = false;
|
||||
this.deleteresources.Location = new System.Drawing.Point(259, 140);
|
||||
this.deleteresources.Name = "deleteresources";
|
||||
|
@ -76,6 +79,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
//
|
||||
// addresource
|
||||
//
|
||||
this.addresource.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.addresource.Location = new System.Drawing.Point(3, 140);
|
||||
this.addresource.Name = "addresource";
|
||||
this.addresource.Size = new System.Drawing.Size(118, 24);
|
||||
|
@ -84,41 +88,6 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.addresource.UseVisualStyleBackColor = true;
|
||||
this.addresource.Click += new System.EventHandler(this.addresource_Click);
|
||||
//
|
||||
// resourceitems
|
||||
//
|
||||
this.resourceitems.AllowDrop = true;
|
||||
this.resourceitems.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||
this.column});
|
||||
this.resourceitems.ContextMenuStrip = this.copypastemenu;
|
||||
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[] {
|
||||
|
@ -193,6 +162,45 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.images.Images.SetKeyName(3, "FolderLocked.ico");
|
||||
this.images.Images.SetKeyName(4, "FileLocked.ico");
|
||||
this.images.Images.SetKeyName(5, "PK3Locked.ico");
|
||||
this.images.Images.SetKeyName(6, "Loader.gif");
|
||||
//
|
||||
// resourceitems
|
||||
//
|
||||
this.resourceitems.AllowDrop = true;
|
||||
this.resourceitems.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.resourceitems.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||
this.column});
|
||||
this.resourceitems.ContextMenuStrip = this.copypastemenu;
|
||||
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[] {
|
||||
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
|
||||
//
|
||||
|
@ -205,7 +213,6 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.Controls.Add(this.deleteresources);
|
||||
this.Name = "ResourceListEditor";
|
||||
this.Size = new System.Drawing.Size(350, 166);
|
||||
this.Resize += new System.EventHandler(this.ResourceListEditor_Resize);
|
||||
this.copypastemenu.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
|
|
|
@ -20,7 +20,11 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Threading;
|
||||
using CodeImp.DoomBuilder.Config;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
using CodeImp.DoomBuilder.Windows;
|
||||
|
||||
|
@ -30,11 +34,30 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
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
|
||||
|
||||
public delegate void ContentChanged();
|
||||
public delegate void WarningsChanged(int size);
|
||||
public event ContentChanged OnContentChanged;
|
||||
public event WarningsChanged OnWarningsChanged;
|
||||
public string StartPath; //mxd
|
||||
public bool IsMapControl = false;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -47,12 +70,15 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
private readonly int pasteactionkey;
|
||||
private readonly int pastespecialactionkey;
|
||||
private readonly int deleteactionkey;
|
||||
private readonly Dictionary<string, CancellationTokenSource> loadingrequiredarchives;
|
||||
private readonly List<Warning> warnings;
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Properties
|
||||
|
||||
public Point DialogOffset { get { return dialogoffset; } set { dialogoffset = value; } }
|
||||
public GameConfiguration GameConfiguration { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -65,7 +91,10 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
InitializeComponent();
|
||||
ResizeColumnHeader();
|
||||
|
||||
if(General.Actions != null)
|
||||
loadingrequiredarchives = new Dictionary<string, CancellationTokenSource>();
|
||||
warnings = new List<Warning>();
|
||||
|
||||
if (General.Actions != null)
|
||||
{
|
||||
// Get key shortcuts (mxd)
|
||||
copyactionkey = General.Actions.GetActionByName("builder_copyselection").ShortcutKey;
|
||||
|
@ -110,6 +139,266 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
}
|
||||
|
||||
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
|
||||
public void FixedResourceLocationList(DataLocationList list)
|
||||
{
|
||||
|
@ -123,8 +412,11 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
for(int i = resourceitems.Items.Count - 1; i >= 0; i--)
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
else
|
||||
currentitems.Add((DataLocation)resourceitems.Items[i].Tag); //mxd
|
||||
}
|
||||
|
@ -138,17 +430,25 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// Add item as fixed
|
||||
resourceitems.Items.Insert(0, new ListViewItem(list[i].location));
|
||||
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
|
||||
resourceitems.Items[0].ForeColor = SystemColors.GrayText;
|
||||
|
||||
// Validate path (mxd)
|
||||
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
|
||||
resourceitems.EndUpdate();
|
||||
|
||||
if (loadingrequiredarchives.Count == 0)
|
||||
UpdateWarnings();
|
||||
}
|
||||
|
||||
// This will edit the given list
|
||||
|
@ -165,9 +465,12 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
for(int i = resourceitems.Items.Count - 1; i >= 0; i--)
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
// Go for all items
|
||||
foreach(DataLocation dl in list)
|
||||
|
@ -176,6 +479,9 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
AddItem(dl);
|
||||
}
|
||||
|
||||
if (loadingrequiredarchives.Count == 0)
|
||||
UpdateWarnings();
|
||||
|
||||
// Done
|
||||
resourceitems.EndUpdate();
|
||||
ResizeColumnHeader();
|
||||
|
@ -208,7 +514,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
int index = resourceitems.Items.Count;
|
||||
resourceitems.Items.Add(new ListViewItem(rl.location));
|
||||
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
|
||||
resourceitems.Items[index].ForeColor = SystemColors.WindowText;
|
||||
|
@ -218,6 +524,12 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
// Done
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -240,6 +552,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
// Open resource options dialog
|
||||
ResourceOptionsForm resoptions = new ResourceOptionsForm(new DataLocation(), "Add Resource", StartPath);
|
||||
resoptions.GameConfiguration = GameConfiguration;
|
||||
resoptions.StartPosition = FormStartPosition.Manual;
|
||||
Rectangle startposition = new Rectangle(dialogoffset.X, dialogoffset.Y, 1, 1);
|
||||
startposition = this.RectangleToScreen(startposition);
|
||||
|
@ -257,6 +570,9 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
General.Interface.DisplayStatus(StatusType.Warning, "Resource already added!"); //mxd
|
||||
return; //mxd
|
||||
}
|
||||
|
||||
if (loadingrequiredarchives.Count == 0)
|
||||
UpdateWarnings();
|
||||
}
|
||||
|
||||
// Raise content changed event
|
||||
|
@ -274,6 +590,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
// Open resource options dialog
|
||||
ResourceOptionsForm resoptions = new ResourceOptionsForm((DataLocation)selecteditem.Tag, "Resource Options", StartPath);
|
||||
resoptions.GameConfiguration = GameConfiguration;
|
||||
resoptions.StartPosition = FormStartPosition.Manual;
|
||||
Rectangle startposition = new Rectangle(dialogoffset.X, dialogoffset.Y, 1, 1);
|
||||
startposition = this.RectangleToScreen(startposition);
|
||||
|
@ -292,13 +609,20 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
DataLocation rl = resoptions.ResourceLocation;
|
||||
selecteditem.Text = rl.location;
|
||||
selecteditem.Tag = rl;
|
||||
selecteditem.ImageIndex = GetIconIndex(rl.type, false);
|
||||
selecteditem.ImageIndex = IsLoading(rl.location) ? GetLoaderIndex() : GetIconIndex(rl.type, false);
|
||||
|
||||
// Done
|
||||
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
|
||||
if(OnContentChanged != null) OnContentChanged();
|
||||
if (OnContentChanged != null) OnContentChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -402,19 +726,19 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
case ".wad":
|
||||
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;
|
||||
case ".pk7":
|
||||
case ".pk3":
|
||||
case ".ipk3":
|
||||
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;
|
||||
}
|
||||
}
|
||||
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++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -425,8 +749,11 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
}
|
||||
|
||||
if (loadingrequiredarchives.Count == 0)
|
||||
UpdateWarnings();
|
||||
|
||||
// Raise content changed event
|
||||
if(OnContentChanged != null) OnContentChanged();
|
||||
if (OnContentChanged != null) OnContentChanged();
|
||||
}
|
||||
|
||||
// Client size changed
|
||||
|
@ -469,8 +796,11 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// Display notification
|
||||
General.Interface.DisplayStatus(StatusType.Info, pastedcount + " Resource" + (pastedcount > 1 ? "s" : "") + " Pasted");
|
||||
|
||||
if (loadingrequiredarchives.Count == 0)
|
||||
UpdateWarnings();
|
||||
|
||||
// Raise content changed event
|
||||
if(OnContentChanged != null) OnContentChanged();
|
||||
if (OnContentChanged != null) OnContentChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -500,8 +830,11 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// Display notification
|
||||
General.Interface.DisplayStatus(StatusType.Info, pastedcount + " Resource" + (pastedcount > 1 ? "s" : "") + " Replaced");
|
||||
|
||||
if (loadingrequiredarchives.Count == 0)
|
||||
UpdateWarnings();
|
||||
|
||||
// Raise content changed event
|
||||
if(OnContentChanged != null) OnContentChanged();
|
||||
if (OnContentChanged != null) OnContentChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -519,8 +852,11 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
ResizeColumnHeader();
|
||||
|
||||
if (loadingrequiredarchives.Count == 0)
|
||||
UpdateWarnings();
|
||||
|
||||
// Raise content changed event
|
||||
if(OnContentChanged != null) OnContentChanged();
|
||||
if (OnContentChanged != null) OnContentChanged();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -579,29 +915,5 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
|
||||
#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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,120 +112,142 @@
|
|||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</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>
|
||||
</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>
|
||||
</metadata>
|
||||
<data name="images.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAi
|
||||
FgAAAk1TRnQBSQFMAgEBBgEAAZwBAAGcAQABEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
|
||||
AwABIAMAAQEBAAEgBgABIDcAApYB/wEAApYB/wEAAkAB/wEAAkAB/wEAAkAB/wEAAkAB/y0AApYB/wEA
|
||||
ApYB/wEAAkAB/wEAAkAB/wEAAkAB/wEAAkAB/5QAA4UB/wOFAf8DhQH/A4UB/wEAArkB/wEAApYB/wEA
|
||||
ApYB/wE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ABAQGBA/8BwAEHAcABAQb/AeABAwL/
|
||||
Cw==
|
||||
</value>
|
||||
</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>
|
||||
</metadata>
|
||||
</root>
|
|
@ -17,6 +17,7 @@
|
|||
#region ================== Namespaces
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
#endregion
|
||||
|
@ -38,9 +39,10 @@ namespace CodeImp.DoomBuilder.Data
|
|||
public bool option1;
|
||||
public bool option2;
|
||||
public bool notfortesting;
|
||||
public List<string> requiredarchives;
|
||||
|
||||
// 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
|
||||
this.type = type;
|
||||
|
@ -50,10 +52,11 @@ namespace CodeImp.DoomBuilder.Data
|
|||
this.option2 = option2;
|
||||
this.notfortesting = notfortesting;
|
||||
this.name = string.Empty; //mxd
|
||||
this.requiredarchives = requiredarchives;
|
||||
}
|
||||
|
||||
//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
|
||||
this.type = type;
|
||||
|
@ -63,6 +66,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
this.option2 = option2;
|
||||
this.notfortesting = notfortesting;
|
||||
this.name = string.Empty;
|
||||
this.requiredarchives = requiredarchives;
|
||||
}
|
||||
|
||||
// This displays the struct as string
|
||||
|
|
|
@ -20,6 +20,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using CodeImp.DoomBuilder.IO;
|
||||
|
||||
#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("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(res);
|
||||
}
|
||||
|
@ -101,6 +105,8 @@ namespace CodeImp.DoomBuilder.Data
|
|||
rlinfo.Add("option2", General.Bool2Int(this[i].option2));
|
||||
rlinfo.Add("notfortesting", General.Bool2Int(this[i].notfortesting));
|
||||
|
||||
if (this[i].requiredarchives != null) rlinfo.Add("requiredarchives", string.Join(",", this[i].requiredarchives.ToArray()));
|
||||
|
||||
// Add structure
|
||||
resinfo.Add("resource" + i.ToString(CultureInfo.InvariantCulture), rlinfo);
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ using CodeImp.DoomBuilder.ZDoom;
|
|||
using Matrix = CodeImp.DoomBuilder.Rendering.Matrix;
|
||||
using CodeImp.DoomBuilder.Controls;
|
||||
using CodeImp.DoomBuilder.Dehacked;
|
||||
using System.Diagnostics;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -132,7 +133,6 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Things combined with things created from Decorate
|
||||
private DecorateParser decorate;
|
||||
private ZScriptParser zscript;
|
||||
private Dictionary<DataReader, ICollection<string>> classesbyarchive;
|
||||
private Dictionary<string, ActorStructure> zdoomclasses;
|
||||
private List<ThingCategory> thingcategories;
|
||||
private Dictionary<int, ThingTypeInfo> thingtypes;
|
||||
|
@ -324,29 +324,6 @@ namespace CodeImp.DoomBuilder.Data
|
|||
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
|
||||
internal void Load(DataLocationList configlist, DataLocationList maplist)
|
||||
{
|
||||
|
@ -383,8 +360,6 @@ namespace CodeImp.DoomBuilder.Data
|
|||
cvars = new CvarsCollection();
|
||||
ambientsounds = new Dictionary<int, AmbientSoundInfo>();
|
||||
|
||||
classesbyarchive = new Dictionary<DataReader, ICollection<string>>();
|
||||
|
||||
// Load texture sets
|
||||
foreach(DefinedTextureSet ts in General.Map.ConfigSettings.TextureSets)
|
||||
texturesets.Add(new MatchingTextureSet(ts));
|
||||
|
@ -413,7 +388,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
try
|
||||
{
|
||||
// Choose container type
|
||||
switch(dl.type)
|
||||
switch (dl.type)
|
||||
{
|
||||
//mxd. Load resource in read-only mode if:
|
||||
// 1. UseResourcesInReadonlyMode map option is set.
|
||||
|
@ -423,10 +398,10 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
// WAD file container
|
||||
case DataLocation.RESOURCE_WAD:
|
||||
c = new WADReader(dl, true);
|
||||
if(((WADReader)c).WadFile.IsOfficialIWAD) //mxd
|
||||
c = new WADReader(dl, General.Map.Config, true);
|
||||
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() + "\".");
|
||||
prevofficialiwad = dl.GetDisplayName();
|
||||
}
|
||||
|
@ -434,16 +409,16 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
// Directory container
|
||||
case DataLocation.RESOURCE_DIRECTORY:
|
||||
c = new DirectoryReader(dl, true);
|
||||
c = new DirectoryReader(dl, General.Map.Config, true);
|
||||
break;
|
||||
|
||||
// PK3 file container
|
||||
case DataLocation.RESOURCE_PK3:
|
||||
c = new PK3Reader(dl, true);
|
||||
c = new PK3Reader(dl, General.Map.Config, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
// 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);
|
||||
|
@ -645,36 +620,6 @@ namespace CodeImp.DoomBuilder.Data
|
|||
gldefsentries.Count + " dynamic light definitions, " +
|
||||
glowingflats.Count + " glowing flat definitions, " + skyboxes.Count + " skybox 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
|
||||
|
@ -1782,20 +1727,16 @@ namespace CodeImp.DoomBuilder.Data
|
|||
{
|
||||
// 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.
|
||||
long t = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||
Stopwatch t = new Stopwatch();
|
||||
t.Start();
|
||||
|
||||
currentreader = dr;
|
||||
IEnumerable<TextResourceData> streams = dr.GetDecorateData("ZSCRIPT");
|
||||
foreach (TextResourceData data in streams)
|
||||
foreach (TextResourceData data in dr.GetZScriptData("ZSCRIPT"))
|
||||
{
|
||||
// Parse the data
|
||||
data.Stream.Seek(0, SeekOrigin.Begin);
|
||||
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...
|
||||
if (zscript.HasError)
|
||||
{
|
||||
|
@ -1804,10 +1745,13 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
}
|
||||
|
||||
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();
|
||||
DebugConsole.WriteLine(string.Format("Finalizing ZScript lumps took {0}ms", t2.ElapsedMilliseconds));
|
||||
if (zscript.HasError)
|
||||
zscript.LogError();
|
||||
|
||||
|
@ -1835,17 +1779,12 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// 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.
|
||||
currentreader = dr;
|
||||
IEnumerable<TextResourceData> decostreams = dr.GetDecorateData("DECORATE");
|
||||
foreach(TextResourceData data in decostreams)
|
||||
foreach(TextResourceData data in dr.GetDecorateData("DECORATE"))
|
||||
{
|
||||
// Parse the data
|
||||
data.Stream.Seek(0, SeekOrigin.Begin);
|
||||
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...
|
||||
if (decorate.HasError)
|
||||
{
|
||||
|
|
|
@ -38,20 +38,20 @@ namespace CodeImp.DoomBuilder.Data
|
|||
#region ================== Constructor / Disposer
|
||||
|
||||
// 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 + "\"");
|
||||
|
||||
// Initialize
|
||||
files = new DirectoryFilesList(dl.location, true);
|
||||
Initialize();
|
||||
files = new DirectoryFilesList(dl.location, config, true);
|
||||
Initialize(config);
|
||||
|
||||
// We have no destructor
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
//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
|
||||
string[] wadfiles = GetWadFiles();
|
||||
|
@ -62,8 +62,8 @@ namespace CodeImp.DoomBuilder.Data
|
|||
string wadfilepath = Path.Combine(location.location, wadfile);
|
||||
if(General.Map.FilePathName != wadfilepath)
|
||||
{
|
||||
DataLocation wdl = new DataLocation(DataLocation.RESOURCE_WAD, wadfilepath, false, false, true);
|
||||
wads.Add(new WADReader(wdl, isreadonly) { ParentResource = this } );
|
||||
DataLocation wdl = new DataLocation(DataLocation.RESOURCE_WAD, wadfilepath, false, false, true, null);
|
||||
wads.Add(new WADReader(wdl, config, isreadonly) { ParentResource = this } );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
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
|
||||
|
@ -197,7 +197,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
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
|
||||
|
@ -230,7 +230,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
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
|
||||
|
@ -263,7 +263,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
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
|
||||
|
@ -300,7 +300,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
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
|
||||
|
@ -331,7 +331,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
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
|
||||
|
@ -368,7 +368,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
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
|
||||
|
@ -471,7 +471,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -484,7 +484,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
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;
|
||||
}
|
||||
|
@ -504,7 +504,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,17 +68,18 @@ namespace CodeImp.DoomBuilder.Data
|
|||
#region ================== Constructor / Disposer
|
||||
|
||||
// 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;
|
||||
FileShare share;
|
||||
|
||||
isreadonly = asreadonly;
|
||||
config = config;
|
||||
|
||||
// Determine if opening for read only
|
||||
if (isreadonly)
|
||||
|
@ -143,10 +144,10 @@ namespace CodeImp.DoomBuilder.Data
|
|||
filestream = null;
|
||||
|
||||
// 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();
|
||||
Initialize(config);
|
||||
|
||||
// We have no destructor
|
||||
GC.SuppressFinalize(this);
|
||||
|
@ -589,7 +590,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
catch(SharpCompress.Compressors.Deflate.ZlibException)
|
||||
{
|
||||
// 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 = null;
|
||||
|
@ -598,7 +599,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
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 = null;
|
||||
|
@ -618,7 +619,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if(filedata == null)
|
||||
{
|
||||
//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;
|
||||
}
|
||||
|
||||
|
@ -656,7 +657,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
+ ", started at " + checkresult.Processes[0].StartTime + ").";
|
||||
}
|
||||
|
||||
General.ErrorLogger.Add(ErrorType.Error, errmsg);
|
||||
if (!Silent) General.ErrorLogger.Add(ErrorType.Error, errmsg);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -667,7 +668,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if(za == null)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -720,7 +721,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
case 60:
|
||||
case 62:
|
||||
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;
|
||||
|
||||
default:
|
||||
|
|
|
@ -43,6 +43,9 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
#region ================== Variables
|
||||
|
||||
// Optional setting
|
||||
public bool Silent = false;
|
||||
|
||||
// Source
|
||||
protected readonly bool roottextures;
|
||||
protected readonly bool rootflats;
|
||||
|
@ -70,7 +73,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
// 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.
|
||||
if (wads != null) foreach (WADReader wr in wads) wr.Dispose();
|
||||
|
@ -80,8 +83,8 @@ namespace CodeImp.DoomBuilder.Data
|
|||
foreach(string w in wadfiles)
|
||||
{
|
||||
string tempfile = CreateTempFile(w);
|
||||
DataLocation wdl = new DataLocation(DataLocation.RESOURCE_WAD, tempfile, Path.Combine(location.GetDisplayName(), Path.GetFileName(w)), false, false, true);
|
||||
wads.Add(new WADReader(wdl, location.type != DataLocation.RESOURCE_DIRECTORY) { ParentResource = this } );
|
||||
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, config, location.type != DataLocation.RESOURCE_DIRECTORY) { ParentResource = this } );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,7 +147,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if(stream.Length > 767) //mxd
|
||||
palette = new Playpal(stream);
|
||||
else
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Warning: invalid palette \"" + foundfile + "\"");
|
||||
if (!Silent) General.ErrorLogger.Add(ErrorType.Warning, "Warning: invalid palette \"" + foundfile + "\"");
|
||||
stream.Dispose();
|
||||
}
|
||||
|
||||
|
@ -175,7 +178,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if(stream.Length >= 256) //mxd
|
||||
colormap = new ColorMap(stream, palette);
|
||||
else
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Warning: invalid colormap \"" + foundfile + "\"");
|
||||
if (!Silent) General.ErrorLogger.Add(ErrorType.Warning, "Warning: invalid colormap \"" + foundfile + "\"");
|
||||
stream.Dispose();
|
||||
}
|
||||
|
||||
|
@ -217,7 +220,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if((texture1file != null) && FileExists(texture1file))
|
||||
{
|
||||
MemoryStream filedata = LoadFile(texture1file);
|
||||
WADReader.LoadTextureSet("TEXTURE1", filedata, ref imgset, pnames);
|
||||
WADReader.LoadTextureSet("TEXTURE1", filedata, ref imgset, pnames, Silent);
|
||||
filedata.Dispose();
|
||||
}
|
||||
|
||||
|
@ -226,7 +229,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if((texture2file != null) && FileExists(texture2file))
|
||||
{
|
||||
MemoryStream filedata = LoadFile(texture2file);
|
||||
WADReader.LoadTextureSet("TEXTURE2", filedata, ref imgset, pnames);
|
||||
WADReader.LoadTextureSet("TEXTURE2", filedata, ref imgset, pnames, Silent);
|
||||
filedata.Dispose();
|
||||
}
|
||||
|
||||
|
@ -282,7 +285,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if(string.IsNullOrEmpty(Path.GetFileNameWithoutExtension(f)))
|
||||
{
|
||||
// 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
|
||||
{
|
||||
|
@ -813,7 +816,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if(string.IsNullOrEmpty(Path.GetFileNameWithoutExtension(f)))
|
||||
{
|
||||
// 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
|
||||
{
|
||||
|
@ -843,7 +846,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace CodeImp.DoomBuilder.Data.Scripting
|
|||
target.Items.Clear();
|
||||
|
||||
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));
|
||||
|
||||
if(parser.Parse(data, false))
|
||||
|
|
|
@ -61,6 +61,9 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
#region ================== Variables
|
||||
|
||||
// Optional setting
|
||||
public bool Silent = false;
|
||||
|
||||
// Source
|
||||
private WAD file;
|
||||
private bool is_iwad;
|
||||
|
@ -89,7 +92,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
#region ================== Constructor / Disposer
|
||||
|
||||
// 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 + "\"");
|
||||
|
||||
|
@ -99,14 +102,14 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Initialize
|
||||
file = new WAD(location.location, asreadonly);
|
||||
strictpatches = dl.option1;
|
||||
Initialize(); //mxd
|
||||
Initialize(config); //mxd
|
||||
|
||||
// We have no destructor
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
//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)
|
||||
{
|
||||
|
@ -119,14 +122,14 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Initialize
|
||||
file = new WAD(location.location, asreadonly);
|
||||
strictpatches = dl.option1;
|
||||
Initialize();
|
||||
Initialize(config);
|
||||
|
||||
// We have no destructor
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
//mxd
|
||||
private void Initialize()
|
||||
private void Initialize(GameConfiguration config)
|
||||
{
|
||||
is_iwad = file.IsIWAD;
|
||||
isreadonly |= file.IsReadOnly; // Just in case...
|
||||
|
@ -141,13 +144,13 @@ namespace CodeImp.DoomBuilder.Data
|
|||
voxelranges = new List<LumpRange>(); //mxd
|
||||
|
||||
// Find ranges
|
||||
FindRanges(patchranges, General.Map.Config.PatchRanges, "patches", "Patch");
|
||||
FindRanges(spriteranges, General.Map.Config.SpriteRanges, "sprites", "Sprite");
|
||||
FindRanges(flatranges, General.Map.Config.FlatRanges, "flats", "Flat");
|
||||
FindRanges(textureranges, General.Map.Config.TextureRanges, "textures", "Texture");
|
||||
FindRanges(hiresranges, General.Map.Config.HiResRanges, "hires", "HiRes texture");
|
||||
FindRanges(colormapranges, General.Map.Config.ColormapRanges, "colormaps", "Colormap");
|
||||
FindRanges(voxelranges, General.Map.Config.VoxelRanges, "voxels", "Voxel");
|
||||
FindRanges(config, patchranges, config.PatchRanges, "patches", "Patch");
|
||||
FindRanges(config, spriteranges, config.SpriteRanges, "sprites", "Sprite");
|
||||
FindRanges(config, flatranges, config.FlatRanges, "flats", "Flat");
|
||||
FindRanges(config, textureranges, config.TextureRanges, "textures", "Texture");
|
||||
FindRanges(config, hiresranges, config.HiResRanges, "hires", "HiRes texture");
|
||||
FindRanges(config, colormapranges, config.ColormapRanges, "colormaps", "Colormap");
|
||||
FindRanges(config, voxelranges, config.VoxelRanges, "voxels", "Voxel");
|
||||
|
||||
//mxd
|
||||
invertedflatranges = new List<LumpRange>();
|
||||
|
@ -225,7 +228,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
// 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<int, bool> successfulrangestarts = new Dictionary<int, bool>(); //mxd
|
||||
|
@ -234,8 +237,8 @@ namespace CodeImp.DoomBuilder.Data
|
|||
foreach(DictionaryEntry r in rangeinfos)
|
||||
{
|
||||
// Read start and end
|
||||
string rangestart = General.Map.Config.ReadSetting(rangename + "." + r.Key + ".start", "");
|
||||
string rangeend = General.Map.Config.ReadSetting(rangename + "." + r.Key + ".end", "");
|
||||
string rangestart = config.ReadSetting(rangename + "." + r.Key + ".start", "");
|
||||
string rangeend = config.ReadSetting(rangename + "." + r.Key + ".end", "");
|
||||
if((rangestart.Length > 0) && (rangeend.Length > 0))
|
||||
{
|
||||
// Find ranges
|
||||
|
@ -271,7 +274,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
foreach(KeyValuePair<LumpRange, KeyValuePair<string, string>> group in failedranges)
|
||||
{
|
||||
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
|
||||
|
@ -280,8 +283,10 @@ namespace CodeImp.DoomBuilder.Data
|
|||
HashSet<string> names = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
for(int i = range.start + 1; i < range.end; i++)
|
||||
{
|
||||
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 (names.Contains(file.Lumps[i].Name))
|
||||
{
|
||||
if (!Silent) General.ErrorLogger.Add(ErrorType.Warning, elementname + " \"" + file.Lumps[i].Name + "\", index " + i + " is double defined in resource \"" + location.GetDisplayName() + "\".");
|
||||
}
|
||||
else
|
||||
names.Add(file.Lumps[i].Name);
|
||||
}
|
||||
|
@ -430,11 +435,11 @@ namespace CodeImp.DoomBuilder.Data
|
|||
Lump lump = file.FindLump("TEXTURE1");
|
||||
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
|
||||
}
|
||||
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
|
||||
foreach(LumpRange range in textureranges)
|
||||
|
@ -454,7 +459,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
else
|
||||
{
|
||||
// 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
|
||||
{
|
||||
// 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
|
||||
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;
|
||||
BinaryReader reader = new BinaryReader(texturedata);
|
||||
|
@ -608,7 +613,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
else
|
||||
{
|
||||
// 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
|
||||
|
@ -631,7 +636,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
else
|
||||
{
|
||||
// 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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ namespace CodeImp.DoomBuilder
|
|||
//mxd. General.Map.FilePathName will be empty when a newly created map was not saved yet.
|
||||
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.Add(maplocation);
|
||||
}
|
||||
|
|
|
@ -295,12 +295,12 @@ namespace CodeImp.DoomBuilder
|
|||
map = new MapSet();
|
||||
|
||||
// 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);
|
||||
#if DEBUG
|
||||
tempwadreader = new WADReader(templocation, false, true);
|
||||
tempwadreader = new WADReader(templocation, General.Map.Config, false, true);
|
||||
#else
|
||||
try { tempwadreader = new WADReader(templocation, false, true); }
|
||||
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);
|
||||
|
@ -389,12 +389,12 @@ namespace CodeImp.DoomBuilder
|
|||
map = new MapSet();
|
||||
|
||||
// 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);
|
||||
#if DEBUG
|
||||
tempwadreader = new WADReader(templocation, false, true);
|
||||
tempwadreader = new WADReader(templocation, General.Map.Config, false, true);
|
||||
#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);
|
||||
return false;
|
||||
|
@ -427,7 +427,7 @@ namespace CodeImp.DoomBuilder
|
|||
// Load data manager
|
||||
General.WriteLogLine("Loading data resources...");
|
||||
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);
|
||||
|
||||
// Remove unused sectors
|
||||
|
@ -486,14 +486,14 @@ namespace CodeImp.DoomBuilder
|
|||
WAD mapwad;
|
||||
|
||||
// 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);
|
||||
if(tempwadreader != null) tempwadreader.Dispose();
|
||||
|
||||
#if DEBUG
|
||||
tempwadreader = new WADReader(templocation, false, true);
|
||||
tempwadreader = new WADReader(templocation, General.Map.Config, false, true);
|
||||
#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);
|
||||
return false;
|
||||
|
@ -2370,7 +2370,7 @@ namespace CodeImp.DoomBuilder
|
|||
data = new DataManager();
|
||||
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);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using CodeImp.DoomBuilder.Config;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
|
||||
#endregion
|
||||
|
@ -68,7 +69,7 @@ namespace CodeImp.DoomBuilder.IO
|
|||
#region ================== Constructor / Disposer
|
||||
|
||||
// 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);
|
||||
string[] files = Directory.GetFiles(path, "*", subdirectories ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
|
||||
|
@ -85,25 +86,28 @@ namespace CodeImp.DoomBuilder.IO
|
|||
continue;
|
||||
}
|
||||
|
||||
if(General.Map.Config.IgnoredFileExtensions.Contains(e.extension)) continue;
|
||||
if (config != null)
|
||||
{
|
||||
if (config.IgnoredFileExtensions.Contains(e.extension)) continue;
|
||||
|
||||
bool skipfolder = false;
|
||||
foreach(string ef in General.Map.Config.IgnoredDirectoryNames)
|
||||
foreach (string ef in config.IgnoredDirectoryNames)
|
||||
{
|
||||
if(e.path.StartsWith(ef + Path.DirectorySeparatorChar))
|
||||
if (e.path.StartsWith(ef + Path.DirectorySeparatorChar))
|
||||
{
|
||||
skipfolder = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(skipfolder) continue;
|
||||
if (skipfolder) continue;
|
||||
}
|
||||
|
||||
AddOrReplaceEntry(e);
|
||||
}
|
||||
}
|
||||
|
||||
// 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());
|
||||
wadentries = new List<string>();
|
||||
|
@ -115,22 +119,25 @@ namespace CodeImp.DoomBuilder.IO
|
|||
continue;
|
||||
}
|
||||
|
||||
if(General.Map.Config.IgnoredFileExtensions.Contains(e.extension)) continue;
|
||||
if (config != null)
|
||||
{
|
||||
if (config.IgnoredFileExtensions.Contains(e.extension)) continue;
|
||||
|
||||
bool skipfolder = false;
|
||||
foreach(string ef in General.Map.Config.IgnoredDirectoryNames)
|
||||
foreach (string ef in config.IgnoredDirectoryNames)
|
||||
{
|
||||
if(e.path.StartsWith(ef + Path.DirectorySeparatorChar))
|
||||
if (e.path.StartsWith(ef + Path.DirectorySeparatorChar))
|
||||
{
|
||||
skipfolder = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(skipfolder) continue;
|
||||
if (skipfolder) continue;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
12
Source/Core/Properties/Resources.Designer.cs
generated
12
Source/Core/Properties/Resources.Designer.cs
generated
|
@ -19,7 +19,7 @@ namespace CodeImp.DoomBuilder.Properties {
|
|||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// 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.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
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>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
|
|
@ -622,4 +622,7 @@
|
|||
<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>
|
||||
</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>
|
BIN
Source/Core/Resources/Loader.gif
Normal file
BIN
Source/Core/Resources/Loader.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
5
Source/Core/Windows/ConfigForm.Designer.cs
generated
5
Source/Core/Windows/ConfigForm.Designer.cs
generated
|
@ -305,12 +305,17 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// configdata
|
||||
//
|
||||
this.configdata.AllowDrop = true;
|
||||
this.configdata.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.configdata.DialogOffset = new System.Drawing.Point(-120, 10);
|
||||
this.configdata.GameConfiguration = null;
|
||||
this.configdata.Location = new System.Drawing.Point(15, 55);
|
||||
this.configdata.Name = "configdata";
|
||||
this.configdata.Size = new System.Drawing.Size(467, 204);
|
||||
this.configdata.TabIndex = 0;
|
||||
this.configdata.OnContentChanged += new CodeImp.DoomBuilder.Controls.ResourceListEditor.ContentChanged(this.resourcelocations_OnContentChanged);
|
||||
this.configdata.OnWarningsChanged += new CodeImp.DoomBuilder.Controls.ResourceListEditor.WarningsChanged(this.configdata_OnWarningsChanged);
|
||||
//
|
||||
// tabnodebuilder
|
||||
//
|
||||
|
|
|
@ -41,6 +41,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
private List<DefinedTextureSet> copiedsets;
|
||||
private bool preventchanges;
|
||||
private bool reloadresources;
|
||||
private readonly int initialformheight;
|
||||
|
||||
//mxd. "Copy/Paste" stuff
|
||||
private ConfigurationInfo configinfocopy;
|
||||
|
@ -109,6 +110,9 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
|
||||
//mxd. Trigger change to update the right panel...
|
||||
listconfigs_MouseUp(this, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0));
|
||||
|
||||
//
|
||||
initialformheight = Height;
|
||||
}
|
||||
|
||||
// This shows a specific page
|
||||
|
@ -142,6 +146,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
configinfo.ApplyDefaults(gameconfig);
|
||||
|
||||
// Fill resources list
|
||||
configdata.GameConfiguration = gameconfig;
|
||||
configdata.EditResourceLocationList(configinfo.Resources);
|
||||
|
||||
// Go for all nodebuilder save items
|
||||
|
@ -1126,5 +1131,11 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void configdata_OnWarningsChanged(int size)
|
||||
{
|
||||
Height = initialformheight + size;
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -223,7 +223,7 @@
|
|||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAA4
|
||||
CAAAAk1TRnQBSQFMAwEBAAEsAQIBLAECARMBAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
|
||||
CAAAAk1TRnQBSQFMAwEBAAE8AQIBPAECARMBAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
|
||||
AUwDAAEQAwABAQEAAQgFAAHAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
|
||||
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
|
||||
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
|
||||
|
|
13
Source/Core/Windows/MapOptionsForm.Designer.cs
generated
13
Source/Core/Windows/MapOptionsForm.Designer.cs
generated
|
@ -157,6 +157,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
//
|
||||
// label4
|
||||
//
|
||||
label4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
label4.AutoSize = true;
|
||||
label4.Location = new System.Drawing.Point(13, 198);
|
||||
label4.Name = "label4";
|
||||
|
@ -189,7 +191,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
//
|
||||
// panelres
|
||||
//
|
||||
this.panelres.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
this.panelres.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.panelres.Controls.Add(this.longtexturenames);
|
||||
this.panelres.Controls.Add(this.strictpatches);
|
||||
|
@ -225,14 +228,21 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// 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(368, 127);
|
||||
this.datalocations.TabIndex = 0;
|
||||
this.datalocations.OnWarningsChanged += new CodeImp.DoomBuilder.Controls.ResourceListEditor.WarningsChanged(this.datalocations_OnWarningsChanged);
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label5.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.label5.Location = new System.Drawing.Point(13, 423);
|
||||
this.label5.Name = "label5";
|
||||
|
@ -241,6 +251,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
//
|
||||
// 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);
|
||||
|
|
|
@ -39,6 +39,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
private ExternalCommandSettings testprecommand;
|
||||
private ExternalCommandSettings testpostcommand;
|
||||
private bool prepostcommandsmodified;
|
||||
private readonly int initialformheight;
|
||||
|
||||
// Properties
|
||||
public MapOptions Options { get { return options; } }
|
||||
|
@ -110,6 +111,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
//mxd. Still better than nothing :)
|
||||
if(config.SelectedIndex == -1 && config.Items.Count > 0) config.SelectedIndex = 0;
|
||||
|
||||
// Find whatever was selected after the previous step
|
||||
|
||||
//mxd
|
||||
if(General.Map != null) datalocations.StartPath = General.Map.FilePathName;
|
||||
|
||||
|
@ -120,9 +123,20 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
strictpatches.Checked = options.StrictPatches;
|
||||
|
||||
// Fill the resources list
|
||||
datalocations.IsMapControl = true;
|
||||
datalocations.GameConfiguration = GetGameConfiguration();
|
||||
datalocations.EditResourceLocationList(options.Resources);
|
||||
|
||||
//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
|
||||
|
@ -176,20 +190,6 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
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
|
||||
if(!newmap)
|
||||
{
|
||||
|
@ -242,6 +242,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
{
|
||||
// Select this item
|
||||
config.SelectedIndex = i;
|
||||
datalocations.GameConfiguration = GetGameConfiguration();
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
@ -345,6 +346,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
}
|
||||
|
||||
// Show resources
|
||||
datalocations.GameConfiguration = GetGameConfiguration();
|
||||
datalocations.FixedResourceLocationList(info.Resources);
|
||||
|
||||
// Update long texture names checkbox (mxd)
|
||||
|
@ -388,5 +390,11 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
prepostcommandsmodified = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void datalocations_OnWarningsChanged(int size)
|
||||
{
|
||||
Height = initialformheight + size;
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
}
|
14
Source/Core/Windows/OpenMapOptionsForm.Designer.cs
generated
14
Source/Core/Windows/OpenMapOptionsForm.Designer.cs
generated
|
@ -78,8 +78,10 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
//
|
||||
// label3
|
||||
//
|
||||
label3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
label3.AutoSize = true;
|
||||
label3.Location = new System.Drawing.Point(11, 198);
|
||||
label3.Location = new System.Drawing.Point(11, 195);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new System.Drawing.Size(299, 52);
|
||||
label3.TabIndex = 17;
|
||||
|
@ -87,7 +89,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
//
|
||||
// panelres
|
||||
//
|
||||
this.panelres.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
this.panelres.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.panelres.Controls.Add(this.longtexturenames);
|
||||
this.panelres.Controls.Add(this.strictpatches);
|
||||
|
@ -123,11 +126,16 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// 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(368, 127);
|
||||
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
|
||||
//
|
||||
|
|
|
@ -41,6 +41,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
private string selectedmapname;
|
||||
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 readonly int initialformsize;
|
||||
|
||||
// Properties
|
||||
//public string FilePathName { get { return filepathname; } }
|
||||
|
@ -51,11 +52,13 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
{
|
||||
// Initialize
|
||||
InitializeComponent();
|
||||
CodeImp.DoomBuilder.General.ApplyMonoListViewFix(mapslist);
|
||||
General.ApplyMonoListViewFix(mapslist);
|
||||
this.Text = "Open Map from " + Path.GetFileName(filepathname);
|
||||
this.filepathname = filepathname;
|
||||
datalocations.StartPath = filepathname; //mxd
|
||||
datalocations.IsMapControl = true;
|
||||
this.options = null;
|
||||
this.initialformsize = Height;
|
||||
}
|
||||
|
||||
// Constructor
|
||||
|
@ -63,12 +66,20 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
{
|
||||
// Initialize
|
||||
InitializeComponent();
|
||||
CodeImp.DoomBuilder.General.ApplyMonoListViewFix(mapslist);
|
||||
General.ApplyMonoListViewFix(mapslist);
|
||||
this.Text = "Open Map from " + Path.GetFileName(filepathname);
|
||||
this.filepathname = filepathname;
|
||||
this.options = options;
|
||||
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
|
||||
|
@ -230,6 +241,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
{
|
||||
// Show the window
|
||||
this.Opacity = 1;
|
||||
datalocations.GameConfiguration = GetGameConfiguration();
|
||||
}
|
||||
|
||||
// Done
|
||||
|
@ -311,6 +323,9 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// Configuration is selected
|
||||
private void config_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
//
|
||||
datalocations.GameConfiguration = GetGameConfiguration();
|
||||
|
||||
// Anything selected?
|
||||
if(config.SelectedIndex < 0) return;
|
||||
|
||||
|
@ -528,6 +543,10 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
|
||||
// Load settings
|
||||
LoadSettings();
|
||||
|
||||
// Show
|
||||
if (options != null)
|
||||
datalocations.EditResourceLocationList(options.Resources);
|
||||
}
|
||||
|
||||
// Map name doubleclicked
|
||||
|
@ -540,7 +559,10 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// Map name selected
|
||||
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 listedlocations;
|
||||
|
@ -618,5 +640,11 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
General.ShowHelp("w_openmapoptions.html");
|
||||
hlpevent.Handled = true;
|
||||
}
|
||||
|
||||
private void datalocations_OnWarningsChanged(int size)
|
||||
{
|
||||
Height = initialformsize + size;
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
}
|
55
Source/Core/Windows/ResourceOptionsForm.Designer.cs
generated
55
Source/Core/Windows/ResourceOptionsForm.Designer.cs
generated
|
@ -53,6 +53,9 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.wadfiledialog = new System.Windows.Forms.OpenFileDialog();
|
||||
this.pk3filedialog = new System.Windows.Forms.OpenFileDialog();
|
||||
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();
|
||||
label2 = new System.Windows.Forms.Label();
|
||||
label3 = new System.Windows.Forms.Label();
|
||||
|
@ -60,6 +63,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.wadfiletab.SuspendLayout();
|
||||
this.directorytab.SuspendLayout();
|
||||
this.pk3filetab.SuspendLayout();
|
||||
this.checkingloader.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// 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.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.Size = new System.Drawing.Size(112, 25);
|
||||
this.cancel.TabIndex = 2;
|
||||
|
@ -291,7 +296,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// 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(144, 260);
|
||||
this.apply.Location = new System.Drawing.Point(144, 304);
|
||||
this.apply.Name = "apply";
|
||||
this.apply.Size = new System.Drawing.Size(112, 25);
|
||||
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.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.Size = new System.Drawing.Size(239, 17);
|
||||
this.notfortesting.TabIndex = 3;
|
||||
this.notfortesting.Text = "Exclude this resource from testing parameters";
|
||||
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
|
||||
//
|
||||
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(386, 293);
|
||||
this.ClientSize = new System.Drawing.Size(386, 337);
|
||||
this.Controls.Add(this.checkingloader);
|
||||
this.Controls.Add(this.notfortesting);
|
||||
this.Controls.Add(this.cancel);
|
||||
this.Controls.Add(this.apply);
|
||||
|
@ -348,6 +389,9 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.directorytab.PerformLayout();
|
||||
this.pk3filetab.ResumeLayout(false);
|
||||
this.pk3filetab.PerformLayout();
|
||||
this.checkingloader.ResumeLayout(false);
|
||||
this.checkingloader.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
|
@ -376,5 +420,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
private System.Windows.Forms.CheckBox strictpatches;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.CheckBox notfortesting;
|
||||
private System.Windows.Forms.Panel checkingloader;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
}
|
||||
}
|
|
@ -20,6 +20,13 @@ using System;
|
|||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
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
|
||||
|
||||
|
@ -31,9 +38,45 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
private DataLocation res;
|
||||
private string startPath;
|
||||
private Controls.FolderSelectDialog dirdialog;
|
||||
private List<string> requiredarchives;
|
||||
|
||||
// Properties
|
||||
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
|
||||
public ResourceOptionsForm(DataLocation settings, string caption, string startPath) //mxd. added startPath
|
||||
|
@ -44,6 +87,9 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// Set caption
|
||||
this.Text = caption;
|
||||
|
||||
//
|
||||
this.requiredarchives = new List<string>();
|
||||
|
||||
// Apply settings from ResourceLocation
|
||||
this.res = settings;
|
||||
switch(res.type)
|
||||
|
@ -76,21 +122,208 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
this.startPath = startPath;
|
||||
}
|
||||
|
||||
// OK clicked
|
||||
private void apply_Click(object sender, EventArgs e)
|
||||
protected override void OnClosing(CancelEventArgs 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
|
||||
switch(tabs.SelectedIndex)
|
||||
switch (tabs.SelectedIndex)
|
||||
{
|
||||
// Setup WAD File
|
||||
case DataLocation.RESOURCE_WAD:
|
||||
|
||||
// Check if file is specified
|
||||
if((wadlocation.Text.Length == 0) ||
|
||||
if ((wadlocation.Text.Length == 0) ||
|
||||
(!File.Exists(wadlocation.Text)))
|
||||
{
|
||||
// No valid wad file specified
|
||||
MessageBox.Show(this, "Please select a valid WAD File resource.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -100,10 +333,6 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
res.option1 = strictpatches.Checked;
|
||||
res.option2 = false;
|
||||
res.notfortesting = notfortesting.Checked;
|
||||
|
||||
// Done
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -111,11 +340,10 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
case DataLocation.RESOURCE_DIRECTORY:
|
||||
|
||||
// Check if directory is specified
|
||||
if((dirlocation.Text.Length == 0) ||
|
||||
if ((dirlocation.Text.Length == 0) ||
|
||||
(!Directory.Exists(dirlocation.Text)))
|
||||
{
|
||||
// No valid directory specified
|
||||
MessageBox.Show(this, "Please select a valid directory resource.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -125,10 +353,6 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
res.option1 = dir_textures.Checked;
|
||||
res.option2 = dir_flats.Checked;
|
||||
res.notfortesting = notfortesting.Checked;
|
||||
|
||||
// Done
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -136,11 +360,10 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
case DataLocation.RESOURCE_PK3:
|
||||
|
||||
// Check if file is specified
|
||||
if((pk3location.Text.Length == 0) ||
|
||||
if ((pk3location.Text.Length == 0) ||
|
||||
(!File.Exists(pk3location.Text)))
|
||||
{
|
||||
// No valid pk3 file specified
|
||||
MessageBox.Show(this, "Please select a valid PK3 or PK7 File resource.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -150,13 +373,39 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
res.option1 = false;
|
||||
res.option2 = false;
|
||||
res.notfortesting = notfortesting.Checked;
|
||||
|
||||
// Done
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
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
|
||||
|
@ -175,6 +424,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
{
|
||||
// Use this file
|
||||
wadlocation.Text = wadfiledialog.FileName;
|
||||
StartRequiredArchivesCheck();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -203,6 +453,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
{
|
||||
// Use this directory
|
||||
dirlocation.Text = dirdialog.FileName;
|
||||
StartRequiredArchivesCheck();
|
||||
dirdialog = null;
|
||||
}
|
||||
}
|
||||
|
@ -215,6 +466,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
{
|
||||
// Use this file
|
||||
pk3location.Text = pk3filedialog.FileName;
|
||||
StartRequiredArchivesCheck();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -201,7 +201,4 @@
|
|||
<metadata name="pk3filedialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>227, 17</value>
|
||||
</metadata>
|
||||
<metadata name="notfortesting.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
|
@ -65,6 +65,9 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
//mxd. Disposing. Is that really needed?..
|
||||
private bool isdisposed;
|
||||
|
||||
//
|
||||
public bool NoWarnings = false;
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Properties
|
||||
|
@ -134,6 +137,13 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
|
||||
#region ================== Parsing
|
||||
|
||||
protected internal override void LogWarning(string message, int linenumber)
|
||||
{
|
||||
if (NoWarnings)
|
||||
return;
|
||||
base.LogWarning(message, linenumber);
|
||||
}
|
||||
|
||||
// This parses the given decorate stream
|
||||
// Returns false on errors
|
||||
public override bool Parse(TextResourceData data, bool clearerrors)
|
||||
|
|
|
@ -708,7 +708,7 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
|
||||
//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, int linenumber)
|
||||
protected internal virtual void LogWarning(string message, int linenumber)
|
||||
{
|
||||
// Add a warning
|
||||
int errline = (linenumber != CompilerError.NO_LINE_NUMBER
|
||||
|
|
|
@ -193,6 +193,9 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
// [ZZ] custom tokenizer class
|
||||
internal ZScriptTokenizer tokenizer;
|
||||
|
||||
//
|
||||
public bool NoWarnings = false;
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Properties
|
||||
|
@ -346,6 +349,13 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
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.
|
||||
internal List<ZScriptToken> ParseExpression(bool betweenparen = false)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue