diff --git a/README.md b/README.md index 60a5063..c49540b 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,8 @@ Instead of editing the source code directly, the settings can be changed by edit "Fuzzy": [ ".", "r", "o", "ro" ], // If do fuzzy search do find cards (r = input ranks, o = opening hands) "ForcedIncr": 10, // Number of RNG additions when "Play" is selected "AcceptDelayFrame": 3, // Number of frames after selecting "Play" that RNG additions stop - "Prompt": "> " // The prompt string to display + "Prompt": "> ", // The prompt string to display + "Interactive": false // If should prompt for parameters in case they're not supplied } ``` diff --git a/settings.json b/settings.json index a280f3c..b8cc5c6 100644 --- a/settings.json +++ b/settings.json @@ -16,5 +16,6 @@ "Fuzzy": [ ".", "r", "o", "ro" ], "ForcedIncr": 10, "AcceptDelayFrame": 3, - "Prompt": "> " + "Prompt": "> ", + "Interactive": false } diff --git a/src/Options.cs b/src/Options.cs index 2e73f0b..db50833 100644 --- a/src/Options.cs +++ b/src/Options.cs @@ -23,6 +23,7 @@ public class Options public uint ForcedIncr { get; set; } = 10; public int AcceptDelayFrame { get; set; } = 3; public string Prompt { get; set; } = "> "; + public bool Interactive { get; set; } = false; public enum TOrder { diff --git a/src/Program.cs b/src/Program.cs index 9ee7c82..f915e4a 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -25,13 +25,20 @@ static void Main(string[] args) return; } - if (args.Length == 0) + if (_args.Length == 0) { - ShowHelp(); - return; + if (_options.Interactive) + { + _args = PromptArgs(); + } + else + { + ShowHelp(); + return; + } } - var (firstState, state, count, searchType) = ReadArgs(args); + var (firstState, state, count, searchType) = ReadArgs(_args); var player = PlayerTable.Get(_options.Player); if (searchType == TSearchType.First) @@ -781,6 +788,22 @@ static void ShowPatternHelp() Console.WriteLine(Translate.Get("help.pattern")); } + static string[] PromptArgs() + { + Console.WriteLine(Translate.Get("prompt_args.first")); + var first = Prompt(); + Console.WriteLine(Translate.Get("prompt_args.second")); + var second = Prompt(); + Console.WriteLine(); + + if (string.IsNullOrWhiteSpace(second)) + { + return new string[] { first }; + } + + return new string[] { first, second }; + } + static string Prompt() { Console.Write(_options.Prompt); diff --git a/src/Translate.cs b/src/Translate.cs index ba53a0c..d3ee890 100644 --- a/src/Translate.cs +++ b/src/Translate.cs @@ -15,6 +15,9 @@ static Translate() _expressions.Add("pattern2str_fmt", "Initiative: {0}\nDeck: {1}"); _expressions.Add("no_target", "There is no target."); + _expressions.Add("prompt_args.first", "Enter 1 for Elastoid, 2 for Malboro, 3 for Biggs&Wedge or the RNG state in hexadecimal:"); + _expressions.Add("prompt_args.second", "Enter the RNG counter (optional):"); + _expressions.Add("prompt.rare_search", "Enter:start Rare Card Timer (h:Help, q:Quit, else:Recovery Search):"); _expressions.Add("prompt.after_normal_search", "Enter:start Rare Card Timer (h:Help, q:Quit, else:change Pattern for Search):"); _expressions.Add("prompt.second_game_method", "Please hit \"Play\" with turbo button\nand input the opening situation of the 1st game (h:Help, q:Quit):");