support for the interior tileSet. trees don't work. mounted all 3 of the tileSet mixen; this means there are name-clashes in some cases.

This commit is contained in:
Bob
2010-01-29 14:19:44 +13:00
parent 5bd6c32aff
commit 95b98a78bb
8 changed files with 838 additions and 13 deletions

View File

@@ -11,7 +11,8 @@ namespace OpenRa.FileFormats
foreach (var x in ini)
{
var field = self.GetType().GetField(x.Key.Trim());
field.SetValue(self, GetValue(field.FieldType, x.Value.Trim()));
if( field != null )
field.SetValue(self, GetValue(field.FieldType, x.Value.Trim()));
}
}

View File

@@ -27,6 +27,10 @@ namespace OpenRa.FileFormats
FileSystem.Mount( new Package( "speech.mix" ) );
FileSystem.Mount( new Package( "allies.mix" ) );
FileSystem.Mount( new Package( "russian.mix" ) );
FileSystem.Mount( new Package( "temperat.mix" ) );
FileSystem.Mount( new Package( "snow.mix" ) );
FileSystem.Mount( new Package( "interior.mix" ) );
}
public static void MountAftermathPackages()

View File

@@ -6,7 +6,7 @@ namespace OpenRa.FileFormats
{
public class TileTemplate
{
public int Index;
public int Index; // not valid for `interior` stuff. only used for bridges.
public string Name;
public int2 Size;
public string Bridge;
@@ -36,10 +36,11 @@ namespace OpenRa.FileFormats
p => int.Parse(p.Key.Substring(8)),
p => int.Parse(p.Value)),
Name = section.GetValue("Name", null).ToLowerInvariant(),
Index = int.Parse(section.Name.Substring(3)),
Bridge = section.GetValue("bridge", null),
HP = float.Parse(section.GetValue("hp", "0"))
};
tile.Index = -1;
int.TryParse(section.Name.Substring(3), out tile.Index);
walkability[tile.Name] = tile;
}