added a default "All" texture set which always contains all textures and (like the "Others" set) cannot be removed

This commit is contained in:
codeimp 2009-01-09 23:05:41 +00:00
parent 299f29dfe0
commit 5adc7fd505
11 changed files with 145 additions and 32 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -661,6 +661,7 @@
<None Include="Resources\Copy.png" />
<None Include="Resources\Cut.png" />
<None Include="Resources\Close.png" />
<Compile Include="Config\AllTexturesSet.cs" />
<Compile Include="Config\FlagTranslation.cs" />
<Compile Include="Data\PK3FileImage.cs" />
<Compile Include="Data\PK3StructuredReader.cs" />

View file

@ -0,0 +1,85 @@
#region ================== Copyright (c) 2007 Pascal vd Heiden
/*
* Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com
* This program is released under GNU General Public License
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#endregion
#region ================== Namespaces
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using CodeImp.DoomBuilder.IO;
using CodeImp.DoomBuilder.Data;
using System.IO;
using System.Diagnostics;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using System.Collections.Specialized;
#endregion
namespace CodeImp.DoomBuilder.Config
{
internal sealed class AllTextureSet : TextureSet, IFilledTextureSet
{
#region ================== Constants
public const string NAME = "All";
#endregion
#region ================== Variables
// Matching textures and flats
private List<ImageData> textures;
private List<ImageData> flats;
#endregion
#region ================== Properties
public ICollection<ImageData> Textures { get { return textures; } }
public ICollection<ImageData> Flats { get { return flats; } }
#endregion
#region ================== Constructor / Destructor
// New texture set constructor
public AllTextureSet()
{
this.name = NAME;
this.textures = new List<ImageData>();
this.flats = new List<ImageData>();
}
#endregion
#region ================== Methods
internal void AddTexture(ImageData image)
{
textures.Add(image);
}
internal void AddFlat(ImageData image)
{
flats.Add(image);
}
#endregion
}
}

View file

@ -37,7 +37,7 @@ namespace CodeImp.DoomBuilder.Config
{
#region ================== Constants
public const string NAME = "Other";
public const string NAME = "Others";
#endregion

View file

@ -60,6 +60,7 @@ namespace CodeImp.DoomBuilder.Data
private Dictionary<long, ImageData> sprites;
private List<MatchingTextureSet> texturesets;
private OthersTextureSet othertextures;
private AllTextureSet alltextures;
// Background loading
private Queue<ImageData> imageque;
@ -101,6 +102,7 @@ namespace CodeImp.DoomBuilder.Data
public ImageData ThingBox { get { return thingbox; } }
internal ICollection<MatchingTextureSet> TextureSets { get { return texturesets; } }
internal OthersTextureSet OthersTextureSet { get { return othertextures; } }
internal AllTextureSet AllTextureSet { get { return alltextures; } }
public bool IsLoading
{
@ -209,8 +211,9 @@ namespace CodeImp.DoomBuilder.Data
// Sort the texture sets
texturesets.Sort();
// Other textures set
// Special textures sets
othertextures = new OthersTextureSet();
alltextures = new AllTextureSet();
// Go for all locations
foreach(DataLocation dl in locations)
@ -280,6 +283,9 @@ namespace CodeImp.DoomBuilder.Data
// If not matched in any set, add it to the others
if(!matchfound) othertextures.AddTexture(img.Value);
// Add to all
alltextures.AddTexture(img.Value);
}
// Add flat names to texture sets
@ -292,6 +298,9 @@ namespace CodeImp.DoomBuilder.Data
// If not matched in any set, add it to the others
if(!matchfound) othertextures.AddFlat(img.Value);
// Add to all
alltextures.AddFlat(img.Value);
}
// Start background loading

View file

@ -107,6 +107,7 @@ namespace CodeImp.DoomBuilder.Windows
this.smallimages.TransparentColor = System.Drawing.Color.Transparent;
this.smallimages.Images.SetKeyName(0, "KnownTextureSet2.ico");
this.smallimages.Images.SetKeyName(1, "OthersTextureSet2.ico");
this.smallimages.Images.SetKeyName(2, "AllTextureSet2.ico");
//
// FlatBrowserForm
//
@ -128,11 +129,11 @@ namespace CodeImp.DoomBuilder.Windows
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Browse Flats";
this.Load += new System.EventHandler(this.FlatBrowserForm_Load);
this.Activated += new System.EventHandler(this.FlatBrowserForm_Activated);
this.Move += new System.EventHandler(this.FlatBrowserForm_Move);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FlatBrowserForm_FormClosing);
this.ResizeEnd += new System.EventHandler(this.FlatBrowserForm_ResizeEnd);
this.Load += new System.EventHandler(this.FlatBrowserForm_Load);
this.ResumeLayout(false);
}

View file

@ -67,10 +67,13 @@ namespace CodeImp.DoomBuilder.Windows
item.ImageIndex = 0;
}
// Add other textures set
// Add special textures sets
item = texturesets.Items.Add(General.Map.Data.OthersTextureSet.Name);
item.Tag = General.Map.Data.OthersTextureSet;
item.ImageIndex = 1;
item = texturesets.Items.Add(General.Map.Data.AllTextureSet.Name);
item.Tag = General.Map.Data.AllTextureSet;
item.ImageIndex = 2;
// Select the last one that was selected
string selectname = General.Settings.ReadSetting("browserwindow.flatstextureset", "");

View file

@ -136,8 +136,8 @@
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAC
CQAAAk1TRnQBSQFMAgEBAgEAAQQBAAEEAQABEAEAARYBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAA6
CgAAAk1TRnQBSQFMAgEBAwEAAQQBAAEEAQABEAEAARYBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARYDAAEBAQABCAUAAYABBRgAAYACAAGAAwACgAEAAYADAAGAAQABgAEAAoACAAPAAQABwAHc
AcABAAHwAcoBpgEAATMFAAEzAQABMw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7QKRAfQBbAIAAgcEtQH3AbUC7QKRAfQBbAIHArUCBwS1
AfcBtQLtApEUAAEHCv8BbAQAAQcK/wFsAgABBwj/AvUBbAH0AWwUAAIHBLUB9wG1Au0CkQQAAgcEtQH3
AbUC7QKRAgACBwS1AfcBtQLtApEB9AFsNAABBwj/AvUBbDQAAgcEtQH3AbUC7QKR0AABQgFNAT4HAAE+
AwABKAMAAUADAAEWAwABAQEAAQEFAAGwFwAD/wEABv8CAAb/AgAG/wIABP8BAAEPAgAE/wEAAQ8DAAEP
AQABDwEAAQMDAAEPAQABDwEAAQMDAAEDAQABAwUAAQMBAAEDJAABwAEAAcAFAAHAAQABwAUAAfABAAHw
AQABwAMAAfABAAHwAQABwAMABP8B8AMABP8B8AMABv8CAAb/AgAG/wIACw==
</value>
</data>
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">

View file

@ -107,6 +107,7 @@ namespace CodeImp.DoomBuilder.Windows
this.smallimages.TransparentColor = System.Drawing.Color.Transparent;
this.smallimages.Images.SetKeyName(0, "KnownTextureSet2.ico");
this.smallimages.Images.SetKeyName(1, "OthersTextureSet2.ico");
this.smallimages.Images.SetKeyName(2, "AllTextureSet2.ico");
//
// TextureBrowserForm
//
@ -128,11 +129,11 @@ namespace CodeImp.DoomBuilder.Windows
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Browse Textures";
this.Load += new System.EventHandler(this.TextureBrowserForm_Load);
this.Activated += new System.EventHandler(this.TextureBrowserForm_Activated);
this.Move += new System.EventHandler(this.TextureBrowserForm_Move);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.TextureBrowserForm_FormClosing);
this.ResizeEnd += new System.EventHandler(this.TextureBrowserForm_ResizeEnd);
this.Load += new System.EventHandler(this.TextureBrowserForm_Load);
this.ResumeLayout(false);
}

View file

@ -67,10 +67,13 @@ namespace CodeImp.DoomBuilder.Windows
item.ImageIndex = 0;
}
// Add other textures set
// Add special textures sets
item = texturesets.Items.Add(General.Map.Data.OthersTextureSet.Name);
item.Tag = General.Map.Data.OthersTextureSet;
item.ImageIndex = 1;
item = texturesets.Items.Add(General.Map.Data.AllTextureSet.Name);
item.Tag = General.Map.Data.AllTextureSet;
item.ImageIndex = 2;
// Select the last one that was selected
string selectname = General.Settings.ReadSetting("browserwindow.texturestextureset", "");

View file

@ -136,8 +136,8 @@
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAC
CQAAAk1TRnQBSQFMAgEBAgEAAQQBAAEEAQABEAEAARYBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAA6
CgAAAk1TRnQBSQFMAgEBAwEAAQQBAAEEAQABEAEAARYBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARYDAAEBAQABCAUAAYABBRgAAYACAAGAAwACgAEAAYADAAGAAQABgAEAAoACAAPAAQABwAHc
AcABAAHwAcoBpgEAATMFAAEzAQABMwEAATMBAAIzAgADFgEAAxwBAAMiAQADKQEAA1UBAANNAQADQgEA
AzkBAAGAAXwB/wEAAlAB/wEAAZMBAAHWAQAB/wHsAcwBAAHGAdYB7wEAAdYC5wEAAZABqQGtAgAB/wEz
@ -165,17 +165,22 @@
AZkBzAEAAf8BmQH/AQAB/wHMAgAB/wHMATMBAAH/AcwBZgEAAf8BzAGZAQAB/wLMAQAB/wH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