Esempio n. 1
0
        public void SetupTerminal()
        {
            //just so that the terminal can access our save
            SaveSystem.CurrentSave = MySave;

            Applications.Terminal.MakeWidget(txtterm);
            TerminalBackend.InStory       = false;
            TerminalBackend.PrefixEnabled = true;
            Console.WriteLine("{TERMINAL_TUTORIAL_1}");
            SaveSystem.TransferCodepointsFrom("oobe", 50);

            Shiftorium.Installed += () =>
            {
                if (SaveSystem.CurrentSave.StoryPosition < 5)
                {
                    if (Shiftorium.UpgradeInstalled("mud_fundamentals"))
                    {
                        Console.WriteLine("{TERMINAL_TUTORIAL_2}");
                        txtterm.Height -= pgsystemstatus.Height - 4;
                        pgsystemstatus.Show();

                        StartInstall();
                    }
                }
            };
        }
 public void OnUpgrade()
 {
     lbupgrades.SelectionMode = (UpgradeInstalled("shiftorium_gui_bulk_buy") == true) ? SelectionMode.MultiExtended : SelectionMode.One;
     lbcodepoints.Visible     = Shiftorium.UpgradeInstalled("shiftorium_gui_codepoints_display");
     Populate();
     SetList();
 }
Esempio n. 3
0
        public void PopulateAppLauncher(LauncherItem[] items)
        {
            apps.DropDownItems.Clear();

            foreach (var kv in items)
            {
                var item = new ToolStripMenuItem();
                item.Text   = kv.DisplayData.Name;
                item.Click += (o, a) =>
                {
                    Engine.AppearanceManager.SetupWindow(Activator.CreateInstance(kv.LaunchType) as IShiftOSWindow);
                };
                apps.DropDownItems.Add(item);
            }

            if (Shiftorium.UpgradeInstalled("al_shutdown"))
            {
                apps.DropDownItems.Add(new ToolStripSeparator());
                var item = new ToolStripMenuItem();
                item.Text   = Localization.Parse("{SHUTDOWN}");
                item.Click += (o, a) =>
                {
                    TerminalBackend.InvokeCommand("sos.shutdown");
                };
                apps.DropDownItems.Add(item);
            }
        }
Esempio n. 4
0
 private void lvitems_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (currentdir != "__system")
         {
             var itm = lvitems.SelectedItems[0];
             if (itm.Tag.ToString() != "__..")
             {
                 if (DirectoryExists(currentdir + "/" + itm.Tag.ToString()))
                 {
                     deleteToolStripMenuItem.Visible = Shiftorium.UpgradeInstalled("fs_recursive_delete");
                     moveToolStripMenuItem.Visible   = Shiftorium.UpgradeInstalled("fs_move_folder");
                     copyToolStripMenuItem.Visible   = Shiftorium.UpgradeInstalled("fs_copy_folder");
                 }
                 else if (FileExists(currentdir + "/" + itm.Tag.ToString()))
                 {
                     deleteToolStripMenuItem.Visible = Shiftorium.UpgradeInstalled("fs_delete");
                     moveToolStripMenuItem.Visible   = Shiftorium.UpgradeInstalled("fs_move");
                     copyToolStripMenuItem.Visible   = Shiftorium.UpgradeInstalled("fs_copy");
                 }
             }
         }
     }
     catch
     {
         moveToolStripMenuItem.Visible = false;
         copyToolStripMenuItem.Visible = false;
     }
 }
