Removed Input() stuff!

This commit is contained in:
Alex-TIMEHACK 2017-11-18 16:09:54 +00:00
parent b2f7322f30
commit 65b7ac2b8c
3 changed files with 19 additions and 22 deletions

View file

@ -14,12 +14,10 @@ namespace ShiftOS.Main.Terminal.Commands
public override string Usage { get; } = "Hello <NAME>.";
public override bool Unlocked { get; set; } = false;
public override async void Run(params string[] parameters)
public override void Run(params string[] parameters)
{
string name = string.Join(" ", parameters);
WriteLine($"Oh, hello, {name}.", Color.Red);
string age = await Input("Hey, What's your age?");
WriteLine($"Ok, so your name is {name} and your age {age}.");
WriteLine($"Oh, hello, {name}.");
}
}
}

View file

@ -11,10 +11,9 @@ namespace ShiftOS.Main.Terminal
public static class TerminalBackend
{
// The line below gets all the terminal commands in... well... the entire ShiftOS.Engine
public static IEnumerable<TerminalCommand> instances = from t in Assembly.GetExecutingAssembly().GetTypes()
where t.IsSubclassOf(typeof(TerminalCommand))
&& t.GetConstructor(Type.EmptyTypes) != null
select Activator.CreateInstance(t) as TerminalCommand;
public static IEnumerable<TerminalCommand> instances = Assembly.GetExecutingAssembly().GetTypes()
.Where(t => t.IsSubclassOf(typeof(TerminalCommand)) && t.GetConstructor(Type.EmptyTypes) != null)
.Select(t => Activator.CreateInstance(t) as TerminalCommand);
public static List<ShiftOS.Apps.Terminal> trm = new List<ShiftOS.Apps.Terminal>();
public static int trmTopID = 0;

View file

@ -71,22 +71,22 @@ namespace ShiftOS.Main.Terminal
/// Writes specified text in the terminal.
/// </summary>
/// <param name="value"><summary>The text to say before requesting text. </summary></param>
public virtual Task<string> Input(string value = "")
{
ShiftOS.Apps.Terminal trm = Array.Find(TerminalBackend.trm.ToArray(), w => w.TerminalID == TermID);
trm.Input(value);
//public virtual Task<string> Input(string value = "")
//{
// ShiftOS.Apps.Terminal trm = Array.Find(TerminalBackend.trm.ToArray(), w => w.TerminalID == TermID);
// trm.Input(value);
Task<string> Input = new Task<string>(() =>
{
while (true)
if (trm.InputReturnText != "") break;
// Task<string> Input = new Task<string>(() =>
// {
// while (true)
// if (trm.InputReturnText != "") break;
// The terminal has finally decided!
// // The terminal has finally decided!
return trm.InputReturnText;
});
Input.Start();
return Input;
}
// return trm.InputReturnText;
// });
// Input.Start();
// return Input;
//}
}
}