private void btnconfirm_Click(object sender, RoutedEventArgs e) { if (!string.IsNullOrWhiteSpace(txtfilename.Text)) { if (!txtfilename.Text.EndsWith(filter.SelectedItem.ToString())) { txtfilename.Text += filter.SelectedItem.ToString(); } switch (OpenerStyle) { case FileOpenerStyle.Open: if (Utils.FileExists(currentFolder + "/" + txtfilename.Text)) { Callback?.Invoke(currentFolder + "/" + txtfilename.Text); AppearanceManager.Close(this); } else { Infobox.Show("File not found", $"The file {currentFolder}/{txtfilename.Text} was not found."); } break; case FileOpenerStyle.Save: Callback?.Invoke(currentFolder + "/" + txtfilename.Text); AppearanceManager.Close(this); break; } } else { Infobox.Show("File Skimmer", "Please provide a filename."); } }
private void btnlogin_Click(object sender, EventArgs e) { string sys = txtsys.Text; string uname = txtuname.Text; string root = txtroot.Text; // validation if (string.IsNullOrWhiteSpace(sys)) { Infobox.Show("{TITLE_EMPTY_SYSNAME}", "{MSG_EMPTY_SYSNAME}"); return; } if (sys.Length < 5) { Infobox.Show("{TITLE_VALIDATION_ERROR}", "{MSG_VALIDATION_ERROR_SYSNAME_LENGTH}"); return; } if (string.IsNullOrWhiteSpace(uname)) { Infobox.Show("{TITLE_VALIDATION_ERROR}", "You must provide a username."); return; } Callback?.Invoke(new SignupCredentials { SystemName = sys, Username = uname, RootPassword = root }); AppearanceManager.Close(this); }
public static void AppscapeTroublesEnd() { Applications.Chat chat = null; Desktop.InvokeOnWorkerThread(() => { chat = OpenChat(); }); while (chat == null) { Thread.Sleep(10); } chat.ShowChat(); chat.ChatID = "maureen_fenn@trisys"; CurrentChat = chat; SendChatMessage("maureen_fenn", "I just talked to hacker101 about our little issue here..."); SendChatMessage("maureen_fenn", "He tried to get Aiden to lighten up, but he's too hell-bent on making DevX happy."); SendChatMessage("maureen_fenn", "But, I think we've gotten a plan."); SendChatMessage("hacker101", "<user joined chat>"); chat.ChatID = "maureen_fenn@trisys, hacker101@pebcak"; SendChatMessage("hacker101", "We meet again, " + SaveSystem.CurrentUser.Username + "..."); SendChatMessage("hacker101", "Maureen tells me you've used your hacking skills to steal a document from Aiden Nirh."); SendChatMessage("hacker101", "I hope he didn't find out about brute..."); SendChatMessage("maureen_fenn", "Ugh... brute? That thing? That's not hacking."); SendChatMessage("maureen_fenn", "You're just turning " + SaveSystem.CurrentUser.Username + " into a script-kiddie."); SendChatMessage("maureen_fenn", SaveSystem.CurrentUser.Username + ", you want REAL hacking? Why don't you come to me after we're done here. I'll show you how REAL sentiences get their way."); SendChatMessage("hacker101", "HEY. You gotta give Brute some credit. It's good at cracking passwords."); SendChatMessage("maureen_fenn", "Well, what happens if the user runs into a firewall block? Brute ain't going to help with that."); SendChatMessage("hacker101", "....whatever. Let's just get on with this."); SendChatMessage("hacker101", "We need to get rid of that cease and desist ban."); SendChatMessage("hacker101", "Firstly, let's review the document."); SendChatMessage("hacker101", "<sent a file: maureen_fenn.txt>"); var bytes = Convert.FromBase64String(Properties.Resources.AppscapeWantedFile); chat.PostMessage("maureen_fenn.txt", chat.ChatID, Encoding.UTF8.GetString(bytes)); SendChatMessage("hacker101", "I ain't no lawyer but I can tell you right now that C&D is bull."); SendChatMessage("hacker101", "Guess this is just DevX's way of saying he can't stand you, Maureen."); SendChatMessage("hacker101", "I want you to know that unlike him, I can. I... I..."); SendChatMessage("maureen_fenn", "..Nope, nope. Let's not go there. You're getting a bit creepy, hacker."); SendChatMessage("hacker101", "Whoops. Oh well... We need to show DevX who's boss."); SendChatMessage("hacker101", "Maybe, " + SaveSystem.CurrentUser.Username + " can help us."); SendChatMessage("maureen_fenn", "Maybe they can... and meybe Aiden can as well."); SendChatMessage("hacker101", "No, he's convinced that we're the bad guys."); SendChatMessage("hacker101", "He's got me banned because of brute."); SendChatMessage("maureen_fenn", "Lol, banned... for BRUTE? That little harmless tool? Bahahahaha."); SendChatMessage(SaveSystem.CurrentUser.Username, "Will you two stop bickering at eachother about Brute and hacker101's love for Maureen and let us get on with this? I could be playing Pong right now."); SendChatMessage("maureen_fenn", "Right. We need to gather as much evidence against DevX as possible."); SendChatMessage("hacker101", "Then, we need to send it all to Aiden, right? We'll need " + SaveSystem.CurrentUser.Username + " to do that."); SendChatMessage("maureen_fenn", "Alrighty, " + SaveSystem.CurrentUser.Username + ". You're on our team. We'll have any tasks we need you to do in your missions list."); SendChatMessage("maureen_fenn", "Oh yeah, and here's a couple Codepoints as compensation for helping us out."); Story.Context.MarkComplete(); Thread.Sleep(5000); Desktop.InvokeOnWorkerThread(() => { AppearanceManager.Close(chat); }); }
public void StartShowing(Save save) { MySave = save; AppearanceManager.SetupWindow(this); SetupLanguages(); SaveSystem.GameReady += () => { Dispatcher.Invoke(() => { AppearanceManager.Close(this); }); }; }
internal void OpenInternal(string title, string msg, Action c) { Title = title; AppearanceManager.SetupDialog(this); lbmessage.Text = msg; txtinput.Hide(); flyesno.Hide(); btnok.Show(); btnok.Click += (o, a) => { AppearanceManager.Close(this); c?.Invoke(); }; }
public void PromptYesNoInternal(string title, string message, Action <bool> callback) { Title = title; AppearanceManager.SetupDialog(this); lbmessage.Text = message; txtinput.Hide(); flyesno.Show(); btnok.Hide(); btnyes.Click += (o, a) => { callback?.Invoke(true); AppearanceManager.Close(this); }; btnno.Click += (o, a) => { callback?.Invoke(false); AppearanceManager.Close(this); }; }
public Terminal() { InitializeComponent(); SaveSystem.GameReady += () => { try { this.Invoke(new Action(() => { if (Shiftorium.UpgradeInstalled("first_steps")) { if (!Shiftorium.UpgradeInstalled("desktop")) { TerminalBackend.PrefixEnabled = true; TerminalBackend.InStory = false; TerminalBackend.PrintPrompt(); if (Shiftorium.UpgradeInstalled("wm_free_placement")) { this.ParentForm.Width = 640; this.ParentForm.Height = 480; this.ParentForm.Left = (Screen.PrimaryScreen.Bounds.Width - 640) / 2; this.ParentForm.Top = (Screen.PrimaryScreen.Bounds.Height - 480) / 2; } } else { AppearanceManager.Close(this); } } else { Story.Start("first_steps"); } })); } catch { } }; this.DoubleBuffered = true; }
public void PromptTextInternal(string title, string message, Action <string> callback, bool isPassword) { Title = title; AppearanceManager.SetupDialog(this); lbmessage.Text = message; txtinput.UseSystemPasswordChar = isPassword; txtinput.Show(); flyesno.Hide(); btnok.Show(); btnok.Click += (o, a) => { callback?.Invoke(txtinput.Text); AppearanceManager.Close(this); }; txtinput.KeyDown += (o, a) => { if (a.KeyCode == Keys.Enter) { a.SuppressKeyPress = true; callback?.Invoke(txtinput.Text); AppearanceManager.Close(this); } }; }
public void Reset() { if (currentFolder != "__system") { this.SetTitle("File Skimmer - " + currentFolder); } else { this.SetTitle("File Skimmer"); } lbfiles.Children.Clear(); if (currentFolder == "__system") { foreach (var dir in Utils.Mounts) { var sp = new StackPanel(); sp.Width = 50; sp.Margin = new Thickness(5); var label = new TextBlock(); label.Text = dir.Name; label.TextWrapping = TextWrapping.Wrap; label.TextAlignment = TextAlignment.Center; var img = new Image(); img.Width = 42; img.Height = 42; img.Source = FileSkimmerBackend.GetImage(Utils.Mounts.IndexOf(dir) + ":").ToBitmapImage(); sp.Children.Add(img); sp.Children.Add(label); sp.PreviewMouseLeftButtonDown += (o, a) => { if (a.ClickCount == 2) { ChangeDirectory(Utils.Mounts.IndexOf(dir) + ":"); } }; lbfiles.Children.Add(sp); } } else { var __up = CreateUpOneDirectory(); lbfiles.Children.Add(__up); foreach (var dir in Utils.GetDirectories(currentFolder)) { var sp = new StackPanel(); sp.Margin = new Thickness(5); sp.Width = 50; var label = new TextBlock(); label.Text = Utils.GetDirectoryInfo(dir).Name; label.TextWrapping = TextWrapping.Wrap; label.TextAlignment = TextAlignment.Center; var img = new Image(); img.Width = 42; img.Height = 42; img.Source = FileSkimmerBackend.GetImage(dir).ToBitmapImage(); sp.Children.Add(img); sp.Children.Add(label); sp.PreviewMouseLeftButtonDown += (o, a) => { if (a.ClickCount == 2) { ChangeDirectory(dir); } }; lbfiles.Children.Add(sp); } foreach (var dir in Utils.GetFiles(currentFolder)) { if (dir.EndsWith(filter.SelectedItem.ToString())) { var sp = new StackPanel(); sp.Margin = new Thickness(5); sp.Width = 50; var label = new TextBlock(); label.Text = Utils.GetFileInfo(dir).Name; label.TextWrapping = TextWrapping.Wrap; label.TextAlignment = TextAlignment.Center; var img = new Image(); img.Width = 42; img.Height = 42; img.Source = FileSkimmerBackend.GetImage(dir).ToBitmapImage(); sp.Children.Add(img); sp.Children.Add(label); sp.PreviewMouseLeftButtonDown += (o, a) => { if (a.ClickCount == 2) { if (OpenerStyle == FileOpenerStyle.Open) { Callback?.Invoke(dir); AppearanceManager.Close(this); } } else { txtfilename.Text = Utils.GetFileInfo(dir).Name; } }; lbfiles.Children.Add(sp); } } } }
private void QuitButton_Click(object sender, EventArgs e) { AppearanceManager.Close(this); //quits the game (In case user donsn't have close button) }
private void exitToolStripMenuItem_Click(object sender, EventArgs e) { AppearanceManager.Close(this); }
private void btnexit_Click(object sender, EventArgs e) { AppearanceManager.Close(this); }
private void close_Click(object sender, RoutedEventArgs e) { AppearanceManager.Close(this); }
public static void ShiftnetStoryFeaturingTheBlueSmileyFaceHolyFuckThisFunctionNameIsLong() { CharacterName = "aiden"; SysName = "appscape_main"; 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); } WriteLine("aiden@appscape_main - user connecting to your system.", false); Thread.Sleep(2000); WriteLine("Hello there! My name's Aiden Nirh."); WriteLine("I run a small Shiftnet website known simply as \"Appscape\"."); WriteLine("Oh - wait... you don't know what the Shiftnet is..."); WriteLine("Well, the Shiftnet is like... a private Internet, only accessible through ShiftOS."); WriteLine("It has many sites and companies on it - banks, software centres, service providers, you name it."); WriteLine("Appscape is one of them. I host many applications on Appscape, from games to utilities to productivity programs, and anything in between. If it exists as a ShiftOS program, it's either on the Shiftorium or Appscape."); WriteLine("I'm going to assume you're interested... and I'll install the Shiftnet just in case."); WriteLine("Beginning installation of Shiftnet..."); //Set up an Installer. waiting = true; Desktop.InvokeOnWorkerThread(() => { SaveSystem.CurrentSave.StoriesExperienced.Add("installer"); SaveSystem.CurrentSave.StoriesExperienced.Add("downloader"); while (!Shiftorium.UpgradeInstalled("installer")) { Thread.Sleep(20); } AppearanceManager.SetupWindow(installer); installer.InitiateInstall(new ShiftnetInstallation()); }); while (waiting == true) { Thread.Sleep(25); } WriteLine("All good to go! Once I disconnect, type win.open to see a list of your new apps."); WriteLine("I've installed everything you need, for free."); WriteLine("You've got the Downloader, a simple application to help you track Shiftnet file downloads..."); WriteLine("...the Installer which will help you unpack programs from .stp files and install them to your system..."); WriteLine("...and lastly, the Shiftnet browser itself. This program lets you browse the Shiftnet, much like you would the real Internet."); WriteLine("I'd stay on the shiftnet/ cluster though, because although there are many services on the Shiftnet, some of them may try to scam you into losing loads of Codepoints, or worse, wrecking your system with viruses."); WriteLine("If you want a nice list of safe Shiftnet services, head to ShiftSoft's \"Ping\" site, at shiftnet/shiftsoft/ping."); WriteLine("Oh, also, the Shiftnet, much like the real internet, is not free."); WriteLine("It requires a service provider. Service providers cost a fair amount of Codepoints, but if you want to get faster speeds and more reliable connections on the Shiftnet, finding a good service provider is a necessity."); WriteLine("Right now, you are on ShiftSoft's free trial plan, Freebie Solutions, which gives you access to the Shiftnet however you are locked at 256 bytes per second file downloads and can't leave the shiftnet/ cluster."); WriteLine("It's enough to get you started - you'll want to find a faster provider though.."); WriteLine("Anyways, that's all I'll say for now. Have fun on the Shiftnet. I have to go work on something."); WriteLine("One of my friends'll contact you once you've gotten a new service provider."); Story.Context.MarkComplete(); Story.Start("aiden_shiftnet2"); }
public static void AppscapeTroubles() { Applications.Chat chat = null; Desktop.InvokeOnWorkerThread(() => { chat = OpenChat(); }); while (chat == null) { Thread.Sleep(10); } chat.ShowChat(); chat.ChatID = "maureen_fenn@trisys"; CurrentChat = chat; SendChatMessage("maureen_fenn", "Hello there, " + SaveSystem.CurrentUser.Username + ". My name is Maureen."); SendChatMessage("maureen_fenn", "I'm the developer of the various Tri apps you may've seen around the Shiftnet."); Story.Context.AutoComplete = false; SendChatMessage("maureen_fenn", "I have a bit of a problem that may need your assistance.."); SendChatMessage("maureen_fenn", "I struck a deal with Aiden Nirh to put my software on his site and split the profits in half with me and him."); SendChatMessage("maureen_fenn", "But lately, even though many people have been buying my software, I've been getting nothing for it."); SendChatMessage("maureen_fenn", "Now I have barely enough Codepoints to keep my development environment online..."); SendChatMessage("maureen_fenn", "My friend, you know him as hacker101, he's told me that you know how to hack."); SendChatMessage("maureen_fenn", "Can you bust into Aiden's server and see if he's gotten any documents or anything indicating why he's not paying me?"); SendChatMessage("maureen_fenn", "He likes to document a lot of things about what he does and he likes to store those docs on his central Appscape server. Maybe there's something on there about me..."); SendChatMessage("maureen_fenn", "You can find connection details for his server on Appscape's Contact page."); SendChatMessage("maureen_fenn", "The guy has pretty good security though... so be careful."); SendChatMessage("maureen_fenn", "When you find the right file, I'd download it to your system and just send it through SimpleSRC."); VirtualEnvironments.Create("appscape_main", new List <ClientSave> { new ClientSave { Username = "******", Password = GenRandomPassword(), Permissions = UserPermissions.Root, }, new ClientSave { Username = "******", Password = "", Permissions = UserPermissions.Guest } }, 15000l, JsonConvert.DeserializeObject <ShiftOS.Objects.ShiftFS.Directory>(Properties.Resources.AppscapeServerFS)); bool validFileSent = false; chat.FileSent += (file) => { if (Convert.ToBase64String(file.Data) == Properties.Resources.AppscapeWantedFile) { validFileSent = true; } }; Story.Context.AutoComplete = false; Story.PushObjective("Appscape Troubles: The Secret", "Maureen has asked you to find out why Aiden Nirh, the maintainer of Appscape, isn't paying her half the profits for her TriOffice suite. Time to use your hacking skills... just like before.", () => { return(validFileSent); }, () => { SendChatMessage("maureen_fenn", "File received."); SendChatMessage("maureen_fenn", "Awwww, come on, man! You can't tell me I got banned due to a cease and desist from DevX... That bastard... DevX, I mean."); SendChatMessage("maureen_fenn", "Anyways, I'll talk to Aiden about that... if I can... or maybe you can? Either way, here's your Codepoints."); Story.Context.MarkComplete(); Thread.Sleep(5000); Desktop.InvokeOnWorkerThread(() => { AppearanceManager.Close(chat); }); }); }