2018-12-23 17:04:11 +00:00
|
|
|
|
using Microsoft.Xna.Framework.Content.Pipeline;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
|
|
namespace RecrownedAthenaeum.Pipeline.NinePatch
|
|
|
|
|
{
|
2019-01-13 23:09:27 +00:00
|
|
|
|
[ContentImporter(".9p", DisplayName = "Nine Patch Importer", DefaultProcessor = "NinePatchProcessor")]
|
2018-12-23 17:04:11 +00:00
|
|
|
|
internal class NinePatchImporter : ContentImporter<NinePatchData>
|
|
|
|
|
{
|
|
|
|
|
public override NinePatchData Import(string filename, ContentImporterContext context)
|
|
|
|
|
{
|
|
|
|
|
NinePatchData data;
|
|
|
|
|
using (StreamReader stream = new StreamReader(filename))
|
|
|
|
|
{
|
|
|
|
|
data = JsonConvert.DeserializeObject<NinePatchData>(stream.ReadToEnd());
|
|
|
|
|
}
|
|
|
|
|
context.AddDependency(data.textureName);
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|