Esempio n. 5
0
        public void OpenFile(string path)
        {
            bool opened = true;

            string ext = path.Split('.')[path.Split('.').Length - 1];

            switch (ext)
            {
            case "txt":
                if (Shiftorium.UpgradeInstalled("textpad_open"))
                {
                    var txt = new TextPad();
                    txt.LoadFile(path);
                    AppearanceManager.SetupWindow(txt);
                }
                else
                {
                    opened = false;
                }
                break;

            case "pic":
            case "png":
            case "jpg":
            case "bmp":

                break;

            case "wav":
            case "mp3":

                break;

            case "lua":

                break;

            case "py":

                break;

            case "skn":

                break;

            case "mfs":
                Utils.MountPersistent(path);
                string mount = (Utils.Mounts.Count - 1).ToString() + ":";
                OpenDirectory(mount);
                break;

            default:
                opened = false;
                break;
            }
            if (opened == false)
            {
                Infobox.Show("File Skimmer - Can't open file", "File Skimmer can't find an application to open this file!");
            }
        }
Esempio n. 6
0
 private void pnlright_MouseDown(object sender, MouseEventArgs e)
 {
     if (Shiftorium.UpgradeInstalled("resizable_windows"))
     {
         resizing = true;
     }
 }
Esempio n. 7
0
        protected override Size MeasureOverride(Size constraint)
        {
            int topHeight    = 0;
            int bottomHeight = 0;
            int leftHeight   = 0;
            int rightHeight  = 0;

            if (Shiftorium.UpgradeInstalled("wm_titlebar"))
            {
                topHeight = LoadedSkin.TitlebarHeight;
            }
            if (Shiftorium.UpgradeInstalled("wm_free_placement"))
            {
                bottomHeight = LoadedSkin.BottomBorderWidth;
                leftHeight   = LoadedSkin.LeftBorderWidth;
                rightHeight  = LoadedSkin.RightBorderWidth;
            }

            if (_isWPF)
            {
                return(new Size(
                           leftHeight + _parent.Width + rightHeight,
                           topHeight + _parent.Height + bottomHeight));
            }
            else
            {
                return(new Size(
                           leftHeight + _wParent.Width + rightHeight,
                           topHeight + _wParent.Height + bottomHeight));
            }
        }
Esempio n. 8
0
 /// <summary>
 /// Pnltitles the mouse move.
 /// </summary>
 /// <returns>The mouse move.</returns>
 /// <param name="sender">Sender.</param>
 /// <param name="e">E.</param>
 private void pnltitle_MouseMove(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left && Shiftorium.UpgradeInstalled("draggable_windows"))
     {
         ReleaseCapture();
         SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
     }
 }
Esempio n. 9
0
 private void wbmain_NewWindow(object sender, CancelEventArgs e)
 {
     e.Cancel = true;
     if (Shiftorium.UpgradeInstalled("web_browser_new_window"))
     {
         AppearanceManager.SetupWindow(new WebBrowser());
     }
 }
Esempio n. 10
0
        public void PopulateAppLauncher()
        {
            appsmenu.Children.Clear();

            double biggestWidth = 0;

            appsmenu.Background = LoadedSkin.Menu_ToolStripDropDownBackground.CreateBrush();

            foreach (var kv in AppLauncherDaemon.Available())
            {
                var item = new Button();
                if (kv.LaunchType.BaseType == typeof(System.Windows.Forms.UserControl))
                {
                    item.Content = kv.DisplayData.Name + " (Legacy)";
                }
                else
                {
                    item.Content = kv.DisplayData.Name;
                }
                item.Margin = new Thickness(2);
                double measure = item.Content.ToString().Measure(LoadedSkin.MainFont);
                if (measure > biggestWidth)
                {
                    biggestWidth = measure;
                }
                item.Click += (o, a) =>
                {
                    AppearanceManager.SetupWindow(Activator.CreateInstance(kv.LaunchType) as IShiftOSWindow);
                    appsmenu.Visibility = Visibility.Hidden;
                };
                item.HorizontalAlignment = HorizontalAlignment.Stretch;
                appsmenu.Children.Add(item);
            }

            if (Shiftorium.UpgradeInstalled("al_shutdown"))
            {
                var item = new Button();
                item.Content = ShiftOS.Engine.Localization.Parse("{SHUTDOWN}");
                item.Margin  = new Thickness(2);
                double measure = item.Content.ToString().Measure(LoadedSkin.MainFont);
                if (measure > biggestWidth)
                {
                    biggestWidth = measure;
                }


                item.Click += (o, a) =>
                {
                    TerminalBackend.InvokeCommand("sos.shutdown");
                };
                appsmenu.Children.Add(item);
            }

            appsmenu.Width = biggestWidth + 50;

            SkinAppLauncher();
        }
