20 lines
785 B
C#
Raw Normal View History

2020-02-16 21:44:21 -05:00
using Microsoft.Xna.Framework.Content.Pipeline;
using Newtonsoft.Json;
using RecrownedGTK.Data;
using System.IO;
using System.Text;
namespace RecrownedGTK.Pipeline.NinePatch
{
[ContentImporter(DisplayName = "Nine Patch - RecrownedGTK")]
class NinePatchProcessor : ContentProcessor<NinePatchData, NinePatchData>
{
public override NinePatchData Process(NinePatchData input, ContentProcessorContext context)
{
if (Path.GetFileNameWithoutExtension(context.SourceIdentity.SourceFilename) == Path.GetFileNameWithoutExtension(input.textureName)) throw new InvalidContentException("Ninepatch data and texture for the data can't have the same name.");
context.AddDependency(input.textureName);
return input;
}
}
}