예제 #1
0
 /// <summary>
 /// Shows the help.
 /// </summary>
 /// <param name="arg"></param>
 /// <param name="arg2"></param>
 public void ShowHelp(string arg, string arg2)
 {
     //TODO: Currently this is being done both in InputValidation.cs and here. Simplify?
     string[] panelNames = { "MOVE", "TUTORIAL", "INTERACT", "COMMAND", "COMBAT" };
     //Check if the Player gave any additional input
     CheckString("Help", arg);
     //If not, send "null" to the InterfaceScript so that will show the help panel
     if (NoInput)
     {
         InterfaceScript.ShowHelp("null");
         //InterfaceScript.ActivateInput();
         return;
     }
     //If there are arguments, it should either be "with" + a valid help opion
     // or just a valid help option.
     if (arg.Equals("with", StringComparison.CurrentCultureIgnoreCase) &&
         CommandListScript.AllCommandsList.Any(s => s.Equals(arg2, StringComparison.CurrentCultureIgnoreCase)))
     {
         InterfaceScript.ShowHelp(arg2);
         return;
     }
     if (CommandListScript.AllCommandsList.Any(s => s.Equals(arg, StringComparison.CurrentCultureIgnoreCase)) ||
         panelNames.Any(s => s.Equals(arg, StringComparison.CurrentCultureIgnoreCase)))
     {
         InterfaceScript.ShowHelp(arg);
         return;
     }
     //Or if no valid command was given as an argument, let the Player know.
     else
     {
         DialogueScript.ErrorText("No help for that.");
     }
 }