Esempio n. 11
0
 public void SetLastText()
 {
     if (SaveSystem.CurrentSave != null)
     {
         if (!Shiftorium.UpgradeInstalled("window_manager"))
         {
             AppearanceManager.LastTerminalText = UnderlyingControl.Text;
         }
     }
 }
Esempio n. 12
0
 private static Visibility getVisibility(string upg)
 {
     if (Shiftorium.UpgradeInstalled(upg))
     {
         return(Visibility.Visible);
     }
     else
     {
         return(Visibility.Collapsed);
     }
 }
        public static void SentiencesLikeGods()
        {
            Story.Context.AutoComplete = false;
            Applications.Chat chat = null;
            Desktop.InvokeOnWorkerThread(() =>
            {
                chat = OpenChat();
            });
            while (chat == null)
            {
                Thread.Sleep(10);
            }
            CurrentChat = chat;
            chat.ChatID = "devx@system";
            chat.ShowChat();
            SendChatMessage("maureen_fenn", "Hey, you remember when I told you to come see me if you wanted to become a real hacker?");
            SendChatMessage("maureen_fenn", "Well, it's now time you learn about port scanners, firewalls, and malware injection.");
            SendChatMessage("maureen_fenn", "You know, not everything involves password cracking and stealing from wide-open FTP servers.");
            SendChatMessage("maureen_fenn", "That's baby talk.");
            SendChatMessage("maureen_fenn", "Have you ever felt the rush of breaching the root account of a Codepoint bank and going on a 60-second long withdrawl-spree to see how much Codepoints you can get from as many users as possible?");
            SendChatMessage("maureen_fenn", "Or maybe you felt like droppin' a little script on your buddy's Shiftnet website that makes it so everytime someone buys something, half the cash goes to you?");
            SendChatMessage("maureen_fenn", "Or maybe you want to spy on someone, see what they're doing, without them knowing?");
            SendChatMessage("maureen_fenn", "Whatever the case may be, brute is not going to help with that.");
            SendChatMessage("maureen_fenn", "What you need is my much more advanced and sophisticated toolset, consisting of a port scanner, network monitor, IP spoofer, and yes, an unreasonably convoluted user-interface.");
            SendChatMessage("maureen_fenn", "Also, you may want to get yourself a better window manager if you're still on the tiling WM. The WM Free Placement upgrade should do the trick.");
            SendChatMessage("maureen_fenn", "If you want to download my toolset, head to this underground Shiftnet URL: downunder/maureen_fenn/hacker_suite");
            SendChatMessage("maureen_fenn", "Actually, you'll need it for our DevX exposition quest, so go get it now.");

            Action onGotWMFreePlacement = () =>
            {
                Story.PushObjective("Sentiences Like Gods: Go down under.", "Head to the Shiftnet URL that Maureen sent you to get the advanced hacker's tool suite.", () =>
                {
                    return(Shiftorium.UpgradeInstalled("mf_hackertools"));
                },
                                    () =>
                {
                    SendChatMessage("maureen_fenn", "Alright. When you're ready for a crash course, let me know.");
                    Story.Context.MarkComplete();
                });
            };

            if (Shiftorium.UpgradeInstalled("wm_free_placement"))
            {
                onGotWMFreePlacement.Invoke();
            }
            else
            {
                SendChatMessage("maureen_fenn", "First, let's get you a better window manager.");
                Story.PushObjective("Sentiences Like Gods: A new window manager", "An application is only as good as its user interface allows it to be. That's the same for an operating system. Eventually, you'll need to be able to run more than just 4 programs at once, and you'll need a window manager that can place program windows of any size anywhere on screen. There are Shiftorium Upgrades for that. Let's get some.", () => { return(Shiftorium.UpgradeInstalled("wm_free_placement") && Shiftorium.UpgradeInstalled("wm_unlimited_windows")); }, onGotWMFreePlacement);
            }
        }
