From bca879db94bc6395dbfa77628747080311fdb226 Mon Sep 17 00:00:00 2001 From: Richie Moch Date: Sun, 23 Dec 2018 19:15:07 -0600 Subject: [PATCH] started work on the pong, implemented "ShiftToolStrip". (note: pong is very buggy) --- ShiftOS.Engine/ShiftOS.Engine.csproj | 2 +- ShiftOS.Engine/UI/ShiftStripRenderer.cs | 30 --- ShiftOS.Engine/UI/ShiftToolStrip.cs | 26 +++ .../Apps/FileSkimmer.Designer.cs | 2 +- .../{MainGame => }/Apps/FileSkimmer.cs | 2 +- .../{MainGame => }/Apps/FileSkimmer.resx | 0 ShiftOS.Main/Apps/Pong.Designer.cs | 100 ++++++++++ ShiftOS.Main/Apps/Pong.cs | 72 +++++++ ShiftOS.Main/Apps/Pong.resx | 123 ++++++++++++ .../{MainGame => }/Apps/ShiftDemo.Designer.cs | 0 ShiftOS.Main/{MainGame => }/Apps/ShiftDemo.cs | 0 .../{MainGame => }/Apps/ShiftDemo.resx | 0 .../Apps/ShifterStuff/SelectColor.Designer.cs | 0 .../Apps/ShifterStuff/SelectColor.cs | 0 .../Apps/ShifterStuff/SelectColor.resx | 0 .../Apps/ShifterStuff/Shifter.Designer.cs | 0 .../Apps/ShifterStuff/Shifter.cs | 0 .../Apps/ShifterStuff/Shifter.resx | 0 .../{MainGame => }/Apps/Terminal.Designer.cs | 2 +- ShiftOS.Main/{MainGame => }/Apps/Terminal.cs | 2 +- .../{MainGame => }/Apps/Terminal.resx | 0 .../{MainGame => }/Apps/TestForm.Designer.cs | 0 ShiftOS.Main/{MainGame => }/Apps/TestForm.cs | 0 .../{MainGame => }/Apps/TestForm.resx | 0 .../{MainGame => }/Apps/TextPad.Designer.cs | 2 +- ShiftOS.Main/{MainGame => }/Apps/TextPad.cs | 2 +- ShiftOS.Main/{MainGame => }/Apps/TextPad.resx | 0 ShiftOS.Main/Desktop.Designer.cs | 138 +++++++++++++ ShiftOS.Main/Desktop.cs | 51 +++++ ShiftOS.Main/{MainGame => }/Desktop.resx | 8 +- ShiftOS.Main/MainGame/Desktop.Designer.cs | 186 ------------------ ShiftOS.Main/MainGame/Desktop.cs | 72 ------- ShiftOS.Main/Program.cs | 3 +- ShiftOS.Main/ShiftOS.Main.csproj | 91 +++++---- ShiftOS.Main/Terminal/Commands/startx.cs | 16 +- ShiftOS.Main/Terminal/TerminalBackend.cs | 3 +- ShiftOS.Main/Terminal/TerminalCommand.cs | 6 +- 37 files changed, 586 insertions(+), 353 deletions(-) delete mode 100644 ShiftOS.Engine/UI/ShiftStripRenderer.cs create mode 100644 ShiftOS.Engine/UI/ShiftToolStrip.cs rename ShiftOS.Main/{MainGame => }/Apps/FileSkimmer.Designer.cs (99%) rename ShiftOS.Main/{MainGame => }/Apps/FileSkimmer.cs (98%) rename ShiftOS.Main/{MainGame => }/Apps/FileSkimmer.resx (100%) create mode 100644 ShiftOS.Main/Apps/Pong.Designer.cs create mode 100644 ShiftOS.Main/Apps/Pong.cs create mode 100644 ShiftOS.Main/Apps/Pong.resx rename ShiftOS.Main/{MainGame => }/Apps/ShiftDemo.Designer.cs (100%) rename ShiftOS.Main/{MainGame => }/Apps/ShiftDemo.cs (100%) rename ShiftOS.Main/{MainGame => }/Apps/ShiftDemo.resx (100%) rename ShiftOS.Main/{MainGame => }/Apps/ShifterStuff/SelectColor.Designer.cs (100%) rename ShiftOS.Main/{MainGame => }/Apps/ShifterStuff/SelectColor.cs (100%) rename ShiftOS.Main/{MainGame => }/Apps/ShifterStuff/SelectColor.resx (100%) rename ShiftOS.Main/{MainGame => }/Apps/ShifterStuff/Shifter.Designer.cs (100%) rename ShiftOS.Main/{MainGame => }/Apps/ShifterStuff/Shifter.cs (100%) rename ShiftOS.Main/{MainGame => }/Apps/ShifterStuff/Shifter.resx (100%) rename ShiftOS.Main/{MainGame => }/Apps/Terminal.Designer.cs (98%) rename ShiftOS.Main/{MainGame => }/Apps/Terminal.cs (99%) rename ShiftOS.Main/{MainGame => }/Apps/Terminal.resx (100%) rename ShiftOS.Main/{MainGame => }/Apps/TestForm.Designer.cs (100%) rename ShiftOS.Main/{MainGame => }/Apps/TestForm.cs (100%) rename ShiftOS.Main/{MainGame => }/Apps/TestForm.resx (100%) rename ShiftOS.Main/{MainGame => }/Apps/TextPad.Designer.cs (99%) rename ShiftOS.Main/{MainGame => }/Apps/TextPad.cs (95%) rename ShiftOS.Main/{MainGame => }/Apps/TextPad.resx (100%) create mode 100644 ShiftOS.Main/Desktop.Designer.cs create mode 100644 ShiftOS.Main/Desktop.cs rename ShiftOS.Main/{MainGame => }/Desktop.resx (96%) delete mode 100644 ShiftOS.Main/MainGame/Desktop.Designer.cs delete mode 100644 ShiftOS.Main/MainGame/Desktop.cs diff --git a/ShiftOS.Engine/ShiftOS.Engine.csproj b/ShiftOS.Engine/ShiftOS.Engine.csproj index d63258a..de69248 100644 --- a/ShiftOS.Engine/ShiftOS.Engine.csproj +++ b/ShiftOS.Engine/ShiftOS.Engine.csproj @@ -84,7 +84,7 @@ ShiftButton.cs - + UserControl diff --git a/ShiftOS.Engine/UI/ShiftStripRenderer.cs b/ShiftOS.Engine/UI/ShiftStripRenderer.cs deleted file mode 100644 index fe64ff9..0000000 --- a/ShiftOS.Engine/UI/ShiftStripRenderer.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace ShiftOS.Engine.UI -{ - public class ShiftStripRenderer : ToolStripRenderer - { - SolidBrush sb; - - protected override void OnRenderButtonBackground(ToolStripItemRenderEventArgs e) - { - if (!e.Item.Selected) - { - base.OnRenderButtonBackground(e); - } - else - { - sb = new SolidBrush(Color.FromArgb(64, 64, 64)); - Rectangle rectangle = new Rectangle(0, 0, e.Item.Size.Width - 1, e.Item.Size.Height - 1); - e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(64,64,64)), rectangle); - e.Graphics.DrawRectangle(new Pen(sb, 1F), rectangle); - } - } - } -} \ No newline at end of file diff --git a/ShiftOS.Engine/UI/ShiftToolStrip.cs b/ShiftOS.Engine/UI/ShiftToolStrip.cs new file mode 100644 index 0000000..853e79c --- /dev/null +++ b/ShiftOS.Engine/UI/ShiftToolStrip.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ShiftOS.Engine.UI +{ + public partial class ShiftToolStrip : ToolStripProfessionalRenderer + { + protected override void OnRenderMenuItemBackground(ToolStripItemRenderEventArgs e) + { + if (!e.Item.Selected) base.OnRenderMenuItemBackground(e); + else + { + var rc = new Rectangle(Point.Empty, e.Item.Size); + e.Graphics.FillRectangle(Brushes.Gray, rc); + e.Graphics.DrawRectangle(Pens.White, 1, 0, rc.Width - 2, rc.Height - 1); + } + } + } +} diff --git a/ShiftOS.Main/MainGame/Apps/FileSkimmer.Designer.cs b/ShiftOS.Main/Apps/FileSkimmer.Designer.cs similarity index 99% rename from ShiftOS.Main/MainGame/Apps/FileSkimmer.Designer.cs rename to ShiftOS.Main/Apps/FileSkimmer.Designer.cs index 5a23ec7..36fe4e5 100644 --- a/ShiftOS.Main/MainGame/Apps/FileSkimmer.Designer.cs +++ b/ShiftOS.Main/Apps/FileSkimmer.Designer.cs @@ -1,6 +1,6 @@ using System.Windows.Forms; -namespace ShiftOS.Main.ShiftOS.Apps +namespace ShiftOS.Main.Apps { partial class FileSkimmer { diff --git a/ShiftOS.Main/MainGame/Apps/FileSkimmer.cs b/ShiftOS.Main/Apps/FileSkimmer.cs similarity index 98% rename from ShiftOS.Main/MainGame/Apps/FileSkimmer.cs rename to ShiftOS.Main/Apps/FileSkimmer.cs index 58cc126..e749d21 100644 --- a/ShiftOS.Main/MainGame/Apps/FileSkimmer.cs +++ b/ShiftOS.Main/Apps/FileSkimmer.cs @@ -8,7 +8,7 @@ using ShiftOS.Engine.WindowManager; using System.Linq; using ShiftOS.Engine.UI; -namespace ShiftOS.Main.ShiftOS.Apps +namespace ShiftOS.Main.Apps { public partial class FileSkimmer : UserControl, IShiftWindowExtensions { diff --git a/ShiftOS.Main/MainGame/Apps/FileSkimmer.resx b/ShiftOS.Main/Apps/FileSkimmer.resx similarity index 100% rename from ShiftOS.Main/MainGame/Apps/FileSkimmer.resx rename to ShiftOS.Main/Apps/FileSkimmer.resx diff --git a/ShiftOS.Main/Apps/Pong.Designer.cs b/ShiftOS.Main/Apps/Pong.Designer.cs new file mode 100644 index 0000000..4b9bd01 --- /dev/null +++ b/ShiftOS.Main/Apps/Pong.Designer.cs @@ -0,0 +1,100 @@ +namespace ShiftOS.Main.Apps +{ + partial class Pong + { + /// + /// 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 Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.playerPaddle = new System.Windows.Forms.PictureBox(); + this.cpuPaddle = new System.Windows.Forms.PictureBox(); + this.ball = new System.Windows.Forms.PictureBox(); + this.gameTimer = new System.Windows.Forms.Timer(this.components); + ((System.ComponentModel.ISupportInitialize)(this.playerPaddle)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.cpuPaddle)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.ball)).BeginInit(); + this.SuspendLayout(); + // + // playerPaddle + // + this.playerPaddle.BackColor = System.Drawing.Color.White; + this.playerPaddle.Location = new System.Drawing.Point(27, 153); + this.playerPaddle.Name = "playerPaddle"; + this.playerPaddle.Size = new System.Drawing.Size(22, 103); + this.playerPaddle.TabIndex = 0; + this.playerPaddle.TabStop = false; + // + // cpuPaddle + // + this.cpuPaddle.BackColor = System.Drawing.Color.White; + this.cpuPaddle.Location = new System.Drawing.Point(751, 153); + this.cpuPaddle.Name = "cpuPaddle"; + this.cpuPaddle.Size = new System.Drawing.Size(22, 103); + this.cpuPaddle.TabIndex = 1; + this.cpuPaddle.TabStop = false; + // + // ball + // + this.ball.BackColor = System.Drawing.Color.White; + this.ball.Location = new System.Drawing.Point(390, 201); + this.ball.Name = "ball"; + this.ball.Size = new System.Drawing.Size(18, 18); + this.ball.TabIndex = 2; + this.ball.TabStop = false; + // + // gameTimer + // + this.gameTimer.Interval = 20; + this.gameTimer.Tick += new System.EventHandler(this.gameTimer_Tick); + // + // Pong + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.Black; + this.Controls.Add(this.ball); + this.Controls.Add(this.cpuPaddle); + this.Controls.Add(this.playerPaddle); + this.ForeColor = System.Drawing.Color.White; + this.Name = "Pong"; + this.Size = new System.Drawing.Size(801, 470); + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Pong_KeyDown); + this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.Pong_KeyUp); + ((System.ComponentModel.ISupportInitialize)(this.playerPaddle)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.cpuPaddle)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.ball)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.PictureBox playerPaddle; + private System.Windows.Forms.PictureBox cpuPaddle; + private System.Windows.Forms.PictureBox ball; + private System.Windows.Forms.Timer gameTimer; + } +} diff --git a/ShiftOS.Main/Apps/Pong.cs b/ShiftOS.Main/Apps/Pong.cs new file mode 100644 index 0000000..aa0c792 --- /dev/null +++ b/ShiftOS.Main/Apps/Pong.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ShiftOS.Main.Apps +{ + public partial class Pong : UserControl + { + bool goUp = false; + bool goDown = false; + int speed = 5; + float ballX = 5; + float ballY = 5; + public Pong() + { + InitializeComponent(); + gameTimer.Start(); + ResetToRest(); + } + void ResetToRest() + { + ball.Location = new Point((int)Math.Round(this.Width / 2d, 0), (int)Math.Round(this.Height / 2d, 0)); + playerPaddle.Location = new Point(playerPaddle.Location.X, (int)Math.Round(this.Height / 2d, 0)); + cpuPaddle.Location = new Point(cpuPaddle.Location.X, (int)Math.Round(this.Height / 2d, 0)); + } + + private void Pong_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.W) goUp = true; + if (e.KeyCode == Keys.S) goDown = true; + } + + private void Pong_KeyUp(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.W) goUp = false; + if (e.KeyCode == Keys.S) goDown = false; + } + + private void gameTimer_Tick(object sender, EventArgs e) + { + ball.Top -= (int)ballY; + ball.Left -= (int)ballX; + + cpuPaddle.Top += speed; + + if (cpuPaddle.Top < 0 || cpuPaddle.Top > this.Height) speed = -speed; + + if (ball.Left < 0) + { + ResetToRest(); + ballX = -ballX; + } + if (ball.Left + ball.Width > this.Height) + { + ResetToRest(); + ballX = -ballX; + } + if (ball.Top < 0 || ball.Top + ball.Height > this.Height) ballY = -ballY; + if (ball.Bounds.IntersectsWith(playerPaddle.Bounds) || ball.Bounds.IntersectsWith(cpuPaddle.Bounds)) ballX = -ballX; + + if (goUp && playerPaddle.Top > 0) playerPaddle.Top -= 8; + if (goDown && playerPaddle.Top < this.Height) playerPaddle.Top += 8; + + } + } +} diff --git a/ShiftOS.Main/Apps/Pong.resx b/ShiftOS.Main/Apps/Pong.resx new file mode 100644 index 0000000..a0e8b0d --- /dev/null +++ b/ShiftOS.Main/Apps/Pong.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + \ No newline at end of file diff --git a/ShiftOS.Main/MainGame/Apps/ShiftDemo.Designer.cs b/ShiftOS.Main/Apps/ShiftDemo.Designer.cs similarity index 100% rename from ShiftOS.Main/MainGame/Apps/ShiftDemo.Designer.cs rename to ShiftOS.Main/Apps/ShiftDemo.Designer.cs diff --git a/ShiftOS.Main/MainGame/Apps/ShiftDemo.cs b/ShiftOS.Main/Apps/ShiftDemo.cs similarity index 100% rename from ShiftOS.Main/MainGame/Apps/ShiftDemo.cs rename to ShiftOS.Main/Apps/ShiftDemo.cs diff --git a/ShiftOS.Main/MainGame/Apps/ShiftDemo.resx b/ShiftOS.Main/Apps/ShiftDemo.resx similarity index 100% rename from ShiftOS.Main/MainGame/Apps/ShiftDemo.resx rename to ShiftOS.Main/Apps/ShiftDemo.resx diff --git a/ShiftOS.Main/MainGame/Apps/ShifterStuff/SelectColor.Designer.cs b/ShiftOS.Main/Apps/ShifterStuff/SelectColor.Designer.cs similarity index 100% rename from ShiftOS.Main/MainGame/Apps/ShifterStuff/SelectColor.Designer.cs rename to ShiftOS.Main/Apps/ShifterStuff/SelectColor.Designer.cs diff --git a/ShiftOS.Main/MainGame/Apps/ShifterStuff/SelectColor.cs b/ShiftOS.Main/Apps/ShifterStuff/SelectColor.cs similarity index 100% rename from ShiftOS.Main/MainGame/Apps/ShifterStuff/SelectColor.cs rename to ShiftOS.Main/Apps/ShifterStuff/SelectColor.cs diff --git a/ShiftOS.Main/MainGame/Apps/ShifterStuff/SelectColor.resx b/ShiftOS.Main/Apps/ShifterStuff/SelectColor.resx similarity index 100% rename from ShiftOS.Main/MainGame/Apps/ShifterStuff/SelectColor.resx rename to ShiftOS.Main/Apps/ShifterStuff/SelectColor.resx diff --git a/ShiftOS.Main/MainGame/Apps/ShifterStuff/Shifter.Designer.cs b/ShiftOS.Main/Apps/ShifterStuff/Shifter.Designer.cs similarity index 100% rename from ShiftOS.Main/MainGame/Apps/ShifterStuff/Shifter.Designer.cs rename to ShiftOS.Main/Apps/ShifterStuff/Shifter.Designer.cs diff --git a/ShiftOS.Main/MainGame/Apps/ShifterStuff/Shifter.cs b/ShiftOS.Main/Apps/ShifterStuff/Shifter.cs similarity index 100% rename from ShiftOS.Main/MainGame/Apps/ShifterStuff/Shifter.cs rename to ShiftOS.Main/Apps/ShifterStuff/Shifter.cs diff --git a/ShiftOS.Main/MainGame/Apps/ShifterStuff/Shifter.resx b/ShiftOS.Main/Apps/ShifterStuff/Shifter.resx similarity index 100% rename from ShiftOS.Main/MainGame/Apps/ShifterStuff/Shifter.resx rename to ShiftOS.Main/Apps/ShifterStuff/Shifter.resx diff --git a/ShiftOS.Main/MainGame/Apps/Terminal.Designer.cs b/ShiftOS.Main/Apps/Terminal.Designer.cs similarity index 98% rename from ShiftOS.Main/MainGame/Apps/Terminal.Designer.cs rename to ShiftOS.Main/Apps/Terminal.Designer.cs index a746456..2ad4398 100644 --- a/ShiftOS.Main/MainGame/Apps/Terminal.Designer.cs +++ b/ShiftOS.Main/Apps/Terminal.Designer.cs @@ -1,4 +1,4 @@ -namespace ShiftOS.Main.ShiftOS.Apps +namespace ShiftOS.Main.Apps { partial class Terminal { diff --git a/ShiftOS.Main/MainGame/Apps/Terminal.cs b/ShiftOS.Main/Apps/Terminal.cs similarity index 99% rename from ShiftOS.Main/MainGame/Apps/Terminal.cs rename to ShiftOS.Main/Apps/Terminal.cs index f0efec0..6a76d19 100644 --- a/ShiftOS.Main/MainGame/Apps/Terminal.cs +++ b/ShiftOS.Main/Apps/Terminal.cs @@ -9,7 +9,7 @@ using System.IO; using ShiftOS.Main.Properties; using Whoa; -namespace ShiftOS.Main.ShiftOS.Apps +namespace ShiftOS.Main.Apps { public partial class Terminal : UserControl { diff --git a/ShiftOS.Main/MainGame/Apps/Terminal.resx b/ShiftOS.Main/Apps/Terminal.resx similarity index 100% rename from ShiftOS.Main/MainGame/Apps/Terminal.resx rename to ShiftOS.Main/Apps/Terminal.resx diff --git a/ShiftOS.Main/MainGame/Apps/TestForm.Designer.cs b/ShiftOS.Main/Apps/TestForm.Designer.cs similarity index 100% rename from ShiftOS.Main/MainGame/Apps/TestForm.Designer.cs rename to ShiftOS.Main/Apps/TestForm.Designer.cs diff --git a/ShiftOS.Main/MainGame/Apps/TestForm.cs b/ShiftOS.Main/Apps/TestForm.cs similarity index 100% rename from ShiftOS.Main/MainGame/Apps/TestForm.cs rename to ShiftOS.Main/Apps/TestForm.cs diff --git a/ShiftOS.Main/MainGame/Apps/TestForm.resx b/ShiftOS.Main/Apps/TestForm.resx similarity index 100% rename from ShiftOS.Main/MainGame/Apps/TestForm.resx rename to ShiftOS.Main/Apps/TestForm.resx diff --git a/ShiftOS.Main/MainGame/Apps/TextPad.Designer.cs b/ShiftOS.Main/Apps/TextPad.Designer.cs similarity index 99% rename from ShiftOS.Main/MainGame/Apps/TextPad.Designer.cs rename to ShiftOS.Main/Apps/TextPad.Designer.cs index 7d83c68..3842fbf 100644 --- a/ShiftOS.Main/MainGame/Apps/TextPad.Designer.cs +++ b/ShiftOS.Main/Apps/TextPad.Designer.cs @@ -1,4 +1,4 @@ -namespace ShiftOS.Main.ShiftOS.Apps +namespace ShiftOS.Main.Apps { partial class TextPad { diff --git a/ShiftOS.Main/MainGame/Apps/TextPad.cs b/ShiftOS.Main/Apps/TextPad.cs similarity index 95% rename from ShiftOS.Main/MainGame/Apps/TextPad.cs rename to ShiftOS.Main/Apps/TextPad.cs index 66863cf..ee4a379 100644 --- a/ShiftOS.Main/MainGame/Apps/TextPad.cs +++ b/ShiftOS.Main/Apps/TextPad.cs @@ -4,7 +4,7 @@ using System; using System.IO; using System.Windows.Forms; -namespace ShiftOS.Main.ShiftOS.Apps +namespace ShiftOS.Main.Apps { public partial class TextPad : UserControl { diff --git a/ShiftOS.Main/MainGame/Apps/TextPad.resx b/ShiftOS.Main/Apps/TextPad.resx similarity index 100% rename from ShiftOS.Main/MainGame/Apps/TextPad.resx rename to ShiftOS.Main/Apps/TextPad.resx diff --git a/ShiftOS.Main/Desktop.Designer.cs b/ShiftOS.Main/Desktop.Designer.cs new file mode 100644 index 0000000..e82c63e --- /dev/null +++ b/ShiftOS.Main/Desktop.Designer.cs @@ -0,0 +1,138 @@ +namespace ShiftOS.Main +{ + partial class Desktop + { + /// + /// 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.components = new System.ComponentModel.Container(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.applicationsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.terminalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.fileSkimmerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.textPadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pongToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.shifterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.menuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // contextMenuStrip1 + // + this.contextMenuStrip1.Name = "contextMenuStrip1"; + this.contextMenuStrip1.Size = new System.Drawing.Size(61, 4); + // + // menuStrip1 + // + this.menuStrip1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.applicationsToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(933, 24); + this.menuStrip1.TabIndex = 1; + this.menuStrip1.Text = "menuStrip1"; + // + // applicationsToolStripMenuItem + // + this.applicationsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.terminalToolStripMenuItem, + this.fileSkimmerToolStripMenuItem, + this.textPadToolStripMenuItem, + this.pongToolStripMenuItem, + this.shifterToolStripMenuItem}); + this.applicationsToolStripMenuItem.Font = new System.Drawing.Font("Courier New", 9F); + this.applicationsToolStripMenuItem.ForeColor = System.Drawing.Color.White; + this.applicationsToolStripMenuItem.Name = "applicationsToolStripMenuItem"; + this.applicationsToolStripMenuItem.Size = new System.Drawing.Size(103, 20); + this.applicationsToolStripMenuItem.Text = "Applications"; + // + // terminalToolStripMenuItem + // + this.terminalToolStripMenuItem.Name = "terminalToolStripMenuItem"; + this.terminalToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.terminalToolStripMenuItem.Text = "Terminal"; + this.terminalToolStripMenuItem.Click += new System.EventHandler(this.terminalToolStripMenuItem_Click); + // + // fileSkimmerToolStripMenuItem + // + this.fileSkimmerToolStripMenuItem.Name = "fileSkimmerToolStripMenuItem"; + this.fileSkimmerToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.fileSkimmerToolStripMenuItem.Text = "File Skimmer"; + this.fileSkimmerToolStripMenuItem.Click += new System.EventHandler(this.fileSkimmerToolStripMenuItem_Click); + // + // textPadToolStripMenuItem + // + this.textPadToolStripMenuItem.Name = "textPadToolStripMenuItem"; + this.textPadToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.textPadToolStripMenuItem.Text = "TextPad"; + this.textPadToolStripMenuItem.Click += new System.EventHandler(this.textPadToolStripMenuItem_Click); + // + // pongToolStripMenuItem + // + this.pongToolStripMenuItem.Name = "pongToolStripMenuItem"; + this.pongToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.pongToolStripMenuItem.Text = "Pong"; + this.pongToolStripMenuItem.Click += new System.EventHandler(this.pongToolStripMenuItem_Click); + // + // shifterToolStripMenuItem + // + this.shifterToolStripMenuItem.Name = "shifterToolStripMenuItem"; + this.shifterToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.shifterToolStripMenuItem.Text = "Shifter"; + // + // Desktop + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.Black; + this.ClientSize = new System.Drawing.Size(933, 485); + this.Controls.Add(this.menuStrip1); + this.Font = new System.Drawing.Font("Courier New", 8.25F); + this.ForeColor = System.Drawing.Color.White; + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "Desktop"; + this.Text = "Desktop"; + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem applicationsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem terminalToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem fileSkimmerToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem textPadToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem pongToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem shifterToolStripMenuItem; + } +} \ No newline at end of file diff --git a/ShiftOS.Main/Desktop.cs b/ShiftOS.Main/Desktop.cs new file mode 100644 index 0000000..41e0873 --- /dev/null +++ b/ShiftOS.Main/Desktop.cs @@ -0,0 +1,51 @@ +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; +using ShiftOS.Engine.UI; +using ShiftOS.Engine.WindowManager; + +namespace ShiftOS.Main +{ + public partial class Desktop : Form + { + public Desktop() + { + InitializeComponent(); + foreach (var menuItem in applicationsToolStripMenuItem.DropDownItems.OfType()) + { + menuItem.BackColor = Color.FromArgb(64,64,64); + menuItem.ForeColor = Color.White; + } + menuStrip1.RenderMode = ToolStripRenderMode.ManagerRenderMode; + ToolStripManager.Renderer = new ShiftToolStrip(); + this.FormClosed += (o, a) => Application.Exit(); + } + + private void terminalToolStripMenuItem_Click(object sender, EventArgs e) + { + ShiftWM.Init(new Apps.Terminal(), "Terminal", Properties.Resources.iconTerminal); + } + + private void fileSkimmerToolStripMenuItem_Click(object sender, EventArgs e) + { + ShiftWM.Init(new Apps.FileSkimmer(), "FileSkimmer", Properties.Resources.iconFileSkimmer); + } + + private void textPadToolStripMenuItem_Click(object sender, EventArgs e) + { + ShiftWM.Init(new Apps.TextPad(), "TextPad", Properties.Resources.iconTextPad); + } + + private void pongToolStripMenuItem_Click(object sender, EventArgs e) + { + ShiftWM.Init(new Apps.Pong(), "Pong", null); + } + + } +} diff --git a/ShiftOS.Main/MainGame/Desktop.resx b/ShiftOS.Main/Desktop.resx similarity index 96% rename from ShiftOS.Main/MainGame/Desktop.resx rename to ShiftOS.Main/Desktop.resx index f706e8f..37c49b6 100644 --- a/ShiftOS.Main/MainGame/Desktop.resx +++ b/ShiftOS.Main/Desktop.resx @@ -117,10 +117,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 219, 17 + + 17, 17 - - 132, 17 + + 172, 17 \ No newline at end of file diff --git a/ShiftOS.Main/MainGame/Desktop.Designer.cs b/ShiftOS.Main/MainGame/Desktop.Designer.cs deleted file mode 100644 index 5378aac..0000000 --- a/ShiftOS.Main/MainGame/Desktop.Designer.cs +++ /dev/null @@ -1,186 +0,0 @@ -namespace ShiftOS.Main.ShiftOS -{ - partial class Desktop - { - /// - /// 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.components = new System.ComponentModel.Container(); - this.taskbar = new System.Windows.Forms.Panel(); - this.clockPanel = new System.Windows.Forms.Panel(); - this.lblClock = new System.Windows.Forms.Label(); - this.panel2 = new System.Windows.Forms.Panel(); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.applicationsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.shifterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.terminalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.textPadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.fileSkimmerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.timer1 = new System.Windows.Forms.Timer(this.components); - this.taskbar.SuspendLayout(); - this.clockPanel.SuspendLayout(); - this.panel2.SuspendLayout(); - this.menuStrip1.SuspendLayout(); - this.SuspendLayout(); - // - // taskbar - // - this.taskbar.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.taskbar.Controls.Add(this.clockPanel); - this.taskbar.Controls.Add(this.panel2); - this.taskbar.Dock = System.Windows.Forms.DockStyle.Top; - this.taskbar.Location = new System.Drawing.Point(0, 0); - this.taskbar.Name = "taskbar"; - this.taskbar.Size = new System.Drawing.Size(640, 24); - this.taskbar.TabIndex = 0; - // - // clockPanel - // - this.clockPanel.Controls.Add(this.lblClock); - this.clockPanel.Dock = System.Windows.Forms.DockStyle.Right; - this.clockPanel.Location = new System.Drawing.Point(574, 0); - this.clockPanel.Name = "clockPanel"; - this.clockPanel.Size = new System.Drawing.Size(66, 24); - this.clockPanel.TabIndex = 1; - // - // lblClock - // - this.lblClock.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.lblClock.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblClock.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblClock.ForeColor = System.Drawing.Color.White; - this.lblClock.Location = new System.Drawing.Point(0, 0); - this.lblClock.Name = "lblClock"; - this.lblClock.Size = new System.Drawing.Size(66, 24); - this.lblClock.TabIndex = 1; - this.lblClock.Text = "00:00:00"; - this.lblClock.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // panel2 - // - this.panel2.Controls.Add(this.menuStrip1); - this.panel2.Dock = System.Windows.Forms.DockStyle.Left; - this.panel2.Location = new System.Drawing.Point(0, 0); - this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(102, 24); - this.panel2.TabIndex = 0; - // - // menuStrip1 - // - this.menuStrip1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.menuStrip1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.menuStrip1.Dock = System.Windows.Forms.DockStyle.None; - this.menuStrip1.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.applicationsToolStripMenuItem}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(231, 24); - this.menuStrip1.TabIndex = 2; - this.menuStrip1.Text = "Applications"; - this.menuStrip1.MenuActivate += new System.EventHandler(this.menuStrip1_MenuActivate); - // - // applicationsToolStripMenuItem - // - this.applicationsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.shifterToolStripMenuItem, - this.terminalToolStripMenuItem, - this.textPadToolStripMenuItem, - this.fileSkimmerToolStripMenuItem}); - this.applicationsToolStripMenuItem.ForeColor = System.Drawing.Color.White; - this.applicationsToolStripMenuItem.Name = "applicationsToolStripMenuItem"; - this.applicationsToolStripMenuItem.Size = new System.Drawing.Size(103, 20); - this.applicationsToolStripMenuItem.Text = "Applications"; - // - // shifterToolStripMenuItem - // - this.shifterToolStripMenuItem.Name = "shifterToolStripMenuItem"; - this.shifterToolStripMenuItem.Size = new System.Drawing.Size(158, 22); - this.shifterToolStripMenuItem.Text = "Shifter"; - this.shifterToolStripMenuItem.Click += new System.EventHandler(this.shifterToolStripMenuItem_Click); - // - // terminalToolStripMenuItem - // - this.terminalToolStripMenuItem.Name = "terminalToolStripMenuItem"; - this.terminalToolStripMenuItem.Size = new System.Drawing.Size(158, 22); - this.terminalToolStripMenuItem.Text = "Terminal"; - this.terminalToolStripMenuItem.Click += new System.EventHandler(this.terminalToolStripMenuItem_Click); - // - // textPadToolStripMenuItem - // - this.textPadToolStripMenuItem.Name = "textPadToolStripMenuItem"; - this.textPadToolStripMenuItem.Size = new System.Drawing.Size(158, 22); - this.textPadToolStripMenuItem.Text = "TextPad"; - this.textPadToolStripMenuItem.Click += new System.EventHandler(this.textPadToolStripMenuItem_Click); - // - // fileSkimmerToolStripMenuItem - // - this.fileSkimmerToolStripMenuItem.Name = "fileSkimmerToolStripMenuItem"; - this.fileSkimmerToolStripMenuItem.Size = new System.Drawing.Size(158, 22); - this.fileSkimmerToolStripMenuItem.Text = "File Skimmer"; - this.fileSkimmerToolStripMenuItem.Click += new System.EventHandler(this.fileSkimmerToolStripMenuItem_Click); - // - // timer1 - // - this.timer1.Tick += new System.EventHandler(this.timer1_Tick); - // - // Desktop - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.Black; - this.ClientSize = new System.Drawing.Size(640, 480); - this.Controls.Add(this.taskbar); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.Margin = new System.Windows.Forms.Padding(2); - this.Name = "Desktop"; - this.Text = "Desktop"; - this.Load += new System.EventHandler(this.Desktop_Load); - this.taskbar.ResumeLayout(false); - this.clockPanel.ResumeLayout(false); - this.panel2.ResumeLayout(false); - this.panel2.PerformLayout(); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Panel taskbar; - private System.Windows.Forms.Panel panel2; - private System.Windows.Forms.Panel clockPanel; - private System.Windows.Forms.Label lblClock; - private System.Windows.Forms.Timer timer1; - private System.Windows.Forms.MenuStrip menuStrip1; - private System.Windows.Forms.ToolStripMenuItem applicationsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem shifterToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem terminalToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem textPadToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem fileSkimmerToolStripMenuItem; - } -} \ No newline at end of file diff --git a/ShiftOS.Main/MainGame/Desktop.cs b/ShiftOS.Main/MainGame/Desktop.cs deleted file mode 100644 index 0cb3583..0000000 --- a/ShiftOS.Main/MainGame/Desktop.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Windows.Forms; -using ShiftOS.Engine.WindowManager; -using ShiftOS.Main.Properties; -using ShiftOS.Main.ShiftOS.Apps; -using System.IO; -using ShiftOS.Engine; -using System.Drawing; -using ShiftOS.Engine.UI; - -namespace ShiftOS.Main.ShiftOS -{ - // testing github because git hates me - public partial class Desktop : Form - { - - public Desktop() - { - InitializeComponent(); - foreach (object t in applicationsToolStripMenuItem.DropDownItems) - { - var appList = t as ToolStripItem; - if (t == null) continue; - appList.BackColor = Color.FromArgb(64, 64, 64); - appList.ForeColor = Color.White; - } - timer1.Start(); - Closed += (sender, args) => { Application.Exit(); }; - - } - - private void shifterToolStripMenuItem_Click(object sender, EventArgs e) - { - Apps.ShifterStuff.Shifter app = new Apps.ShifterStuff.Shifter(); - ShiftWM.Init(app, "Shifter", Resources.iconShifter); - } - - private void Desktop_Load(object sender, EventArgs e) - { - this.WindowState = FormWindowState.Maximized; - } - - private void terminalToolStripMenuItem_Click(object sender, EventArgs e) - { - var t = new Apps.Terminal(); - ShiftWM.Init(t, "Terminal", Resources.iconTerminal, false); - - } - - private void textPadToolStripMenuItem_Click(object sender, EventArgs e) - { - var t = new TextPad(); - ShiftWM.Init(t, "TextPad", Resources.iconTextPad); - } - - private void fileSkimmerToolStripMenuItem_Click(object sender, EventArgs e) - { - var fs = new FileSkimmer(); - ShiftWM.Init(fs, "File Skimmer", Resources.iconFileSkimmer); - } - - private void timer1_Tick(object sender, EventArgs e) - { - lblClock.Text = DateTime.Now.ToString("hh:mm:ss"); - } - - private void menuStrip1_MenuActivate(object sender, EventArgs e) - { - menuStrip1.BackColor = Color.FromArgb(64, 64, 64); - } - } -} diff --git a/ShiftOS.Main/Program.cs b/ShiftOS.Main/Program.cs index acce816..17aaffc 100644 --- a/ShiftOS.Main/Program.cs +++ b/ShiftOS.Main/Program.cs @@ -1,6 +1,5 @@ using System; using System.Windows.Forms; -using ShiftOS.Main.ShiftOS; namespace ShiftOS.Main { @@ -21,7 +20,7 @@ namespace ShiftOS.Main if (terminalMode) { Form terminalForm = new Form(); - ShiftOS.Apps.Terminal term = new ShiftOS.Apps.Terminal(); + Main.Apps.Terminal term = new Main.Apps.Terminal(); terminalForm.Controls.Add(term); terminalForm.FormBorderStyle = FormBorderStyle.None; terminalForm.WindowState = FormWindowState.Maximized; diff --git a/ShiftOS.Main/ShiftOS.Main.csproj b/ShiftOS.Main/ShiftOS.Main.csproj index 86746dd..2bfc058 100644 --- a/ShiftOS.Main/ShiftOS.Main.csproj +++ b/ShiftOS.Main/ShiftOS.Main.csproj @@ -52,44 +52,50 @@ - - - + UserControl - - FileSkimmer.cs + + Pong.cs - - UserControl - - - SelectColor.cs - - - UserControl - - - Shifter.cs - - - UserControl - - - Terminal.cs - - - UserControl - - - TextPad.cs - - + Form - + Desktop.cs + + + + UserControl + + + FileSkimmer.cs + + + UserControl + + + SelectColor.cs + + + UserControl + + + Shifter.cs + + + UserControl + + + Terminal.cs + + + UserControl + + + TextPad.cs + @@ -101,6 +107,12 @@ + + Pong.cs + + + Desktop.cs + ResXFileCodeGenerator Resources.Designer.cs @@ -111,24 +123,21 @@ Resources.resx True - + FileSkimmer.cs - + SelectColor.cs - + Shifter.cs - + Terminal.cs - + TextPad.cs - - Desktop.cs - SettingsSingleFileGenerator @@ -152,9 +161,7 @@ ShiftOS.Engine - - - + diff --git a/ShiftOS.Main/Terminal/Commands/startx.cs b/ShiftOS.Main/Terminal/Commands/startx.cs index 38a8fdf..5b2feb4 100644 --- a/ShiftOS.Main/Terminal/Commands/startx.cs +++ b/ShiftOS.Main/Terminal/Commands/startx.cs @@ -7,7 +7,8 @@ using System.Threading.Tasks; using ShiftOS.Engine; using static ShiftOS.Engine.CodepointUpgrade; using static ShiftOS.Engine.SaveSystem; - +using ShiftOS.Main; +using System.Windows.Forms; namespace ShiftOS.Main.Terminal.Commands { @@ -15,12 +16,12 @@ namespace ShiftOS.Main.Terminal.Commands { private bool hasGUI = false; private bool autostart = false; + private Timer timer = new Timer(); public override string Name { get; } = "startx"; public override string Summary { get; } = "Starts the ShiftX driver."; public override string Usage { get; } = "startx"; public override bool Unlocked { get; set; } = false; public int codePoints { get; set; } = 150; - public override void Run(params string[] args) { if (args.Length > 0) @@ -43,13 +44,16 @@ namespace ShiftOS.Main.Terminal.Commands } if (!hasGUI) { - var d = new Desktop(); - d.Show(); + WriteLine("[startx] starting driver..."); + new System.Threading.ManualResetEvent(false).WaitOne(1500); + + new Desktop().Show(); hasGUI = true; + return; } - if (hasGUI == true) + if (hasGUI) { - WriteLine("The ShiftX driver has already been intialized."); + WriteLine("startx: the ShiftX driver has already been intialized."); return; } } diff --git a/ShiftOS.Main/Terminal/TerminalBackend.cs b/ShiftOS.Main/Terminal/TerminalBackend.cs index 36d4036..bb3faaa 100644 --- a/ShiftOS.Main/Terminal/TerminalBackend.cs +++ b/ShiftOS.Main/Terminal/TerminalBackend.cs @@ -5,6 +5,7 @@ using System.Reflection; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using ShiftOS.Main.Apps; namespace ShiftOS.Main.Terminal { @@ -15,7 +16,7 @@ namespace ShiftOS.Main.Terminal .Where(t => t.IsSubclassOf(typeof(TerminalCommand)) && t.GetConstructor(Type.EmptyTypes) != null) .Select(t => Activator.CreateInstance(t) as TerminalCommand); - public static List trm = new List(); + public static List trm = new List(); public static int trmTopID = 0; public static Stack commandBuffer = new Stack(); /// diff --git a/ShiftOS.Main/Terminal/TerminalCommand.cs b/ShiftOS.Main/Terminal/TerminalCommand.cs index 1aeb845..6e4b81b 100644 --- a/ShiftOS.Main/Terminal/TerminalCommand.cs +++ b/ShiftOS.Main/Terminal/TerminalCommand.cs @@ -43,7 +43,7 @@ namespace ShiftOS.Main.Terminal /// The color the text is written in. public virtual void WriteLine(string value, Color textClr) { - ShiftOS.Apps.Terminal trm = Array.Find(TerminalBackend.trm.ToArray(), w => w.TerminalID == TermID); + Main.Apps.Terminal trm = Array.Find(TerminalBackend.trm.ToArray(), w => w.TerminalID == TermID); int startPoint = trm.termmain.Text.Length; trm.termmain.AppendText($" {value} \n"); @@ -59,7 +59,7 @@ namespace ShiftOS.Main.Terminal public virtual void Write(string value, Color textClr) { - ShiftOS.Apps.Terminal trm = Array.Find(TerminalBackend.trm.ToArray(), w => w.TerminalID == TermID); + Main.Apps.Terminal trm = Array.Find(TerminalBackend.trm.ToArray(), w => w.TerminalID == TermID); int startPoint = trm.termmain.Text.Length; trm.termmain.AppendText($" {value}"); @@ -94,7 +94,7 @@ namespace ShiftOS.Main.Terminal /// public virtual void Clear() { - ShiftOS.Apps.Terminal trm = Array.Find(TerminalBackend.trm.ToArray(), w => w.TerminalID == TermID); + Main.Apps.Terminal trm = Array.Find(TerminalBackend.trm.ToArray(), w => w.TerminalID == TermID); trm.Clear(); }