2018-12-23 11:04:11 -06:00
|
|
|
|
using Microsoft.Xna.Framework.Content.Pipeline;
|
|
|
|
|
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;
|
2019-01-13 22:05:34 -06:00
|
|
|
|
using Newtonsoft.Json;
|
2019-01-20 01:07:52 -06:00
|
|
|
|
using RecrownedAthenaeum.Data;
|
2019-03-20 19:28:16 -05:00
|
|
|
|
using System.IO;
|
2018-12-23 11:04:11 -06:00
|
|
|
|
|
|
|
|
|
namespace RecrownedAthenaeum.Pipeline.NinePatch
|
|
|
|
|
{
|
|
|
|
|
[ContentTypeWriter]
|
2019-03-20 19:28:16 -05:00
|
|
|
|
class NinePatchWriter : ContentTypeWriter<NinePatchData>
|
2018-12-23 11:04:11 -06:00
|
|
|
|
{
|
|
|
|
|
public override string GetRuntimeReader(TargetPlatform targetPlatform)
|
|
|
|
|
{
|
2019-01-20 23:06:25 -06:00
|
|
|
|
return "RecrownedAthenaeum.ContentReaders.NinePatchDataReader, RecrownedAthenaeum";
|
2018-12-23 11:04:11 -06:00
|
|
|
|
}
|
|
|
|
|
|
2019-03-20 19:28:16 -05:00
|
|
|
|
protected override void Write(ContentWriter output, NinePatchData value)
|
2018-12-23 11:04:11 -06:00
|
|
|
|
{
|
2019-03-20 19:28:16 -05:00
|
|
|
|
output.Write(Path.GetFileNameWithoutExtension(value.textureName));
|
|
|
|
|
output.Write(value.left);
|
|
|
|
|
output.Write(value.right);
|
|
|
|
|
output.Write(value.bottom);
|
|
|
|
|
output.Write(value.top);
|
2018-12-23 11:04:11 -06:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|