From b8eb7dccfdd16bd1d39bbedeb176fce7f0f1dc9e Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 19 Jul 2017 16:08:33 -0400 Subject: [PATCH] Fix terminal and add support for animations --- ShiftOS.Frontend/Apps/CodeShop.cs | 3 +- ShiftOS.Frontend/Apps/FileSkimmer.cs | 5 +- ShiftOS.Frontend/Apps/SystemStatus.cs | 3 +- ShiftOS.Frontend/Apps/Terminal.cs | 107 +++++++++++------- ShiftOS.Frontend/Desktop/Desktop.cs | 5 +- ShiftOS.Frontend/Desktop/WindowManager.cs | 11 +- ShiftOS.Frontend/GUI/Button.cs | 2 +- ShiftOS.Frontend/GUI/Control.cs | 9 +- ShiftOS.Frontend/GUI/ItemGroup.cs | 4 +- ShiftOS.Frontend/GUI/ListBox.cs | 4 +- ShiftOS.Frontend/GUI/PictureBox.cs | 7 +- ShiftOS.Frontend/GUI/TextControl.cs | 3 +- .../GraphicsSubsystem/GraphicsContext.cs | 2 +- .../GraphicsSubsystem/UIManager.cs | 6 +- ShiftOS.Frontend/Infobox.cs | 5 +- ShiftOS.Frontend/ShiftOS.cs | 2 +- ShiftOS_TheReturn/TerminalBackend.cs | 1 - 17 files changed, 105 insertions(+), 74 deletions(-) diff --git a/ShiftOS.Frontend/Apps/CodeShop.cs b/ShiftOS.Frontend/Apps/CodeShop.cs index ff39d6e..009521c 100644 --- a/ShiftOS.Frontend/Apps/CodeShop.cs +++ b/ShiftOS.Frontend/Apps/CodeShop.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.Xna.Framework; using ShiftOS.Engine; using ShiftOS.Frontend.GraphicsSubsystem; @@ -24,7 +25,7 @@ namespace ShiftOS.Frontend.Apps Height = 480; } - protected override void OnLayout() + protected override void OnLayout(GameTime gameTime) { try { diff --git a/ShiftOS.Frontend/Apps/FileSkimmer.cs b/ShiftOS.Frontend/Apps/FileSkimmer.cs index 29c5802..c4dbb09 100644 --- a/ShiftOS.Frontend/Apps/FileSkimmer.cs +++ b/ShiftOS.Frontend/Apps/FileSkimmer.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.Xna.Framework; using ShiftOS.Engine; using static ShiftOS.Objects.ShiftFS.Utils; @@ -133,11 +134,11 @@ namespace ShiftOS.Frontend.Apps } - protected override void OnLayout() + protected override void OnLayout(GameTime gameTime) { try { - _currentdirtext.Layout(); + _currentdirtext.Layout(gameTime); _fList.X = 0; _fList.Y = 0; _fList.Width = Width; diff --git a/ShiftOS.Frontend/Apps/SystemStatus.cs b/ShiftOS.Frontend/Apps/SystemStatus.cs index 9add92b..772a642 100644 --- a/ShiftOS.Frontend/Apps/SystemStatus.cs +++ b/ShiftOS.Frontend/Apps/SystemStatus.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.Xna.Framework; using ShiftOS.Engine; using ShiftOS.Frontend.Desktop; using ShiftOS.Frontend.GraphicsSubsystem; @@ -48,7 +49,7 @@ namespace ShiftOS.Frontend.Apps { } - protected override void OnLayout() + protected override void OnLayout(GameTime gameTime) { _header.Font = SkinEngine.LoadedSkin.HeaderFont; _header.X = 20; diff --git a/ShiftOS.Frontend/Apps/Terminal.cs b/ShiftOS.Frontend/Apps/Terminal.cs index 740cb4e..0eea68a 100644 --- a/ShiftOS.Frontend/Apps/Terminal.cs +++ b/ShiftOS.Frontend/Apps/Terminal.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Input; using ShiftOS.Engine; using ShiftOS.Frontend.GraphicsSubsystem; @@ -33,7 +34,6 @@ namespace ShiftOS.Frontend.Apps _terminal = new Apps.TerminalControl(); _terminal.Dock = GUI.DockStyle.Fill; AddControl(_terminal); - _terminal.Layout(); AppearanceManager.ConsoleOut = _terminal; AppearanceManager.StartConsoleOut(); TerminalBackend.PrintPrompt(); @@ -45,7 +45,7 @@ namespace ShiftOS.Frontend.Apps }; } - protected override void OnLayout() + protected override void OnLayout(GameTime gameTime) { if (ContainsFocusedControl || IsFocusedControl) AppearanceManager.ConsoleOut = _terminal; @@ -138,9 +138,18 @@ namespace ShiftOS.Frontend.Apps { } - protected override void OnLayout() + private bool blinkStatus = false; + private double blinkTime = 0.0; + + protected override void OnLayout(GameTime gameTime) { - + blinkTime += gameTime.ElapsedGameTime.TotalMilliseconds; + if (blinkTime > 500.0) + blinkTime = 0; + bool prev = blinkStatus; + blinkStatus = blinkTime > 250.0; + if (prev != blinkStatus) + Invalidate(); } /// @@ -148,7 +157,7 @@ namespace ShiftOS.Frontend.Apps /// /// A object used for font measurements /// An absolute fucking mess. Seriously, can someone fix this method so it uhh WORKS PROPERLY? - public Point GetPointAtIndex(Graphics gfx) + public System.Drawing.Point GetPointAtIndex(Graphics gfx) { int vertMeasure = 2; int horizMeasure = 2; @@ -169,7 +178,7 @@ namespace ShiftOS.Frontend.Apps vertMeasure += (int)lnMeasure.Height; } horizMeasure += w; - return new Point(horizMeasure, vertMeasure); + return new System.Drawing.Point(horizMeasure, vertMeasure); } private PointF CaretPosition = new PointF(2, 2); @@ -191,12 +200,14 @@ namespace ShiftOS.Frontend.Apps var text2 = text[text.Length - 1]; var text3 = ""; var text4 = Regex.Replace(text2, @"\t|\n|\r", ""); - WriteLine(""); - { + WriteLine(""); + if (TerminalBackend.PrefixEnabled) { text3 = text4.Remove(0, $"{SaveSystem.CurrentSave.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ".Length); } + if (!string.IsNullOrWhiteSpace(text3)) + { TerminalBackend.LastCommand = text3; TerminalBackend.SendText(text4); if (TerminalBackend.InStory == false) @@ -215,16 +226,20 @@ namespace ShiftOS.Frontend.Apps } } - if (TerminalBackend.PrefixEnabled) - { - TerminalBackend.PrintPrompt(); - } - AppearanceManager.CurrentPosition = 0; } } catch { } + finally + { + if (TerminalBackend.PrefixEnabled) + { + TerminalBackend.PrintPrompt(); + } + AppearanceManager.CurrentPosition = 0; + + } } else if (a.Key == Keys.Back) { @@ -300,6 +315,8 @@ namespace ShiftOS.Frontend.Apps InvalidateTopLevel(); } } + blinkStatus = true; + blinkTime = 250; } protected override void OnPaint(GraphicsContext gfx) @@ -308,14 +325,24 @@ namespace ShiftOS.Frontend.Apps if (!string.IsNullOrEmpty(Text)) { //Draw the caret. - PointF cursorPos; - using (var cgfx = System.Drawing.Graphics.FromImage(new System.Drawing.Bitmap(1, 1))) + if (blinkStatus == true) { - cursorPos = GetPointAtIndex(cgfx); + PointF cursorPos; + using (var cgfx = System.Drawing.Graphics.FromImage(new System.Drawing.Bitmap(1, 1))) + { + cursorPos = GetPointAtIndex(cgfx); + } + var cursorSize = gfx.MeasureString(Text[Index - 1].ToString(), LoadedSkin.TerminalFont); + + var lineMeasure = gfx.MeasureString(Lines[GetCurrentLine()], LoadedSkin.TerminalFont); + if (cursorPos.X > lineMeasure.X) + { + cursorPos.X = lineMeasure.X; + } + + gfx.DrawRectangle((int)cursorPos.X, (int)cursorPos.Y - (int)_vertOffset, (int)cursorSize.X, (int)cursorSize.Y, LoadedSkin.TerminalForeColorCC.ToColor().ToMonoColor()); } - var cursorSize = gfx.MeasureString(Text[Index - 1].ToString(), LoadedSkin.TerminalFont); - gfx.DrawRectangle((int)cursorPos.X, (int)cursorPos.Y - (int)_vertOffset, (int)cursorSize.X, (int)cursorSize.Y, LoadedSkin.TerminalForeColorCC.ToColor().ToMonoColor()); //Draw the text @@ -327,44 +354,44 @@ namespace ShiftOS.Frontend.Apps public static class ConsoleColorExtensions { - public static Color ToColor(this ConsoleColor cc) + public static System.Drawing.Color ToColor(this ConsoleColor cc) { switch (cc) { case ConsoleColor.Black: - return Color.Black; + return System.Drawing.Color.Black; case ConsoleColor.Blue: - return Color.Blue; + return System.Drawing.Color.Blue; case ConsoleColor.Cyan: - return Color.Cyan; + return System.Drawing.Color.Cyan; case ConsoleColor.DarkBlue: - return Color.DarkBlue; + return System.Drawing.Color.DarkBlue; case ConsoleColor.DarkCyan: - return Color.DarkCyan; + return System.Drawing.Color.DarkCyan; case ConsoleColor.DarkGray: - return Color.DarkGray; + return System.Drawing.Color.DarkGray; case ConsoleColor.DarkGreen: - return Color.DarkGreen; + return System.Drawing.Color.DarkGreen; case ConsoleColor.DarkMagenta: - return Color.DarkMagenta; + return System.Drawing.Color.DarkMagenta; case ConsoleColor.DarkRed: - return Color.DarkRed; + return System.Drawing.Color.DarkRed; case ConsoleColor.DarkYellow: - return Color.Orange; + return System.Drawing.Color.Orange; case ConsoleColor.Gray: - return Color.Gray; + return System.Drawing.Color.Gray; case ConsoleColor.Green: - return Color.Green; + return System.Drawing.Color.Green; case ConsoleColor.Magenta: - return Color.Magenta; + return System.Drawing.Color.Magenta; case ConsoleColor.Red: - return Color.Red; + return System.Drawing.Color.Red; case ConsoleColor.White: - return Color.White; + return System.Drawing.Color.White; case ConsoleColor.Yellow: - return Color.Yellow; + return System.Drawing.Color.Yellow; } - return Color.Empty; + return System.Drawing.Color.Empty; } } @@ -375,11 +402,11 @@ namespace ShiftOS.Frontend.Apps if (string.IsNullOrEmpty(s)) s = " "; var textformat = new StringFormat(StringFormat.GenericTypographic); - textformat.FormatFlags = StringFormatFlags.MeasureTrailingSpaces; - textformat.Trimming = StringTrimming.None; - textformat.FormatFlags |= StringFormatFlags.NoClip; + textformat.FormatFlags |= StringFormatFlags.MeasureTrailingSpaces; + //textformat.Trimming = StringTrimming.Character; + //textformat.FormatFlags |= StringFormatFlags.NoClip; - gfx.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; + gfx.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; var measure = gfx.MeasureString(s, font, width, textformat); return new SizeF((float)Math.Ceiling(measure.Width), (float)Math.Ceiling(measure.Height)); } diff --git a/ShiftOS.Frontend/Desktop/Desktop.cs b/ShiftOS.Frontend/Desktop/Desktop.cs index bc219b2..ec40227 100644 --- a/ShiftOS.Frontend/Desktop/Desktop.cs +++ b/ShiftOS.Frontend/Desktop/Desktop.cs @@ -4,6 +4,7 @@ using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.Xna.Framework; using ShiftOS.Engine; using ShiftOS.Frontend.Apps; using ShiftOS.Frontend.GraphicsSubsystem; @@ -100,7 +101,7 @@ namespace ShiftOS.Frontend.Desktop { } - public void OpenAppLauncher(Point loc) + public void OpenAppLauncher(System.Drawing.Point loc) { alX = loc.X; alY = loc.Y; @@ -188,7 +189,7 @@ namespace ShiftOS.Frontend.Desktop private string dateTimeString = ""; - protected override void OnLayout() + protected override void OnLayout(GameTime gameTime) { if (alOpen) BringToFront(); diff --git a/ShiftOS.Frontend/Desktop/WindowManager.cs b/ShiftOS.Frontend/Desktop/WindowManager.cs index cdbae90..01ebe7f 100644 --- a/ShiftOS.Frontend/Desktop/WindowManager.cs +++ b/ShiftOS.Frontend/Desktop/WindowManager.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ShiftOS.Engine; using ShiftOS.Frontend.GraphicsSubsystem; @@ -224,7 +225,7 @@ namespace ShiftOS.Frontend.Desktop private int lastmousex, lastmousey = 0; - protected override void OnLayout() + protected override void OnLayout(GameTime gameTime) { int titlebarheight = LoadedSkin.TitlebarHeight; int borderleft = LoadedSkin.LeftBorderWidth; @@ -318,7 +319,7 @@ namespace ShiftOS.Frontend.Desktop var closebuttonsize = LoadedSkin.CloseButtonSize; var closebuttonright = LoadedSkin.CloseButtonFromSide; if (LoadedSkin.TitleButtonPosition == 0) - closebuttonright = new Point(Width - closebuttonsize.Width - closebuttonright.X, closebuttonright.Y); + closebuttonright = new System.Drawing.Point(Width - closebuttonsize.Width - closebuttonright.X, closebuttonright.Y); if (!UIManager.SkinTextures.ContainsKey("closebutton")) { gfx.DrawRectangle(closebuttonright.X, closebuttonright.Y, closebuttonsize.Width, closebuttonsize.Height, UIManager.SkinTextures["CloseButtonColor"]); @@ -332,7 +333,7 @@ namespace ShiftOS.Frontend.Desktop closebuttonsize = LoadedSkin.MaximizeButtonSize; closebuttonright = LoadedSkin.MaximizeButtonFromSide; if (LoadedSkin.TitleButtonPosition == 0) - closebuttonright = new Point(Width - closebuttonsize.Width - closebuttonright.X, closebuttonright.Y); + closebuttonright = new System.Drawing.Point(Width - closebuttonsize.Width - closebuttonright.X, closebuttonright.Y); if (!UIManager.SkinTextures.ContainsKey("maximizebutton")) { @@ -347,7 +348,7 @@ namespace ShiftOS.Frontend.Desktop closebuttonsize = LoadedSkin.MinimizeButtonSize; closebuttonright = LoadedSkin.MinimizeButtonFromSide; if (LoadedSkin.TitleButtonPosition == 0) - closebuttonright = new Point(Width - closebuttonsize.Width - closebuttonright.X, closebuttonright.Y); + closebuttonright = new System.Drawing.Point(Width - closebuttonsize.Width - closebuttonright.X, closebuttonright.Y); if (!UIManager.SkinTextures.ContainsKey("minimizebutton")) { gfx.DrawRectangle(closebuttonright.X, closebuttonright.Y, closebuttonsize.Width, closebuttonsize.Height, UIManager.SkinTextures["MinimizeButtonColor"]); @@ -441,7 +442,7 @@ namespace ShiftOS.Frontend.Desktop public static Texture2D ToTexture2D(this Image image, GraphicsDevice device) { var bmp = (Bitmap)image; - var lck = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), System.Drawing.Imaging.ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb); + var lck = bmp.LockBits(new System.Drawing.Rectangle(0, 0, bmp.Width, bmp.Height), System.Drawing.Imaging.ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb); var data = new byte[Math.Abs(lck.Stride) * lck.Height]; Marshal.Copy(lck.Scan0, data, 0, data.Length); bmp.UnlockBits(lck); diff --git a/ShiftOS.Frontend/GUI/Button.cs b/ShiftOS.Frontend/GUI/Button.cs index c2e55b9..62db283 100644 --- a/ShiftOS.Frontend/GUI/Button.cs +++ b/ShiftOS.Frontend/GUI/Button.cs @@ -18,7 +18,7 @@ namespace ShiftOS.Frontend.GUI Text = "Click me!"; } - protected override void OnLayout() + protected override void OnLayout(GameTime gameTime) { if(AutoSize == true) { diff --git a/ShiftOS.Frontend/GUI/Control.cs b/ShiftOS.Frontend/GUI/Control.cs index d34a97a..b78f032 100644 --- a/ShiftOS.Frontend/GUI/Control.cs +++ b/ShiftOS.Frontend/GUI/Control.cs @@ -429,7 +429,7 @@ namespace ShiftOS.Frontend.GUI } } - public void Layout() + public void Layout(GameTime gameTime) { //Dock style if(_parent != null) @@ -469,12 +469,12 @@ namespace ShiftOS.Frontend.GUI break; } } - OnLayout(); + OnLayout(gameTime); foreach (var child in _children) - child.Layout(); + child.Layout(gameTime); } - protected virtual void OnLayout() + protected virtual void OnLayout(GameTime gameTime) { //do nothing } @@ -621,7 +621,6 @@ namespace ShiftOS.Frontend.GUI { _mouseX = coords.X; _mouseY = coords.Y; - Layout(); _wasMouseInControl = true; int newX = MathHelper.Clamp(state.X, X, X + Width); int newY = MathHelper.Clamp(state.Y, Y, Y + Height); diff --git a/ShiftOS.Frontend/GUI/ItemGroup.cs b/ShiftOS.Frontend/GUI/ItemGroup.cs index e52a17f..13f02c6 100644 --- a/ShiftOS.Frontend/GUI/ItemGroup.cs +++ b/ShiftOS.Frontend/GUI/ItemGroup.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.Xna.Framework; namespace ShiftOS.Frontend.GUI { @@ -12,7 +13,7 @@ namespace ShiftOS.Frontend.GUI private FlowDirection _flowDir = FlowDirection.LeftToRight; private int _initialgap = 2; - protected override void OnLayout() + protected override void OnLayout(GameTime gameTime) { if (AutoSize) { @@ -44,7 +45,6 @@ namespace ShiftOS.Frontend.GUI ctrl.X = _x; ctrl.Y = _y; ctrl.Dock = DockStyle.None; - ctrl.Layout(); _x += ctrl.Width + _gap; if (_maxYForRow < ctrl.Height + _gap) diff --git a/ShiftOS.Frontend/GUI/ListBox.cs b/ShiftOS.Frontend/GUI/ListBox.cs index 2fe5fc4..0339eff 100644 --- a/ShiftOS.Frontend/GUI/ListBox.cs +++ b/ShiftOS.Frontend/GUI/ListBox.cs @@ -168,14 +168,14 @@ namespace ShiftOS.Frontend.GUI } } - protected override void OnLayout() + protected override void OnLayout(GameTime gameTime) { if(fontheight != LoadedSkin.MainFont.Height) { fontheight = LoadedSkin.MainFont.Height; Invalidate(); } - base.OnLayout(); + base.OnLayout(gameTime); } public event Action SelectedIndexChanged; diff --git a/ShiftOS.Frontend/GUI/PictureBox.cs b/ShiftOS.Frontend/GUI/PictureBox.cs index 6f60b29..db4df7f 100644 --- a/ShiftOS.Frontend/GUI/PictureBox.cs +++ b/ShiftOS.Frontend/GUI/PictureBox.cs @@ -9,6 +9,7 @@ using ShiftOS.Engine; using System.Drawing.Imaging; using ShiftOS.Frontend.GraphicsSubsystem; using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework; namespace ShiftOS.Frontend.GUI { @@ -43,7 +44,7 @@ namespace ShiftOS.Frontend.GUI } } - protected override void OnLayout() + protected override void OnLayout(GameTime gameTime) { if (AutoSize) { @@ -109,8 +110,8 @@ namespace ShiftOS.Frontend.GUI InterpolationMode.HighQualityBicubic; grPhoto.DrawImage(imgPhoto, - new Rectangle(destX, destY, destWidth, destHeight), - new Rectangle(sourceX, sourceY, sourceWidth, sourceHeight), + new System.Drawing.Rectangle(destX, destY, destWidth, destHeight), + new System.Drawing.Rectangle(sourceX, sourceY, sourceWidth, sourceHeight), GraphicsUnit.Pixel); grPhoto.Dispose(); diff --git a/ShiftOS.Frontend/GUI/TextControl.cs b/ShiftOS.Frontend/GUI/TextControl.cs index f1bbef1..1e23680 100644 --- a/ShiftOS.Frontend/GUI/TextControl.cs +++ b/ShiftOS.Frontend/GUI/TextControl.cs @@ -4,6 +4,7 @@ using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.Xna.Framework; using ShiftOS.Frontend.GraphicsSubsystem; namespace ShiftOS.Frontend.GUI @@ -14,7 +15,7 @@ namespace ShiftOS.Frontend.GUI private TextAlign _textAlign = TextAlign.TopLeft; private Font _font = new Font("Tahoma", 9f); - protected override void OnLayout() + protected override void OnLayout(GameTime gameTime) { if (AutoSize) { diff --git a/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs b/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs index 68026ef..331018f 100644 --- a/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs +++ b/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs @@ -159,7 +159,7 @@ namespace ShiftOS.Frontend.GraphicsSubsystem { var sFormat = System.Drawing.StringFormat.GenericTypographic; sFormat.FormatFlags |= System.Drawing.StringFormatFlags.NoClip; - sFormat.FormatFlags |= System.Drawing.StringFormatFlags.DisplayFormatControl; + gfx.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; gfx.DrawString(text, font, System.Drawing.Brushes.White, new System.Drawing.RectangleF(0, 0, bmp.Width, bmp.Height), sFormat); diff --git a/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs b/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs index a88f28e..d16685b 100644 --- a/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs +++ b/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs @@ -25,10 +25,10 @@ namespace ShiftOS.Frontend.GraphicsSubsystem topLevels.Add(ctrl); } - public static void LayoutUpdate() + public static void LayoutUpdate(GameTime gameTime) { foreach (var toplevel in topLevels.ToArray()) - toplevel.Layout(); + toplevel.Layout(gameTime); } public static void Animate(object owner, System.Reflection.PropertyInfo prop, double from, double to, int timeMs) @@ -135,7 +135,7 @@ namespace ShiftOS.Frontend.GraphicsSubsystem { if (!topLevels.Contains(ctrl)) topLevels.Add(ctrl); - ctrl.Layout(); + } public static void InvalidateAll() diff --git a/ShiftOS.Frontend/Infobox.cs b/ShiftOS.Frontend/Infobox.cs index 18bf60a..21b5538 100644 --- a/ShiftOS.Frontend/Infobox.cs +++ b/ShiftOS.Frontend/Infobox.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.Xna.Framework; using ShiftOS.Engine; using ShiftOS.Frontend.Desktop; using ShiftOS.Frontend.GraphicsSubsystem; @@ -178,11 +179,9 @@ namespace ShiftOS.Frontend this.AddControl(btnok); this.AddControl(flyesno); this.AddControl(lbmessage); - - this.Layout(); } - protected override void OnLayout() + protected override void OnLayout(GameTime gameTime) { try { diff --git a/ShiftOS.Frontend/ShiftOS.cs b/ShiftOS.Frontend/ShiftOS.cs index 9211fcd..7286151 100644 --- a/ShiftOS.Frontend/ShiftOS.cs +++ b/ShiftOS.Frontend/ShiftOS.cs @@ -229,7 +229,7 @@ namespace ShiftOS.Frontend } //Cause layout update on all elements - UIManager.LayoutUpdate(); + UIManager.LayoutUpdate(gameTime); timeSinceLastPurge += gameTime.ElapsedGameTime.TotalSeconds; diff --git a/ShiftOS_TheReturn/TerminalBackend.cs b/ShiftOS_TheReturn/TerminalBackend.cs index db6fde3..689465f 100644 --- a/ShiftOS_TheReturn/TerminalBackend.cs +++ b/ShiftOS_TheReturn/TerminalBackend.cs @@ -476,7 +476,6 @@ namespace ShiftOS.Engine /// public static void PrintPrompt() { - Console.WriteLine(); if (SaveSystem.CurrentSave != null) { ConsoleEx.BackgroundColor = SkinEngine.LoadedSkin.TerminalBackColorCC;