public override ResourceItem[] LoadFromFile(String keyPrefix, String fileName, String fileExtension, FileStream stream) { StreamReader reader = new StreamReader(stream); String text = reader.ReadToEnd(); reader.Close(); if (fileExtension == "lang") { String[] split = text.Split('"'); ResourceItem[] items = new ResourceItem[(split.Length - 1) / 4]; for (int i = 1, j = 0; i < split.Length; i += 4, ++j) { items[j] = new ResourceItem(split[i].ToLower(), split[i + 2]); } return(items); } else { return new ResourceItem[] { new ResourceItem(keyPrefix + fileName, text) } }; }
public override ResourceItem[] LoadFromFile( string keyPrefix, string fileName, string fileExtension, FileStream stream ) { InfoObject[] objs = Info.ParseStream( stream ); ResourceItem[] items = new ResourceItem[ objs.Length ]; for( int i = 0; i < objs.Length; ++ i ) { Info.Register( objs[ i ] ); items[ i ] = new ResourceItem( objs[ i ].Type + "_" + objs[ i ].Name, objs[ i ] ); } return items; }
public override ResourceItem[] LoadFromFile( String keyPrefix, String fileName, String fileExtension, FileStream stream ) { StreamReader reader = new StreamReader( stream ); String text = reader.ReadToEnd(); reader.Close(); if ( fileExtension == "lang" ) { String[] split = text.Split( '"' ); ResourceItem[] items = new ResourceItem[ ( split.Length - 1 ) / 4 ]; for ( int i = 1, j = 0; i < split.Length; i += 4, ++ j ) items[ j ] = new ResourceItem( split[ i ].ToLower(), split[ i + 2 ] ); return items; } else return new ResourceItem[] { new ResourceItem( keyPrefix + fileName, text ) }; }