diff options
| author | Michael <[email protected]> | 2017-02-06 15:33:18 -0500 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-02-06 15:33:18 -0500 |
| commit | 481623e07418dd740e23df2a77a30f7ef272d618 (patch) | |
| tree | 733649e90b30b74567aaa1402dc3bb220acb9830 | |
| parent | c73611e5c5d681dae2da7b2b3aa186e60c7cf896 (diff) | |
| download | shiftos_thereturn-481623e07418dd740e23df2a77a30f7ef272d618.tar.gz shiftos_thereturn-481623e07418dd740e23df2a77a30f7ef272d618.tar.bz2 shiftos_thereturn-481623e07418dd740e23df2a77a30f7ef272d618.zip | |
OSFT-ifying part 1.1: fix threading issue
| -rw-r--r-- | ShiftOS_TheReturn/Commands.cs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/ShiftOS_TheReturn/Commands.cs b/ShiftOS_TheReturn/Commands.cs index 455da27..1976ce3 100644 --- a/ShiftOS_TheReturn/Commands.cs +++ b/ShiftOS_TheReturn/Commands.cs @@ -54,7 +54,10 @@ namespace ShiftOS.Engine [Command("show")] public static bool ShowInfo(Dictionary<string, object> args) { - Infobox.Show(args["title"].ToString(), args["msg"].ToString()); + Desktop.InvokeOnWorkerThread(new Action(() => + { + Infobox.Show(args["title"].ToString(), args["msg"].ToString()); + })); return true; } @@ -71,7 +74,11 @@ namespace ShiftOS.Engine Console.WriteLine($"{SaveSystem.CurrentSave.Username} says {resultFriendly}."); TerminalBackend.IsForwardingConsoleWrites = false; }; - Infobox.PromptYesNo(args["title"].ToString(), args["msg"].ToString(), callback); + Desktop.InvokeOnWorkerThread(new Action(() => + { + Infobox.PromptYesNo(args["title"].ToString(), args["msg"].ToString(), callback); + + })); return true; } @@ -87,8 +94,11 @@ namespace ShiftOS.Engine Console.WriteLine($"{SaveSystem.CurrentSave.Username} says \"{result}\"."); TerminalBackend.IsForwardingConsoleWrites = false; }; - Infobox.PromptText(args["title"].ToString(), args["msg"].ToString(), callback); - return true; + Desktop.InvokeOnWorkerThread(new Action(() => + { + Infobox.PromptText(args["title"].ToString(), args["msg"].ToString(), callback); + })); + return true; } } |