Esempio n. 14
0
 public bool DependenciesInstalled(ShiftoriumUpgrade upg)
 {
     string[] split = upg.Dependencies.Split(';');
     foreach (var u in split)
     {
         if (!u.StartsWith("appscape_handled"))
         {
             if (!Shiftorium.UpgradeInstalled(u))
             {
                 return(false);
             }
         }
     }
     return(true);
 }
Esempio n. 15
0
        private void apps_Click(object sender, EventArgs e)
        {
            if (Shiftorium.UpgradeInstalled("advanced_app_launcher"))
            {
                lbalstatus.Text = $@"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}
{SaveSystem.CurrentSave.Codepoints} Codepoints
{Shiftorium.GetAvailable().Length} available, {SaveSystem.CurrentSave.CountUpgrades()} installed.";

                flapps.Controls.Clear();
                apps.DropDown.Hide();
                pnladvancedal.Location = new Point(0, (LoadedSkin.DesktopPanelPosition == 0) ? desktoppanel.Height : this.Height - pnladvancedal.Height - desktoppanel.Height);
                pnladvancedal.Visible  = !pnladvancedal.Visible;
                pnladvancedal.BringToFront();
            }
        }
Esempio n. 16
0
        private void btnopen_Click(object sender, RoutedEventArgs e)
        {
            string filters = ".txt";

            if (Shiftorium.UpgradeInstalled("textpad_lua_support"))
            {
                filters += ";.lua";
            }
            if (Shiftorium.UpgradeInstalled("textpad_python_support"))
            {
                filters += ";.py";
            }

            FileSkimmerBackend.GetFile(filters.Split(';'), FileOpenerStyle.Open, new Action <string>((file) => LoadFile(file)));
        }
Esempio n. 17
0
        public static void Universal_KeyDown(object o, KeyEventArgs a)
        {
            if (a.Control && a.KeyCode == Keys.T)
            {
                a.SuppressKeyPress = true;


                if (SaveSystem.CurrentSave != null)
                {
                    if (Shiftorium.UpgradeInstalled("window_manager"))
                    {
                        Engine.AppearanceManager.SetupWindow(new Applications.Terminal());
                    }
                }
            }
        }
Esempio n. 18
0
 private void buybtn_Click(object sender, EventArgs e)
 {
     if (Shiftorium.UpgradeInstalled("mindblow"))
     {
         Infobox.Show("Already Purchased", "You have already bought MindBlow.");
     }
     else if (SaveSystem.CurrentSave.Codepoints < 50000)
     {
         Infobox.Show("Not Enough Codepoints", "You do not have enough Codepoints to buy MindBlow.");
     }
     else
     {
         Shiftorium.Buy("mindblow", 50000);
         Infobox.Show("Installation Complete", "MindBlow has been successfully installed.");
     }
 }
Esempio n. 19
0
 public void OnUpgrade()
 {
     grade = 1;
     if (Shiftorium.UpgradeInstalled("virus_scanner_grade_2"))
     {
         grade++;
     }
     if (Shiftorium.UpgradeInstalled("virus_scanner_grade_3"))
     {
         grade++;
     }
     if (Shiftorium.UpgradeInstalled("virus_scanner_grade_4"))
     {
         grade++;
     }
     SetupStatus();
 }
