From f4d11fcdad5fdfc7c25cf3c6f96516b2330dca1c Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 5 Aug 2017 17:01:15 -0400 Subject: file opener and file saver --- ShiftOS.Frontend/Commands.cs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'ShiftOS.Frontend/Commands.cs') diff --git a/ShiftOS.Frontend/Commands.cs b/ShiftOS.Frontend/Commands.cs index e557ea2..19d229c 100644 --- a/ShiftOS.Frontend/Commands.cs +++ b/ShiftOS.Frontend/Commands.cs @@ -46,6 +46,38 @@ namespace ShiftOS.Frontend { public static class FrontendDebugCommands { + [Command("drop_opener")] + [ShellConstraint("shiftos_debug> ")] + public static void DropOpener(Dictionary args) + { + string[] ids = new string[] { "" }; + if (args.ContainsKey("id")) + { + ids = args["id"].ToString().Split(';'); + } + FileSkimmerBackend.GetFile(ids, FileOpenerStyle.Open, (path) => + { + Console.WriteLine(path); + TerminalBackend.PrintPrompt(); + }); + } + + [Command("drop_saver")] + [ShellConstraint("shiftos_debug> ")] + public static void DropSaver(Dictionary args) + { + string[] ids = new string[] { "" }; + if (args.ContainsKey("id")) + { + ids = args["id"].ToString().Split(';'); + } + FileSkimmerBackend.GetFile(ids, FileOpenerStyle.Save, (path) => + { + Console.WriteLine(path); + TerminalBackend.PrintPrompt(); + }); + } + /// /// Debug command to drop a fatal objective/hack failure screen in the form of an emergency alert system-esque screen. /// -- cgit v1.2.3