From fc55d4feecb64c2bae355cceac93bdac73fe00ea Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 5 Mar 2017 08:02:30 -0500 Subject: hang on, busy making a sad victor tran face --- ShiftOS.WinForms/Applications/Downloader.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ShiftOS.WinForms/Applications/Downloader.cs') diff --git a/ShiftOS.WinForms/Applications/Downloader.cs b/ShiftOS.WinForms/Applications/Downloader.cs index b1b7ed9..48a5cfd 100644 --- a/ShiftOS.WinForms/Applications/Downloader.cs +++ b/ShiftOS.WinForms/Applications/Downloader.cs @@ -187,6 +187,16 @@ namespace ShiftOS.WinForms.Applications return 256; } + public static IEnumerable GetAllSubscriptions() + { + //For now we'll have them hard-coded into the client but in future they'll be in the MUD. + + foreach(var sub in JsonConvert.DeserializeObject(Properties.Resources.ShiftnetServices)) + { + yield return sub; + } + } + public static void StartDownload(Download down) { var t = new Thread(() => -- cgit v1.2.3 From 308006ff9de8ce34e00d31d39ccffa43d98cba5e Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 5 Mar 2017 10:28:51 -0500 Subject: Add Shiftnet subscription metadata --- ShiftOS.WinForms/Applications/Downloader.cs | 21 +++------------------ ShiftOS.WinForms/Resources/ShiftnetServices.txt | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 21 deletions(-) (limited to 'ShiftOS.WinForms/Applications/Downloader.cs') diff --git a/ShiftOS.WinForms/Applications/Downloader.cs b/ShiftOS.WinForms/Applications/Downloader.cs index 48a5cfd..da90c6d 100644 --- a/ShiftOS.WinForms/Applications/Downloader.cs +++ b/ShiftOS.WinForms/Applications/Downloader.cs @@ -173,28 +173,13 @@ namespace ShiftOS.WinForms.Applications /// Download speed in bytes. public static int GetDownloadSpeed() { - switch (SaveSystem.CurrentSave.ShiftnetSubscription) - { - case 0: - return 256/*B*/; - case 1: - return 1024 * 1024/*KB*/; - case 2: - return 1024 * 10240/*KB*/; - case 3: - return 1024 * 1024 * 1024/*MB*/; - } - return 256; + return GetAllSubscriptions()[SaveSystem.CurrentSave.ShiftnetSubscription].DownloadSpeed; } - public static IEnumerable GetAllSubscriptions() + public static ShiftOS.Objects.EngineShiftnetSubscription[] GetAllSubscriptions() { //For now we'll have them hard-coded into the client but in future they'll be in the MUD. - - foreach(var sub in JsonConvert.DeserializeObject(Properties.Resources.ShiftnetServices)) - { - yield return sub; - } + return JsonConvert.DeserializeObject(Properties.Resources.ShiftnetServices); } public static void StartDownload(Download down) diff --git a/ShiftOS.WinForms/Resources/ShiftnetServices.txt b/ShiftOS.WinForms/Resources/ShiftnetServices.txt index a396849..e9c04e1 100644 --- a/ShiftOS.WinForms/Resources/ShiftnetServices.txt +++ b/ShiftOS.WinForms/Resources/ShiftnetServices.txt @@ -9,12 +9,22 @@ With Freebie Solutions from ShiftSoft, you'll be able to traverse the Shiftnet w Company: "ShiftSoft" }, { - Company: "" + Company: "Shiftcast", + Name: "NetXtreme Hyper Edition", + CostPerMonth: 1500, + DownloadSpeed: 524288, //512 kb/s + Description: "It's time to supercharge your Shiftnet experience. With all the multimedia available, fast download speeds are a must on the Shiftnet. Start your subscription today for the low price of 1500 Codepoints and become a hyper-traveller today." }, { - + Company: "Plumb Corp.", + Name: "youConnect", + CostPerMonth: 4000, + DownloadSpeed: 262144 }, { - + Company: "theCorp", + Name: "theNet", + CostPerMonth: 2000, + DownloadSpeed: 1048576, }, ] \ No newline at end of file -- cgit v1.2.3 From a9754b7df28795b6bb2c5cfe04c1b38b19fb0d05 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 10 Mar 2017 12:29:28 -0500 Subject: Lock certain apps away when system offline. --- ShiftOS.WinForms/Applications/Artpad.cs | 1 + ShiftOS.WinForms/Applications/Chat.cs | 1 + ShiftOS.WinForms/Applications/Downloader.cs | 1 + ShiftOS.WinForms/Applications/FormatEditor.cs | 1 + ShiftOS.WinForms/Applications/GraphicPicker.cs | 1 + ShiftOS.WinForms/Applications/MUDControlCentre.cs | 1 + ShiftOS.WinForms/Applications/NameChanger.cs | 1 + ShiftOS.WinForms/Applications/Pong.cs | 1 + ShiftOS.WinForms/Applications/ShiftLetters.cs | 1 + ShiftOS.WinForms/Applications/ShiftLotto.cs | 1 + ShiftOS.WinForms/Applications/ShiftSweeper.cs | 1 + ShiftOS.WinForms/Applications/Shifter.cs | 1 + ShiftOS.WinForms/Applications/Shiftnet.cs | 1 + .../Applications/ShiftoriumFrontend.cs | 1 + ShiftOS.WinForms/HackerCommands.cs | 10 ++++++ ShiftOS.WinForms/WinformsWindowManager.cs | 18 ++++++++++ ShiftOS_TheReturn/AppLauncherDaemon.cs | 20 +++++++++--- ShiftOS_TheReturn/KernelWatchdog.cs | 38 +++++++++++++++++++++- ShiftOS_TheReturn/Scripting.cs | 7 ++-- 19 files changed, 100 insertions(+), 7 deletions(-) (limited to 'ShiftOS.WinForms/Applications/Downloader.cs') diff --git a/ShiftOS.WinForms/Applications/Artpad.cs b/ShiftOS.WinForms/Applications/Artpad.cs index 6c1bc1c..71f7afb 100644 --- a/ShiftOS.WinForms/Applications/Artpad.cs +++ b/ShiftOS.WinForms/Applications/Artpad.cs @@ -41,6 +41,7 @@ using ShiftOS.Engine; namespace ShiftOS.WinForms.Applications { + [MultiplayerOnly] [Launcher("Artpad", true, "al_artpad", "Graphics")] [RequiresUpgrade("artpad")] [WinOpen("artpad")] diff --git a/ShiftOS.WinForms/Applications/Chat.cs b/ShiftOS.WinForms/Applications/Chat.cs index 06a7873..caf8cd2 100644 --- a/ShiftOS.WinForms/Applications/Chat.cs +++ b/ShiftOS.WinForms/Applications/Chat.cs @@ -36,6 +36,7 @@ using ShiftOS.Engine; namespace ShiftOS.WinForms.Applications { + [MultiplayerOnly] public partial class Chat : UserControl, IShiftOSWindow { public Chat(string chatId) diff --git a/ShiftOS.WinForms/Applications/Downloader.cs b/ShiftOS.WinForms/Applications/Downloader.cs index da90c6d..1f240bf 100644 --- a/ShiftOS.WinForms/Applications/Downloader.cs +++ b/ShiftOS.WinForms/Applications/Downloader.cs @@ -41,6 +41,7 @@ using System.IO.Compression; namespace ShiftOS.WinForms.Applications { + [MultiplayerOnly] [Launcher("Downloader", false, null, "Networking")] [DefaultIcon("iconDownloader")] public partial class Downloader : UserControl, IShiftOSWindow diff --git a/ShiftOS.WinForms/Applications/FormatEditor.cs b/ShiftOS.WinForms/Applications/FormatEditor.cs index ef44b47..56b0253 100644 --- a/ShiftOS.WinForms/Applications/FormatEditor.cs +++ b/ShiftOS.WinForms/Applications/FormatEditor.cs @@ -34,6 +34,7 @@ using System.Windows.Forms; using ShiftOS.Engine; namespace ShiftOS.WinForms.Applications { + [MultiplayerOnly] [Launcher("FormatEditor", true, "al_format_editor", "Games")] [RequiresUpgrade("format_editor")] [WinOpen("formateditor")] diff --git a/ShiftOS.WinForms/Applications/GraphicPicker.cs b/ShiftOS.WinForms/Applications/GraphicPicker.cs index 2dfe7ec..b3dd8bf 100644 --- a/ShiftOS.WinForms/Applications/GraphicPicker.cs +++ b/ShiftOS.WinForms/Applications/GraphicPicker.cs @@ -37,6 +37,7 @@ using ShiftOS.WinForms.Tools; namespace ShiftOS.WinForms.Applications { + [MultiplayerOnly] [DefaultTitle("Choose graphic")] [DefaultIcon("icongraphicpicker")] public partial class GraphicPicker : UserControl, IShiftOSWindow { diff --git a/ShiftOS.WinForms/Applications/MUDControlCentre.cs b/ShiftOS.WinForms/Applications/MUDControlCentre.cs index 02fe868..e2668bd 100644 --- a/ShiftOS.WinForms/Applications/MUDControlCentre.cs +++ b/ShiftOS.WinForms/Applications/MUDControlCentre.cs @@ -38,6 +38,7 @@ using ShiftOS.WinForms.Tools; namespace ShiftOS.WinForms.Applications { + [MultiplayerOnly] [RequiresUpgrade("mud_fundamentals")] [Launcher("MUD Control Centre", true, "al_mud_control_centre", "Networking")] [WinOpen("mud_control_centre")] diff --git a/ShiftOS.WinForms/Applications/NameChanger.cs b/ShiftOS.WinForms/Applications/NameChanger.cs index ca76e57..d7c99f7 100644 --- a/ShiftOS.WinForms/Applications/NameChanger.cs +++ b/ShiftOS.WinForms/Applications/NameChanger.cs @@ -38,6 +38,7 @@ using ShiftOS.WinForms.Tools; namespace ShiftOS.WinForms.Applications { + [MultiplayerOnly] [Launcher("Name Changer", true, "al_name_changer", "Customization")] [RequiresUpgrade("name_changer")] [WinOpen("name_changer")] diff --git a/ShiftOS.WinForms/Applications/Pong.cs b/ShiftOS.WinForms/Applications/Pong.cs index af1e156..157ce8c 100644 --- a/ShiftOS.WinForms/Applications/Pong.cs +++ b/ShiftOS.WinForms/Applications/Pong.cs @@ -37,6 +37,7 @@ using ShiftOS.Objects; namespace ShiftOS.WinForms.Applications { + [MultiplayerOnly] [Launcher("Pong", true, "al_pong", "Games")] [WinOpen("pong")] [DefaultIcon("iconPong")] diff --git a/ShiftOS.WinForms/Applications/ShiftLetters.cs b/ShiftOS.WinForms/Applications/ShiftLetters.cs index 700df7e..b5e9aa4 100644 --- a/ShiftOS.WinForms/Applications/ShiftLetters.cs +++ b/ShiftOS.WinForms/Applications/ShiftLetters.cs @@ -36,6 +36,7 @@ using System.Windows.Forms; namespace ShiftOS.WinForms.Applications { + [MultiplayerOnly] [Launcher("ShiftLetters", false, null, "Games")] [RequiresUpgrade("shiftletters")] [WinOpen("shiftletters")] diff --git a/ShiftOS.WinForms/Applications/ShiftLotto.cs b/ShiftOS.WinForms/Applications/ShiftLotto.cs index 7acba3e..33f357f 100644 --- a/ShiftOS.WinForms/Applications/ShiftLotto.cs +++ b/ShiftOS.WinForms/Applications/ShiftLotto.cs @@ -35,6 +35,7 @@ using ShiftOS.Engine; namespace ShiftOS.WinForms.Applications { [Launcher("ShiftLotto", true, "al_shiftlotto", "Games")] + [MultiplayerOnly] [DefaultIcon("iconShiftLotto")] [RequiresUpgrade("shiftlotto")] [WinOpen("shiftlotto")] diff --git a/ShiftOS.WinForms/Applications/ShiftSweeper.cs b/ShiftOS.WinForms/Applications/ShiftSweeper.cs index b13880f..cf6d331 100644 --- a/ShiftOS.WinForms/Applications/ShiftSweeper.cs +++ b/ShiftOS.WinForms/Applications/ShiftSweeper.cs @@ -36,6 +36,7 @@ using ShiftOS.Engine; namespace ShiftOS.WinForms.Applications { [Launcher("ShiftSweeper", true, "al_shiftsweeper", "Games")] [RequiresUpgrade("shiftsweeper")] + [MultiplayerOnly] [WinOpen("shiftsweeper")] [DefaultIcon("iconShiftSweeper")] public partial class ShiftSweeper : UserControl, IShiftOSWindow { diff --git a/ShiftOS.WinForms/Applications/Shifter.cs b/ShiftOS.WinForms/Applications/Shifter.cs index 1adc75a..fe2bf20 100644 --- a/ShiftOS.WinForms/Applications/Shifter.cs +++ b/ShiftOS.WinForms/Applications/Shifter.cs @@ -40,6 +40,7 @@ using ShiftOS.WinForms.Tools; namespace ShiftOS.WinForms.Applications { + [MultiplayerOnly] [Launcher("Shifter", true, "al_shifter", "Customization")] [RequiresUpgrade("shifter")] [WinOpen("shifter")] diff --git a/ShiftOS.WinForms/Applications/Shiftnet.cs b/ShiftOS.WinForms/Applications/Shiftnet.cs index 45f37d4..c1c81d5 100644 --- a/ShiftOS.WinForms/Applications/Shiftnet.cs +++ b/ShiftOS.WinForms/Applications/Shiftnet.cs @@ -38,6 +38,7 @@ using ShiftOS.WinForms.Tools; namespace ShiftOS.WinForms.Applications { [Launcher("Shiftnet", false, null, "Networking")] + [MultiplayerOnly] [DefaultIcon("iconShiftnet")] public partial class Shiftnet : UserControl, IShiftOSWindow { public Shiftnet() { diff --git a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs index b3724ae..0580b47 100644 --- a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs +++ b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs @@ -39,6 +39,7 @@ namespace ShiftOS.WinForms.Applications { [Launcher("Shiftorium", true, "al_shiftorium", "Utilities")] [RequiresUpgrade("shiftorium_gui")] + [MultiplayerOnly] [WinOpen("shiftorium")] [DefaultTitle("Shiftorium")] [DefaultIcon("iconShiftorium")] diff --git a/ShiftOS.WinForms/HackerCommands.cs b/ShiftOS.WinForms/HackerCommands.cs index 52d8568..d9504d3 100644 --- a/ShiftOS.WinForms/HackerCommands.cs +++ b/ShiftOS.WinForms/HackerCommands.cs @@ -668,5 +668,15 @@ namespace ShiftOS.WinForms return true; } + + [Command("experience", description = "Marks a story plot as experienced without triggering the plot.", usage ="{id:}")] + [RequiresArgument("id")] + [RemoteLock] + public static bool Experience(Dictionary args) + { + SaveSystem.CurrentSave.StoriesExperienced.Add(args["id"].ToString()); + SaveSystem.SaveGame(); + return true; + } } } diff --git a/ShiftOS.WinForms/WinformsWindowManager.cs b/ShiftOS.WinForms/WinformsWindowManager.cs index b8f0cae..eeaa6c9 100644 --- a/ShiftOS.WinForms/WinformsWindowManager.cs +++ b/ShiftOS.WinForms/WinformsWindowManager.cs @@ -106,6 +106,24 @@ namespace ShiftOS.WinForms return; } + foreach(var attr in form.GetType().GetCustomAttributes(true)) + { + if(attr is MultiplayerOnlyAttribute) + { + if(KernelWatchdog.MudConnected == false) + { + Infobox.PromptYesNo("Disconnected from MUD", "This application requires a connection to the MUD. Would you like to reconnect?", new Action((answer) => + { + if(answer == true) + { + KernelWatchdog.MudConnected = true; + SetupWindow(form); + } + })); + return; + } + } + } if (!Shiftorium.UpgradeAttributesUnlocked(form.GetType())) { diff --git a/ShiftOS_TheReturn/AppLauncherDaemon.cs b/ShiftOS_TheReturn/AppLauncherDaemon.cs index 7ef34c1..5e3bd72 100644 --- a/ShiftOS_TheReturn/AppLauncherDaemon.cs +++ b/ShiftOS_TheReturn/AppLauncherDaemon.cs @@ -66,12 +66,24 @@ namespace ShiftOS.Engine { foreach (var attr in type.GetCustomAttributes(false)) { - if (attr is LauncherAttribute) + bool isAllowed = true; + if(attr is MultiplayerOnlyAttribute) { - var launch = attr as LauncherAttribute; - if (launch.UpgradeInstalled) + if(KernelWatchdog.MudConnected == false) { - win.Add(new LauncherItem { DisplayData = launch, LaunchType = type }); + isAllowed = false; + + } + } + if (isAllowed == true) + { + if (attr is LauncherAttribute) + { + var launch = attr as LauncherAttribute; + if (launch.UpgradeInstalled) + { + win.Add(new LauncherItem { DisplayData = launch, LaunchType = type }); + } } } } diff --git a/ShiftOS_TheReturn/KernelWatchdog.cs b/ShiftOS_TheReturn/KernelWatchdog.cs index 1b59b25..e69c9ba 100644 --- a/ShiftOS_TheReturn/KernelWatchdog.cs +++ b/ShiftOS_TheReturn/KernelWatchdog.cs @@ -25,8 +25,44 @@ namespace ShiftOS.Engine } } + private static bool _mudConnected = true; + public static bool InKernelMode { get; private set; } - public static bool MudConnected { get; set; } + public static bool MudConnected + { + get + { + return _mudConnected; + } + set + { + if(value == false) + { + foreach(var win in AppearanceManager.OpenForms) + { + foreach(var attr in win.ParentWindow.GetType().GetCustomAttributes(true)) + { + if(attr is MultiplayerOnlyAttribute) + { + ConsoleEx.Bold = true; + ConsoleEx.Underline = false; + ConsoleEx.Italic = true; + ConsoleEx.ForegroundColor = ConsoleColor.Red; + Console.Write("Error:"); + ConsoleEx.Bold = false; + ConsoleEx.ForegroundColor = ConsoleColor.DarkYellow; + Console.WriteLine("Cannot disconnect from multi-user domain because an app that depends on it is open."); + TerminalBackend.PrintPrompt(); + return; + } + } + } + } + + _mudConnected = value; + Desktop.PopulateAppLauncher(); + } + } public static bool IsSafe(Type type) { diff --git a/ShiftOS_TheReturn/Scripting.cs b/ShiftOS_TheReturn/Scripting.cs index bb65dc7..6768efb 100644 --- a/ShiftOS_TheReturn/Scripting.cs +++ b/ShiftOS_TheReturn/Scripting.cs @@ -67,11 +67,14 @@ namespace ShiftOS.Engine.Scripting { ServerManager.MessageReceived += (msg) => { - if(msg.Name == "run") + if (msg.Name == "run") { var cntnts = JsonConvert.DeserializeObject(msg.Contents); var interp = new LuaInterpreter(); - interp.Execute(cntnts.script.ToString()); + Desktop.InvokeOnWorkerThread(() => + { + interp.Execute(cntnts.script.ToString()); + }); } }; } -- cgit v1.2.3 From a9a9beaf63e5a8dc63e8ec8388373e3868d11cfb Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 9 Apr 2017 20:46:56 -0400 Subject: finish the smiley's first story --- ShiftOS.WinForms/Applications/Downloader.cs | 5 +- ShiftOS.WinForms/Applications/Installer.cs | 5 ++ ShiftOS.WinForms/Applications/Shiftnet.cs | 5 +- ShiftOS.WinForms/Resources/Shiftorium.txt | 23 ++++- ShiftOS.WinForms/Stories/LegionStory.cs | 135 +++++++++++++++++++++++++++- ShiftOS.WinForms/WinformsDesktop.cs | 11 +++ 6 files changed, 179 insertions(+), 5 deletions(-) (limited to 'ShiftOS.WinForms/Applications/Downloader.cs') diff --git a/ShiftOS.WinForms/Applications/Downloader.cs b/ShiftOS.WinForms/Applications/Downloader.cs index 1f240bf..b3d2cea 100644 --- a/ShiftOS.WinForms/Applications/Downloader.cs +++ b/ShiftOS.WinForms/Applications/Downloader.cs @@ -42,8 +42,11 @@ using System.IO.Compression; namespace ShiftOS.WinForms.Applications { [MultiplayerOnly] - [Launcher("Downloader", false, null, "Networking")] + [Launcher("Downloader", true, "al_downloader", "Networking")] [DefaultIcon("iconDownloader")] + [WinOpen("downloader")] + [DefaultTitle("Downloader")] + [RequiresUpgrade("downloader")] public partial class Downloader : UserControl, IShiftOSWindow { public Downloader() diff --git a/ShiftOS.WinForms/Applications/Installer.cs b/ShiftOS.WinForms/Applications/Installer.cs index 1b5521e..2193f8a 100644 --- a/ShiftOS.WinForms/Applications/Installer.cs +++ b/ShiftOS.WinForms/Applications/Installer.cs @@ -11,6 +11,11 @@ using ShiftOS.Engine; namespace ShiftOS.WinForms.Applications { + [WinOpen("installer")] + [RequiresUpgrade("installer")] + [MultiplayerOnly] + [DefaultTitle("Installer")] + [Launcher("Installer", true, "al_installer", "Utilities")] public partial class Installer : UserControl, IShiftOSWindow { public Installer() diff --git a/ShiftOS.WinForms/Applications/Shiftnet.cs b/ShiftOS.WinForms/Applications/Shiftnet.cs index 501fa56..54a8aa6 100644 --- a/ShiftOS.WinForms/Applications/Shiftnet.cs +++ b/ShiftOS.WinForms/Applications/Shiftnet.cs @@ -44,8 +44,11 @@ namespace ShiftOS.WinForms.Applications // //READ THE DAMN SHIFTOS CODING GUIDELINES. - [Launcher("Shiftnet", false, null, "Networking")] + [Launcher("Shiftnet", true, "al_shiftnet", "Networking")] [MultiplayerOnly] + [DefaultTitle("Shiftnet")] + [WinOpen("shiftnet")] + [RequiresUpgrade("victortran_shiftnet")] [DefaultIcon("iconShiftnet")] public partial class Shiftnet : UserControl, IShiftOSWindow { diff --git a/ShiftOS.WinForms/Resources/Shiftorium.txt b/ShiftOS.WinForms/Resources/Shiftorium.txt index ae4cb0a..fd03677 100644 --- a/ShiftOS.WinForms/Resources/Shiftorium.txt +++ b/ShiftOS.WinForms/Resources/Shiftorium.txt @@ -160,7 +160,28 @@ Category: "GUI", Description: "This upgrade allows you to find ShiftLotto in your App Launcher." }, - + //STORY-DRIVEN AL UPGRADES + { + Name: "AL Shiftnet", + Cost: 150, + Dependencies: "app_launcher;victortran_shiftnet", + Category: "GUI", + Description: "This upgrade puts a Shiftnet entry into your app launcher - you know, for those times when you just feel like surfing the net." + }, + { + Name: "AL Installer", + Cost: 150, + Dependencies: "installer;app_launcher", + Category: "GUI", + Description: "Got a new .stp file and want to set it up, from your App Launcher? This upgrade is for you! It adds an AL entry for the Installer." + }, + { + Name: "AL Downloader", + Cost: 150, + Dependencies: "app_launcher;downloader", + Category: "GUI", + Description: "The Downloader is an easy, central way to check all your downloads' progress. This upgrade adds an app launcher entry for it." + }, // COLOR DEPTH AND DITHERING { diff --git a/ShiftOS.WinForms/Stories/LegionStory.cs b/ShiftOS.WinForms/Stories/LegionStory.cs index 00c7544..9b4966f 100644 --- a/ShiftOS.WinForms/Stories/LegionStory.cs +++ b/ShiftOS.WinForms/Stories/LegionStory.cs @@ -10,6 +10,72 @@ namespace ShiftOS.WinForms.Stories { public static class LegionStory { + private static string CharacterName = "DevX"; + private static string SysName = "mud"; + + [Story("victortran_shiftnet")] + public static void ShiftnetStoryFeaturingTheBlueSmileyFaceHolyFuckThisFunctionNameIsLong() + { + CharacterName = "victor_tran"; + SysName = "theos"; + bool waiting = false; + var installer = new Applications.Installer(); + installer.InstallCompleted += () => + { + Desktop.InvokeOnWorkerThread(() => + { + AppearanceManager.Close(installer); + }); + waiting = false; + }; + + if (!terminalOpen()) + { + var term = new Applications.Terminal(); + AppearanceManager.SetupWindow(term); + } + + var t = new Thread(() => + { + WriteLine("victortran@theos - user connecting to your system.", false); + Thread.Sleep(2000); + WriteLine("Hey there - yes, I am not just a sentient being. I am indeed Victor Tran."); + WriteLine("I am the creator of a Linux desktop environment called theShell."); + WriteLine("I'm in the middle of working on a ShiftOS version of it."); + WriteLine("However, before I start, I feel I need to show you something."); + WriteLine("You have a lot of ShiftOS applications, and you can earn lots of Codepoints - and you already have lots."); + WriteLine("Well, you'd be a perfect candidate for me to install the Shiftnet Client on your system."); + WriteLine("I'll begin the installation right now."); + //Set up an Installer. + waiting = true; + Desktop.InvokeOnWorkerThread(() => + { + Story.Start("installer"); + AppearanceManager.SetupWindow(installer); + installer.InitiateInstall(new ShiftnetInstallation()); + }); + while (waiting == true) + Thread.Sleep(25); + + WriteLine("All installed! Once I disconnect, type win.open to see a list of your new apps."); + WriteLine("The Shiftnet is a vast network of websites only accessible through ShiftOS."); + WriteLine("Think of it as the DarkNet, but much darker, and much more secretive."); + WriteLine("There are lots of apps, games, skins and utilities on the Shiftnet."); + WriteLine("There are also lots of companies offering many services."); + WriteLine("I'd stay on the shiftnet/ cluster though, others may be dangerous."); + WriteLine("I'd also stick to the sites listed on shiftnet/shiftsoft/ping - that site is regularly updated with the most safe Shiftnet sites."); + WriteLine("Anyways, it was nice meeting you, hopefully someday you'll give theShell a try."); + + TerminalBackend.PrefixEnabled = true; + TerminalBackend.PrintPrompt(); + }); + t.IsBackground = true; + t.Start(); + + TerminalBackend.PrefixEnabled = false; + + } + private static void WriteLine(string text, bool showCharacterName=true) { Console.WriteLine(); @@ -17,11 +83,11 @@ namespace ShiftOS.WinForms.Stories { ConsoleEx.Bold = true; ConsoleEx.ForegroundColor = ConsoleColor.DarkMagenta; - Console.Write("DevX"); + Console.Write(CharacterName); Console.ForegroundColor = ConsoleColor.White; Console.Write("@"); ConsoleEx.ForegroundColor = ConsoleColor.Yellow; - Console.Write("mud: "); + Console.Write(SysName + ": "); } ConsoleEx.ForegroundColor = ConsoleColor.Gray; ConsoleEx.Bold = false; @@ -56,6 +122,8 @@ namespace ShiftOS.WinForms.Stories [Story("devx_legions")] public static void DevXLegionStory() { + CharacterName = "DevX"; + SysName = "mud"; bool waiting = false; //Used for DevX dialogue. //Used for legion selection. @@ -198,5 +266,68 @@ namespace ShiftOS.WinForms.Stories SetProgress(100); } } + + /// + /// Stub: Used for story-driven Shiftorium dependency "installer". + /// + [Story("installer")] + public static void InstallerPlaceholder() + { + + } + + /// + /// Stub: Used for story-driven Shiftorium dependency: "downloader" + /// + [Story("downloader")] + public static void DownloaderPlaceholder() + { + + } + + public class ShiftnetInstallation : Applications.Installation + { + protected override void Run() + { + SetStatus("Preparing to install dependency: installer_user_agent"); + SetProgress(0); + Thread.Sleep(5000); + for(int i = 0; i < 100; i++) + { + SetStatus("Installing installer_user_agent"); + SetProgress(i); + Thread.Sleep(50); + } + SetProgress(0); + SetStatus("Preparing to install dependency: downloader"); + Thread.Sleep(3500); + for(int i = 0; i < 100; i++) + { + SetStatus("Installing dependency: downloader"); + SetProgress(i); + Thread.Sleep(100); + } + Story.Start("downloader"); + SetProgress(0); + SetStatus("Dependencies installed."); + Thread.Sleep(2000); + SetStatus("Installing Shiftnet."); + Thread.Sleep(3000); + for(int i = 0; i < 100; i++) + { + SetProgress(i); + string dots = ""; + if ((i % 2) == 0) + dots = "."; + if ((i % 3) == 0) + dots = ".."; + if ((i % 4) == 0) + dots = "..."; + SetStatus($"Installing Shiftnet{dots}"); + Thread.Sleep(100); + } + + } + } } } diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs index 5a42106..8704b94 100644 --- a/ShiftOS.WinForms/WinformsDesktop.cs +++ b/ShiftOS.WinForms/WinformsDesktop.cs @@ -74,6 +74,17 @@ namespace ShiftOS.WinForms } } } + + if (!Shiftorium.UpgradeInstalled("victortran_shiftnet")) + { + if (SaveSystem.CurrentSave.Codepoints >= 50000) + { + if (Shiftorium.IsCategoryEmptied("Applications")) + { + Story.Start("victortran_shiftnet"); + } + } + } }; this.TopMost = false; -- cgit v1.2.3