Theater definitions in yaml
This commit is contained in:
@@ -51,8 +51,6 @@ namespace OpenRA.FileFormats
|
||||
return s.Length <= maxLength ? s : s.Substring(0,maxLength );
|
||||
}
|
||||
|
||||
public string TileSuffix { get { return "." + Truncate(Theater, 3); } }
|
||||
|
||||
public Map(string filename)
|
||||
{
|
||||
IniFile file = new IniFile(FileSystem.Open(filename));
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace OpenRA.FileFormats
|
||||
{
|
||||
public readonly Dictionary<ushort, Terrain> tiles = new Dictionary<ushort, Terrain>();
|
||||
|
||||
public readonly Walkability Walkability = new Walkability();
|
||||
public readonly Walkability Walkability;
|
||||
public readonly Dictionary<ushort, TileTemplate> walk
|
||||
= new Dictionary<ushort, TileTemplate>();
|
||||
|
||||
@@ -46,12 +46,12 @@ namespace OpenRA.FileFormats
|
||||
return ret;
|
||||
}
|
||||
|
||||
public TileSet( string suffix )
|
||||
public TileSet( string tilesetFile, string templatesFile, string suffix )
|
||||
{
|
||||
Walkability = new Walkability();
|
||||
Walkability = new Walkability(templatesFile);
|
||||
|
||||
char tileSetChar = char.ToUpperInvariant( suffix[ 1 ] );
|
||||
StreamReader tileIdFile = new StreamReader( FileSystem.Open( "tileSet.til" ) );
|
||||
char tileSetChar = char.ToUpperInvariant( suffix[ 0 ] );
|
||||
StreamReader tileIdFile = new StreamReader( FileSystem.Open(tilesetFile) );
|
||||
|
||||
while( true )
|
||||
{
|
||||
@@ -74,7 +74,7 @@ namespace OpenRA.FileFormats
|
||||
if (!walk.ContainsKey((ushort)(start + i)))
|
||||
walk.Add((ushort)(start + i), Walkability.GetWalkability(tilename));
|
||||
|
||||
using( Stream s = FileSystem.Open( tilename + suffix ) )
|
||||
using( Stream s = FileSystem.Open( tilename + "." + suffix ) )
|
||||
{
|
||||
if( !tiles.ContainsKey( (ushort)( start + i ) ) )
|
||||
tiles.Add( (ushort)( start + i ), new Terrain( s ) );
|
||||
|
||||
@@ -38,9 +38,9 @@ namespace OpenRA.FileFormats
|
||||
Dictionary<string, TileTemplate> walkability
|
||||
= new Dictionary<string,TileTemplate>();
|
||||
|
||||
public Walkability()
|
||||
public Walkability(string templatesFile)
|
||||
{
|
||||
var file = new IniFile( FileSystem.Open( "templates.ini" ) );
|
||||
var file = new IniFile( FileSystem.Open( templatesFile ) );
|
||||
|
||||
foreach (var section in file.Sections)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user