Added requirement boolean for arguments as well as implemented.

This commit is contained in:
Harrison Deng 2019-01-13 00:13:57 -06:00
parent 1070deb193
commit 477f827c1a
4 changed files with 15 additions and 11 deletions

View File

@ -142,6 +142,9 @@ namespace RecrownedAthenaeum.Tools.CommandProcessor
{ {
if (Validate(argument)) if (Validate(argument))
{ {
EngineCommandArgument eca = EngineCommandArgumentOf(argument);
string helpString = eca.help;
if (eca.required) helpString = helpString + " required.";
return EngineCommandArgumentOf(argument).help; return EngineCommandArgumentOf(argument).help;
} }
else else

View File

@ -8,11 +8,12 @@ namespace RecrownedAthenaeum.Tools.CommandProcessor
{ {
public string invokeString; public string invokeString;
public string help; public string help;
public bool required;
public EngineCommandArgument(string invokeString, string help) public EngineCommandArgument(string invokeString, string help, bool required = false)
{ {
this.invokeString = invokeString; this.invokeString = invokeString;
this.help = help; this.help = help;
this.required = required;
} }
} }
} }

View File

@ -19,12 +19,12 @@ namespace RecrownedAthenaeum.Tools.NinePatchTools
arguments = new EngineCommandArgument[6]; arguments = new EngineCommandArgument[6];
arguments[0] = new EngineCommandArgument("-i", "defines the path to the texture to be used for the nine patch."); arguments[0] = new EngineCommandArgument("-i", "defines the path to the texture to be used for the nine patch.", true);
arguments[1] = new EngineCommandArgument("-o", "defines path of output file."); arguments[1] = new EngineCommandArgument("-o", "defines path of output file.", true);
arguments[2] = new EngineCommandArgument("-l", "left patch."); arguments[2] = new EngineCommandArgument("-l", "left patch.", true);
arguments[3] = new EngineCommandArgument("-r", "right patch."); arguments[3] = new EngineCommandArgument("-r", "right patch.", true);
arguments[4] = new EngineCommandArgument("-u", "up patch."); arguments[4] = new EngineCommandArgument("-u", "up patch.", true);
arguments[5] = new EngineCommandArgument("-d", "down patch."); arguments[5] = new EngineCommandArgument("-d", "down patch.", true);
} }
public override void Run(string[] arguments = null) public override void Run(string[] arguments = null)

View File

@ -15,9 +15,9 @@ namespace RecrownedAthenaeum.Tools.TextureAtlasTools
help = "Packs a given directory composed of png and jpg files into an atlas. Can also add 9patch properties. Images with the associated \".9p\" files will automatically be defined in the resulting .tatlas file, but can be overwritten by use of the \"-9p\" argument."; help = "Packs a given directory composed of png and jpg files into an atlas. Can also add 9patch properties. Images with the associated \".9p\" files will automatically be defined in the resulting .tatlas file, but can be overwritten by use of the \"-9p\" argument.";
arguments = new EngineCommandArgument[7] { arguments = new EngineCommandArgument[7] {
new EngineCommandArgument("-interactive", "runs in interactive mode. Ninepatches must still be defined with arguments or previously defined with associated \".9p\" files. Other arguments will be ignored."), new EngineCommandArgument("-interactive", "runs in interactive mode. Ninepatches must still be defined with arguments or previously defined with associated \".9p\" files. Other arguments will be ignored."),
new EngineCommandArgument("-i", "for input directory containing the textures. Required."), new EngineCommandArgument("-i", "for input directory containing the textures.", true),
new EngineCommandArgument("-o", "Path for output files. Points to non-existent file. Will create texture and definitions file with name. Required."), new EngineCommandArgument("-o", "Path for output files. Points to non-existent file. Will create texture and definitions file with name.", true),
new EngineCommandArgument("-9p", "Can be used multiple times for defining a 9patch. This parameter requires a name, left patch, right patch, top patch, and bottom patch in the format name,a,b,c,d. Optional."), new EngineCommandArgument("-9p", "Can be used multiple times for defining a 9patch. This parameter requires a name, left patch, right patch, top patch, and bottom patch in the format name,a,b,c,d."),
new EngineCommandArgument("-sp", "Starting power for one side of the texture. Default is 8."), new EngineCommandArgument("-sp", "Starting power for one side of the texture. Default is 8."),
new EngineCommandArgument("-mp", "Maximum power for one side of the texture. Default is 8."), new EngineCommandArgument("-mp", "Maximum power for one side of the texture. Default is 8."),
new EngineCommandArgument("-dau", "Disables automatically upscaling the texture."), new EngineCommandArgument("-dau", "Disables automatically upscaling the texture."),