Allow import of skins which don't have ini files

This commit is contained in:
Dean Herbert 2018-03-19 20:26:16 +09:00
parent 7272ba2f1b
commit b71c123214
1 changed files with 6 additions and 3 deletions

View File

@ -26,10 +26,13 @@ public LegacySkin(SkinInfo skin, IResourceStore<byte[]> storage, AudioManager au
samples = audioManager.GetSampleManager(storage); samples = audioManager.GetSampleManager(storage);
textures = new TextureStore(new RawTextureLoaderStore(storage)); textures = new TextureStore(new RawTextureLoaderStore(storage));
var decoder = new LegacySkinDecoder(); Stream stream = storage.GetStream("skin.ini");
using (StreamReader reader = new StreamReader(storage.GetStream("skin.ini"))) if (stream != null)
Configuration = decoder.Decode(reader); using (StreamReader reader = new StreamReader(stream))
Configuration = new LegacySkinDecoder().Decode(reader);
else
Configuration = new SkinConfiguration();
} }
public override Drawable GetDrawableComponent(string componentName) public override Drawable GetDrawableComponent(string componentName)