From 74d0790ab3b91d0a46db526f2599d6bf26172377 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 26 Jul 2017 09:59:48 -0400 Subject: skin loading and fullscreen toggle in options --- ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'ShiftOS.Frontend/GraphicsSubsystem') diff --git a/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs b/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs index 7bb534e..96ef3cb 100644 --- a/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs +++ b/ShiftOS.Frontend/GraphicsSubsystem/UIManager.cs @@ -18,6 +18,28 @@ namespace ShiftOS.Frontend.GraphicsSubsystem private static List topLevels = new List(); public static System.Drawing.Size Viewport { get; set; } public static GUI.Control FocusedControl = null; + private static ShiftOS _game = null; + + public static void Init(ShiftOS sentience) + { + _game = sentience; + } + + public static bool Fullscreen + { + get + { + return _game.graphicsDevice.IsFullScreen; + } + set + { + var uconf = Objects.UserConfig.Get(); + uconf.Fullscreen = value; + System.IO.File.WriteAllText("config.json", Newtonsoft.Json.JsonConvert.SerializeObject(uconf, Newtonsoft.Json.Formatting.Indented)); + _game.graphicsDevice.IsFullScreen = value; + _game.graphicsDevice.ApplyChanges(); + } + } public static void BringToFront(GUI.Control ctrl) { -- cgit v1.2.3