From f89cd092830a8e88bd9aaf8048c18b0dda7dea25 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 2 Apr 2017 14:26:25 -0400 Subject: Various bugfixes. --- ShiftOS.WinForms/Controls/TerminalBox.cs | 8 +++ ShiftOS.WinForms/Oobe.cs | 22 +++---- ShiftOS.WinForms/WinformsDesktop.cs | 5 +- ShiftOS.WinForms/WinformsWindowManager.cs | 104 +++++++++++++++++++++++++++++- 4 files changed, 124 insertions(+), 15 deletions(-) (limited to 'ShiftOS.WinForms') diff --git a/ShiftOS.WinForms/Controls/TerminalBox.cs b/ShiftOS.WinForms/Controls/TerminalBox.cs index 9e4c61c..bc2bcc0 100644 --- a/ShiftOS.WinForms/Controls/TerminalBox.cs +++ b/ShiftOS.WinForms/Controls/TerminalBox.cs @@ -47,6 +47,14 @@ namespace ShiftOS.WinForms.Controls catch { } } + protected override void Dispose(bool disposing) + { + if (disposing == true) + if(AppearanceManager.ConsoleOut == this) + AppearanceManager.ConsoleOut = null; + base.Dispose(disposing); + } + protected override void OnClick(EventArgs e) { base.OnClick(e); diff --git a/ShiftOS.WinForms/Oobe.cs b/ShiftOS.WinForms/Oobe.cs index 7370396..898f60b 100644 --- a/ShiftOS.WinForms/Oobe.cs +++ b/ShiftOS.WinForms/Oobe.cs @@ -419,7 +419,7 @@ namespace ShiftOS.WinForms Clear(); textgeninput = lblhackwords; Clear(); - + this.Invoke(new Action(() => { textgeninput.Font = SkinEngine.LoadedSkin.TerminalFont; @@ -450,7 +450,7 @@ namespace ShiftOS.WinForms TextType("In ShiftOS, the Terminal is your main control centre for the operating system. You can see system status, check Codepoints, open other programs, buy upgrades, and more."); Thread.Sleep(500); TextType("Go ahead and type 'sos.help' to see a list of commands."); - while(TutorialProgress == 0) + while (TutorialProgress == 0) { } @@ -459,7 +459,7 @@ namespace ShiftOS.WinForms TextType("You can run any command, by typing in their Namespace, followed by a period (.), followed by their Command Name."); Thread.Sleep(500); TextType("Go ahead and run the 'status' command within the 'sos' namespace to see what the command does."); - while(TutorialProgress == 1) + while (TutorialProgress == 1) { } @@ -476,7 +476,7 @@ namespace ShiftOS.WinForms TextType("You can easily get upgrades using the Shiftorium - a repository of approved ShiftOS upgrades."); Thread.Sleep(500); TextType("To start using the Shiftorium, simply type 'shiftorium.list' to see available upgrades."); - while(TutorialProgress == 2) + while (TutorialProgress == 2) { } @@ -500,17 +500,17 @@ namespace ShiftOS.WinForms TextType("If you want to escape a backslash inside a string, simply type two backslashes instead of one - for example key:\"Back\\\\slash.\""); Thread.Sleep(500); TextType("shiftorium.info requires an upgrade argument, which is a string type. Go ahead and give shiftorium.info's upgrade argument the 'mud_fundamentals' upgrade's ID."); - while(TutorialProgress == 3) + while (TutorialProgress == 3) { - } + } TextType("As you can see, mud_fundamentals is very useful. In fact, a lot of useful upgrades depend on it. You should buy it!"); Thread.Sleep(500); TextType("shiftorium.info already gave you a command that will let you buy the upgrade - go ahead and run that command!"); while (!Shiftorium.UpgradeInstalled("mud_fundamentals")) { - } + } TextType("Hooray! You now have the MUD Fundamentals upgrade."); Thread.Sleep(500); TextType("You can also earn more Codepoints by playing Pong. To open Pong, you can use the win.open command."); @@ -518,20 +518,20 @@ namespace ShiftOS.WinForms TextType("If you run win.open without arguments, you can see a list of applications that you can open."); Thread.Sleep(500); TextType("Just run win.open without arguments, and this tutorial will be completed!"); - while(TutorialProgress == 4) + while (TutorialProgress == 4) { } TextType("This concludes the ShiftOS beginners' guide brought to you by the multi-user domain. Stay safe in a connected world."); Thread.Sleep(2000); - this.Invoke(new Action(() => + Desktop.InvokeOnWorkerThread(() => { OnComplete?.Invoke(this, EventArgs.Empty); - this.Close(); SaveSystem.CurrentSave.StoryPosition = 2; SaveSystem.SaveGame(); AppearanceManager.SetupWindow(new Applications.Terminal()); - })); + }); + }); t.IsBackground = true; t.Start(); diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs index d30adb4..06f103e 100644 --- a/ShiftOS.WinForms/WinformsDesktop.cs +++ b/ShiftOS.WinForms/WinformsDesktop.cs @@ -664,7 +664,10 @@ namespace ShiftOS.WinForms /// Act. public void InvokeOnWorkerThread(Action act) { - this.Invoke(act); + this.Invoke(new Action(()=> + { + act?.Invoke(); + })); } public void OpenAppLauncher(Point loc) diff --git a/ShiftOS.WinForms/WinformsWindowManager.cs b/ShiftOS.WinForms/WinformsWindowManager.cs index eeaa6c9..40177be 100644 --- a/ShiftOS.WinForms/WinformsWindowManager.cs +++ b/ShiftOS.WinForms/WinformsWindowManager.cs @@ -36,6 +36,24 @@ namespace ShiftOS.WinForms { internal class WinformsWindowManager : WindowManager { + public int DesktopHeight + { + get + { + return Desktop.Size.Height - ((Shiftorium.UpgradeInstalled("desktop_panel") == true) ? SkinEngine.LoadedSkin.DesktopPanelHeight : 0); + } + } + + public int TopLocation + { + get + { + if (!Shiftorium.UpgradeInstalled("desktop_panel")) + return 0; + return ((SkinEngine.LoadedSkin.DesktopPanelPosition == 0) ? SkinEngine.LoadedSkin.DesktopPanelHeight : 0); + } + } + public override void Close(IShiftOSWindow win) { (win as UserControl).Close(); @@ -160,9 +178,11 @@ namespace ShiftOS.WinForms { List formstoclose = new List(); - foreach (WindowBorder frm in AppearanceManager.OpenForms) + for (int i = 0; i < maxWindows && i < AppearanceManager.OpenForms.Count; i++) { - formstoclose.Add(frm); + var frm = AppearanceManager.OpenForms[i] as WindowBorder; + if(!frm.IsDialog) + formstoclose.Add(frm); } @@ -177,7 +197,85 @@ namespace ShiftOS.WinForms var wb = new WindowBorder(form as UserControl); - ControlManager.SetupWindows(); + SetupWindows(); + } + + public void SetupWindows() + { + var windows = new List(); + foreach(var win in AppearanceManager.OpenForms) + { + if (win is WindowBorder) + if ((win as WindowBorder).IsDialog == false) + windows.Add(win as WindowBorder); + } + + if (Shiftorium.UpgradeInstalled("wm_free_placement")) + return; + + else if (windows.Count == 4) + { + var w1 = windows[0]; + var w2 = windows[1]; + var w3 = windows[2]; + var w4 = windows[3]; + w1.Location = new Point(0, TopLocation); + w1.Width = Desktop.Size.Width / 2; + w1.Height = DesktopHeight / 2; + w2.Left = w1.Width; + w2.Width = w1.Width; + w2.Height = w1.Height; + w2.Top = w1.Top; + w3.Top = w2.Height; + w3.Height = w1.Height; + w3.Left = 0; + w3.Width = w1.Width; + w4.Width = w3.Width; + w4.Top = w3.Top; + w4.Left = w3.Width; + w4.Height = w3.Height; + } + else if(windows.Count == 3) + { + var w1 = windows[0]; + var w2 = windows[1]; + var w3 = windows[2]; + w1.Location = new Point(0, TopLocation); + w1.Width = Desktop.Size.Width / 2; + w1.Height = DesktopHeight / 2; + w2.Left = w1.Width; + w2.Width = w1.Width; + w2.Height = w1.Height; + w2.Top = w1.Top; + w3.Top = w2.Height; + w3.Height = w1.Height; + w3.Left = 0; + w3.Width = w1.Width + w2.Width; + } + else if (windows.Count == 2) + { + var w1 = windows[0]; + var w2 = windows[1]; + + w1.Location = new Point(0, TopLocation); + w1.Width = Desktop.Size.Width / 2; + w1.Height = DesktopHeight; + w2.Left = w1.Width; + w2.Width = w1.Width; + w2.Height = w1.Height; + w2.Top = w1.Top; + + } + else if(windows.Count == 1) + { + var win = windows.FirstOrDefault(); + if(win != null) + { + win.Size = new Size(Desktop.Size.Width, DesktopHeight); + win.Location = new Point(0, this.TopLocation); + } + } + } } } -- cgit v1.2.3 From a3f3e03569e0268ddc70c699d49bc70331f60ab2 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 2 Apr 2017 14:37:59 -0400 Subject: Call OnUpgrade() when upgrade installed. --- ShiftOS.WinForms/WindowBorder.cs | 8 +++++++- ShiftOS.WinForms/WinformsWindowManager.cs | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'ShiftOS.WinForms') diff --git a/ShiftOS.WinForms/WindowBorder.cs b/ShiftOS.WinForms/WindowBorder.cs index 0308f8a..4fba470 100644 --- a/ShiftOS.WinForms/WindowBorder.cs +++ b/ShiftOS.WinForms/WindowBorder.cs @@ -124,7 +124,6 @@ namespace ShiftOS.WinForms } }; - this.Width = LoadedSkin.LeftBorderWidth + _parentWindow.Width + LoadedSkin.RightBorderWidth; this.Height = LoadedSkin.TitlebarHeight + _parentWindow.Height + LoadedSkin.BottomBorderWidth; @@ -133,6 +132,13 @@ namespace ShiftOS.WinForms this._parentWindow.Show(); ControlManager.SetupControls(this._parentWindow); + ParentWindow.OnSkinLoad(); + ParentWindow.OnUpgrade(); + Shiftorium.Installed += () => + { + Setup(); + ParentWindow.OnUpgrade(); + }; Desktop.ShowWindow(this); diff --git a/ShiftOS.WinForms/WinformsWindowManager.cs b/ShiftOS.WinForms/WinformsWindowManager.cs index 40177be..494c572 100644 --- a/ShiftOS.WinForms/WinformsWindowManager.cs +++ b/ShiftOS.WinForms/WinformsWindowManager.cs @@ -197,6 +197,13 @@ namespace ShiftOS.WinForms var wb = new WindowBorder(form as UserControl); + FormClosedEventHandler onClose = (o,a)=> { }; + onClose = (o, a) => + { + SetupWindows(); + wb.FormClosed -= onClose; + }; + wb.FormClosed += onClose; SetupWindows(); } -- cgit v1.2.3 From 2ea24d407ca5bad94bc17df7df33713e7734d415 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 2 Apr 2017 15:02:04 -0400 Subject: Auto-update the codepoints display --- .../Applications/ShiftoriumFrontend.Designer.cs | 37 +++++++--------------- .../Applications/ShiftoriumFrontend.cs | 19 ++++++++--- 2 files changed, 26 insertions(+), 30 deletions(-) (limited to 'ShiftOS.WinForms') diff --git a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs index e0e76fa..36943be 100644 --- a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs +++ b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs @@ -56,7 +56,7 @@ namespace ShiftOS.WinForms.Applications { this.panel1 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel(); - this.label2 = new System.Windows.Forms.Label(); + this.lbcodepoints = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.lbupgradedesc = new System.Windows.Forms.Label(); this.pnlupgradeactions = new System.Windows.Forms.Panel(); @@ -93,29 +93,16 @@ namespace ShiftOS.WinForms.Applications this.panel2.Size = new System.Drawing.Size(376, 427); this.panel2.TabIndex = 1; // - // label2 + // lbcodepoints // - if (ShiftoriumFrontend.UpgradeInstalled("shiftorium_gui_codepoints_display")) - { - this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(128, 357); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(135, 13); - this.label2.TabIndex = 3; - this.label2.Text = "You have: %cp Codepoints"; - this.label2.Click += new System.EventHandler(this.label2_Click); - } else - { - this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(128, 357); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(1, 1); - this.label2.TabIndex = 3; - this.label2.Text = ""; - this.label2.Click += new System.EventHandler(this.label2_Click); - } + this.lbcodepoints.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.lbcodepoints.AutoSize = true; + this.lbcodepoints.Location = new System.Drawing.Point(128, 357); + this.lbcodepoints.Name = "lbcodepoints"; + this.lbcodepoints.Size = new System.Drawing.Size(135, 13); + this.lbcodepoints.TabIndex = 3; + this.lbcodepoints.Text = "You have: %cp Codepoints"; + this.lbcodepoints.Click += new System.EventHandler(this.lbcodepoints_Click); // // lbupgradedesc // @@ -165,7 +152,7 @@ namespace ShiftOS.WinForms.Applications // // pnllist // - this.pnllist.Controls.Add(this.label2); + this.pnllist.Controls.Add(this.lbcodepoints); this.pnllist.Controls.Add(this.label1); this.pnllist.Controls.Add(this.pgupgradeprogress); this.pnllist.Controls.Add(this.lbupgrades); @@ -255,7 +242,7 @@ namespace ShiftOS.WinForms.Applications private System.Windows.Forms.Button btnbuy; private ShiftedProgressBar pgupgradeprogress; private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label lbcodepoints; private System.Windows.Forms.Label label3; } } \ No newline at end of file diff --git a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs index 0580b47..d2390ff 100644 --- a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs +++ b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs @@ -51,7 +51,12 @@ namespace ShiftOS.WinForms.Applications public ShiftoriumFrontend() { - + cp_update = new System.Windows.Forms.Timer(); + cp_update.Tick += (o, a) => + { + lbcodepoints.Text = $"You have {SaveSystem.CurrentSave.Codepoints} Codepoints."; + }; + cp_update.Interval = 100; InitializeComponent(); PopulateShiftorium(); lbupgrades.SelectedIndexChanged += (o, a) => @@ -88,8 +93,7 @@ namespace ShiftOS.WinForms.Applications lbupgrades.Items.Clear(); upgrades.Clear(); Timer(); - label2.Text = "You have: " + SaveSystem.CurrentSave.Codepoints.ToString() + " Codepoints"; - + foreach (var upg in backend.GetAvailable()) { String name = Localization.Parse(upg.Name) + " - " + upg.Cost.ToString() + "CP"; @@ -162,6 +166,7 @@ namespace ShiftOS.WinForms.Applications public void OnLoad() { + cp_update.Start(); } public void OnSkinLoad() @@ -169,17 +174,21 @@ namespace ShiftOS.WinForms.Applications } + Timer cp_update = new System.Windows.Forms.Timer(); + public bool OnUnload() { + cp_update.Stop(); + cp_update = null; return true; } public void OnUpgrade() { - + lbcodepoints.Visible = Shiftorium.UpgradeInstalled("shiftorium_gui_codepoints_display"); } - private void label2_Click(object sender, EventArgs e) + private void lbcodepoints_Click(object sender, EventArgs e) { } -- cgit v1.2.3 From 2612721346bc59807c4963d5e8c2f936852aa48b Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 2 Apr 2017 18:29:42 -0400 Subject: Reconnect to MUD after unexpected loss --- ShiftOS.WinForms/WinformsWindowManager.cs | 12 ++++++++++-- ShiftOS_TheReturn/ServerManager.cs | 20 +++++++++++++++++++- 2 files changed, 29 insertions(+), 3 deletions(-) (limited to 'ShiftOS.WinForms') diff --git a/ShiftOS.WinForms/WinformsWindowManager.cs b/ShiftOS.WinForms/WinformsWindowManager.cs index 494c572..26438bf 100644 --- a/ShiftOS.WinForms/WinformsWindowManager.cs +++ b/ShiftOS.WinForms/WinformsWindowManager.cs @@ -40,7 +40,7 @@ namespace ShiftOS.WinForms { get { - return Desktop.Size.Height - ((Shiftorium.UpgradeInstalled("desktop_panel") == true) ? SkinEngine.LoadedSkin.DesktopPanelHeight : 0); + return Desktop.Size.Height - ((Shiftorium.UpgradeInstalled("desktop") == true) ? SkinEngine.LoadedSkin.DesktopPanelHeight : 0); } } @@ -48,7 +48,7 @@ namespace ShiftOS.WinForms { get { - if (!Shiftorium.UpgradeInstalled("desktop_panel")) + if (!Shiftorium.UpgradeInstalled("desktop")) return 0; return ((SkinEngine.LoadedSkin.DesktopPanelPosition == 0) ? SkinEngine.LoadedSkin.DesktopPanelHeight : 0); } @@ -64,6 +64,14 @@ namespace ShiftOS.WinForms Desktop.InvokeOnWorkerThread(act); } + public WinformsWindowManager() + { + Shiftorium.Installed += () => + { + SetupWindows(); + }; + } + public override void Maximize(IWindowBorder form) { try diff --git a/ShiftOS_TheReturn/ServerManager.cs b/ShiftOS_TheReturn/ServerManager.cs index 31b3129..4fce247 100644 --- a/ShiftOS_TheReturn/ServerManager.cs +++ b/ShiftOS_TheReturn/ServerManager.cs @@ -51,9 +51,11 @@ namespace ShiftOS.Engine public static Guid thisGuid { get; private set; } private static NetObjectClient client { get; set; } + private static bool UserDisconnect = false; public static void Disconnect() { + UserDisconnect = true; if (client != null) { client.Disconnect(); @@ -117,7 +119,23 @@ namespace ShiftOS.Engine public static void Initiate(string mud_address, int port) { client = new NetObjectClient(); - + client.OnDisconnected += (o, a) => + { + if (!UserDisconnect) + { + TerminalBackend.PrefixEnabled = true; + ConsoleEx.ForegroundColor = ConsoleColor.Red; + ConsoleEx.Bold = true; + Console.Write($@"Disconnected from MUD: "); + ConsoleEx.Bold = false; + ConsoleEx.Italic = true; + ConsoleEx.ForegroundColor = ConsoleColor.DarkYellow; + Console.WriteLine("You have been disconnected from the multi-user domain for an unknown reason. Your save data is preserved within the kernel and you will be reconnected shortly."); + TerminalBackend.PrefixEnabled = true; + TerminalBackend.PrintPrompt(); + Initiate(mud_address, port); + } + }; client.OnReceived += (o, a) => { var msg = a.Data.Object as ServerMessage; -- cgit v1.2.3 From 6622225a697e5e835f84f2793b1eca8a739cda1c Mon Sep 17 00:00:00 2001 From: Rylan/wowmom98 Date: Sun, 2 Apr 2017 18:37:24 -0400 Subject: actually made useful panel buttons need panel buttons --- ShiftOS.WinForms/Resources/Shiftorium.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ShiftOS.WinForms') diff --git a/ShiftOS.WinForms/Resources/Shiftorium.txt b/ShiftOS.WinForms/Resources/Shiftorium.txt index 12e3a1a..619d2a8 100644 --- a/ShiftOS.WinForms/Resources/Shiftorium.txt +++ b/ShiftOS.WinForms/Resources/Shiftorium.txt @@ -383,7 +383,7 @@ Name: "Useful Panel Buttons", Cost: 250, Description: "Minimize and restore windows by clicking their Panel Button!", - Dependencies: "desktop" + Dependencies: "desktop;wm_panel_buttons" }, { Name: "Maximize Command", -- cgit v1.2.3 From 62257c42f830f13a3aa9c796d55cf7b4b03acaeb Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 2 Apr 2017 18:43:12 -0400 Subject: Remove obsolete MUD Cracker upgrade --- ShiftOS.WinForms/Resources/Shiftorium.txt | 6 ------ 1 file changed, 6 deletions(-) (limited to 'ShiftOS.WinForms') diff --git a/ShiftOS.WinForms/Resources/Shiftorium.txt b/ShiftOS.WinForms/Resources/Shiftorium.txt index 619d2a8..ec3778e 100644 --- a/ShiftOS.WinForms/Resources/Shiftorium.txt +++ b/ShiftOS.WinForms/Resources/Shiftorium.txt @@ -253,12 +253,6 @@ Description: "It may be expensive, but having an easy-access menu to all your apps is very valuable.", Dependencies:"desktop;wm_unlimited_windows" }, - { - Name: "MUD Cracker", - Cost: 500, - Description: "An application for cracking the current multi-user domain's admin password.", - Dependencies: "mud_fundamentals" - }, { Name: "AL MUD Cracker", Cost: 150, -- cgit v1.2.3 From 6a5a0365768fc20d8c8874be36ae8bf379e20825 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 2 Apr 2017 19:11:59 -0400 Subject: remove AL MUD Chat --- ShiftOS.WinForms/Resources/Shiftorium.txt | 6 ------ 1 file changed, 6 deletions(-) (limited to 'ShiftOS.WinForms') diff --git a/ShiftOS.WinForms/Resources/Shiftorium.txt b/ShiftOS.WinForms/Resources/Shiftorium.txt index ec3778e..9b01be4 100644 --- a/ShiftOS.WinForms/Resources/Shiftorium.txt +++ b/ShiftOS.WinForms/Resources/Shiftorium.txt @@ -456,12 +456,6 @@ Description: "Add a widget to the desktop which shows the results of sys.clock as text on the desktop.", Dependencies: "clock;desktop" }, - { - Name: "AL MUD Chat", - Cost: 150, - Description: "Adds an app launcher entry for the MUD chat application.", - Dependencies: "mud_fundamentals;app_launcher" - }, { Name: "App Launcher Categories", Cost: 1000, -- cgit v1.2.3 From f43f6fe17d054f83c686b552201d6b4bfc83524d Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 3 Apr 2017 18:36:13 -0400 Subject: LOADS of optimizations and Pong fixes. --- ShiftOS.Objects/ShiftOS.Objects.csproj | 1 - ShiftOS.Objects/ShiftOSMenuRenderer.cs | 51 ------- ShiftOS.WinForms/Applications/Pong.Designer.cs | 177 +++++++++++++------------ ShiftOS.WinForms/Applications/Pong.cs | 36 ++++- ShiftOS.WinForms/Oobe.cs | 30 ++++- ShiftOS.WinForms/Tools/ControlManager.cs | 107 +++------------ ShiftOS.WinForms/WinformsDesktop.cs | 13 +- ShiftOS.WinForms/WinformsWindowManager.cs | 17 +-- ShiftOS_TheReturn/Shiftorium.cs | 28 +++- 9 files changed, 217 insertions(+), 243 deletions(-) delete mode 100644 ShiftOS.Objects/ShiftOSMenuRenderer.cs (limited to 'ShiftOS.WinForms') diff --git a/ShiftOS.Objects/ShiftOS.Objects.csproj b/ShiftOS.Objects/ShiftOS.Objects.csproj index 3dc0c33..4514b68 100644 --- a/ShiftOS.Objects/ShiftOS.Objects.csproj +++ b/ShiftOS.Objects/ShiftOS.Objects.csproj @@ -54,7 +54,6 @@ - diff --git a/ShiftOS.Objects/ShiftOSMenuRenderer.cs b/ShiftOS.Objects/ShiftOSMenuRenderer.cs deleted file mode 100644 index c76bd35..0000000 --- a/ShiftOS.Objects/ShiftOSMenuRenderer.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 Michael VanOverbeek and ShiftOS devs - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace ShiftOS.Objects -{ - class ShiftOSMenuRenderer : ToolStripProfessionalRenderer - { - public ShiftOSMenuRenderer() : base(new ShiftOSColorTable()) - { - - } - - protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e) - { - - } - } - - public class ShiftOSColorTable : ProfessionalColorTable - { - - } -} diff --git a/ShiftOS.WinForms/Applications/Pong.Designer.cs b/ShiftOS.WinForms/Applications/Pong.Designer.cs index faaf0f5..e619eaa 100644 --- a/ShiftOS.WinForms/Applications/Pong.Designer.cs +++ b/ShiftOS.WinForms/Applications/Pong.Designer.cs @@ -79,6 +79,11 @@ namespace ShiftOS.WinForms.Applications this.tmrcountdown = new System.Windows.Forms.Timer(this.components); this.tmrstoryline = new System.Windows.Forms.Timer(this.components); this.pgcontents = new ShiftOS.WinForms.Controls.Canvas(); + this.pnlhighscore = new System.Windows.Forms.Panel(); + this.lbhighscore = new System.Windows.Forms.ListBox(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.button2 = new System.Windows.Forms.Button(); + this.label10 = new System.Windows.Forms.Label(); this.pnlgamestats = new System.Windows.Forms.Panel(); this.button1 = new System.Windows.Forms.Button(); this.label12 = new System.Windows.Forms.Label(); @@ -91,9 +96,6 @@ namespace ShiftOS.WinForms.Applications this.btncashout = new System.Windows.Forms.Button(); this.Label2 = new System.Windows.Forms.Label(); this.lbllevelreached = new System.Windows.Forms.Label(); - this.pnlhighscore = new System.Windows.Forms.Panel(); - this.lbhighscore = new System.Windows.Forms.ListBox(); - this.label10 = new System.Windows.Forms.Label(); this.pnlfinalstats = new System.Windows.Forms.Panel(); this.btnplayagain = new System.Windows.Forms.Button(); this.lblfinalcodepoints = new System.Windows.Forms.Label(); @@ -122,16 +124,14 @@ namespace ShiftOS.WinForms.Applications this.lblstatscodepoints = new System.Windows.Forms.Label(); this.lblstatsY = new System.Windows.Forms.Label(); this.lblstatsX = new System.Windows.Forms.Label(); - this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); - this.button2 = new System.Windows.Forms.Button(); this.pgcontents.SuspendLayout(); - this.pnlgamestats.SuspendLayout(); this.pnlhighscore.SuspendLayout(); + this.flowLayoutPanel1.SuspendLayout(); + this.pnlgamestats.SuspendLayout(); this.pnlfinalstats.SuspendLayout(); this.pnllose.SuspendLayout(); this.pnlintro.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.paddleHuman)).BeginInit(); - this.flowLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // // gameTimer @@ -174,11 +174,67 @@ namespace ShiftOS.WinForms.Applications this.pgcontents.Dock = System.Windows.Forms.DockStyle.Fill; this.pgcontents.Location = new System.Drawing.Point(0, 0); this.pgcontents.Name = "pgcontents"; - this.pgcontents.Size = new System.Drawing.Size(700, 400); + this.pgcontents.Size = new System.Drawing.Size(1867, 819); this.pgcontents.TabIndex = 20; this.pgcontents.Paint += new System.Windows.Forms.PaintEventHandler(this.pgcontents_Paint); this.pgcontents.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pongMain_MouseMove); // + // pnlhighscore + // + this.pnlhighscore.Controls.Add(this.lbhighscore); + this.pnlhighscore.Controls.Add(this.flowLayoutPanel1); + this.pnlhighscore.Controls.Add(this.label10); + this.pnlhighscore.Location = new System.Drawing.Point(688, 302); + this.pnlhighscore.Name = "pnlhighscore"; + this.pnlhighscore.Size = new System.Drawing.Size(539, 311); + this.pnlhighscore.TabIndex = 14; + this.pnlhighscore.Visible = false; + // + // lbhighscore + // + this.lbhighscore.Dock = System.Windows.Forms.DockStyle.Fill; + this.lbhighscore.FormattingEnabled = true; + this.lbhighscore.Location = new System.Drawing.Point(0, 36); + this.lbhighscore.MultiColumn = true; + this.lbhighscore.Name = "lbhighscore"; + this.lbhighscore.SelectionMode = System.Windows.Forms.SelectionMode.None; + this.lbhighscore.Size = new System.Drawing.Size(539, 246); + this.lbhighscore.TabIndex = 1; + // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.AutoSize = true; + this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.flowLayoutPanel1.Controls.Add(this.button2); + this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; + this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 282); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(539, 29); + this.flowLayoutPanel1.TabIndex = 2; + // + // button2 + // + this.button2.AutoSize = true; + this.button2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.button2.Location = new System.Drawing.Point(476, 3); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(60, 23); + this.button2.TabIndex = 0; + this.button2.Text = "{CLOSE}"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // label10 + // + this.label10.Dock = System.Windows.Forms.DockStyle.Top; + this.label10.Location = new System.Drawing.Point(0, 0); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(539, 36); + this.label10.TabIndex = 0; + this.label10.Text = "{HIGH_SCORES}"; + this.label10.TextAlign = System.Drawing.ContentAlignment.TopCenter; + // // pnlgamestats // this.pnlgamestats.Controls.Add(this.button1); @@ -192,7 +248,7 @@ namespace ShiftOS.WinForms.Applications this.pnlgamestats.Controls.Add(this.btncashout); this.pnlgamestats.Controls.Add(this.Label2); this.pnlgamestats.Controls.Add(this.lbllevelreached); - this.pnlgamestats.Location = new System.Drawing.Point(56, 76); + this.pnlgamestats.Location = new System.Drawing.Point(104, 375); this.pnlgamestats.Name = "pnlgamestats"; this.pnlgamestats.Size = new System.Drawing.Size(466, 284); this.pnlgamestats.TabIndex = 6; @@ -307,38 +363,6 @@ namespace ShiftOS.WinForms.Applications this.lbllevelreached.TabIndex = 0; this.lbllevelreached.Text = "You Reached Level 2!"; // - // pnlhighscore - // - this.pnlhighscore.Controls.Add(this.lbhighscore); - this.pnlhighscore.Controls.Add(this.flowLayoutPanel1); - this.pnlhighscore.Controls.Add(this.label10); - this.pnlhighscore.Location = new System.Drawing.Point(67, 29); - this.pnlhighscore.Name = "pnlhighscore"; - this.pnlhighscore.Size = new System.Drawing.Size(539, 311); - this.pnlhighscore.TabIndex = 14; - this.pnlhighscore.Visible = false; - // - // lbhighscore - // - this.lbhighscore.Dock = System.Windows.Forms.DockStyle.Fill; - this.lbhighscore.FormattingEnabled = true; - this.lbhighscore.Location = new System.Drawing.Point(0, 36); - this.lbhighscore.MultiColumn = true; - this.lbhighscore.Name = "lbhighscore"; - this.lbhighscore.SelectionMode = System.Windows.Forms.SelectionMode.None; - this.lbhighscore.Size = new System.Drawing.Size(539, 246); - this.lbhighscore.TabIndex = 1; - // - // label10 - // - this.label10.Dock = System.Windows.Forms.DockStyle.Top; - this.label10.Location = new System.Drawing.Point(0, 0); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(539, 36); - this.label10.TabIndex = 0; - this.label10.Text = "{HIGH_SCORES}"; - this.label10.TextAlign = System.Drawing.ContentAlignment.TopCenter; - // // pnlfinalstats // this.pnlfinalstats.Controls.Add(this.btnplayagain); @@ -373,6 +397,7 @@ namespace ShiftOS.WinForms.Applications this.lblfinalcodepoints.Name = "lblfinalcodepoints"; this.lblfinalcodepoints.Size = new System.Drawing.Size(356, 73); this.lblfinalcodepoints.TabIndex = 15; + this.lblfinalcodepoints.Tag = "header1"; this.lblfinalcodepoints.Text = "134 CP"; this.lblfinalcodepoints.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // @@ -384,6 +409,7 @@ namespace ShiftOS.WinForms.Applications this.Label11.Name = "Label11"; this.Label11.Size = new System.Drawing.Size(33, 33); this.Label11.TabIndex = 14; + this.Label11.Tag = "header2"; this.Label11.Text = "+"; this.Label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // @@ -394,6 +420,7 @@ namespace ShiftOS.WinForms.Applications this.lblfinalcomputerreward.Name = "lblfinalcomputerreward"; this.lblfinalcomputerreward.Size = new System.Drawing.Size(151, 52); this.lblfinalcomputerreward.TabIndex = 12; + this.lblfinalcomputerreward.Tag = "header2"; this.lblfinalcomputerreward.Text = "34"; this.lblfinalcomputerreward.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // @@ -413,6 +440,7 @@ namespace ShiftOS.WinForms.Applications this.lblfinallevelreward.Name = "lblfinallevelreward"; this.lblfinallevelreward.Size = new System.Drawing.Size(151, 52); this.lblfinallevelreward.TabIndex = 10; + this.lblfinallevelreward.Tag = "header2"; this.lblfinallevelreward.Text = "100"; this.lblfinallevelreward.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // @@ -432,6 +460,7 @@ namespace ShiftOS.WinForms.Applications this.lblfinalcodepointswithtext.Name = "lblfinalcodepointswithtext"; this.lblfinalcodepointswithtext.Size = new System.Drawing.Size(356, 26); this.lblfinalcodepointswithtext.TabIndex = 1; + this.lblfinalcodepointswithtext.Tag = "header2"; this.lblfinalcodepointswithtext.Text = "You cashed out with 134 codepoints!"; this.lblfinalcodepointswithtext.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // @@ -502,10 +531,11 @@ namespace ShiftOS.WinForms.Applications this.pnlintro.Controls.Add(this.Label6); this.pnlintro.Controls.Add(this.btnstartgame); this.pnlintro.Controls.Add(this.Label8); - this.pnlintro.Location = new System.Drawing.Point(52, 29); + this.pnlintro.Location = new System.Drawing.Point(1139, 41); this.pnlintro.Name = "pnlintro"; this.pnlintro.Size = new System.Drawing.Size(595, 303); this.pnlintro.TabIndex = 13; + this.pnlintro.Tag = "header2"; // // Label6 // @@ -548,6 +578,7 @@ namespace ShiftOS.WinForms.Applications this.lblbeatai.Name = "lblbeatai"; this.lblbeatai.Size = new System.Drawing.Size(600, 30); this.lblbeatai.TabIndex = 8; + this.lblbeatai.Tag = "header2"; this.lblbeatai.Text = "You got 2 codepoints for beating the Computer!"; this.lblbeatai.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblbeatai.Visible = false; @@ -577,7 +608,6 @@ namespace ShiftOS.WinForms.Applications // this.paddleHuman.BackColor = System.Drawing.Color.Black; this.paddleHuman.Location = new System.Drawing.Point(10, 134); - this.paddleComputer.MaximumSize = new System.Drawing.Size(20, 150); this.paddleHuman.Name = "paddleHuman"; this.paddleHuman.Size = new System.Drawing.Size(20, 100); this.paddleHuman.TabIndex = 3; @@ -587,7 +617,7 @@ namespace ShiftOS.WinForms.Applications // this.paddleComputer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.paddleComputer.BackColor = System.Drawing.Color.Black; - this.paddleComputer.Location = new System.Drawing.Point(666, 134); + this.paddleComputer.Location = new System.Drawing.Point(1833, 134); this.paddleComputer.MaximumSize = new System.Drawing.Size(20, 150); this.paddleComputer.Name = "paddleComputer"; this.paddleComputer.Size = new System.Drawing.Size(20, 100); @@ -599,69 +629,52 @@ namespace ShiftOS.WinForms.Applications this.lbllevelandtime.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lbllevelandtime.Location = new System.Drawing.Point(0, 0); this.lbllevelandtime.Name = "lbllevelandtime"; - this.lbllevelandtime.Size = new System.Drawing.Size(700, 22); + this.lbllevelandtime.Size = new System.Drawing.Size(1867, 22); this.lbllevelandtime.TabIndex = 4; + this.lbllevelandtime.Tag = "header1"; this.lbllevelandtime.Text = "Level: 1 - 58 Seconds Left"; this.lbllevelandtime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lblstatscodepoints // - this.lblstatscodepoints.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + this.lblstatscodepoints.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.lblstatscodepoints.AutoSize = true; this.lblstatscodepoints.Font = new System.Drawing.Font("Georgia", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblstatscodepoints.Location = new System.Drawing.Point(239, 356); + this.lblstatscodepoints.Location = new System.Drawing.Point(239, 775); this.lblstatscodepoints.Name = "lblstatscodepoints"; - this.lblstatscodepoints.Size = new System.Drawing.Size(219, 35); + this.lblstatscodepoints.Size = new System.Drawing.Size(116, 23); this.lblstatscodepoints.TabIndex = 12; + this.lblstatscodepoints.Tag = "header2"; this.lblstatscodepoints.Text = "Codepoints: "; this.lblstatscodepoints.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lblstatsY // this.lblstatsY.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.lblstatsY.AutoSize = true; this.lblstatsY.Font = new System.Drawing.Font("Georgia", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblstatsY.Location = new System.Drawing.Point(542, 356); + this.lblstatsY.Location = new System.Drawing.Point(1395, 775); this.lblstatsY.Name = "lblstatsY"; - this.lblstatsY.Size = new System.Drawing.Size(144, 35); + this.lblstatsY.Size = new System.Drawing.Size(76, 23); this.lblstatsY.TabIndex = 11; + this.lblstatsY.Tag = "header2"; this.lblstatsY.Text = "Yspeed:"; this.lblstatsY.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lblstatsX // this.lblstatsX.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.lblstatsX.AutoSize = true; this.lblstatsX.Font = new System.Drawing.Font("Georgia", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblstatsX.Location = new System.Drawing.Point(3, 356); + this.lblstatsX.Location = new System.Drawing.Point(3, 775); this.lblstatsX.Name = "lblstatsX"; - this.lblstatsX.Size = new System.Drawing.Size(144, 35); + this.lblstatsX.Size = new System.Drawing.Size(83, 23); this.lblstatsX.TabIndex = 5; + this.lblstatsX.Tag = "header2"; this.lblstatsX.Text = "Xspeed: "; this.lblstatsX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // flowLayoutPanel1 - // - this.flowLayoutPanel1.AutoSize = true; - this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.flowLayoutPanel1.Controls.Add(this.button2); - this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; - this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 282); - this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(539, 29); - this.flowLayoutPanel1.TabIndex = 2; - // - // button2 - // - this.button2.AutoSize = true; - this.button2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.button2.Location = new System.Drawing.Point(476, 3); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(60, 23); - this.button2.TabIndex = 0; - this.button2.Text = "{CLOSE}"; - this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.button2_Click); - // // Pong // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -670,23 +683,23 @@ namespace ShiftOS.WinForms.Applications this.Controls.Add(this.pgcontents); this.DoubleBuffered = true; this.Name = "Pong"; - this.Text = "{PONG_NAME}"; - this.Size = new System.Drawing.Size(820, 500); + this.Size = new System.Drawing.Size(1867, 819); this.Load += new System.EventHandler(this.Pong_Load); this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pongMain_MouseMove); this.pgcontents.ResumeLayout(false); - this.pnlgamestats.ResumeLayout(false); - this.pnlgamestats.PerformLayout(); + this.pgcontents.PerformLayout(); this.pnlhighscore.ResumeLayout(false); this.pnlhighscore.PerformLayout(); + this.flowLayoutPanel1.ResumeLayout(false); + this.flowLayoutPanel1.PerformLayout(); + this.pnlgamestats.ResumeLayout(false); + this.pnlgamestats.PerformLayout(); this.pnlfinalstats.ResumeLayout(false); this.pnlfinalstats.PerformLayout(); this.pnllose.ResumeLayout(false); this.pnlintro.ResumeLayout(false); this.pnlintro.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.paddleHuman)).EndInit(); - this.flowLayoutPanel1.ResumeLayout(false); - this.flowLayoutPanel1.PerformLayout(); this.ResumeLayout(false); } diff --git a/ShiftOS.WinForms/Applications/Pong.cs b/ShiftOS.WinForms/Applications/Pong.cs index 157ce8c..a7b1aeb 100644 --- a/ShiftOS.WinForms/Applications/Pong.cs +++ b/ShiftOS.WinForms/Applications/Pong.cs @@ -34,6 +34,7 @@ using System.Windows.Forms; using Newtonsoft.Json; using ShiftOS.Engine; using ShiftOS.Objects; +using ShiftOS.WinForms.Tools; namespace ShiftOS.WinForms.Applications { @@ -83,6 +84,26 @@ namespace ShiftOS.WinForms.Applications paddleHuman.Location = new Point(paddleHuman.Location.X, (loc.Y) - (paddleHuman.Height / 2)); } + private void CenterPanels() + { + pnlfinalstats.CenterParent(); + pnlgamestats.CenterParent(); + pnlhighscore.CenterParent(); + pnlintro.CenterParent(); + pnllose.CenterParent(); + lblcountdown.CenterParent(); + lblbeatai.Left = (this.Width - lblbeatai.Width) / 2; + SetupStats(); + } + + public void SetupStats() + { + lblstatsX.Location = new Point(5, this.Height - lblstatsX.Height - 5); + lblstatsY.Location = new Point(this.Width - lblstatsY.Width - 5, this.Height - lblstatsY.Height - 5); + lblstatscodepoints.Top = this.Height - lblstatscodepoints.Height - 5; + lblstatscodepoints.Left = (this.Width - lblstatscodepoints.Width) / 2; + } + // ERROR: Handles clauses are not supported in C# private void gameTimer_Tick(object sender, EventArgs e) @@ -102,7 +123,7 @@ namespace ShiftOS.WinForms.Applications //Set the computer player to move according to the ball's position. if (aiShouldIsbeEnabled) - if (ball.Location.X > 500 - xVel * 10 && xVel > 0) + if (ball.Location.X > (this.Width - (this.Width / 3)) - xVel * 10 && xVel > 0) { if (ball.Location.Y > paddleComputer.Location.Y + 50) { @@ -116,12 +137,12 @@ namespace ShiftOS.WinForms.Applications } else { - //used to be me.location.y + //used to be me.location.y - except it's fucking C# and this comment is misleading as fuck. OH WAIT! I didn't write it! And none of the current devs did either! - Michael if (paddleComputer.Location.Y > this.Size.Height / 2 - paddleComputer.Height + casualposition) { paddleComputer.Location = new Point(paddleComputer.Location.X, paddleComputer.Location.Y - computerspeed); } - //used to be me.location.y + //Rylan is hot. Used to be //used to be me.location.y if (paddleComputer.Location.Y < this.Size.Height / 2 - paddleComputer.Height + casualposition) { paddleComputer.Location = new Point(paddleComputer.Location.X, paddleComputer.Location.Y + computerspeed); @@ -269,6 +290,7 @@ namespace ShiftOS.WinForms.Applications } lblstatscodepoints.Text = Localization.Parse("{CODEPOINTS}: ") + (levelrewards[level - 1] + beatairewardtotal).ToString(); } + SetupStats(); } public void SendHighscores() @@ -652,10 +674,17 @@ namespace ShiftOS.WinForms.Applications pnlhighscore.Hide(); pnlgamestats.Hide(); pnlfinalstats.Hide(); + CenterPanels(); + lblbeatai.Hide(); } public void OnSkinLoad() { + CenterPanels(); + this.SizeChanged += (o, a) => + { + CenterPanels(); + }; } public bool OnUnload() @@ -665,6 +694,7 @@ namespace ShiftOS.WinForms.Applications public void OnUpgrade() { + CenterPanels(); } private void button2_Click(object sender, EventArgs e) diff --git a/ShiftOS.WinForms/Oobe.cs b/ShiftOS.WinForms/Oobe.cs index 898f60b..d6d3b92 100644 --- a/ShiftOS.WinForms/Oobe.cs +++ b/ShiftOS.WinForms/Oobe.cs @@ -64,7 +64,10 @@ namespace ShiftOS.WinForms { while(typing == true) { + //JESUS CHRIST PAST MICHAEL. + //We should PROBABLY block the thread... You know... not everyone has a 10-core processor. + Thread.Sleep(100); } charcount = texttotype.Length; @@ -452,6 +455,10 @@ namespace ShiftOS.WinForms TextType("Go ahead and type 'sos.help' to see a list of commands."); while (TutorialProgress == 0) { + //JESUS CHRIST PAST MICHAEL. + + //We should PROBABLY block the thread... You know... not everyone has a 10-core processor. + Thread.Sleep(100); } TextType("As you can see, sos.help gives you a list of all commands in the system."); @@ -461,6 +468,10 @@ namespace ShiftOS.WinForms TextType("Go ahead and run the 'status' command within the 'sos' namespace to see what the command does."); while (TutorialProgress == 1) { + //JESUS CHRIST PAST MICHAEL. + + //We should PROBABLY block the thread... You know... not everyone has a 10-core processor. + Thread.Sleep(100); } TextType("Brilliant. The sos.status command will tell you how many Codepoints you have, as well as how many upgrades you have installed and how many are available."); @@ -478,6 +489,10 @@ namespace ShiftOS.WinForms TextType("To start using the Shiftorium, simply type 'shiftorium.list' to see available upgrades."); while (TutorialProgress == 2) { + //JESUS CHRIST PAST MICHAEL. + + //We should PROBABLY block the thread... You know... not everyone has a 10-core processor. + Thread.Sleep(100); } Clear(); @@ -502,13 +517,21 @@ namespace ShiftOS.WinForms TextType("shiftorium.info requires an upgrade argument, which is a string type. Go ahead and give shiftorium.info's upgrade argument the 'mud_fundamentals' upgrade's ID."); while (TutorialProgress == 3) { + //JESUS CHRIST PAST MICHAEL. + + //We should PROBABLY block the thread... You know... not everyone has a 10-core processor. + Thread.Sleep(100); } TextType("As you can see, mud_fundamentals is very useful. In fact, a lot of useful upgrades depend on it. You should buy it!"); Thread.Sleep(500); TextType("shiftorium.info already gave you a command that will let you buy the upgrade - go ahead and run that command!"); while (!Shiftorium.UpgradeInstalled("mud_fundamentals")) - { + { //JESUS CHRIST PAST MICHAEL. + + //We should PROBABLY block the thread... You know... not everyone has a 10-core processor. + Thread.Sleep(100); + } TextType("Hooray! You now have the MUD Fundamentals upgrade."); @@ -520,6 +543,10 @@ namespace ShiftOS.WinForms TextType("Just run win.open without arguments, and this tutorial will be completed!"); while (TutorialProgress == 4) { + //JESUS CHRIST PAST MICHAEL. + + //We should PROBABLY block the thread... You know... not everyone has a 10-core processor. + Thread.Sleep(100); } TextType("This concludes the ShiftOS beginners' guide brought to you by the multi-user domain. Stay safe in a connected world."); @@ -528,6 +555,7 @@ namespace ShiftOS.WinForms { OnComplete?.Invoke(this, EventArgs.Empty); SaveSystem.CurrentSave.StoryPosition = 2; + this.Close(); SaveSystem.SaveGame(); AppearanceManager.SetupWindow(new Applications.Terminal()); }); diff --git a/ShiftOS.WinForms/Tools/ControlManager.cs b/ShiftOS.WinForms/Tools/ControlManager.cs index 52663d7..a2a76b7 100644 --- a/ShiftOS.WinForms/Tools/ControlManager.cs +++ b/ShiftOS.WinForms/Tools/ControlManager.cs @@ -67,91 +67,6 @@ namespace ShiftOS.WinForms.Tools } - public static void SetupWindows() - { - if (SaveSystem.CurrentSave != null) - { - int screen_height_start = 0; - if (Shiftorium.UpgradeInstalled("wm_free_placement")) - { - } - else if (Shiftorium.UpgradeInstalled("wm_4_windows")) - { - int screen_width_half = Screen.PrimaryScreen.Bounds.Width / 2; - int screen_height_half = (Screen.PrimaryScreen.Bounds.Height - screen_height_start) / 2; - - for (int i = 0; i < OpenForms.Count; i++) - { - var frm = OpenForms[i] as WindowBorder; - - switch (i) - { - case 0: - frm.Location = new System.Drawing.Point(0, screen_height_start); - frm.Size = new System.Drawing.Size((OpenForms.Count > 1) ? screen_width_half : screen_width_half * 2, (OpenForms.Count > 2) ? screen_height_half : screen_height_half * 2); - - break; - case 1: - frm.Location = new System.Drawing.Point(screen_width_half, screen_height_start); - frm.Size = new System.Drawing.Size(screen_width_half, (OpenForms.Count > 2) ? screen_height_half : screen_height_half * 2); - break; - case 2: - frm.Location = new System.Drawing.Point(0, screen_height_half + screen_height_start); - frm.Size = new System.Drawing.Size((OpenForms.Count > 3) ? screen_width_half : screen_width_half * 2, screen_height_half); - break; - case 3: - frm.Location = new System.Drawing.Point(screen_width_half, screen_height_half + screen_height_start); - frm.Size = new System.Drawing.Size(screen_width_half, (OpenForms.Count > 2) ? screen_height_half : screen_height_half * 2); - break; - } - } - - } - else if (Shiftorium.UpgradeInstalled("window_manager")) - { - int screen_width_half = Screen.PrimaryScreen.Bounds.Width / 2; - int screen_height = (Screen.PrimaryScreen.Bounds.Height) - screen_height_start; - - - - for (int i = 0; i < OpenForms.Count; i++) - { - - - var frm = OpenForms[i] as WindowBorder; - switch (i) - { - case 0: - frm.Location = new System.Drawing.Point(0, screen_height_start); - frm.Size = new System.Drawing.Size((OpenForms.Count > 1) ? screen_width_half : screen_width_half * 2, screen_height); - break; - case 1: - frm.Location = new System.Drawing.Point(screen_width_half, screen_height_start); - frm.Size = new System.Drawing.Size(screen_width_half, screen_height); - break; - } - OpenForms[i] = frm; - } - } - else - { - var frm = OpenForms[0] as WindowBorder; - frm.Location = new Point(0, 0); - frm.Size = Desktop.Size; - OpenForms[0] = frm; - - } - } - else - { - var frm = OpenForms[0] as WindowBorder; - frm.Location = new Point(0, 0); - frm.Size = Desktop.Size; - OpenForms[0] = frm; - - } - } - internal static Color ConvertColor(ConsoleColor cCol) { switch (cCol) @@ -214,9 +129,22 @@ namespace ShiftOS.WinForms.Tools #endif } + /// + /// Centers the control along its parent. + /// + /// The control to center (this is an extension method - you can call it on a control as though it was a method in that control) + public static void CenterParent(this Control ctrl) + { + ctrl.Location = new Point( + (ctrl.Parent.Width - ctrl.Width) / 2, + (ctrl.Parent.Height - ctrl.Height) / 2 + ); + } + public static void SetupControl(Control ctrl) { SuspendDrawing(ctrl); + ctrl.SuspendLayout(); SetCursor(ctrl); if (!(ctrl is MenuStrip) && !(ctrl is ToolStrip) && !(ctrl is StatusStrip) && !(ctrl is ContextMenuStrip)) { @@ -270,13 +198,7 @@ namespace ShiftOS.WinForms.Tools a.SuppressKeyPress = true; - if (SaveSystem.CurrentSave != null) - { - if (Shiftorium.UpgradeInstalled("window_manager")) - { - Engine.AppearanceManager.SetupWindow(new Applications.Terminal()); - } - } + Engine.AppearanceManager.SetupWindow(new Applications.Terminal()); } ShiftOS.Engine.Scripting.LuaInterpreter.RaiseEvent("on_key_down", a); @@ -293,6 +215,7 @@ namespace ShiftOS.WinForms.Tools } MakeDoubleBuffered(ctrl); + ctrl.ResumeLayout(); ResumeDrawing(ctrl); } diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs index 06f103e..033802e 100644 --- a/ShiftOS.WinForms/WinformsDesktop.cs +++ b/ShiftOS.WinForms/WinformsDesktop.cs @@ -664,10 +664,17 @@ namespace ShiftOS.WinForms /// Act. public void InvokeOnWorkerThread(Action act) { - this.Invoke(new Action(()=> + try { - act?.Invoke(); - })); + this.Invoke(new Action(() => + { + act?.Invoke(); + })); + } + catch + { + + } } public void OpenAppLauncher(Point loc) diff --git a/ShiftOS.WinForms/WinformsWindowManager.cs b/ShiftOS.WinForms/WinformsWindowManager.cs index 26438bf..cfcb6d3 100644 --- a/ShiftOS.WinForms/WinformsWindowManager.cs +++ b/ShiftOS.WinForms/WinformsWindowManager.cs @@ -184,20 +184,21 @@ namespace ShiftOS.WinForms if (maxWindows > 0) { - List formstoclose = new List(); - - for (int i = 0; i < maxWindows && i < AppearanceManager.OpenForms.Count; i++) + var windows = new List(); + foreach(var WB in AppearanceManager.OpenForms) { - var frm = AppearanceManager.OpenForms[i] as WindowBorder; - if(!frm.IsDialog) - formstoclose.Add(frm); - + if (WB is WindowBorder) + windows.Add(WB as WindowBorder); } + List formstoclose = new List(windows.Where(x => x.IsDialog == false).ToArray()); + while (formstoclose.Count > maxWindows - 1) { - formstoclose[0].Close(); + this.Close(formstoclose[0].ParentWindow); + AppearanceManager.OpenForms.Remove(formstoclose[0]); formstoclose.RemoveAt(0); + } } } diff --git a/ShiftOS_TheReturn/Shiftorium.cs b/ShiftOS_TheReturn/Shiftorium.cs index 0bdd9f4..4556cd6 100644 --- a/ShiftOS_TheReturn/Shiftorium.cs +++ b/ShiftOS_TheReturn/Shiftorium.cs @@ -46,6 +46,23 @@ namespace ShiftOS.Engine Installed?.Invoke(); } + public static string GetCategory(string id) + { + var upg = GetDefaults().FirstOrDefault(x => x.ID == id); + if (upg == null) + return "Other"; + return (upg.Category == null) ? "Other" : upg.Category; + } + + public static IEnumerable GetAllInCategory(string cat) + { + return GetDefaults().Where(x => x.Category == cat); + } + + public static bool IsCategoryEmptied(string cat) + { + return GetDefaults().Where(x => x.Category == cat).FirstOrDefault(x => x.Installed == false) == null; + } public static bool Buy(string id, int cost) { @@ -278,8 +295,15 @@ namespace ShiftOS.Engine public string Description { get; set; } public int Cost { get; set; } public string ID { get { return (this.Id != null ? this.Id : (Name.ToLower().Replace(" ", "_"))); } } - public string Id { get; } - + public string Id { get; set; } + public string Category { get; set; } + public bool Installed + { + get + { + return Shiftorium.UpgradeInstalled(ID); + } + } public string Dependencies { get; set; } } } -- cgit v1.2.3 From 9566b4b062ad0f10832584c65457ef6505b097ab Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 3 Apr 2017 19:28:35 -0400 Subject: Categorize the Shiftorium --- ShiftOS.WinForms/Resources/Shiftorium.txt | 154 ++++++++++++++++++++++++++++-- ShiftOS_TheReturn/Commands.cs | 57 ++++++++++- ShiftOS_TheReturn/Shiftorium.cs | 23 +++++ 3 files changed, 221 insertions(+), 13 deletions(-) (limited to 'ShiftOS.WinForms') diff --git a/ShiftOS.WinForms/Resources/Shiftorium.txt b/ShiftOS.WinForms/Resources/Shiftorium.txt index 9b01be4..0c4e0c6 100644 --- a/ShiftOS.WinForms/Resources/Shiftorium.txt +++ b/ShiftOS.WinForms/Resources/Shiftorium.txt @@ -4,13 +4,15 @@ Name: "Screensavers", Cost: 750, Description: "Like to leave your PC idle for long periods of time? Save some energy and keep your screen from being tired by hiding the desktop behind a black screen with an image on it.", - Dependencies: "desktop" + Dependencies: "desktop", + Category: "Enhancements", }, { Name: "Shift Screensavers", Cost: 100, Description: "This Shifter upgrade will allow you to customize the screensaver.", - Dependencies: "screensavers;shifter" + Dependencies: "screensavers;shifter", + Category: "Customization" }, @@ -19,72 +21,84 @@ Name: "Calculator", Cost: 1000, Dependencies: "wm_free_placement;desktop", - Description: "Crazy math problems getting you down? Well, this calculator will take care of that!" + Description: "Crazy math problems getting you down? Well, this calculator will take care of that!", + Category: "Applications" }, { Name: "AL Calculator", Cost: 150, Dependencies: "calculator;app_launcher", - Description: "Add an App Launcher Entry for the Calculator!" + Description: "Add an App Launcher Entry for the Calculator!", + Category: "GUI", }, { Name: "Calc Equals Button", Cost: 600, Dependencies: "calculator", + Category: "Enhancements", Description: "Right now, you can only type numbers, but this equals button opens the door to solving equations!" }, { Name: "Calc Decimal Button", Cost: 600, Dependencies: "calculator", + Category: "Enhancements", Description: "Whole numbers can get boring. With this button, you can type decimal numbers!" }, { Name: "Calc Plus Button", Cost: 700, Dependencies: "calc_equals_button", + Category: "Enhancements", Description: "With this extra button, your calculator can now do addition problems!" }, { Name: "Calc Minus Button", Cost: 700, Dependencies: "calc_equals_button", + Category: "Enhancements", Description: "With this extra button, your calculator can now do subtraction problems!" }, { Name: "Calc Multiply Button", Cost: 800, Dependencies: "calc_plus_button", + Category: "Enhancements", Description: "You can add numbers together, but it must be tiring to add the same number over and over. This multiplication button will make it easier for you!" }, { Name: "Calc Divide Button", Cost: 800, Dependencies: "calc_multiply_button", + Category: "Enhancements", Description: "You can multiply, but what about reversing multiplication? This divide button will sort that out!" }, { Name: "Calc Clear Button", Cost: 750, Dependencies: "calc_equals_button", + Category: "Enhancements", Description: "Typed the wrong number? No worries! With this Clear button, you can clear the number field, without messing up the equation you're trying to solve!" }, { Name: "Calc CE Button", Cost: 750, Dependencies: "calc_clear_button", + Category: "Enhancements", Description: "Wanna start all over with a new equation? With this CE (Clear Everything) button, you get rid of not only the numbers in the number field, but also the equation!" }, { Name: "MUD Fundamentals", Cost: 50, Description: "Some basic commands for the terminal that'll help you out in the multi-user domain.", + Category: "Kernel & System", Dependencies: null }, { Name: "AL Notifications", Cost: 150, Dependencies: "app_launcher", + Category: "GUI", Description: "Want to open the Notifications application from within the App Launcher? This upgrade is for you." }, @@ -93,35 +107,41 @@ Name: "ShiftLetters", Cost: 150, Dependencies: null, + Category: "Applications", Description: "Sick and tired of playing Pong? Buy this upgrade to get a whole new game!" }, { Name: "AL ShiftLetters", Cost: 150, Dependencies: "app_launcher;shiftletters", + Category: "GUI", Description: "This upgrade allows you to find ShiftLetters in your App Launcher." }, { Name: "SL Contributors Wordlist", Cost: 250, Dependencies: "shiftletters", + Category: "Enhancements", Description: "This nice wordlist lets you find out the people who contributed to the development of ShiftOS!" }, { Name: "SL Operating Systems Wordlist", Cost: 500, Dependencies: "shiftletters", + Category: "Enhancements", Description: "Know a lot about computer operating systems? This upgrade adds a wordlist to ShiftLetters, full of various Linux distros, Windows codenames and other OS names. All for the low price of 500 Codepoints! It's an incredible value but it's true! Upgrade today... except out of ShiftOS!" }, { Name: "Panel Notifications", Cost: 150, Description: "It's good to know what time it is, but how about knowing how many notifications you have? After all, notifications are a great way to tell what's going on! This upgrade adds a button that displays how many notifications you have. If you click it, you will open the Notifications app!", + Category: "GUI", Dependencies: "desktop_clock_widget" }, { Name: "Audio Volume", Cost: 80, + Category: "Kernel & System", Description: "Want to adjust the volume of ShiftOS's audio? This upgrade will let you." }, @@ -130,12 +150,14 @@ Name: "ShiftLotto", Cost: 200, Dependencies: null, + Category: "Applications", Description: "Are you feeling lucky? Spend some money on this upgrade! If you have any left, go ahead and bet your money in ShiftLotto!" }, { Name: "AL ShiftLotto", Cost: 150, Dependencies: "app_launcher;shiftlotto", + Category: "GUI", Description: "This upgrade allows you to find ShiftLotto in your App Launcher." }, @@ -144,358 +166,418 @@ { Name: "Color Depth Dithering", Cost: 1000, + Category: "Device Drivers", Description: "Right now, if you try to display images on the screen, with a low color depth like we have, the image will be totally unrecognizable! With this upgrade, we can adapt a simple 1-dimensional dithering algorithm into the video driver to hopefully smooth out the transition between colors.", }, { Name: "Color Depth Floyd-Steinberg Dithering", Cost: 2000, Description: "So your images look... alright... with the new dithering algorithm, but let's take things even further and get rid of the jagged lines in the image using a 2-dimensional algorithm called the Floyd-Steinberg algorithm. It'll sure make things look better.", + Category: "Device Drivers", Dependencies: "color_depth_dithering" }, { Name: "Color Depth 2 bits", Cost: 2000, + Category: "Device Drivers", Description: "We can only display black and white - 0 or 1 in binary. Let's take it even further by adding an extra bit to our binary notation - making black, white, dark gray and light gray possible!", }, { Name: "Color Depth 4 bits", Cost: 4000, Description: "4 colors is nice - but let's take it even further. With our dithering algorithm in place, let's make our images even smoother by giving a 16-color palette to the video driver!", + Category: "Device Drivers", Dependencies: "color_depth_2_bits;color_depth_dithering" }, { Name: "Color Depth 6 bits", Cost: 6000, Description: "Let's extend our color range into the depths of 6 bits! This'll make up to 64 different shades of gray possible! We're getting even closer to modern-day color...", + Category: "Device Drivers", Dependencies: "color_depth_4_bits" }, { Name: "Color Depth 8 bits", Cost: 8000, Description: "What do you get when you bite your food? You get perhaps a yummy taste. What do you get when you take a byte of memory? 256 shades of gray, of course!", + Category: "Device Drivers", Dependencies: "color_depth_6_bits" }, { Name: "Color Depth 16 bits", Cost: 16000, Description: "If we were just given another byte... we could divide the two up into three channels and allow mixing and matching of the channels to create colors other than gray! Let's do it.", + Category: "Device Drivers", Dependencies: "color_depth_8_bits" }, { Name: "Color Depth 24 Bits", Cost: 24000, Description: "Having actual color is nice for our images as we can truly see detail in our images - but if we had a third byte, each channel could have up to 256 values - adding up to almost 17 million different colors! Our eyes can't even distinguish that many.", + Category: "Device Drivers", Dependencies: "color_depth_16_bits" }, { Name: "AL MUD Control Centre", Cost: 150, Dependencies: "mud_fundamentals;app_launcher", + Category: "Device Drivers", Description: "Want to access your MUD profile, legions, jobs and shops, but don't want to open your Terminal? This upgrade is for you!" }, { Name: "Kernel Coherence", Cost: 10000, Dependencies: "wm_free_placement", + Category: "Device Drivers", Description: "With the free placement upgrade, you can place windows of any size anywhere on the desktop, which means theoretically you could add kernel coherence between ShiftOS and another GUI-based operating system and run their applications inside ShiftOS. This upgrade unlocks that.", }, { Name: "Pong Increased Paddle Size", Cost: 1000, Dependencies: "pong_upgrade", + Category: "Enhancements", Description: "Having trouble keeping that darn ball in front of you? Well, with this upgrade, your paddle increases in height.... slightly.", }, { Name: "WM 4 Windows", Cost: 150, Description: "Display up to 4 simultaneous windows on-screen in a 2x2 grid.", + Category: "Enhancements", Dependencies: "window_manager" }, { Name: "Virus Scanner", Cost: 2000, Description: "Being inside the multi-user domain comes with many risks, one of which being viruses. The Virus Scanner can mitigate this threat by allowing you to scan the files on your system for any viruses and delete them for you.", + Category: "Applications", Dependencies: "mud_fundamentals;file_skimmer" }, { Name: "AL Virus Scanner", Cost: 150, Description: "Add an App Launcher entry for the Virus Scanner.", + Category: "GUI", Dependencies: "virus_scanner;app_launcher" }, { Name: "WM Panel Buttons", Cost: 200, Description: "Sometimes it's useful to have a list of windows that are open on your system so you can easily switch between them.", + Category: "GUI", Dependencies: "desktop;wm_unlimited_windows" }, { Name: "AL Skin Loader", Cost: 150, Description: "Buy this upgrade to add an entry for the Skin Loader to the App Launcher.", + Category: "GUI", Dependencies: "app_launcher;skinning" }, { Name: "Shift Panel Buttons", Cost: 150, Description: "Want to customize your panel buttons? This Shifter category is for you!", + Category: "Customization", Dependencies: "wm_panel_buttons" }, { Name: "TextPad Lua Support", Cost: 450, Description: "Use TextPad to write Lua scripts!", + Category: "Enhancements", Dependencies: "textpad;file_skimmer", }, { Name: "App Launcher", Cost: 7500, Description: "It may be expensive, but having an easy-access menu to all your apps is very valuable.", + Category: "GUI", Dependencies:"desktop;wm_unlimited_windows" }, - { - Name: "AL MUD Cracker", - Cost: 150, - Description: "Add a launcher item for the MUD cracker.", - Dependencies: "mud_cracker;app_launcher" - }, { Name: "Format Editor", Cost: 6000, Description: "Allows you to change the format of commands.", + Category: "Applications", Dependencies: "shifter;name_changer" }, { Name: "Format Editor Optional Text", Cost: 150, Description: "Allows you to add an optional text to commands", + Category: "Enhancements", Dependencies: "format_editor" }, { Name: "Format Editor Regex", Cost: 150, Description: "Allows you to customize your commands with regexes.", + Category: "Enhancements", Dependencies: "format_editor_optional_text" }, { Name: "Format Editor Syntax Highligting", Cost: 150, Description: "Allows you to give color to commands as the user types them.", + Category: "Enhancements", Dependencies: "format_editor_regex" }, { Name: "AL Format Editor", Cost: 150, Description: "Add a launcher item for the Format Editor.", + Category: "GUI", Dependencies: "format_editor;app_launcher" }, { Name: "Textpad", Cost: 2500, Description: "\"Write, save and open a text document.\"", + Category: "Applications", Dependencies: "file_skimmer" }, { Name: "Shifter", Cost: 10000, Description: "Tired of the green and black look that is ShiftOS's default skin? Use the Shifter to shift it your way.", + Category: "Applications", Dependencies: "desktop;wm_unlimited_windows", }, { Name: "Name Changer", Cost: 5000, Description: "Are you not a linux person and want the terminal to be called Command Prompt? Well this app is for you!", + Category: "Applications", Dependencies: "shifter", }, { Name: "AL Name Changer", Cost: 150, Description: "Launch the Name Changer from the app launcher.", + Category: "GUI", Dependencies: "name_changer", }, { Name: "AL Shifter", Cost: 150, Description: "Launch the Shifter from the app launcher.", + Category: "GUI", Dependencies: "app_launcher;shifter" }, { Name: "AL Pong", Cost: 150, Description: "Launch Pong from the app launcher.", + Category: "GUI", Dependencies: "app_launcher" }, { Name: "AL Textpad", Cost: 150, Description: "Write, save and open text documents from the App Launcher.", + Category: "GUI", Dependencies:"app_launcher;textpad" }, { Name: "AL File Skimmer", Cost: 150, Description: "Open the File Skimmer from your App Launcher.", + Category: "GUI", Dependencies:"app_launcher;file_skimmer" }, { Name: "WM Free Placement", Cost: 2000, Description: "Disable the grid system and allow windows to be freely positioned, moved, and overlapped.", + Category: "Enhancements", Dependencies: "wm_4_windows" }, { Name: "Desktop", Cost: 9000, Description: "Use a fully customizable desktop in place of the terminal to control ShiftOS.", + Category: "GUI", Dependencies: "window_manager" }, { Name: "App Icons", Cost: 400, Description: "So you have a titlebar, well, let's add an icon to it to hopefully make it easier to tell which app is which.", + Category: "GUI", Dependencies: "wm_titlebar;skinning" }, { Name: "Close command", Cost: 150, Description: "Add a win.close script to allow you to close windows.", + Category: "Kernel & System", Dependencies: "mud_fundamentals", }, { Name: "WM Unlimited Windows", Cost: 5000, Description: "Break the limit of windows that can be run. Perfect for high-maintenance tasks.", + Category: "Enhancements", Dependencies: "wm_free_placement;close_command" }, { Name: "Minimize Command", Cost: 1250, Description: "Use the win.mini{id} command to minimize/restore windows.", + Category: "Kernel & System", Dependencies: "useful_panel_buttons" }, { Name: "Useful Panel Buttons", Cost: 250, Description: "Minimize and restore windows by clicking their Panel Button!", + Category: "Enhancements", Dependencies: "desktop;wm_panel_buttons" }, { Name: "Maximize Command", Cost: 1250, Description: "Use the win.max{id} command to maximize windows.", + Category: "Kernel & System", Dependencies: "wm_titlebar;desktop;wm_free_placement" }, { Name: "Close Button", Cost: 1000, Description: "Add a close button to the titlebar to easily close applications.", + Category: "GUI", Dependencies: "wm_titlebar;close_command" }, { Name: "Minimize Button", Cost: 1000, Description: "Minimize windows using a button on the titlebar", + Category: "GUI", Dependencies: "wm_titlebar;minimize_command" }, { Name: "Shiftorium Bulk Buy", Cost: 2000, + Category: "Enhancements", Description:"Tired of typing shiftorium.buy{} all the time? This upgrade will add a bulk buy command which allows you to specify a comma-separated list of upgrades to buy." }, + { + Name: "Shiftorium GUI Bulk Buy", + Cost: 3000, + Category: "GUI", + Description: "Tired of the repetition of selecting an upgrade and hitting \"Buy\" a hundred times when binging? Using the bulkbuy command, we can make the Shiftorium GUI allow you to buy in bulk!", + Dependencies: "shiftorium_gui;shiftorium_bulk_buy" + }, { Name: "File Skimmer", Cost: 500, Description: "View the files on your computer using File Skimmer.", + Category: "Applications", Dependencies: null }, { Name: "Maximize Button", Cost: 500, Description: "Maximize windows using a button on the titlebar", + Category: "GUI", Dependencies: "wm_titlebar;maximize_command" }, { Name: "Clock", Cost: 100, Description: "Adds a script that shows the amount of seconds that have passed since Midnight. Use 'sys.clock' to activate it.", + Category: "Applications", Dependencies: "mud_fundamentals" }, { Name: "WM Titlebar", Cost: 250, Description: "Display a title on each window.", + Category: "GUI", Dependencies: "window_manager" }, { Name: "Clock Minutes", Cost: 250, Description: "Upgrade the sys.clock command to show minutes since midnight with a {type:\"m\"} argument.", + Category: "Enhancements", Dependencies: "clock" }, { Name: "Clock Hours", Cost: 225, Description: "Upgrade the sys.clock command to show hours since midnight with a {type:\"h\"} argument.", + Category: "Enhancements", Dependencies: "clock_minutes" }, { Name: "Clock AM and PM", Cost: 75, Description: "Change the clock to be 12-hour based, showing whether the current time is ante-meridiem or post-meridiem.", + Category: "Enhancements", Dependencies: "clock_hours", }, { Name: "Full Precision Time", Cost: 500, Description: "Show full-precision time by default when using sys.clock.", + Category: "Enhancements", Dependencies: "clock_am_and_pm" }, { Name: "Desktop Clock Widget", Cost: 1000, Description: "Add a widget to the desktop which shows the results of sys.clock as text on the desktop.", + Category: "GUI", Dependencies: "clock;desktop" }, { Name: "App Launcher Categories", Cost: 1000, Dependencies: "app_launcher", + Category: "Enhancements", Description: "Is your App Launcher getting full of items? Perhaps a little too full? Are you having trouble finding things? This upgrade should help - it'll sort all App Launcher items into categories for you." }, { Name: "Draggable windows", Cost: 400, Description: "Allows you to drag windows around with the mouse using the title bar.", + Category: "Enhancements", Dependencies: "wm_titlebar;wm_free_placement" }, { Name: "Window Manager", Cost: 100, Description: "Allows you to run two windows simultaneously within ShiftOS.", + Category: "Kernel & System", Dependencies: "mud_fundamentals" }, { Name: "Pong Upgrade", Cost: 4000, Description: "This upgrade makes pong double the codepoints you get from it so you can spend less time grinding!", + Category: "Enhancements", Dependencies: "mud_fundamentals;window_manager" }, { Name: "Pong Upgrade 2", Cost: 8000, Description: "So you lost in pong, it must be sad to lose all the codepoints you've gained. With this upgrade you can save 1 percent of the loss, so at least you get something for losing!", + Category: "Enhancements", Dependencies: "mud_fundamentals;window_manager;pong_upgrade" }, { Name: "Audio Player", Cost: 10000, Description: "Want to listen to the greatest tunes? Well get this app asap!", + Category: "Applications", Dependencies: "desktop;wm_free_placement" }, { Name: "Audio Player AL", Cost: 150, Description: "Just another app launcher, making it easier to listen to your favorite songs!", + Category: "GUI", Dependencies: "desktop;wm_free_placement;audio_player" }, @@ -505,42 +587,49 @@ Name: "Shift Titlebar", Cost: 200, Description: "Customize the Titlebar within the Shifter.", + Category: "Customization", Dependencies: "shifter;wm_titlebar" }, { Name: "Shift Title Text", Cost: 200, Description: "Title text looking boring? This upgrade lets you customize the font, color, and position of the Title Text.", + Category: "Customization", Dependencies: "shift_titlebar" }, { Name: "Shift Window Borders", Cost: 200, Description: "Want to customize the look of the ShiftOS window borders? Buy this upgrade and you can customize the color and thickness of the borders.", + Category: "Customization", Dependencies: "shifter" }, { Name: "Shift Desktop Panel", Cost: 200, Description: "Not liking your desktop panel the way it is? Buy this upgrade to allow you to change the color, height, and position of the desktop panel.", + Category: "Customization", Dependencies: "shifter;desktop" }, { Name: "Shift App Launcher", Cost: 200, Description: "You've made your desktop panel look very nice, but your app launcher looks kinda out of place. This upgrade will fix that, allowing you to change the position, size, and appearance of the app launcher button.", + Category: "Customization", Dependencies: "shift_desktop_panel;app_launcher" }, { Name: "Shift Panel Clock", Cost: 200, Dependencies: "shift_desktop_panel;desktop_clock_widget", + Category: "Customization", Description: "That clock is very simple - let's shift it! This upgrade allows you to customize the font and color of the panel clock." }, { Name: "Shift Title Buttons", Cost: 200, Dependencies: "close_button;minimize_button;maximize_button;shift_titlebar", + Category: "Customization", Description: "Those title buttons look very similar and primitive - with this upgrade you can change the size, position, and color of each button." }, @@ -550,6 +639,7 @@ Name: "Skinning", Cost: 10000, Description: "It may be expensive, but with this upgrade, you can break the limitations of using just solid colors and gradients for your skin and start using images!", + Category: "Customization", Dependencies: "shifter" }, @@ -558,12 +648,14 @@ { Name: "Artpad", Cost: 7500, + Category: "Applications", Description: "ArtPad is a very extensible tool that allows you to draw images within ShiftOS. Buy this upgrade to gain access to it through win.open{}!" }, { Name: "AL Artpad", Cost: 150, Description: "Add an App Launcher Entry for Artpad!", + Category: "GUI", Dependencies: "artpad;app_launcher" }, @@ -576,60 +668,70 @@ Name: "Artpad Pixel Limit 4", Cost: 100, Dependencies: "artpad", + Category: "Enhancements", Description: "Having ArtPad is great, but there's not much you can draw with only 2 pixels. Buy this upgrade to increase the breathing room your imagination can have." }, { Name: "Artpad Pixel Limit 8", Cost: 150, Dependencies: "artpad_pixel_limit_4", + Category: "Enhancements", Description: "With a 4 pixel limit, you can do some simple patterns and such, but it's still not great. Buy this upgrade to double the pixel limit and add even more possibilities!" }, { Name: "Artpad Pixel Limit 16", Cost: 200, Dependencies:"artpad_pixel_limit_8", + Category: "Enhancements", Description: "Now we can have 8-pixel images, but we still can't do much more than simple patterns and icons. Use this upgrade to double the max image size yet again and allow even more images!" }, { Name: "Artpad Pixel Limit 64", Cost: 600, Dependencies: "artpad_pixel_limit_16", + Category: "Enhancements", Description: "Alright. Now it's time to kick it into high-gear. Patterns and icons are fun, but let's increase the image size even more to allow higher-detail icons/patterns and small sprites!" }, { Name: "Artpad Pixel Limit 256", Cost: 1000, Dependencies: "artpad_pixel_limit_64", + Category: "Enhancements", Description: "We can create high resolution icons and patterns, but we still can't really do too much more than that. Buy this upgrade and you'll be able to have up to 256 pixels in an image!" }, { Name: "Artpad Pixel Limit 1024", Cost: 1250, Dependencies: "artpad_pixel_limit_256", + Category: "Enhancements", Description: "Let's make things even higher quality! With this upgrade, we'll be able to increase the image size by 4 times! ArtPad is really starting to advance." }, { Name: "Artpad Pixel Limit 4096", Cost: 2600, Dependencies: "artpad_pixel_limit_1024", + Category: "Enhancements", Description: "Now we can do 1024-pixel images, but how about increasing the limit by 4 times yet again? That'll leave even more room for imagination and drawings!" }, { Name: "Artpad Pixel Limit 16384", Cost: 4800, Dependencies: "artpad_pixel_limit_4096", + Category: "Enhancements", Description: "We're ever-so-slightly approaching limitless possibilities. With this upgrade, images in ArtPad will be able to have up to 16384 pixels. We can make desktop backgrounds for small monitors!" }, { Name: "Artpad Pixel Limit 65536", Cost: 7000, Dependencies: "artpad_pixel_limit_16384", + Category: "Enhancements", Description: "Wow! This might be the last time we'll have to deal with pixel limits. It's amazing how far we've came since 2-pixel gradients. Now let's go even further." }, { Name: "Artpad Limitless Pixels", Cost: 12000, Dependencies: "artpad_pixel_limit_65536", + Category: "Enhancements", Description: "We have a pretty high pixel limit, but with this upgrade, pixel limits are no more! With limitless pixels comes limitless creativity. Have fun!" }, @@ -637,6 +739,7 @@ Name: "AL Shutdown", Cost: 300, Dependencies: "app_launcher", + Category: "GUI", Description: "Want to shut down ShiftOS from your app launcher? This is the perfect upgrade for you." }, @@ -645,12 +748,14 @@ Id: "help_description", Cost: 150, Dependencies: "", + Category: "Enhancements", Description: "Dont understand what some commands do in the terminal? With this upgrade, it adds a handy little description to almost every command when you run the command sos.help!" }, { Name: "Help Usage", Cost: 150, Dependencies: "help_description", + Category: "Enhancements", Description: "You got descriptions on what some commands do in the terminal, but wouldn't it be handy to also see what the proper usage is for? Now you can with this upgrade!" }, @@ -659,65 +764,76 @@ Name: "Artpad Pixel Placer", Dependencies: "artpad", Cost: 750, + Category: "Enhancements", Description: "This tool extends the Pixel Setter to allow you to use your mouse to place pixels by clicking on the canvas." }, { Name: "Artpad PP Movement Mode", Dependencies: "artpad_pixel_placer", Cost: 500, + Category: "Enhancements", Description: "This tool extends the Pixel Placer and allows you to drag your mouse while the button is held down to draw pixels on the canvas." }, { Name: "Artpad Pencil", Dependencies: "artpad_pp_movement_mode", Cost: 1000, + Category: "Enhancements", Description: "Using the power of the Pixel Placer's movement mode, the Pencil can draw strokes of different thicknesses. Most tools will extend this tool." }, { Name: "Artpad Paintbrush", Cost: 1000, Dependencies: "artpad_pencil", + Category: "Enhancements", Description: "The Paintbrush allows you to draw more thick strokes on the canvas than the Pencil does." }, { Name: "Artpad Eraser", Cost: 500, Dependencies: "artpad_paintbrush;artpad_undo", + Category: "Enhancements", Description: "Undo not effective? Want to only erase a select bit of the canvas? Use this tool to get an eraser!" }, { Name: "Artpad Load", Cost: 350, Dependencies: "artpad;file_skimmer", + Category: "Enhancements", Description: "Want to start off from an existing masterpiece? This tool is for you. Select any .pic file and it'll be loaded onto the canvas!" }, { Name: "Artpad Line Tool", Cost: 800, Dependencies: "artpad_pp_movement_mode", + Category: "Enhancements", Description: "Using the power of linear interpolation and the Pixel Placer Movement Mode, the Line tool can help you draw straight lines from one point to another." }, { Name: "Artpad Rectangle Tool", Cost: 400, Dependencies: "artpad_line_tool", + Category: "Enhancements", Description: "With the line tool we are able to figure out the distance from point A to point B. Let's use that basic framework to draw rectangles!" }, { Name: "Artpad Oval Tool", Cost: 401, Dependencies: "artpad_line_tool", + Category: "Enhancements", Description: "Want to draw some ovals? With this tool, you can! It uses the data from the line tool to construct a circle as you drag the mouse." }, { Name: "Artpad Fill Tool", Cost: 1000, Dependencies: "artpad_pixel_placer", + Category: "Enhancements", Description: "The Pixel Placer is useful because we can grab pixel coordinates from the mouse, and determine how we can fill the area with a certain color - let's do that!" }, { Name: "Artpad Text Tool", Cost: 1500, + Category: "Enhancements", Dependencies: "artpad_pixel_placer", Description: "Want to place text on your canvas? Use the Text Tool to do so!" }, @@ -725,30 +841,35 @@ Name: "Artpad New", Dependencies: "artpad", Cost: 500, + Category: "Enhancements", Description: "Made a mistake? Want a blank canvas? This tool gives you just that." }, { Name: "Artpad Open", Dependencies: "artpad;file_skimmer", Cost: 600, + Category: "Enhancements", Description: "Want to edit an artpad picture? If you have the File Skimmer, then this tool is for you!" }, { Name: "Artpad Save", Dependencies: "artpad;file_skimmer", Cost: 1000, + Category: "Enhancements", Description: "Have you been working extra-hard on a masterpiece in ArtPad and want to save? This upgrade is a must-have!" }, { Name: "Artpad Undo", Dependencies: "artpad_new", Cost: 59, + Category: "Enhancements", Description: "Mistakes happen - but if you have to clear the canvas every time you mess up one single pixel it can get annoying. This tool will help mitigate that - you'll be able to make your last change magically disappear!" }, { Name: "Artpad Redo", Dependencies: "artpad_undo", Cost: 50, + Category: "Enhancements", Description: "Did you change your mind about that mistake you've undone? Want it back? This tool is for you. Note that the second you add something new after an undo, the undone change is wiped forever!" }, @@ -760,36 +881,42 @@ Name: "Artpad 4 Color Palettes", Dependencies: "artpad", Cost: 150, + Category: "Enhancements", Description: "Want to add an extra 2 colors to your palette? Buy this upgrade to do so!" }, { Name: "Artpad 8 Color Palettes", Dependencies: "artpad_4_color_palettes", Cost: 400, + Category: "Enhancements", Description: "Want to add an extra 4 color palette entries to your Artpad to have even more colors used at once? Buy this upgrade, and that will happen!" }, { Name: "Artpad 16 Color Palettes", Dependencies: "artpad_8_color_palettes", Cost: 600, + Category: "Enhancements", Description: "With this upgrade, you can have up to 16 different colors in your ArtPad palette. Good for drawing intense scenes without constantly selecting different colors." }, { Name: "Artpad 32 Color Palettes", Dependencies: "artpad_16_color_palettes", Cost: 850, + Category: "Enhancements", Description: "Having 16 different color palettes is nice, but you know what's nicer? Having 32!" }, { Name: "Artpad 64 Color Palettes", Dependencies: "artpad_32_color_palettes", Cost: 1700, + Category: "Enhancements", Description: "Well then. We have 32 color palettes - let's double that." }, { Name: "Artpad 128 Color Palettes", Dependencies: "artpad_128_color_palettes", Cost: 3400, + Category: "Enhancements", Description: "With this upgrade we'll be able to have 128 simultaneous colors in our palette. It may get a bit glitchy though... maybe a window manager upgrade could help?" }, @@ -800,18 +927,21 @@ { Name: "Shiftorium GUI", Cost: 100, + Category: "Applications", Description: "You may spend lots of time in your terminal - executing scripts, chatting, etc, but why make it so difficult and repetitive to upgrade your system? With this upgrade, a GUI will be added to the Shiftorium, and will be accessible using win.open{app:\"shiftorium\"}." }, { Name: "AL Shiftorium", Cost: 150, Dependencies: "shiftorium_gui;app_launcher", + Category: "GUI", Description: "Add an App Launcher Entry for the Shiftorium!" }, { Name: "Shiftorium GUI Codepoints Display", Cost: 2500, Dependencies: "shiftorium_gui", + Category: "Enhancements", Description: "In the shiftorium GUI but dont know what you can spend because you can't see how many code points are on hand? Well shop easy, because with this upgrade that is now possible! You have to restart the shiftorium for it to work." }, @@ -821,24 +951,28 @@ Name: "ShiftSweeper", Cost: 800, Dependencies: "shiftletters", + Category: "Applications", Description: "Getting bored with Pong and ShiftLetters? Try this BRAND NEW game called ShiftSweeper!" }, { Name: "AL ShiftSweeper", Cost: 100, Dependencies: "app_launcher;shiftsweeper", + Category: "GUI", Description: "Play ShiftSweeper quickly with this dandy applauncher!" }, { Name: "ShiftSweeper Medium", Cost: 900, Dependencies: "shiftsweeper", + Category: "Enhancements", Description: "ShiftSweeper getting too easy? Obviously, since you can only play Easy difficulty! However, with this Medium button, you can get a better challenge, and more codepoints!" }, { Name: "ShiftSweeper Hard", Cost: 900, Dependencies: "shiftsweeper_medium", + Category: "Enhancements", Description: "Is ShiftSweeper still too easy for you? Buy the Hard difficulty and you can try to find 99 mines! It may be extremely difficult, but the reward is massive!" } ] \ No newline at end of file diff --git a/ShiftOS_TheReturn/Commands.cs b/ShiftOS_TheReturn/Commands.cs index 73a7e2d..9f85a25 100644 --- a/ShiftOS_TheReturn/Commands.cs +++ b/ShiftOS_TheReturn/Commands.cs @@ -535,7 +535,7 @@ Upgrades: {SaveSystem.CurrentSave.CountUpgrades()} installed, { Console.WriteLine($@"Information for {upgrade}: -{upg.Name} - {upg.Cost} Codepoints +{upg.Category}: {upg.Name} - {upg.Cost} Codepoints ------------------------------------------------------ {upg.Description} @@ -553,15 +553,66 @@ shiftorium.buy{{upgrade:""{upg.ID}""}}"); return false; } } + + [Command("categories")] + public static bool ListCategories() + { + foreach(var cat in Shiftorium.GetCategories()) + { + Console.WriteLine($"{cat} - {Shiftorium.GetAvailable().Where(x=>x.Category==cat).Count()} upgrades"); + } + return true; + } + [Command("list")] - public static bool ListAll() + public static bool ListAll(Dictionary args) { try { + bool showOnlyInCategory = false; + + string cat = "Other"; + + if (args.ContainsKey("cat")) + { + showOnlyInCategory = true; + cat = args["cat"].ToString(); + } + Dictionary upgrades = new Dictionary(); int maxLength = 5; - foreach (var upg in Shiftorium.GetAvailable()) + IEnumerable upglist = Shiftorium.GetAvailable(); + if (showOnlyInCategory) + { + if (Shiftorium.IsCategoryEmptied(cat)) + { + ConsoleEx.Bold = true; + ConsoleEx.ForegroundColor = ConsoleColor.Red; + Console.WriteLine("Shiftorium Query Error"); + Console.WriteLine(); + ConsoleEx.Bold = false; + ConsoleEx.ForegroundColor = ConsoleColor.Gray; + Console.WriteLine("Either there are no upgrades in the category \"" + cat + "\" or the category was not found."); + return true; + } + upglist = Shiftorium.GetAvailable().Where(x => x.Category == cat); + } + + + if(upglist.Count() == 0) + { + ConsoleEx.Bold = true; + ConsoleEx.ForegroundColor = ConsoleColor.Red; + Console.WriteLine("No upgrades available!"); + Console.WriteLine(); + ConsoleEx.Bold = false; + ConsoleEx.ForegroundColor = ConsoleColor.Gray; + Console.WriteLine("You have installed all available upgrades for your system. Please check back later for more."); + return true; + + } + foreach (var upg in upglist) { if (upg.ID.Length > maxLength) { diff --git a/ShiftOS_TheReturn/Shiftorium.cs b/ShiftOS_TheReturn/Shiftorium.cs index 4556cd6..43ea13a 100644 --- a/ShiftOS_TheReturn/Shiftorium.cs +++ b/ShiftOS_TheReturn/Shiftorium.cs @@ -41,6 +41,27 @@ namespace ShiftOS.Engine /// public static bool Silent = false; + /// + /// Gets all Shiftorium categories. + /// + /// Should we look in the "available" upgrade list (i.e, what the user can buy right now), or the full upgrade list? + /// All Shiftorium categories from the list, in a . + public static string[] GetCategories(bool onlyAvailable = true) + { + List cats = new List(); + IEnumerable < ShiftoriumUpgrade > upgrades = GetDefaults(); + if (onlyAvailable) + upgrades = new List(GetAvailable()); + + foreach(var upg in upgrades) + { + if (!cats.Contains(upg.Category)) + cats.Add(upg.Category); + } + + return cats.ToArray(); + } + public static void InvokeUpgradeInstalled() { Installed?.Invoke(); @@ -289,6 +310,8 @@ namespace ShiftOS.Engine public string ID { get; private set; } } + + public class ShiftoriumUpgrade { public string Name { get; set; } -- cgit v1.2.3 From 3e56dfce88257d6d52e9a59acdb75a6404c0ace1 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 3 Apr 2017 19:46:22 -0400 Subject: Allow bulk buying in Shiftorium GUI. --- .../Applications/ShiftoriumFrontend.Designer.cs | 2 -- .../Applications/ShiftoriumFrontend.cs | 24 ++++++++++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) (limited to 'ShiftOS.WinForms') diff --git a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs index 36943be..80e1812 100644 --- a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs +++ b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs @@ -180,8 +180,6 @@ namespace ShiftOS.WinForms.Applications this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(137, 13); this.label3.TabIndex = 2; - int upgradepercent = (pgupgradeprogress.Value / 100) * 100; - this.label3.Text = upgradepercent.ToString(); // // pgupgradeprogress // diff --git a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs index d2390ff..e1e3357 100644 --- a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs +++ b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs @@ -153,9 +153,28 @@ namespace ShiftOS.WinForms.Applications private void btnbuy_Click(object sender, EventArgs e) { + long cpCost = 0; backend.Silent = true; - backend.Buy(upgrades[lbupgrades.SelectedItem.ToString()].ID, upgrades[lbupgrades.SelectedItem.ToString()].Cost); - backend.Silent = false; + Dictionary UpgradesToBuy = new Dictionary(); + foreach (var itm in lbupgrades.SelectedItems) + { + cpCost += upgrades[itm.ToString()].Cost; + UpgradesToBuy.Add(upgrades[itm.ToString()].ID, upgrades[itm.ToString()].Cost); + } + if (SaveSystem.CurrentSave.Codepoints < cpCost) + { + Infobox.Show("Insufficient Codepoints", $"You do not have enough Codepoints to perform this action. You need {cpCost - SaveSystem.CurrentSave.Codepoints} more."); + + } + else + { + foreach(var upg in UpgradesToBuy) + { + backend.Buy(upg.Key, upg.Value); + } + } + + backend.Silent = false; PopulateShiftorium(); btnbuy.Hide(); } @@ -185,6 +204,7 @@ namespace ShiftOS.WinForms.Applications public void OnUpgrade() { + lbupgrades.SelectionMode = (UpgradeInstalled("shiftorium_gui_bulk_buy") == true) ? SelectionMode.MultiExtended : SelectionMode.One; lbcodepoints.Visible = Shiftorium.UpgradeInstalled("shiftorium_gui_codepoints_display"); } -- cgit v1.2.3 From 47561a09ea4660747c402d10094eac5a9f419b00 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 3 Apr 2017 20:14:03 -0400 Subject: Categorize Shiftorium GUI --- .../Applications/ShiftoriumFrontend.Designer.cs | 121 ++++++++++++++++----- .../Applications/ShiftoriumFrontend.cs | 67 ++++++++++-- 2 files changed, 154 insertions(+), 34 deletions(-) (limited to 'ShiftOS.WinForms') diff --git a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs index 80e1812..32d508b 100644 --- a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs +++ b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs @@ -56,20 +56,26 @@ namespace ShiftOS.WinForms.Applications { this.panel1 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel(); - this.lbcodepoints = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); this.lbupgradedesc = new System.Windows.Forms.Label(); this.pnlupgradeactions = new System.Windows.Forms.Panel(); this.btnbuy = new System.Windows.Forms.Button(); this.lbupgradetitle = new System.Windows.Forms.Label(); this.pnllist = new System.Windows.Forms.Panel(); + this.lbcodepoints = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.pgupgradeprogress = new ShiftOS.WinForms.Controls.ShiftedProgressBar(); this.lbupgrades = new System.Windows.Forms.ListBox(); + this.label3 = new System.Windows.Forms.Label(); + this.panel3 = new System.Windows.Forms.Panel(); + this.btncat_back = new System.Windows.Forms.Button(); + this.btncat_forward = new System.Windows.Forms.Button(); + this.lblcategorytext = new System.Windows.Forms.Label(); + this.lbnoupgrades = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.panel2.SuspendLayout(); this.pnlupgradeactions.SuspendLayout(); this.pnllist.SuspendLayout(); + this.panel3.SuspendLayout(); this.SuspendLayout(); // // panel1 @@ -93,17 +99,6 @@ namespace ShiftOS.WinForms.Applications this.panel2.Size = new System.Drawing.Size(376, 427); this.panel2.TabIndex = 1; // - // lbcodepoints - // - this.lbcodepoints.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.lbcodepoints.AutoSize = true; - this.lbcodepoints.Location = new System.Drawing.Point(128, 357); - this.lbcodepoints.Name = "lbcodepoints"; - this.lbcodepoints.Size = new System.Drawing.Size(135, 13); - this.lbcodepoints.TabIndex = 3; - this.lbcodepoints.Text = "You have: %cp Codepoints"; - this.lbcodepoints.Click += new System.EventHandler(this.lbcodepoints_Click); - // // lbupgradedesc // this.lbupgradedesc.Dock = System.Windows.Forms.DockStyle.Fill; @@ -152,6 +147,8 @@ namespace ShiftOS.WinForms.Applications // // pnllist // + this.pnllist.Controls.Add(this.lbnoupgrades); + this.pnllist.Controls.Add(this.panel3); this.pnllist.Controls.Add(this.lbcodepoints); this.pnllist.Controls.Add(this.label1); this.pnllist.Controls.Add(this.pgupgradeprogress); @@ -162,6 +159,17 @@ namespace ShiftOS.WinForms.Applications this.pnllist.Size = new System.Drawing.Size(406, 427); this.pnllist.TabIndex = 0; // + // lbcodepoints + // + this.lbcodepoints.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.lbcodepoints.AutoSize = true; + this.lbcodepoints.Location = new System.Drawing.Point(128, 357); + this.lbcodepoints.Name = "lbcodepoints"; + this.lbcodepoints.Size = new System.Drawing.Size(135, 13); + this.lbcodepoints.TabIndex = 3; + this.lbcodepoints.Text = "You have: %cp Codepoints"; + this.lbcodepoints.Click += new System.EventHandler(this.lbcodepoints_Click); + // // label1 // this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); @@ -172,15 +180,6 @@ namespace ShiftOS.WinForms.Applications this.label1.TabIndex = 2; this.label1.Text = "{UPGRADE_PROGRESS}:"; // - // label3 - // - this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(3, 399); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(137, 13); - this.label3.TabIndex = 2; - // // pgupgradeprogress // this.pgupgradeprogress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) @@ -201,12 +200,78 @@ namespace ShiftOS.WinForms.Applications | System.Windows.Forms.AnchorStyles.Right))); this.lbupgrades.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; this.lbupgrades.FormattingEnabled = true; - this.lbupgrades.Location = new System.Drawing.Point(3, 66); + this.lbupgrades.Location = new System.Drawing.Point(3, 105); this.lbupgrades.Name = "lbupgrades"; - this.lbupgrades.Size = new System.Drawing.Size(397, 277); + this.lbupgrades.Size = new System.Drawing.Size(397, 238); this.lbupgrades.TabIndex = 0; this.lbupgrades.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.lbupgrades_DrawItem); // + // label3 + // + this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(3, 399); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(137, 13); + this.label3.TabIndex = 2; + // + // panel3 + // + this.panel3.Controls.Add(this.lblcategorytext); + this.panel3.Controls.Add(this.btncat_forward); + this.panel3.Controls.Add(this.btncat_back); + this.panel3.Location = new System.Drawing.Point(6, 76); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(394, 23); + this.panel3.TabIndex = 5; + // + // btncat_back + // + this.btncat_back.AutoSize = true; + this.btncat_back.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btncat_back.Dock = System.Windows.Forms.DockStyle.Left; + this.btncat_back.Location = new System.Drawing.Point(0, 0); + this.btncat_back.Name = "btncat_back"; + this.btncat_back.Size = new System.Drawing.Size(29, 23); + this.btncat_back.TabIndex = 0; + this.btncat_back.Text = "<--"; + this.btncat_back.UseVisualStyleBackColor = true; + this.btncat_back.Click += new System.EventHandler(this.btncat_back_Click); + // + // btncat_forward + // + this.btncat_forward.AutoSize = true; + this.btncat_forward.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btncat_forward.Dock = System.Windows.Forms.DockStyle.Right; + this.btncat_forward.Location = new System.Drawing.Point(365, 0); + this.btncat_forward.Name = "btncat_forward"; + this.btncat_forward.Size = new System.Drawing.Size(29, 23); + this.btncat_forward.TabIndex = 1; + this.btncat_forward.Text = "-->"; + this.btncat_forward.UseVisualStyleBackColor = true; + this.btncat_forward.Click += new System.EventHandler(this.btncat_forward_Click); + // + // lblcategorytext + // + this.lblcategorytext.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblcategorytext.Location = new System.Drawing.Point(29, 0); + this.lblcategorytext.Name = "lblcategorytext"; + this.lblcategorytext.Size = new System.Drawing.Size(336, 23); + this.lblcategorytext.TabIndex = 2; + this.lblcategorytext.Text = "label2"; + this.lblcategorytext.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lbnoupgrades + // + this.lbnoupgrades.AutoSize = true; + this.lbnoupgrades.Location = new System.Drawing.Point(69, 183); + this.lbnoupgrades.Name = "lbnoupgrades"; + this.lbnoupgrades.Size = new System.Drawing.Size(71, 13); + this.lbnoupgrades.TabIndex = 6; + this.lbnoupgrades.Tag = "header2"; + this.lbnoupgrades.Text = "No upgrades!"; + this.lbnoupgrades.Visible = false; + // // ShiftoriumFrontend // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -215,7 +280,6 @@ namespace ShiftOS.WinForms.Applications this.Controls.Add(this.panel1); this.ForeColor = System.Drawing.Color.LightGreen; this.Name = "ShiftoriumFrontend"; - this.Text = "{SHIFTORIUM_NAME}"; this.Size = new System.Drawing.Size(782, 427); this.Load += new System.EventHandler(this.Shiftorium_Load); this.panel1.ResumeLayout(false); @@ -224,6 +288,8 @@ namespace ShiftOS.WinForms.Applications this.pnlupgradeactions.PerformLayout(); this.pnllist.ResumeLayout(false); this.pnllist.PerformLayout(); + this.panel3.ResumeLayout(false); + this.panel3.PerformLayout(); this.ResumeLayout(false); } @@ -242,5 +308,10 @@ namespace ShiftOS.WinForms.Applications private System.Windows.Forms.Label label1; private System.Windows.Forms.Label lbcodepoints; private System.Windows.Forms.Label label3; + private System.Windows.Forms.Panel panel3; + private System.Windows.Forms.Label lblcategorytext; + private System.Windows.Forms.Button btncat_forward; + private System.Windows.Forms.Button btncat_back; + private System.Windows.Forms.Label lbnoupgrades; } } \ No newline at end of file diff --git a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs index e1e3357..0762897 100644 --- a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs +++ b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs @@ -45,7 +45,7 @@ namespace ShiftOS.WinForms.Applications [DefaultIcon("iconShiftorium")] public partial class ShiftoriumFrontend : UserControl, IShiftOSWindow { - + public int CategoryId = 0; public static System.Timers.Timer timer100; @@ -90,15 +90,45 @@ namespace ShiftOS.WinForms.Applications public void PopulateShiftorium() { - lbupgrades.Items.Clear(); - upgrades.Clear(); - Timer(); - - foreach (var upg in backend.GetAvailable()) + try + { + lbnoupgrades.Hide(); + lbupgrades.Items.Clear(); + upgrades.Clear(); + Timer(); + + foreach (var upg in backend.GetAvailable().Where(x => x.Category == backend.GetCategories()[CategoryId])) + { + String name = Localization.Parse(upg.Name) + " - " + upg.Cost.ToString() + "CP"; + upgrades.Add(name, upg); + lbupgrades.Items.Add(name); + } + + if (lbupgrades.Items.Count == 0) + { + lbnoupgrades.Show(); + lbnoupgrades.Location = new Point( + (lbupgrades.Width - lbnoupgrades.Width) / 2, + (lbupgrades.Height - lbnoupgrades.Height) / 2 + ); + + } + else + { + lbnoupgrades.Hide(); + } + lblcategorytext.Text = Shiftorium.GetCategories()[CategoryId]; + btncat_back.Visible = (CategoryId > 0); + btncat_forward.Visible = (CategoryId < backend.GetCategories().Length - 1); + } + catch { - String name = Localization.Parse(upg.Name) + " - " + upg.Cost.ToString() + "CP"; - upgrades.Add(name, upg); - lbupgrades.Items.Add(name); + lbnoupgrades.Show(); + lbnoupgrades.Location = new Point( + (lbupgrades.Width - lbnoupgrades.Width) / 2, + (lbupgrades.Height - lbnoupgrades.Height) / 2 + ); + } } @@ -186,6 +216,7 @@ namespace ShiftOS.WinForms.Applications public void OnLoad() { cp_update.Start(); + lbnoupgrades.Hide(); } public void OnSkinLoad() @@ -221,5 +252,23 @@ namespace ShiftOS.WinForms.Applications timer100.AutoReset = true; timer100.Enabled = true; } + + private void btncat_back_Click(object sender, EventArgs e) + { + if(CategoryId > 0) + { + CategoryId--; + PopulateShiftorium(); + } + } + + private void btncat_forward_Click(object sender, EventArgs e) + { + if(CategoryId < backend.GetCategories().Length - 1) + { + CategoryId++; + PopulateShiftorium(); + } + } } } -- cgit v1.2.3 From c8f7cd286327a70280a7db132e45943b44273235 Mon Sep 17 00:00:00 2001 From: lempamo Date: Wed, 5 Apr 2017 20:34:17 -0400 Subject: google translate is a friend for german strings --- ShiftOS.WinForms/Resources/strings_de.txt | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'ShiftOS.WinForms') diff --git a/ShiftOS.WinForms/Resources/strings_de.txt b/ShiftOS.WinForms/Resources/strings_de.txt index 5661c45..5abfd32 100644 --- a/ShiftOS.WinForms/Resources/strings_de.txt +++ b/ShiftOS.WinForms/Resources/strings_de.txt @@ -96,26 +96,26 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{CLIENT_DIAGNOSTICS}":"Client diagnostics", "{GUID}":"GUID", "{CLIENT_DATA}":"Client data", - "{CLOSE}":"Close", + "{CLOSE}":"Schließen", "{LOAD_DEFAULT}":"Load default", - "{IMPORT}":"Import", + "{IMPORT}":"Einführen", "{EXPORT}":"Export", "{APPLY}":"Apply", - "{TEMPLATE}":"Template", + "{TEMPLATE}":"Vorlage", "{H_VEL}":"Horizontal velocity", "{V_VEL}":"Vertical velocity", - "{LEVEL}":"Level", + "{LEVEL}":"Ebene", "{UPGRADE_DEVELOPMENT}":"Development Upgrade", "{UPGRADE_DEVELOPMENT_DESCRIPTION}":"Development Upgrade Don't Buy", - "{SECONDS_LEFT}":"seconds left", + "{SECONDS_LEFT}":"sekunden übrig", "{CASH_OUT_WITH_CODEPOINTS}":"Cash out with your codepoints", "{PONG_PLAY_ON_FOR_MORE}":"Play on for more!", "{YOU_REACHED_LEVEL}":"You've reached level", "{PONG_BEAT_AI_REWARD}":"Reward for beating AI (CP)", "{PONG_BEAT_AI_REWARD_SECONDARY}":"Codepoints for beating AI:", "{CODEPOINTS_FOR_BEATING_LEVEL}":"Codepoints for beating level", - "{YOU_WON}":"You won", - "{YOU_LOSE}":"You lose", + "{YOU_WON}":"Du gewinnst", + "{YOU_LOSE}":"Du verlierst", "{TRY_AGAIN}":"Try again", "{CODEPOINTS_SHORT}":"CP", "{TERMINAL_FORMATTING_DRIVE}":"Formatting drive... %percent %", @@ -138,7 +138,7 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{CREATING_USER}":"Creating user %username", "{SEPERATOR}":" - ", "{NAMESPACE}":"Namespace ", - "{COMMAND}": "| Command ", + "{COMMAND}": "| Befehl ", "{SHIFTOS_HAS_BEEN_INSTALLED}":"ShiftOS has been installed on %domain.", "{WARN}": "WARN: ", "{ERROR}": "!ERROR! ", @@ -154,7 +154,7 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{NAMESPACE_SOS_DESCRIPTION}":"The ShiftOS Namespace", "{COMMAND_HELP_USAGE}":"%ns.%cmd{[topic:]}", - "{COMMAND_HELP_DESCRIPTION}":"Lists all commands", + "{COMMAND_HELP_DESCRIPTION}":"Listet alle Befehle auf", "{COMMAND_SOS_SHUTDOWN_USAGE}":"%ns.%cmd", "{COMMAND_SOS_SHUTDOWN_DESCRIPTION}":"Saves and shuts down ShiftOS", "{COMMAND_SOS_STATUS_USAGE}":"%ns.%cmd", @@ -176,7 +176,7 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{COMMAND_DEV_MULTARG_USAGE}":"%ns.%cmd{id:,name:,type:}", "{COMMAND_DEV_MULTARG_DESCRIPTION}":"A command which requiers multiple arguments", - "{ERR_COMMAND_NOT_FOUND}":"Command not found.", + "{ERR_COMMAND_NOT_FOUND}":"Befehl nicht gefunden.", "{MUD_ERROR}":"MUD error", "{PROLOGUE_NO_USER_DETECTED}":"No user detected. Please enter a username.", @@ -199,20 +199,20 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{SENTIENCE_POSSIBLEHUMAN}":"Sentience: Possible human - user can perform actions based on a choice.", "{SENTIENCE_POSSIBLEHUMANPLUS}":"Sentience: Possible human+ - user can infer, and can pass arguments.", "{SENTIENCE_HUMAN}":"Sentience: Human. Thanks for your patience.", - "{SENTIENCE_INVALIDPASSWORD}":"The password you entered is invalid.", + "{SENTIENCE_INVALIDPASSWORD}":"Das eingegebene Passwort ist ungültig.", "{ARGS_PASSWORD}":"password", "{SHIFTOS_PLUS_MOTTO}":"ShiftOS, Shift it YOUR way.", "{SHIFTOS_VERSION_INFO}":"ShiftOS Version: ", - "{USER_NAME}":"Username", + "{USER_NAME}":"Benutzername", "{DISCOURSE_INTEGRATION}":"Discourse Integration", "{SYSTEM_NAME}":"System Name", "{USER_INFO}":"User Information", "{SELECT_LANG}":"Select language", "{WELCOME_TO_SHIFTOS}":"Welcome to ShiftOS Alpha!", - "{CREATE}":"Create", - "{INSTALL}":"Install", + "{CREATE}":"Erstellen", + "{INSTALL}":"Installieren", "{ALIAS}":"Alias:", "{OBSOLETE_SYS_SHUTDOWN}":"sys.shutdown is obsolete", "{PY_EXCEPTION}":"There was an error running python code.", @@ -237,4 +237,5 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{DIALOG_NAME}":"Dialog", "{COLOR_PICKER_NAME}":"Color Picker", "{CHAT_NAME}":"Chat", + "{GERMAN_SECRET}":"guten tag polen ist anschluss" } \ No newline at end of file -- cgit v1.2.3 From 07376e9ecd6687b2c4278661d0eaf3795d5124c3 Mon Sep 17 00:00:00 2001 From: lempamo Date: Wed, 5 Apr 2017 21:57:09 -0400 Subject: language selection screen! --- ShiftOS.WinForms/LanguageSelector.Designer.cs | 94 ++++++++++++++++++++ ShiftOS.WinForms/LanguageSelector.cs | 44 ++++++++++ ShiftOS.WinForms/LanguageSelector.resx | 120 ++++++++++++++++++++++++++ ShiftOS.WinForms/Program.cs | 9 +- ShiftOS.WinForms/ShiftOS.WinForms.csproj | 9 ++ ShiftOS.WinForms/WFLanguageProvider.cs | 17 ++++ ShiftOS_TheReturn.sln | 14 +-- ShiftOS_TheReturn/Localization.cs | 14 ++- ShiftOS_TheReturn/SaveSystem.cs | 2 +- 9 files changed, 307 insertions(+), 16 deletions(-) create mode 100644 ShiftOS.WinForms/LanguageSelector.Designer.cs create mode 100644 ShiftOS.WinForms/LanguageSelector.cs create mode 100644 ShiftOS.WinForms/LanguageSelector.resx (limited to 'ShiftOS.WinForms') diff --git a/ShiftOS.WinForms/LanguageSelector.Designer.cs b/ShiftOS.WinForms/LanguageSelector.Designer.cs new file mode 100644 index 0000000..508b5df --- /dev/null +++ b/ShiftOS.WinForms/LanguageSelector.Designer.cs @@ -0,0 +1,94 @@ +using ShiftOS.Engine; + +namespace ShiftOS.WinForms +{ + partial class LanguageSelector + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.comboBox1 = new System.Windows.Forms.ComboBox(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // comboBox1 + // + this.comboBox1.Cursor = System.Windows.Forms.Cursors.Default; + this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Items.AddRange(Localization.GetAllLanguages()); + this.comboBox1.Location = new System.Drawing.Point(13, 13); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new System.Drawing.Size(167, 21); + this.comboBox1.TabIndex = 0; + this.comboBox1.SelectedItem = this.comboBox1.Items[0]; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(12, 40); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 1; + this.button1.Text = "Run"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(105, 40); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 2; + this.button2.Text = "Quit"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // LanguageSelector + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(192, 74); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.comboBox1); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "LanguageSelector"; + this.ShowIcon = false; + this.Text = "Choose A Language"; + this.ResumeLayout(false); + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.closing); + + } + + #endregion + + private System.Windows.Forms.ComboBox comboBox1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + } +} \ No newline at end of file diff --git a/ShiftOS.WinForms/LanguageSelector.cs b/ShiftOS.WinForms/LanguageSelector.cs new file mode 100644 index 0000000..c9a5ac1 --- /dev/null +++ b/ShiftOS.WinForms/LanguageSelector.cs @@ -0,0 +1,44 @@ +using ShiftOS.Engine; +using ShiftOS.WinForms.Applications; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ShiftOS.WinForms +{ + public partial class LanguageSelector : Form + { + public string languageID; + public bool rdy = false; + + public LanguageSelector() + { + InitializeComponent(); + } + + private void button1_Click(object sender, EventArgs e) + { + Localization.SetLanguageID((string)comboBox1.SelectedItem); + + rdy = true; + + this.Close(); + } + + private void button2_Click(object sender, EventArgs e) + { + Environment.Exit(0); + } + + private void closing(object sender, FormClosingEventArgs e) + { + if (!rdy) Environment.Exit(0); + } + } +} diff --git a/ShiftOS.WinForms/LanguageSelector.resx b/ShiftOS.WinForms/LanguageSelector.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS.WinForms/LanguageSelector.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ShiftOS.WinForms/Program.cs b/ShiftOS.WinForms/Program.cs index 0578389..b5f371e 100644 --- a/ShiftOS.WinForms/Program.cs +++ b/ShiftOS.WinForms/Program.cs @@ -58,6 +58,14 @@ namespace ShiftOS.WinForms Environment.Exit(0); }; + var langselect = new LanguageSelector(); + langselect.ShowDialog(); + + while (!langselect.rdy) + { + + }; + TutorialManager.RegisterTutorial(new Oobe()); TerminalBackend.TerminalRequested += () => @@ -102,7 +110,6 @@ namespace ShiftOS.WinForms } } - public class WinformsFSFrontend : IFileSkimmer { diff --git a/ShiftOS.WinForms/ShiftOS.WinForms.csproj b/ShiftOS.WinForms/ShiftOS.WinForms.csproj index d865c62..d7b3478 100644 --- a/ShiftOS.WinForms/ShiftOS.WinForms.csproj +++ b/ShiftOS.WinForms/ShiftOS.WinForms.csproj @@ -258,6 +258,12 @@ + + Form + + + LanguageSelector.cs + Form @@ -383,6 +389,9 @@ FakeSetupScreen.cs + + LanguageSelector.cs + Oobe.cs diff --git a/ShiftOS.WinForms/WFLanguageProvider.cs b/ShiftOS.WinForms/WFLanguageProvider.cs index e762e7e..b6b652b 100644 --- a/ShiftOS.WinForms/WFLanguageProvider.cs +++ b/ShiftOS.WinForms/WFLanguageProvider.cs @@ -52,6 +52,18 @@ namespace ShiftOS.WinForms } } + public string GetLanguagePath() + { + switch (SaveSystem.CurrentSave.Language) + { + case "deutsch - in beta": + return Paths.GetPath("deutsch.local"); + default: + return Paths.GetPath("english.local"); + + } + } + public List GetJSONTranscripts() { var strings = new List(); @@ -65,6 +77,11 @@ namespace ShiftOS.WinForms Utils.WriteAllText(Paths.GetPath("english.local"), getDefault()); } + public void WriteTranscript() + { + Utils.WriteAllText(GetLanguagePath(), GetCurrentTranscript()); + } + private string getDefault() { return Properties.Resources.strings_en; diff --git a/ShiftOS_TheReturn.sln b/ShiftOS_TheReturn.sln index e56ebaa..8bb8ef4 100644 --- a/ShiftOS_TheReturn.sln +++ b/ShiftOS_TheReturn.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +VisualStudioVersion = 14.0.23107.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShiftOS.Engine", "ShiftOS_TheReturn\ShiftOS.Engine.csproj", "{7C979B07-0585-4033-A110-E5555B9D6651}" EndProject @@ -19,10 +19,6 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ShiftOS.Modding.VB.LegacySk EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModLauncher", "ModLauncher\ModLauncher.csproj", "{AEACB7B5-E8FC-4569-BBD3-5053A694D6EC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gwen", "Gwen\Gwen.csproj", "{ADDA2F43-96C0-497F-8216-29C67ABC9806}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gwen.Renderer.OpenTK", "Gwen.Renderer.OpenTK\Gwen.Renderer.OpenTK.csproj", "{41650C82-D630-4E5C-845A-F1513C8FDC99}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -61,14 +57,6 @@ Global {AEACB7B5-E8FC-4569-BBD3-5053A694D6EC}.Debug|Any CPU.Build.0 = Debug|Any CPU {AEACB7B5-E8FC-4569-BBD3-5053A694D6EC}.Release|Any CPU.ActiveCfg = Release|Any CPU {AEACB7B5-E8FC-4569-BBD3-5053A694D6EC}.Release|Any CPU.Build.0 = Release|Any CPU - {ADDA2F43-96C0-497F-8216-29C67ABC9806}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ADDA2F43-96C0-497F-8216-29C67ABC9806}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ADDA2F43-96C0-497F-8216-29C67ABC9806}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ADDA2F43-96C0-497F-8216-29C67ABC9806}.Release|Any CPU.Build.0 = Release|Any CPU - {41650C82-D630-4E5C-845A-F1513C8FDC99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {41650C82-D630-4E5C-845A-F1513C8FDC99}.Debug|Any CPU.Build.0 = Debug|Any CPU - {41650C82-D630-4E5C-845A-F1513C8FDC99}.Release|Any CPU.ActiveCfg = Release|Any CPU - {41650C82-D630-4E5C-845A-F1513C8FDC99}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/ShiftOS_TheReturn/Localization.cs b/ShiftOS_TheReturn/Localization.cs index de5e158..a9d24b8 100644 --- a/ShiftOS_TheReturn/Localization.cs +++ b/ShiftOS_TheReturn/Localization.cs @@ -37,6 +37,7 @@ namespace ShiftOS.Engine { List GetJSONTranscripts(); void WriteDefaultTranscript(); + void WriteTranscript(); string GetCurrentTranscript(); string[] GetAllLanguages(); } @@ -44,6 +45,7 @@ namespace ShiftOS.Engine public static class Localization { private static ILanguageProvider _provider = null; + private static string _languageid = null; public static string[] GetAllLanguages() { @@ -67,7 +69,7 @@ namespace ShiftOS.Engine } else { - _provider.WriteDefaultTranscript(); + _provider.WriteTranscript(); } } @@ -197,5 +199,15 @@ namespace ShiftOS.Engine { _provider = p; } + + public static void SetLanguageID(string id) + { + _languageid = id; + } + + public static string GetLanguageID() + { + return _languageid; + } } } diff --git a/ShiftOS_TheReturn/SaveSystem.cs b/ShiftOS_TheReturn/SaveSystem.cs index df4c6d6..5188bf1 100644 --- a/ShiftOS_TheReturn/SaveSystem.cs +++ b/ShiftOS_TheReturn/SaveSystem.cs @@ -70,7 +70,7 @@ namespace ShiftOS.Engine root.permissions = Permissions.All; System.IO.File.WriteAllText(Paths.SaveFile, JsonConvert.SerializeObject(root)); } - + CurrentSave.Language = Localization.GetLanguageID(); if (Utils.Mounts.Count == 0) Utils.Mount(System.IO.File.ReadAllText(Paths.SaveFile)); -- cgit v1.2.3 From 9a8949cffcd454f6297923c7001cfb036604e02f Mon Sep 17 00:00:00 2001 From: lempamo Date: Thu, 6 Apr 2017 10:17:19 -0400 Subject: language changing actually works --- ShiftOS.WinForms/LanguageSelector.Designer.cs | 94 -------------------- ShiftOS.WinForms/LanguageSelector.cs | 44 ---------- ShiftOS.WinForms/LanguageSelector.resx | 120 -------------------------- ShiftOS.WinForms/Program.cs | 8 -- ShiftOS.WinForms/Resources/languages.txt | 2 +- ShiftOS.WinForms/Resources/strings_de.txt | 3 + ShiftOS.WinForms/Resources/strings_en.txt | 5 +- ShiftOS.WinForms/ShiftOS.WinForms.csproj | 9 -- ShiftOS.WinForms/WFLanguageProvider.cs | 21 +++-- ShiftOS_TheReturn/Commands.cs | 29 +++++++ ShiftOS_TheReturn/Localization.cs | 6 ++ ShiftOS_TheReturn/SaveSystem.cs | 3 +- 12 files changed, 59 insertions(+), 285 deletions(-) delete mode 100644 ShiftOS.WinForms/LanguageSelector.Designer.cs delete mode 100644 ShiftOS.WinForms/LanguageSelector.cs delete mode 100644 ShiftOS.WinForms/LanguageSelector.resx (limited to 'ShiftOS.WinForms') diff --git a/ShiftOS.WinForms/LanguageSelector.Designer.cs b/ShiftOS.WinForms/LanguageSelector.Designer.cs deleted file mode 100644 index 508b5df..0000000 --- a/ShiftOS.WinForms/LanguageSelector.Designer.cs +++ /dev/null @@ -1,94 +0,0 @@ -using ShiftOS.Engine; - -namespace ShiftOS.WinForms -{ - partial class LanguageSelector - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.comboBox1 = new System.Windows.Forms.ComboBox(); - this.button1 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // comboBox1 - // - this.comboBox1.Cursor = System.Windows.Forms.Cursors.Default; - this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBox1.FormattingEnabled = true; - this.comboBox1.Items.AddRange(Localization.GetAllLanguages()); - this.comboBox1.Location = new System.Drawing.Point(13, 13); - this.comboBox1.Name = "comboBox1"; - this.comboBox1.Size = new System.Drawing.Size(167, 21); - this.comboBox1.TabIndex = 0; - this.comboBox1.SelectedItem = this.comboBox1.Items[0]; - // - // button1 - // - this.button1.Location = new System.Drawing.Point(12, 40); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(75, 23); - this.button1.TabIndex = 1; - this.button1.Text = "Run"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // button2 - // - this.button2.Location = new System.Drawing.Point(105, 40); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(75, 23); - this.button2.TabIndex = 2; - this.button2.Text = "Quit"; - this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.button2_Click); - // - // LanguageSelector - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(192, 74); - this.Controls.Add(this.button2); - this.Controls.Add(this.button1); - this.Controls.Add(this.comboBox1); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "LanguageSelector"; - this.ShowIcon = false; - this.Text = "Choose A Language"; - this.ResumeLayout(false); - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.closing); - - } - - #endregion - - private System.Windows.Forms.ComboBox comboBox1; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Button button2; - } -} \ No newline at end of file diff --git a/ShiftOS.WinForms/LanguageSelector.cs b/ShiftOS.WinForms/LanguageSelector.cs deleted file mode 100644 index c9a5ac1..0000000 --- a/ShiftOS.WinForms/LanguageSelector.cs +++ /dev/null @@ -1,44 +0,0 @@ -using ShiftOS.Engine; -using ShiftOS.WinForms.Applications; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace ShiftOS.WinForms -{ - public partial class LanguageSelector : Form - { - public string languageID; - public bool rdy = false; - - public LanguageSelector() - { - InitializeComponent(); - } - - private void button1_Click(object sender, EventArgs e) - { - Localization.SetLanguageID((string)comboBox1.SelectedItem); - - rdy = true; - - this.Close(); - } - - private void button2_Click(object sender, EventArgs e) - { - Environment.Exit(0); - } - - private void closing(object sender, FormClosingEventArgs e) - { - if (!rdy) Environment.Exit(0); - } - } -} diff --git a/ShiftOS.WinForms/LanguageSelector.resx b/ShiftOS.WinForms/LanguageSelector.resx deleted file mode 100644 index 1af7de1..0000000 --- a/ShiftOS.WinForms/LanguageSelector.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/ShiftOS.WinForms/Program.cs b/ShiftOS.WinForms/Program.cs index b5f371e..348360f 100644 --- a/ShiftOS.WinForms/Program.cs +++ b/ShiftOS.WinForms/Program.cs @@ -58,14 +58,6 @@ namespace ShiftOS.WinForms Environment.Exit(0); }; - var langselect = new LanguageSelector(); - langselect.ShowDialog(); - - while (!langselect.rdy) - { - - }; - TutorialManager.RegisterTutorial(new Oobe()); TerminalBackend.TerminalRequested += () => diff --git a/ShiftOS.WinForms/Resources/languages.txt b/ShiftOS.WinForms/Resources/languages.txt index ca34308..a452137 100644 --- a/ShiftOS.WinForms/Resources/languages.txt +++ b/ShiftOS.WinForms/Resources/languages.txt @@ -1,4 +1,4 @@ [ "english" - "deutsch - in beta" + "deutsch" ] \ No newline at end of file diff --git a/ShiftOS.WinForms/Resources/strings_de.txt b/ShiftOS.WinForms/Resources/strings_de.txt index 5abfd32..59631de 100644 --- a/ShiftOS.WinForms/Resources/strings_de.txt +++ b/ShiftOS.WinForms/Resources/strings_de.txt @@ -159,6 +159,8 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{COMMAND_SOS_SHUTDOWN_DESCRIPTION}":"Saves and shuts down ShiftOS", "{COMMAND_SOS_STATUS_USAGE}":"%ns.%cmd", "{COMMAND_SOS_STATUS_DESCRIPTION}":"Displays how many codepoints you have", + "{COMMAND_SOS_LANG_USAGE}":"%ns.%cmd{[language:\"english\"]}", + "{COMMAND_SOS_LANG_DESCRIPTION}":"Sprache ändern.", "{COMMAND_DEV_CRASH_USAGE}":"%ns.%cmd", "{COMMAND_DEV_CRASH_DESCRIPTION}":"Shuts down ShiftOS forcefully", "{COMMAND_DEV_UNLOCKEVERYTHING_USAGE}":"%ns.%cmd", @@ -217,6 +219,7 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{OBSOLETE_SYS_SHUTDOWN}":"sys.shutdown is obsolete", "{PY_EXCEPTION}":"There was an error running python code.", "{LUA_ERROR}":"There was an error running lua code.", + "{LANGUAGE_CHANGED}":"The language has been changed. Please restart ShiftOS for changes to take full effect.", "{TERMINAL_NAME}":"Terminal", "{ARTPAD_NAME}":"Artpad", diff --git a/ShiftOS.WinForms/Resources/strings_en.txt b/ShiftOS.WinForms/Resources/strings_en.txt index 54c9b54..34d034a 100644 --- a/ShiftOS.WinForms/Resources/strings_en.txt +++ b/ShiftOS.WinForms/Resources/strings_en.txt @@ -158,12 +158,14 @@ If a system file is deleted by the virus scanner, it will be replaced.", "{COMMAND_SOS_SHUTDOWN_DESCRIPTION}":"Saves and shuts down ShiftOS", "{COMMAND_SOS_STATUS_USAGE}":"%ns.%cmd", "{COMMAND_SOS_STATUS_DESCRIPTION}":"Displays how many codepoints you have", + "{COMMAND_SOS_LANG_USAGE}":"%ns.%cmd{[language:\"deutsch\"]}", + "{COMMAND_SOS_LANG_DESCRIPTION}":"Change the language.", "{COMMAND_DEV_CRASH_USAGE}":"%ns.%cmd", "{COMMAND_DEV_CRASH_DESCRIPTION}":"Shuts down ShiftOS forcefully", "{COMMAND_DEV_UNLOCKEVERYTHING_USAGE}":"%ns.%cmd", "{COMMAND_DEV_UNLOCKEVERYTHING_DESCRIPTION}":"Unlocks all shiftorium upgrades", "{COMMAND_DEV_FREECP_USAGE}":"%ns.%cmd{[amount:1000]}", - "{COMMAND_DEV_FREECP_DESCRIPTION}":"Gives [ammount] codepoints", + "{COMMAND_DEV_FREECP_DESCRIPTION}":"Gives [amount] codepoints", "{COMMAND_TRM_CLEAR_USAGE}":"%ns.%cmd", "{COMMAND_TRM_CLEAR_DESCRIPTION}":"Clears the terminal", "{COMMAND_SHIFTORIUM_BUY_USAGE}":"%ns.%cmd{upgrade:}", @@ -217,6 +219,7 @@ If a system file is deleted by the virus scanner, it will be replaced.", "{OBSOLETE_SYS_SHUTDOWN}":"sys.shutdown is obsolete", "{PY_EXCEPTION}":"There was an error running python code.", "{LUA_ERROR}":"There was an error running lua code.", + "{LANGUAGE_CHANGED}":"The language has been changed. Please restart ShiftOS for changes to take full effect.", "{TERMINAL_NAME}":"Terminal", "{ARTPAD_NAME}":"Artpad", diff --git a/ShiftOS.WinForms/ShiftOS.WinForms.csproj b/ShiftOS.WinForms/ShiftOS.WinForms.csproj index d7b3478..d865c62 100644 --- a/ShiftOS.WinForms/ShiftOS.WinForms.csproj +++ b/ShiftOS.WinForms/ShiftOS.WinForms.csproj @@ -258,12 +258,6 @@ - - Form - - - LanguageSelector.cs - Form @@ -389,9 +383,6 @@ FakeSetupScreen.cs - - LanguageSelector.cs - Oobe.cs diff --git a/ShiftOS.WinForms/WFLanguageProvider.cs b/ShiftOS.WinForms/WFLanguageProvider.cs index b6b652b..c11b6dc 100644 --- a/ShiftOS.WinForms/WFLanguageProvider.cs +++ b/ShiftOS.WinForms/WFLanguageProvider.cs @@ -42,13 +42,20 @@ namespace ShiftOS.WinForms public string GetCurrentTranscript() { - switch (SaveSystem.CurrentSave.Language) + try { - case "deutsch - in beta": - return Properties.Resources.strings_de; - default: - return getDefault(); - + switch (SaveSystem.CurrentSave.Language) + { + case "deutsch": + return Properties.Resources.strings_de; + default: + return getDefault(); + + } + } + catch (NullReferenceException) + { + return getDefault(); } } @@ -56,7 +63,7 @@ namespace ShiftOS.WinForms { switch (SaveSystem.CurrentSave.Language) { - case "deutsch - in beta": + case "deutsch": return Paths.GetPath("deutsch.local"); default: return Paths.GetPath("english.local"); diff --git a/ShiftOS_TheReturn/Commands.cs b/ShiftOS_TheReturn/Commands.cs index 9f85a25..fedff19 100644 --- a/ShiftOS_TheReturn/Commands.cs +++ b/ShiftOS_TheReturn/Commands.cs @@ -357,6 +357,35 @@ namespace ShiftOS.Engine return true; } + [Command("lang", usage = "{{COMMAND_SOS_LANG_USAGE}}", description = "{{COMMAND_SOS_LANG_DESCRIPTION}}")] + [RequiresArgument("language")] + public static bool SetLanguage(Dictionary userArgs) + { + try + { + string lang = ""; + + if (userArgs.ContainsKey("language")) + lang = (string)userArgs["language"]; + else + throw new Exception("You must specify a valid 'language' value."); + + if (Localization.GetAllLanguages().Contains(lang)) + { + SaveSystem.CurrentSave.Language = lang; + SaveSystem.SaveGame(); + Console.WriteLine("{LANGUAGE_CHANGED}"); + return true; + } + + throw new Exception($"Couldn't find language with ID: {lang}"); + } + catch + { + return false; + } + } + [Command("help", "{COMMAND_HELP_USAGE}", "{COMMAND_HELP_DESCRIPTION}")] public static bool Help() { diff --git a/ShiftOS_TheReturn/Localization.cs b/ShiftOS_TheReturn/Localization.cs index a9d24b8..c1a6bd6 100644 --- a/ShiftOS_TheReturn/Localization.cs +++ b/ShiftOS_TheReturn/Localization.cs @@ -67,6 +67,12 @@ namespace ShiftOS.Engine var path = "english.local"; Utils.WriteAllText(Paths.GetPath(path), lines); } + else if (SaveSystem.CurrentSave == null) + { + var lines = Properties.Resources.strings_en; + var path = "english.local"; + Utils.WriteAllText(Paths.GetPath(path), lines); + } else { _provider.WriteTranscript(); diff --git a/ShiftOS_TheReturn/SaveSystem.cs b/ShiftOS_TheReturn/SaveSystem.cs index 5188bf1..9ff3111 100644 --- a/ShiftOS_TheReturn/SaveSystem.cs +++ b/ShiftOS_TheReturn/SaveSystem.cs @@ -70,7 +70,6 @@ namespace ShiftOS.Engine root.permissions = Permissions.All; System.IO.File.WriteAllText(Paths.SaveFile, JsonConvert.SerializeObject(root)); } - CurrentSave.Language = Localization.GetLanguageID(); if (Utils.Mounts.Count == 0) Utils.Mount(System.IO.File.ReadAllText(Paths.SaveFile)); @@ -176,6 +175,8 @@ namespace ShiftOS.Engine } + Localization.SetupTHETRUEDefaultLocals(); + Shiftorium.Init(); while (CurrentSave.StoryPosition < 1) -- cgit v1.2.3 From a40ba40cc048422c6bd3b810fe52d5b00014a031 Mon Sep 17 00:00:00 2001 From: lempamo Date: Thu, 6 Apr 2017 10:47:08 -0400 Subject: made shiftos boot into deutsch mode --- ShiftOS.WinForms/Resources/strings_de.txt | 6 ++--- ShiftOS.WinForms/Resources/strings_en.txt | 4 ++-- ShiftOS_TheReturn/Resources/strings_de.txt | 38 +++++++++++++++++++++++------- ShiftOS_TheReturn/Resources/strings_en.txt | 4 ++-- 4 files changed, 36 insertions(+), 16 deletions(-) (limited to 'ShiftOS.WinForms') diff --git a/ShiftOS.WinForms/Resources/strings_de.txt b/ShiftOS.WinForms/Resources/strings_de.txt index 59631de..0602612 100644 --- a/ShiftOS.WinForms/Resources/strings_de.txt +++ b/ShiftOS.WinForms/Resources/strings_de.txt @@ -150,7 +150,7 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{ERROR_COMMAND_WRONG}": "Check your syntax and try again", "{LOGIN_EXP}": "Login as the admin of the multi user domain.", - "{USAGE}": "Usage: ", + "{USAGE}": "Verwendung: ", "{NAMESPACE_SOS_DESCRIPTION}":"The ShiftOS Namespace", "{COMMAND_HELP_USAGE}":"%ns.%cmd{[topic:]}", @@ -219,7 +219,7 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{OBSOLETE_SYS_SHUTDOWN}":"sys.shutdown is obsolete", "{PY_EXCEPTION}":"There was an error running python code.", "{LUA_ERROR}":"There was an error running lua code.", - "{LANGUAGE_CHANGED}":"The language has been changed. Please restart ShiftOS for changes to take full effect.", + "{LANGUAGE_CHANGED}":"Die Sprache wurde geändert. Bitte ändern Sie ShiftOS neu, damit Änderungen voll wirksam werden.", "{TERMINAL_NAME}":"Terminal", "{ARTPAD_NAME}":"Artpad", @@ -240,5 +240,5 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{DIALOG_NAME}":"Dialog", "{COLOR_PICKER_NAME}":"Color Picker", "{CHAT_NAME}":"Chat", - "{GERMAN_SECRET}":"guten tag polen ist anschluss" + "{GERMAN_SECRET}":"guten tag polen ist anschluss", } \ No newline at end of file diff --git a/ShiftOS.WinForms/Resources/strings_en.txt b/ShiftOS.WinForms/Resources/strings_en.txt index 34d034a..cc4bd1a 100644 --- a/ShiftOS.WinForms/Resources/strings_en.txt +++ b/ShiftOS.WinForms/Resources/strings_en.txt @@ -158,13 +158,13 @@ If a system file is deleted by the virus scanner, it will be replaced.", "{COMMAND_SOS_SHUTDOWN_DESCRIPTION}":"Saves and shuts down ShiftOS", "{COMMAND_SOS_STATUS_USAGE}":"%ns.%cmd", "{COMMAND_SOS_STATUS_DESCRIPTION}":"Displays how many codepoints you have", - "{COMMAND_SOS_LANG_USAGE}":"%ns.%cmd{[language:\"deutsch\"]}", + "{COMMAND_SOS_LANG_USAGE}":"%ns.%cmd{language:\"deutsch\"}", "{COMMAND_SOS_LANG_DESCRIPTION}":"Change the language.", "{COMMAND_DEV_CRASH_USAGE}":"%ns.%cmd", "{COMMAND_DEV_CRASH_DESCRIPTION}":"Shuts down ShiftOS forcefully", "{COMMAND_DEV_UNLOCKEVERYTHING_USAGE}":"%ns.%cmd", "{COMMAND_DEV_UNLOCKEVERYTHING_DESCRIPTION}":"Unlocks all shiftorium upgrades", - "{COMMAND_DEV_FREECP_USAGE}":"%ns.%cmd{[amount:1000]}", + "{COMMAND_DEV_FREECP_USAGE}":"%ns.%cmd{amount:1000}", "{COMMAND_DEV_FREECP_DESCRIPTION}":"Gives [amount] codepoints", "{COMMAND_TRM_CLEAR_USAGE}":"%ns.%cmd", "{COMMAND_TRM_CLEAR_DESCRIPTION}":"Clears the terminal", diff --git a/ShiftOS_TheReturn/Resources/strings_de.txt b/ShiftOS_TheReturn/Resources/strings_de.txt index 10535c8..06ef9d7 100644 --- a/ShiftOS_TheReturn/Resources/strings_de.txt +++ b/ShiftOS_TheReturn/Resources/strings_de.txt @@ -36,7 +36,7 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{TERMINAL}":"Terminal", "{PONG}":"Pong", "{CODEPOINTS}":"Codepoints", - "{CODEPOINTS_VALUE}":"%cp " + "{CODEPOINTS_VALUE}":"%cp ", "{SHIFTORIUM}":"Shiftorium", "{HACK}":"Hack", "{SHIFTER}":"Shifter", @@ -151,15 +151,17 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{ERROR_COMMAND_WRONG}": "Check your syntax and try again", "{LOGIN_EXP}": "Login as the admin of the multi user domain.", - "{USAGE}": "Usage: ", + "{USAGE}": "Verwendung: ", "{NAMESPACE_SOS_DESCRIPTION}":"The ShiftOS Namespace", "{COMMAND_HELP_USAGE}":"%ns.%cmd{[topic:]}", - "{COMMAND_HELP_DESCRIPTION}":"Lists all commands", + "{COMMAND_HELP_DESCRIPTION}":"Listet alle Befehle auf", "{COMMAND_SOS_SHUTDOWN_USAGE}":"%ns.%cmd", "{COMMAND_SOS_SHUTDOWN_DESCRIPTION}":"Saves and shuts down ShiftOS", "{COMMAND_SOS_STATUS_USAGE}":"%ns.%cmd", "{COMMAND_SOS_STATUS_DESCRIPTION}":"Displays how many codepoints you have", + "{COMMAND_SOS_LANG_USAGE}":"%ns.%cmd{[language:\"english\"]}", + "{COMMAND_SOS_LANG_DESCRIPTION}":"Sprache ändern.", "{COMMAND_DEV_CRASH_USAGE}":"%ns.%cmd", "{COMMAND_DEV_CRASH_DESCRIPTION}":"Shuts down ShiftOS forcefully", "{COMMAND_DEV_UNLOCKEVERYTHING_USAGE}":"%ns.%cmd", @@ -177,7 +179,7 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{COMMAND_DEV_MULTARG_USAGE}":"%ns.%cmd{id:,name:,type:}", "{COMMAND_DEV_MULTARG_DESCRIPTION}":"A command which requiers multiple arguments", - "{ERR_COMMAND_NOT_FOUND}":"Command not found.", + "{ERR_COMMAND_NOT_FOUND}":"Befehl nicht gefunden.", "{MUD_ERROR}":"MUD error", "{PROLOGUE_NO_USER_DETECTED}":"No user detected. Please enter a username.", @@ -200,26 +202,44 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{SENTIENCE_POSSIBLEHUMAN}":"Sentience: Possible human - user can perform actions based on a choice.", "{SENTIENCE_POSSIBLEHUMANPLUS}":"Sentience: Possible human+ - user can infer, and can pass arguments.", "{SENTIENCE_HUMAN}":"Sentience: Human. Thanks for your patience.", - "{SENTIENCE_INVALIDPASSWORD}":"The password you entered is invalid.", + "{SENTIENCE_INVALIDPASSWORD}":"Das eingegebene Passwort ist ungültig.", "{ARGS_PASSWORD}":"password", "{SHIFTOS_PLUS_MOTTO}":"ShiftOS, Shift it YOUR way.", "{SHIFTOS_VERSION_INFO}":"ShiftOS Version: ", - "{USER_NAME}":"Username", + "{USER_NAME}":"Benutzername", "{DISCOURSE_INTEGRATION}":"Discourse Integration", "{SYSTEM_NAME}":"System Name", "{USER_INFO}":"User Information", "{SELECT_LANG}":"Select language", "{WELCOME_TO_SHIFTOS}":"Welcome to ShiftOS Alpha!", - "{CREATE}":"Create", - "{INSTALL}":"Install", + "{CREATE}":"Erstellen", + "{INSTALL}":"Installieren", "{ALIAS}":"Alias:", "{OBSOLETE_SYS_SHUTDOWN}":"sys.shutdown is obsolete", "{PY_EXCEPTION}":"There was an error running python code.", - "{LUA_ERROR}":"There was an error running lua code." + "{LUA_ERROR}":"There was an error running lua code.", + "{LANGUAGE_CHANGED}":"Die Sprache wurde geändert. Bitte ändern Sie ShiftOS neu, damit Änderungen voll wirksam werden.", "{TERMINAL_NAME}":"Terminal", "{ARTPAD_NAME}":"Artpad", "{PONG_NAME}":"Pong", + "{WAV_PLAYER_NAME}":"WAV Player", + "{SHIFTORIUM_NAME}":"Shiftorium", + "{TEXTPAD_NAME}":"TextPad", + "{VIRUS_SCANNER_NAME}":"Virus Scanner", + "{SKIN_LOADER_NAME}":"Skin Loader", + "{SHIFTER_NAME}":"Shifter", + "{NAME_CHANGER_NAME}":"Name Changer", + "{MUD_PASSWORD_CRACKER_NAME}":"Multi-User Domain Password Cracker v1.0", + "{MUD_CONTROL_CENTRE_NAME}":"MUD Control Centre", + "{MUD_AUTHENTICATOR_NAME}":"Multi-User Domain Admin Panel", + "{GRAPHIC_PICKER_NAME}":"Graphic Picker", + "{FILE_SKIMMER_NAME}":"File Skimmer", + "{FILE_DIALOG_NAME}":"File Dialog", + "{DIALOG_NAME}":"Dialog", + "{COLOR_PICKER_NAME}":"Color Picker", + "{CHAT_NAME}":"Chat", + "{GERMAN_SECRET}":"guten tag polen ist anschluss", } \ No newline at end of file diff --git a/ShiftOS_TheReturn/Resources/strings_en.txt b/ShiftOS_TheReturn/Resources/strings_en.txt index c42edab..68719c0 100644 --- a/ShiftOS_TheReturn/Resources/strings_en.txt +++ b/ShiftOS_TheReturn/Resources/strings_en.txt @@ -32,7 +32,7 @@ If a system file is deleted by the virus scanner, it will be replaced.", "{TERMINAL}":"Terminal", "{PONG}":"Pong", "{CODEPOINTS}":"Codepoints", - "{CODEPOINTS_VALUE}":"%cp " + "{CODEPOINTS_VALUE}":"%cp ", "{SHIFTORIUM}":"Shiftorium", "{HACK}":"Hack", "{SHIFTER}":"Shifter", @@ -215,7 +215,7 @@ If a system file is deleted by the virus scanner, it will be replaced.", "{ALIAS}":"Alias:", "{OBSOLETE_SYS_SHUTDOWN}":"sys.shutdown is obsolete", "{PY_EXCEPTION}":"There was an error running python code.", - "{LUA_ERROR}":"There was an error running lua code." + "{LUA_ERROR}":"There was an error running lua code.", "{TERMINAL_NAME}":"Terminal", "{ARTPAD_NAME}":"Artpad", -- cgit v1.2.3 From 5308c1cd4807edb2ec33f75923e609e8a382f1af Mon Sep 17 00:00:00 2001 From: lempamo Date: Thu, 6 Apr 2017 11:58:00 -0400 Subject: german translations aint showin halp --- ShiftOS.WinForms/Resources/strings_de.txt | 9 +++++---- ShiftOS.WinForms/Resources/strings_en.txt | 1 + ShiftOS.WinForms/WinformsDesktop.cs | 6 +++--- ShiftOS_TheReturn/Commands.cs | 1 - 4 files changed, 9 insertions(+), 8 deletions(-) (limited to 'ShiftOS.WinForms') diff --git a/ShiftOS.WinForms/Resources/strings_de.txt b/ShiftOS.WinForms/Resources/strings_de.txt index 0602612..139ed69 100644 --- a/ShiftOS.WinForms/Resources/strings_de.txt +++ b/ShiftOS.WinForms/Resources/strings_de.txt @@ -48,7 +48,7 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{UPGRADES}":"Upgrades", "{APPLICATION}":"Anwendung", "{SCRIPT}":"Skript", - "{ERROR}":"Error", + "{ERROR}":"Fehler", "{SCRIPTS}":"Skripts", "{NULL}":"null", "{ID}":"ID Num", @@ -109,7 +109,7 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{UPGRADE_DEVELOPMENT_DESCRIPTION}":"Development Upgrade Don't Buy", "{SECONDS_LEFT}":"sekunden übrig", "{CASH_OUT_WITH_CODEPOINTS}":"Cash out with your codepoints", - "{PONG_PLAY_ON_FOR_MORE}":"Play on for more!", + "{PONG_PLAY_ON_FOR_MORE}":"Spiel für mehr!", "{YOU_REACHED_LEVEL}":"You've reached level", "{PONG_BEAT_AI_REWARD}":"Reward for beating AI (CP)", "{PONG_BEAT_AI_REWARD_SECONDARY}":"Codepoints for beating AI:", @@ -121,7 +121,7 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{TERMINAL_FORMATTING_DRIVE}":"Formatting drive... %percent %", "{INSTALLING_SHIFTOS}":"Installing ShiftOS on %domain.", "{YOU_MISSED_OUT_ON}":"You missed out on", - "{BUT_YOU_GAINED}":"But you gained", + "{BUT_YOU_GAINED}":"Aber du hast gewonnen", "{PONG_PLAYON_DESC}":"Or do you want to try your luck on the next level to increase your reward?", "{PONG_CASHOUT_DESC}":"Would you like the end the game now and cash out with your reward?", "{INITIAL_H_VEL}":"Initial H Vel", @@ -131,7 +131,7 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{MULTIPLAYER_ONLY}":"Program not compatible with single-user domain.", "{MULTIPLAYER_ONLY_EXP}":"This program cannot run within a single-user domain. You must be within a multi-user domain to use this program.", "{SHIFTER_SKIN_APPLIED}":"Shifter - Settings applied!", - "{YOU_HAVE_EARNED}":"You have earned", + "{YOU_HAVE_EARNED}":"Du hast bekommen", "{CREATING_PATH}":"Creating directory: %path", "{CREATING_FILE}":"Creating file: %path", "{SHIFTORIUM_HELP_DESCRIPTION}": "Help Descriptions", @@ -240,5 +240,6 @@ Wenn eine Systemdatei von dem Virenscanner erkannt wird, wird sie ersetzt.", "{DIALOG_NAME}":"Dialog", "{COLOR_PICKER_NAME}":"Color Picker", "{CHAT_NAME}":"Chat", + "{NOTIFICATIONS}":"Benachrichtigungen", "{GERMAN_SECRET}":"guten tag polen ist anschluss", } \ No newline at end of file diff --git a/ShiftOS.WinForms/Resources/strings_en.txt b/ShiftOS.WinForms/Resources/strings_en.txt index cc4bd1a..f63f0e0 100644 --- a/ShiftOS.WinForms/Resources/strings_en.txt +++ b/ShiftOS.WinForms/Resources/strings_en.txt @@ -240,4 +240,5 @@ If a system file is deleted by the virus scanner, it will be replaced.", "{DIALOG_NAME}":"Dialog", "{COLOR_PICKER_NAME}":"Color Picker", "{CHAT_NAME}":"Chat", + "{NOTIFICATIONS}":"Notifications", } diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs index 033802e..182c607 100644 --- a/ShiftOS.WinForms/WinformsDesktop.cs +++ b/ShiftOS.WinForms/WinformsDesktop.cs @@ -65,7 +65,7 @@ namespace ShiftOS.WinForms //Soon this will pop a balloon note. this.Invoke(new Action(() => { - btnnotifications.Text = "Notifications (" + NotificationDaemon.GetUnreadCount().ToString() + ")"; + btnnotifications.Text = Localization.Parse("{NOTIFICATIONS} (" + NotificationDaemon.GetUnreadCount().ToString() + ")"); })); }; @@ -74,7 +74,7 @@ namespace ShiftOS.WinForms //Soon this will pop a balloon note. this.Invoke(new Action(() => { - btnnotifications.Text = "Notifications (" + NotificationDaemon.GetUnreadCount().ToString() + ")"; + btnnotifications.Text = Localization.Parse("{NOTIFICATIONS} (" + NotificationDaemon.GetUnreadCount().ToString() + ")"); })); }; @@ -100,7 +100,7 @@ namespace ShiftOS.WinForms this.Invoke(new Action(() => SetupDesktop())); this.Invoke(new Action(() => { - btnnotifications.Text = "Notifications (" + NotificationDaemon.GetUnreadCount().ToString() + ")"; + btnnotifications.Text = Localization.Parse("{NOTIFICATIONS} (" + NotificationDaemon.GetUnreadCount().ToString() + ")"); })); }; Shiftorium.Installed += () => diff --git a/ShiftOS_TheReturn/Commands.cs b/ShiftOS_TheReturn/Commands.cs index fedff19..c4f0c7a 100644 --- a/ShiftOS_TheReturn/Commands.cs +++ b/ShiftOS_TheReturn/Commands.cs @@ -357,7 +357,6 @@ namespace ShiftOS.Engine return true; } - [Command("lang", usage = "{{COMMAND_SOS_LANG_USAGE}}", description = "{{COMMAND_SOS_LANG_DESCRIPTION}}")] [RequiresArgument("language")] public static bool SetLanguage(Dictionary userArgs) { -- cgit v1.2.3 From 3789b48df00e89fa6dcd7e27bb6885ba880504f6 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 7 Apr 2017 12:54:07 -0400 Subject: Unite API objects for ShiftOS --- ShiftOS.Objects/ShiftOS.Objects.csproj | 1 + ShiftOS.Objects/Unite/Download.cs | 22 ++++++++++++++++++++++ ShiftOS.WinForms/Applications/FormatEditor.cs | 3 ++- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 ShiftOS.Objects/Unite/Download.cs (limited to 'ShiftOS.WinForms') diff --git a/ShiftOS.Objects/ShiftOS.Objects.csproj b/ShiftOS.Objects/ShiftOS.Objects.csproj index 4514b68..d9b8bf7 100644 --- a/ShiftOS.Objects/ShiftOS.Objects.csproj +++ b/ShiftOS.Objects/ShiftOS.Objects.csproj @@ -55,6 +55,7 @@ + diff --git a/ShiftOS.Objects/Unite/Download.cs b/ShiftOS.Objects/Unite/Download.cs new file mode 100644 index 0000000..089a98c --- /dev/null +++ b/ShiftOS.Objects/Unite/Download.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShiftOS.Objects.Unite +{ + public class Download + { + public string Id { get; set; } + public string Name { get; set; } + public string Changelog { get; set; } + public string DownloadUrl { get; set; } + public bool Obsolete { get; set; } + public DateTime PostDate { get; set; } + public string ReleasedBy { get; set; } + public string DevUpdateId { get; set; } + public string ScreenshotUrl { get; set; } + public bool IsStable { get; set; } + } +} diff --git a/ShiftOS.WinForms/Applications/FormatEditor.cs b/ShiftOS.WinForms/Applications/FormatEditor.cs index c5afc02..7491e36 100644 --- a/ShiftOS.WinForms/Applications/FormatEditor.cs +++ b/ShiftOS.WinForms/Applications/FormatEditor.cs @@ -35,9 +35,10 @@ using ShiftOS.Engine; namespace ShiftOS.WinForms.Applications { [MultiplayerOnly] - [Launcher("FormatEditor", true, "al_format_editor", "Games")] + [Launcher("Format Editor", true, "al_format_editor", "Customization")] [RequiresUpgrade("format_editor")] [WinOpen("formateditor")] + [DefaultTitle("Format Editor")] [DefaultIcon("iconFormatEditor")] public partial class FormatEditor : UserControl, IShiftOSWindow { -- cgit v1.2.3