Esempio n. 20
0
 public static void PushObjectives()
 {
     Story.PushObjective("Buy the Skinning upgrade", "The Skinning upgrade will allow you to set pictures in place of solid colors for most UI elements. If you want richer customization and more Codepoints, this upgrade is a necessity.", () =>
     {
         return(Shiftorium.UpgradeInstalled("skinning"));
     }, () =>
     {
         Story.PushObjective("Buy the Skin Loader.", "The Skin Loader is an application that allows you to save and load .skn files containing Shifter skin data. These files can be loaded in to the Skin Loader and applied to the system to give ShiftOS a completely different feel. It's Shiftorium upgrade ID is \"skin_loader\".", () =>
         {
             return(Shiftorium.UpgradeInstalled("skin_loader"));
         },
                             () =>
         {
             Story.Context.MarkComplete();
         });
     });
 }
Esempio n. 21
0
        private void titlebar_MouseDown(object sender, MouseEventArgs e)
        {
            if (Shiftorium.UpgradeInstalled("draggable_windows") && isInDrag == true)
            {
                var element = sender as FrameworkElement;
                currentPoint = e.GetPosition(null);

                transform.X         += (currentPoint.X - anchorPoint.X);
                transform.Y         += (currentPoint.Y - anchorPoint.Y);
                this.RenderTransform = transform;
                anchorPoint          = currentPoint;
                if (_isWPF == false)
                {
                    _wParent.Refresh();
                    (pgcontents.Content as WindowsFormsHost).InvalidateVisual();
                }
            }
        }
