recrownedathenaeum/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchProcessor.cs

20 lines
803 B
C#

using Microsoft.Xna.Framework.Content.Pipeline;
using Newtonsoft.Json;
using RecrownedAthenaeum.Data;
using System.IO;
using System.Text;
namespace RecrownedAthenaeum.Pipeline.NinePatch
{
[ContentImporter(DisplayName = "Nine Patch - RecrownedAthenaeum")]
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;
}
}
}