makes sure input is specified before checking other arguments now.

This commit is contained in:
Harrison Deng 2018-12-09 01:22:23 -06:00
parent f442be1ba6
commit 58c3085f90

View File

@ -41,6 +41,8 @@ namespace RecrownedAthenaeum.Tools.TextureAtlasTools
texturePacker = new TexturePacker((arguments[i + 1]));
}
}
if (texturePacker != null)
{
texturePacker.Build();
for (int i = 0; i < arguments.Length; i++)
@ -52,7 +54,8 @@ namespace RecrownedAthenaeum.Tools.TextureAtlasTools
try
{
texturePacker.SetNinePatch(nPatchArgs[0], int.Parse(nPatchArgs[1]), int.Parse(nPatchArgs[2]), int.Parse(nPatchArgs[3]), int.Parse(nPatchArgs[4]));
} catch (FormatException)
}
catch (FormatException)
{
throw new ArgumentException("-9p argument parameters must be in the format \"-9p textureName,a,b,c,d\" where a, b, c, and d are integers definining the border regions for the 9patch.");
}
@ -73,6 +76,10 @@ namespace RecrownedAthenaeum.Tools.TextureAtlasTools
throw new ArgumentException("no -o argument found to specify output.");
}
}
} else
{
throw new ArgumentException("-i not specified.");
}
}
}
}