2018-12-23 17:04:11 +00:00
|
|
|
|
using Microsoft.Xna.Framework.Content.Pipeline;
|
|
|
|
|
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;
|
2019-01-14 04:05:34 +00:00
|
|
|
|
using Newtonsoft.Json;
|
2019-01-20 07:07:52 +00:00
|
|
|
|
using RecrownedAthenaeum.Data;
|
2019-03-21 00:28:16 +00:00
|
|
|
|
using System.IO;
|
2018-12-23 17:04:11 +00:00
|
|
|
|
|
|
|
|
|
namespace RecrownedAthenaeum.Pipeline.NinePatch
|
|
|
|
|
{
|
|
|
|
|
[ContentTypeWriter]
|
2019-03-21 00:28:16 +00:00
|
|
|
|
class NinePatchWriter : ContentTypeWriter<NinePatchData>
|
2018-12-23 17:04:11 +00:00
|
|
|
|
{
|
|
|
|
|
public override string GetRuntimeReader(TargetPlatform targetPlatform)
|
|
|
|
|
{
|
2019-01-21 05:06:25 +00:00
|
|
|
|
return "RecrownedAthenaeum.ContentReaders.NinePatchDataReader, RecrownedAthenaeum";
|
2018-12-23 17:04:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-03-21 00:28:16 +00:00
|
|
|
|
protected override void Write(ContentWriter output, NinePatchData value)
|
2018-12-23 17:04:11 +00:00
|
|
|
|
{
|
2019-03-21 00:28:16 +00: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 17:04:11 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|