mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2025-03-03 16:11:45 +00:00
Merged in GZDB r2500.
This commit is contained in:
parent
2dba78a3d2
commit
ea2d439b87
3 changed files with 60 additions and 33 deletions
|
@ -33,6 +33,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Members
|
||||
public int type;
|
||||
public string location;
|
||||
private string name; //mxd
|
||||
public bool option1;
|
||||
public bool option2;
|
||||
public bool notfortesting;
|
||||
|
@ -46,6 +47,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
this.option1 = option1;
|
||||
this.option2 = option2;
|
||||
this.notfortesting = notfortesting;
|
||||
this.name = string.Empty; //mxd
|
||||
}
|
||||
|
||||
// This displays the struct as string
|
||||
|
@ -55,6 +57,31 @@ namespace CodeImp.DoomBuilder.Data
|
|||
return location;
|
||||
}
|
||||
|
||||
//mxd. This returns short location name
|
||||
public string GetShortName()
|
||||
{
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{
|
||||
// Make shorter name for display purposes
|
||||
switch (type)
|
||||
{
|
||||
case RESOURCE_DIRECTORY:
|
||||
name = location.Substring(location.LastIndexOf(Path.DirectorySeparatorChar) + 1);
|
||||
break;
|
||||
|
||||
case RESOURCE_WAD:
|
||||
case RESOURCE_PK3:
|
||||
name = Path.GetFileName(location);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new NotImplementedException("Unknown location type: " + type);
|
||||
}
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
// This compares two locations
|
||||
public int CompareTo(DataLocation other)
|
||||
{
|
||||
|
@ -88,7 +115,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
break;
|
||||
|
||||
default:
|
||||
throw new NotImplementedException("ResourceListEditor.FixedResourceLocationList: got unknown location type: " + type);
|
||||
throw new NotImplementedException("Unknown location type: " + type);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -1521,7 +1521,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
{
|
||||
// Parse the data
|
||||
group.Value.Seek(0, SeekOrigin.Begin);
|
||||
decorate.Parse(group.Value, group.Key, true);
|
||||
decorate.Parse(group.Value, Path.Combine(currentreader.Location.GetShortName(), group.Key), true);
|
||||
|
||||
//mxd. DECORATE lumps are interdepandable. Can't carry on...
|
||||
if (decorate.HasError)
|
||||
|
@ -1851,7 +1851,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
foreach(KeyValuePair<string, Stream> group in decostreams)
|
||||
{
|
||||
// Parse this data
|
||||
parser.Parse(group.Value, Path.Combine(currentreader.Location.location, group.Key), false);
|
||||
parser.Parse(group.Value, group.Key, false);
|
||||
|
||||
//mxd. DECORATE lumps are interdepandable. Can't carry on...
|
||||
if (parser.HasError)
|
||||
|
@ -1995,7 +1995,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
foreach(KeyValuePair<string, Stream> group in streams)
|
||||
{
|
||||
// Parse the data
|
||||
if(parser.Parse(group.Value, Path.Combine(currentreader.Location.location, group.Key), true))
|
||||
if (parser.Parse(group.Value, Path.Combine(currentreader.Location.GetShortName(), group.Key), true))
|
||||
{
|
||||
foreach(KeyValuePair<string, ModelData> g in parser.Entries)
|
||||
{
|
||||
|
@ -2078,7 +2078,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
KeyValuePair<string, Stream> group = dr.GetVoxeldefData();
|
||||
if(group.Value != null)
|
||||
{
|
||||
if(parser.Parse(group.Value, group.Key, true))
|
||||
if (parser.Parse(group.Value, Path.Combine(currentreader.Location.GetShortName(), group.Key), true))
|
||||
{
|
||||
foreach(KeyValuePair<string, ModelData> entry in parser.Entries)
|
||||
{
|
||||
|
@ -2135,7 +2135,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
foreach(KeyValuePair<string, Stream> group in streams)
|
||||
{
|
||||
parser.Parse(group.Value, group.Key, false);
|
||||
parser.Parse(group.Value, Path.Combine(currentreader.Location.GetShortName(), group.Key), false);
|
||||
|
||||
// Gldefs can be interdependable. Can't carry on
|
||||
if (parser.HasError)
|
||||
|
@ -2273,7 +2273,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
foreach(KeyValuePair<string, Stream> group in streams)
|
||||
{
|
||||
// Parse the data
|
||||
parser.Parse(group.Value, group.Key, true);
|
||||
parser.Parse(group.Value, Path.Combine(currentreader.Location.GetShortName(), group.Key), true);
|
||||
|
||||
// Report errors?
|
||||
if (parser.HasError) parser.LogError();
|
||||
|
@ -2301,7 +2301,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Parse the data
|
||||
foreach(KeyValuePair<string, Stream> group in streams)
|
||||
{
|
||||
parser.Parse(group.Value, group.Key, true);
|
||||
parser.Parse(group.Value, Path.Combine(currentreader.Location.GetShortName(), group.Key), true);
|
||||
|
||||
// Report errors?
|
||||
if (parser.HasError) parser.LogError();
|
||||
|
@ -2327,7 +2327,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Parse the data
|
||||
foreach(KeyValuePair<string, Stream> group in streams)
|
||||
{
|
||||
parser.Parse(group.Value, group.Key, true);
|
||||
parser.Parse(group.Value, Path.Combine(currentreader.Location.GetShortName(), group.Key), true);
|
||||
|
||||
// Report errors?
|
||||
if (parser.HasError) parser.LogError();
|
||||
|
|
|
@ -200,7 +200,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if(General.Map.Config.MixTexturesFlats)
|
||||
{
|
||||
ImageData img = General.Map.Data.GetTextureImage(p.lumpname);
|
||||
if(!(img is UnknownImage))
|
||||
if (!(img is UnknownImage) && img != this)
|
||||
{
|
||||
if(!img.IsImageLoaded) img.LoadImage();
|
||||
|
||||
|
|
Loading…
Reference in a new issue