2018-12-23 17:04:11 +00:00
using Microsoft.Xna.Framework.Content.Pipeline ;
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 ;
2019-01-22 01:56:51 +00:00
using System.Text ;
2018-12-23 17:04:11 +00:00
namespace RecrownedAthenaeum.Pipeline.NinePatch
{
2019-01-14 04:05:34 +00:00
[ContentImporter(DisplayName = "Nine Patch - RecrownedAthenaeum")]
2019-03-21 00:28:16 +00:00
class NinePatchProcessor : ContentProcessor < NinePatchData , NinePatchData >
2018-12-23 17:04:11 +00:00
{
2019-03-21 00:28:16 +00:00
public override NinePatchData Process ( NinePatchData input , ContentProcessorContext context )
2018-12-23 17:04:11 +00:00
{
2019-03-21 00:28:16 +00:00
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 ;
2018-12-23 17:04:11 +00:00
}
}
}