fix the hacker101 story some more

This commit is contained in:
Michael 2017-03-11 09:54:44 -05:00
parent 49812bf46c
commit dad61e325c
3 changed files with 28 additions and 3 deletions

View file

@ -21,6 +21,8 @@ namespace ShiftOS.WinForms.Applications
InitializeComponent();
IsComplete = false;
lbltuttext.Text = "";
lbltuttext.Padding = new Padding(15);
lbltuttext.Margin = lbltuttext.Padding;
}
bool stillTyping = false;
@ -47,6 +49,7 @@ namespace ShiftOS.WinForms.Applications
}));
Thread.Sleep(75);
}
Thread.Sleep(5000);
stillTyping = false;
}).Start();
}

View file

@ -59,10 +59,25 @@ namespace ShiftOS.WinForms
{
private static void writeSlow(string text)
{
Console.Write("[hacker101@undisclosed]: ");
Thread.Sleep(200);
ConsoleEx.ForegroundColor = ConsoleColor.DarkYellow;
ConsoleEx.Bold = false;
ConsoleEx.Italic = false;
Console.Write("[");
ConsoleEx.ForegroundColor = ConsoleColor.Magenta;
ConsoleEx.Bold = true;
Console.Write("hacker101");
ConsoleEx.ForegroundColor = ConsoleColor.DarkYellow;
ConsoleEx.Italic = true;
Console.Write("@");
ConsoleEx.ForegroundColor = ConsoleColor.White;
Console.Write("undisclosed");
ConsoleEx.ForegroundColor = ConsoleColor.DarkYellow;
ConsoleEx.Bold = false;
ConsoleEx.Italic = false;
Console.Write("]: ");
Thread.Sleep(850);
Console.WriteLine(text);
Thread.Sleep(1000);
Thread.Sleep(4000);
}
[Story("hacker101_deadaccts")]
@ -121,9 +136,12 @@ namespace ShiftOS.WinForms
TerminalBackend.PrefixEnabled = true;
Console.Write($"{SaveSystem.CurrentSave.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ");
StartHackerTutorial();
TerminalBackend.PrefixEnabled = true;
TerminalBackend.PrintPrompt();
});
t.IsBackground = true;
t.Start();
TerminalBackend.PrefixEnabled = false;
}
internal static void StartHackerTutorial()

View file

@ -69,12 +69,16 @@ namespace ShiftOS.Engine.Scripting
{
if (msg.Name == "run")
{
TerminalBackend.PrefixEnabled = false;
var cntnts = JsonConvert.DeserializeObject<dynamic>(msg.Contents);
var interp = new LuaInterpreter();
Desktop.InvokeOnWorkerThread(() =>
{
interp.Execute(cntnts.script.ToString());
});
TerminalBackend.PrefixEnabled = true;
TerminalBackend.PrintPrompt();
}
};
}