Esempio n. 22
0
        public void WindowBorder_Load(object sender, EventArgs e)
        {
            this.DoubleBuffered = true;

            this._parentWindow.TextChanged += (o, a) =>
            {
                Setup();
                Desktop.ResetPanelButtons();
            };

            this.Left = (Screen.PrimaryScreen.Bounds.Width - this.Width) / 2;
            this.Top  = (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2;

            if (!this.IsDialog)
            {
                Engine.AppearanceManager.OpenForms.Add(this);
            }

            SaveSystem.GameReady += () =>
            {
                if (Shiftorium.UpgradeInstalled("wm_free_placement"))
                {
                    AppearanceManager.Invoke(new Action(() =>
                    {
                        this.Left = (Screen.PrimaryScreen.Bounds.Width - this.Width) / 2;
                        this.Top  = (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2;
                    }));
                }
                AppearanceManager.Invoke(new Action(() =>
                {
                    Setup();
                }));
            };

            ControlManager.SetupControls(this);

            Setup();

            var sWin = (IShiftOSWindow)ParentWindow;

            sWin.OnLoad();
        }
Esempio n. 23
0
        protected override void Run()
        {
            if (Shiftorium.UpgradeInstalled(Contents.Upgrade))
            {
                Infobox.Show("Installation failed.", "This package has already been installed.");
                return;
            }

            if (!string.IsNullOrWhiteSpace(Contents.Dependencies))
            {
                SetStatus("Checking Shiftorium for dependencies...");
                string[] dependencies = Contents.Dependencies.Split(';');
                for (int i = 0; i < dependencies.Length; i++)
                {
                    if (Shiftorium.UpgradeInstalled(dependencies[i]))
                    {
                        double percent = (i / dependencies.Length) * 100;
                        SetProgress((int)percent);
                    }
                    else
                    {
                        var upg = Shiftorium.GetDefaults().FirstOrDefault(x => x.Id == dependencies[i]);
                        Infobox.Show("Missing dependency!", $"You are missing the following Shiftorium Upgrade: {upg.Name}\r\n\r\nThe installation cannot continue.");
                        return;
                    }
                    Thread.Sleep(250);
                }
            }
            SetStatus("Installing...");
            SetProgress(0);
            for (int i = 0; i < 100; i++)
            {
                SetProgress(i);
                Thread.Sleep(50);
            }
            Desktop.InvokeOnWorkerThread(() =>
            {
                Shiftorium.Buy(Contents.Upgrade, 0);
                Infobox.Show("Install complete.", "The installation has completed successfully.");
                SaveSystem.SaveGame();
            });
        }
Esempio n. 24
0
        public void Setup()
        {
            this.lbtitletext.Text = Localization.Parse(this._parentWindow.Text);

            if (SaveSystem.CurrentSave != null)
            {
                this.pnltitle.Visible    = Shiftorium.UpgradeInstalled("wm_titlebar");
                this.pnlclose.Visible    = Shiftorium.UpgradeInstalled("close_button");
                this.pnlminimize.Visible = (IsDialog == false) && Shiftorium.UpgradeInstalled("minimize_button");
                this.pnlmaximize.Visible = (IsDialog == false) && Shiftorium.UpgradeInstalled("maximize_button");
                SetupSkin();
            }
            else
            {
                this.pnltitle.Visible    = false;
                this.pnlclose.Visible    = false;
                this.pnlminimize.Visible = false;
                this.pnlmaximize.Visible = false;
            }
        }
Esempio n. 25
0
        /// <summary>
        /// Setup this instance.
        /// </summary>
        public void Setup()
        {
            this.lbtitletext.Text = NameChangerBackend.GetName(ParentWindow);

            if (SaveSystem.CurrentSave != null)
            {
                this.pnltitle.Visible    = Shiftorium.UpgradeInstalled("wm_titlebar");
                this.pnlclose.Visible    = Shiftorium.UpgradeInstalled("close_button");
                this.pnlminimize.Visible = (IsDialog == false) && Shiftorium.UpgradeInstalled("minimize_button");
                this.pnlmaximize.Visible = (IsDialog == false) && Shiftorium.UpgradeInstalled("maximize_button");
                SetupSkin();
            }
            else
            {
                this.pnltitle.Visible    = false;
                this.pnlclose.Visible    = false;
                this.pnlminimize.Visible = false;
                this.pnlmaximize.Visible = false;
            }
        }
Esempio n. 26
0
        /// <summary>
        /// Setup this instance.
        /// </summary>
        public void WBSetup()
        {
            this.lbtitletext.Text = "Window Preview";

            if (SaveSystem.CurrentSave != null)
            {
                this.pnltitle.Visible    = Shiftorium.UpgradeInstalled("wm_titlebar");
                this.pnlclose.Visible    = Shiftorium.UpgradeInstalled("close_button");
                this.pnlminimize.Visible = Shiftorium.UpgradeInstalled("minimize_button");
                this.pnlmaximize.Visible = Shiftorium.UpgradeInstalled("maximize_button");
                WBSetupSkin();
            }
            else
            {
                this.pnltitle.Visible    = false;
                this.pnlclose.Visible    = false;
                this.pnlminimize.Visible = false;
                this.pnlmaximize.Visible = false;
            }
        }
Esempio n. 27
0
        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;
        }
Esempio n. 28
0
        /// <summary>
        /// Populates the panel buttons.
        /// </summary>
        /// <returns>The panel buttons.</returns>
        public void PopulatePanelButtons()
        {
            if (DesktopFunctions.ShowDefaultElements == true)
            {
                panelbuttonholder.Controls.Clear();
                if (Shiftorium.IsInitiated == true)
                {
                    if (Shiftorium.UpgradeInstalled("wm_panel_buttons"))
                    {
                        var pnlbtn = new Panel();
                        pnlbtn.Margin                = new Padding(2, LoadedSkin.PanelButtonFromTop, 0, 0);
                        pnlbtn.BackColor             = LoadedSkin.PanelButtonColor;
                        pnlbtn.BackgroundImage       = GetImage("panelbutton");
                        pnlbtn.BackgroundImageLayout = GetImageLayout("panelbutton");

                        var pnlbtntext = new Label();
                        pnlbtntext.Text      = "Panel Button Text";
                        pnlbtntext.AutoSize  = true;
                        pnlbtntext.Location  = LoadedSkin.PanelButtonFromLeft;
                        pnlbtntext.ForeColor = LoadedSkin.PanelButtonTextColor;
                        pnlbtntext.BackColor = Color.Transparent;

                        pnlbtn.BackColor = LoadedSkin.PanelButtonColor;
                        if (pnlbtn.BackgroundImage != null)
                        {
                            pnlbtntext.BackColor = Color.Transparent;
                        }
                        pnlbtn.Size    = LoadedSkin.PanelButtonSize;
                        pnlbtn.Tag     = "keepbg";
                        pnlbtntext.Tag = "keepbg";
                        pnlbtn.Controls.Add(pnlbtntext);
                        this.panelbuttonholder.Controls.Add(pnlbtn);
                        pnlbtn.Show();
                        pnlbtntext.Show();

                        pnlbtntext.Font = LoadedSkin.PanelButtonFont;
                    }
                }
            }
        }
Esempio n. 29
0
        public void PopulatePanelButtons()
        {
            panelbuttonholder.Controls.Clear();
            if (Shiftorium.UpgradeInstalled("wm_panel_buttons"))
            {
                foreach (WindowBorder form in Engine.AppearanceManager.OpenForms)
                {
                    if (form != null)
                    {
                        if (form.Visible == true)
                        {
                            var pnlbtn = new Panel();
                            pnlbtn.Margin                = new Padding(2, LoadedSkin.PanelButtonFromTop, 0, 0);
                            pnlbtn.BackgroundImage       = GetImage("panelbutton");
                            pnlbtn.BackgroundImageLayout = GetImageLayout("panelbutton");

                            var pnlbtntext = new Label();
                            pnlbtntext.Text      = form.Text;
                            pnlbtntext.AutoSize  = true;
                            pnlbtntext.Location  = LoadedSkin.PanelButtonFromLeft;
                            pnlbtntext.ForeColor = LoadedSkin.PanelButtonTextColor;
                            pnlbtntext.Font      = LoadedSkin.PanelButtonFont;

                            pnlbtn.BackColor = LoadedSkin.PanelButtonColor;
                            if (pnlbtn.BackgroundImage != null)
                            {
                                pnlbtntext.BackColor = Color.Transparent;
                            }
                            pnlbtn.Size = LoadedSkin.PanelButtonSize;

                            pnlbtn.Controls.Add(pnlbtntext);
                            this.panelbuttonholder.Controls.Add(pnlbtn);
                            ControlManager.SetupControls(pnlbtn);
                            pnlbtn.Show();
                            pnlbtntext.Show();
                        }
                    }
                }
            }
        }
Esempio n. 30
0
        public static void BreakingTheBondsIntro()
        {
            CharacterName = "hacker101";
            SysName       = "pebcak";

            if (!terminalOpen())
            {
                var term = new Applications.Terminal();
                AppearanceManager.SetupWindow(term);
            }

            WriteLine("hacker101@pebcak - user connecting to your system.", false);
            Thread.Sleep(2000);
            WriteLine("Greetings, user.");
            WriteLine("My name is hacker101. I have a few things to show you.");
            WriteLine("Before I can do that, however, I need you to do a few things.");
            WriteLine("I'll assign what I need you to do as an objective. When you're done, I'll tell you what you need to know.");

            TerminalBackend.PrefixEnabled = true;

            Story.PushObjective("Breaking the Bonds: Errand Boy", @"hacker101 has something he needs to show you, however before he can, you need to do the following:

 - Buy ""TriWrite"" from Appscape
 - Buy ""Address Book"" from Appscape
 - Buy ""SimpleSRC"" from Appscape", () =>
            {
                bool flag1 = Shiftorium.UpgradeInstalled("address_book");
                bool flag2 = Shiftorium.UpgradeInstalled("triwrite");
                bool flag3 = Shiftorium.UpgradeInstalled("simplesrc_client");
                return(flag1 && flag2 && flag3);
            }, () =>
            {
                Story.Context.MarkComplete();
                SaveSystem.SaveGame();
                Story.Start("hacker101_breakingbonds_2");
            });
            Story.Context.AutoComplete = false;
        }